:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --border: #dfe7f3;
  --text: #0f172a;
  --muted: #64748b;
  --blue: #315be8;
  --blue-soft: #eef3ff;
  --red-soft: #feecef;
  --red: #be3144;
  --green-soft: #eaf8ef;
  --green: #1f8a4c;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 15%, rgba(49, 91, 232, 0.14), transparent 34%),
    radial-gradient(circle at 85% 85%, rgba(31, 138, 76, 0.1), transparent 32%),
    var(--bg);
}

.login-card {
  width: min(100%, 430px);
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.login-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 15px;
  background: var(--blue);
  color: white;
  font-size: 25px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(49, 91, 232, 0.25);
}

.login-logo {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 26px;
  border-radius: 42px;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card h1 { font-size: 28px; }
.login-intro { margin-top: 10px; color: var(--muted); line-height: 1.5; }
.login-form { margin-top: 30px; }

.login-form input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

.login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 91, 232, 0.12); }
.password-field { position: relative; }
.password-field input { padding-right: 66px; }

.show-password {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 36px;
  padding: 0 10px;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
}

.login-error { min-height: 20px; margin-top: 12px; color: var(--red); font-size: 14px; }
.login-button { width: 100%; margin-top: 8px; }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
  background: #ffffff;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-link:hover,
.brand-link:focus {
  color: inherit;
  text-decoration: none;
}

.brand-link strong,
.brand-link small {
  display: block;
}

.brand-block strong { font-size: 16px; }
.brand-block small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.sidebar-mark { width: 42px; height: 42px; margin: 0; border-radius: 12px; font-size: 20px; }

.settings-wrap {
  margin-top: auto;
  position: relative;
}

.settings-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease;
}

.settings-btn:hover,
.settings-btn:focus,
.settings-btn[aria-expanded="true"] {
  background: var(--blue-soft);
  color: #2447b8;
  outline: none;
}

.settings-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  z-index: 60;
}

.settings-item {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
}

.settings-item:hover,
.settings-item:focus,
.settings-item.active {
  background: var(--blue-soft);
  color: #2447b8;
  outline: none;
}

.settings-logout,
.settings-logout:hover,
.settings-logout:focus,
.settings-logout.active {
  color: var(--red);
  background: transparent;
}

.settings-logout:hover,
.settings-logout:focus {
  background: var(--red-soft);
  color: var(--red);
}

.app-content {
  min-width: 0;
}

.app-page {
  min-height: 100vh;
}

.toolhub-page,
.account-page,
.admin-page,
.useful-prompts-page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  width: 100%;
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
  text-decoration: none;
  cursor: pointer;
}

.tool-card:link,
.tool-card:visited,
.tool-card:hover,
.tool-card:active,
.tool-card:focus {
  text-decoration: none;
  color: var(--text);
}

.tool-card-body {
  text-decoration: none;
  min-width: 0;
}

.tool-card strong,
.tool-card small {
  display: block;
  text-decoration: none;
}

.tool-card:not(.disabled-tool):hover,
.tool-card:not(.disabled-tool):focus {
  border-color: var(--blue);
  box-shadow: 0 14px 34px rgba(49, 91, 232, 0.16);
  outline: none;
}

.tool-card strong,
.tool-card small {
  display: block;
}

.tool-card strong {
  margin-bottom: 6px;
  font-size: 17px;
}

.tool-card small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}

.tool-card .tool-blurb {
  display: block;
  margin-top: 6px;
  color: #334155;
  line-height: 1.5;
}

.tool-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}

.tool-icon-img {
  width: 90px;
  height: 90px;
  flex: 0 0 90px;
  border-radius: 22px;
  object-fit: cover;
  filter: drop-shadow(0 5px 10px rgba(15, 23, 42, 0.28));
}

.tool-icon.muted {
  background: var(--blue-soft);
  color: #2447b8;
}

.disabled-tool {
  cursor: default;
  opacity: 0.72;
}

.empty-state {
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
}

.account-info-card,
.account-panel {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.account-info-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1.45fr);
  gap: 22px;
  align-items: start;
}

.account-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.account-details div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafcff;
}

.account-details dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.account-details dd {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.gate-notice {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
}

.panel-copy {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.password-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-top: 22px;
}

.password-form input {
  width: 100%;
  height: 62px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font-size: 18px;
}

.password-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 91, 232, 0.12);
}

.form-status {
  min-height: 20px;
  margin: 12px 0;
  font-size: 14px;
}

.form-status.error { color: var(--red); }
.form-status.done { color: var(--green); }

.password-submit {
  height: 60px;
  white-space: nowrap;
  background: #0f777d;
}

.password-criteria {
  display: grid;
  gap: 11px;
  margin: 18px 0 0;
  padding: 0;
  color: #506983;
  font-size: 18px;
  list-style: none;
}

.password-criteria li {
  display: flex;
  align-items: center;
  gap: 11px;
}

.password-criteria li::before {
  content: "";
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid #cbd8e8;
  border-radius: 50%;
  background: #ffffff;
}

.password-criteria li.met {
  color: var(--green);
}

.password-criteria li.met::before {
  border-color: var(--green);
  background:
    radial-gradient(circle at center, var(--green) 0 45%, transparent 48%),
    #ffffff;
}

.policy-locked .settings-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
}

.admin-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-panel input,
.admin-panel select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  outline: none;
}

.admin-panel input:focus,
.admin-panel select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 91, 232, 0.12);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.user-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.user-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafcff;
  min-width: 0;
  overflow: hidden;
}

.user-row > *,
.user-row label {
  min-width: 0;
}

.user-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.user-summary:hover,
.user-summary:focus {
  background: #f2f6ff;
  outline: none;
}

.user-identity strong,
.user-identity small {
  display: block;
}

.user-identity strong,
.user-identity small {
  overflow-wrap: anywhere;
}

.user-identity small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.expand-indicator {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: #2447b8;
  font-size: 20px;
  font-weight: 900;
}

.user-row.expanded .expand-indicator {
  transform: rotate(45deg);
}

.user-controls {
  display: grid;
  grid-template-columns: minmax(150px, 180px) minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 0 18px 18px;
}

.reset-password-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
}

.tool-access-field {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.tool-access-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tool-access-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.tool-access-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafcff;
  color: var(--text);
}

.tool-access-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 18px;
}

.tool-access-option strong,
.tool-access-option small {
  display: block;
}

.tool-access-option small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.save-tools-btn {
  width: auto;
}

.tool-access-note {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.prompt-form,
.prompt-card {
  margin-bottom: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.prompt-form input,
.prompt-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  outline: none;
}

.prompt-form input {
  height: 44px;
}

.prompt-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.prompt-form input:focus,
.prompt-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 91, 232, 0.12);
}

.prompt-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.prompt-list {
  display: grid;
  gap: 12px;
}

.prompt-card {
  padding: 0;
  overflow: hidden;
}

.prompt-title-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 18px;
}

.prompt-title-btn:hover,
.prompt-title-btn:focus {
  background: #f2f6ff;
  outline: none;
}

.prompt-card.expanded .expand-indicator {
  transform: rotate(45deg);
}

.prompt-body {
  padding: 0 20px 20px;
}

.prompt-body pre {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafcff;
  color: #334155;
  font: inherit;
  line-height: 1.55;
  white-space: pre-wrap;
}

.prompt-card-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: #2447b8;
  font-size: 18px;
  line-height: 1;
  box-shadow: none;
}

.icon-button:hover,
.icon-button:focus {
  outline: 2px solid rgba(49, 91, 232, 0.18);
}

.danger-icon {
  background: var(--red-soft);
  color: var(--red);
}

.prompt-edit-form {
  display: grid;
  gap: 8px;
}

.prompt-edit-form input,
.prompt-edit-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  outline: none;
}

.prompt-edit-form input {
  height: 44px;
}

.prompt-edit-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.prompt-edit-form input:focus,
.prompt-edit-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 91, 232, 0.12);
}

.delete-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #f5bcc7;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

.delete-confirm .primary {
  background: var(--red);
}

.delete-confirm-actions {
  display: flex;
  gap: 8px;
}

.user-danger-zone {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.danger-btn {
  justify-self: start;
  background: var(--red-soft);
  color: var(--red);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.topbar {
  height: 86px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

h1, h2, p { margin: 0; }

h1 { font-size: 23px; font-weight: 800; }
h2 { font-size: 17px; }
.topbar p { margin-top: 8px; color: var(--muted); }

button, input, textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary {
  background: var(--blue);
  color: white;
  padding: 14px 24px;
  box-shadow: var(--shadow);
}

.secondary {
  background: var(--blue-soft);
  color: #2447b8;
  padding: 10px 15px;
}

.layout {
  display: grid;
  grid-template-columns: 30% 70%;
  gap: 20px;
  padding: 20px;
  height: calc(100vh - 86px);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 0;
}

.panel-head {
  height: 74px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.actions {
  display: flex;
  gap: 10px;
}

.input-panel {
  display: flex;
  flex-direction: column;
}

#reportText {
  flex: 1;
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 22px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}

#observationText {
  flex: 1;
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 22px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}

.analysis-textarea {
  flex: 1;
  width: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 22px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}

.tool-guide {
  border-bottom: 1px solid var(--border);
  background: var(--blue-soft);
}

.tool-guide summary {
  cursor: pointer;
  padding: 12px 18px;
  color: #2447b8;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  user-select: none;
}

.tool-guide summary::-webkit-details-marker {
  display: none;
}

.tool-guide summary::after {
  content: "+";
  float: right;
  font-size: 18px;
  font-weight: 900;
  transition: transform 0.16s ease;
}

.tool-guide[open] summary::after {
  transform: rotate(45deg);
}

.tool-guide-body {
  padding: 0 18px 16px;
  color: #334155;
  font-size: 14px;
  line-height: 1.55;
}

.tool-guide-body p {
  margin: 0 0 8px;
}

.tool-guide-body ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.tool-guide-body li {
  margin-bottom: 4px;
}

.tool-guide-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.hint-row {
  min-height: 40px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 18px;
  color: var(--muted);
  font-size: 14px;
}

.recommendation-panel {
  display: flex;
  flex-direction: column;
}

.status {
  margin: 18px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 14px;
}

.status.idle { background: var(--blue-soft); color: #2447b8; }
.status.working { background: #fff7e6; color: #99630a; }
.status.done { background: var(--green-soft); color: var(--green); }
.status.error { background: var(--red-soft); color: var(--red); }

.summary {
  margin: 0 18px 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #334155;
  background: #fafcff;
  line-height: 1.45;
}

.hidden { display: none !important; }

.section-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 18px 14px;
}

.section-pill {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
}

.section-pill.found {
  background: var(--green-soft);
  color: var(--green);
}

.section-pill.missing {
  background: var(--red-soft);
  color: var(--red);
}


.recommendations {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px 18px;
  max-height: calc(100vh - 250px);
}

.rec-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  background: #ffffff;
}

.rec-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.rec-number {
  font-weight: 800;
  color: #2447b8;
  background: var(--blue-soft);
  border-radius: 999px;
  padding: 7px 11px;
}

.type-input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  color: #2447b8;
  background: var(--blue-soft);
  font-weight: 700;
}

.delete-rec {
  width: 32px;
  height: 32px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 20px;
  line-height: 1;
}

label {
  display: block;
  margin: 10px 0 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.rec-card textarea,
.rec-card input {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  line-height: 1.45;
  outline: none;
}

.rec-card input {
  background: #fafcff;
  color: #334155;
}

.rec-card textarea:focus,
.rec-card input:focus,
#reportText:focus,
#observationText:focus,
.analysis-textarea:focus {
  box-shadow: inset 0 0 0 2px rgba(49, 91, 232, 0.14);
}

.copy-suggestion-btn {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.reflection-output {
  flex: 1;
  overflow-y: auto;
  padding: 0 18px 18px;
  max-height: calc(100vh - 250px);
}

.reflect-block {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.reflect-block h3 {
  margin: 0 0 8px;
  color: #2447b8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reflect-block p {
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
}

.reflect-block ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.5;
}

.reflect-block li {
  margin-bottom: 6px;
}

.reflect-encourage {
  border-color: #b9e6c9;
  background: var(--green-soft);
}

.reflect-encourage h3 {
  color: var(--green);
}

.reflect-escalate {
  border-color: #f5d9a8;
  background: #fff7e6;
}

.reflect-escalate h3 {
  color: #99630a;
}

.reflect-empty {
  padding: 14px;
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}

.modal {
  width: min(720px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.modal-body {
  padding: 18px 20px 20px;
  overflow-y: auto;
}

#promptModalText {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-family: Consolas, Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
  background: #fafcff;
  white-space: pre-wrap;
  outline: none;
}

.icon-button.copied {
  background: var(--green-soft);
  color: var(--green);
}

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 70;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    overflow: visible;
  }

  .brand-block {
    min-width: 180px;
    margin: 0;
  }

  .settings-wrap {
    margin-top: 0;
    margin-left: auto;
    flex: 0 0 auto;
  }

  .settings-menu {
    top: calc(100% + 10px);
    bottom: auto;
    right: 0;
    z-index: 80;
  }

  .tool-grid,
  .admin-grid,
  .account-info-card,
  .account-details,
  .password-fields {
    grid-template-columns: 1fr;
  }

  .user-controls {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .panel {
    min-height: 520px;
  }

  .topbar {
    height: auto;
    gap: 16px;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .login-view { padding: 16px; }
  .login-card { padding: 28px 22px; }
  .toolhub-page,
  .account-page,
  .admin-page,
  .useful-prompts-page { width: min(100% - 28px, 1120px); padding: 22px 0; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .topbar { flex-direction: column; }
  .topbar-actions { width: 100%; }
  .topbar-actions button { flex: 1; }
  .topbar-actions .icon-button { flex: 0 0 42px; }
}
