:root {
  --primary: #123c5a;
  --primary-dark: #07172a;
  --primary-soft: #eef5f1;
  --accent: #18a99a;
  --accent-dark: #0c756d;
  --background: #f7f2e9;
  --surface: #fffdf8;
  --surface-strong: #f6efe4;
  --text: #172134;
  --muted: #647083;
  --line: #e5d9c7;
  --line-strong: #cdbb9f;
  --success: #147653;
  --success-bg: #eaf7ef;
  --warning: #8b611f;
  --warning-bg: #fff7e6;
  --danger: #b4233a;
  --danger-bg: #fff0f3;
  --champagne: #d8b76a;
  --champagne-soft: #fbf2dc;
  --indigo: #0c1025;
  --shadow: 0 26px 70px rgba(7, 23, 42, 0.18);
  --shadow-soft: 0 14px 38px rgba(7, 23, 42, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px rgba(216, 183, 106, 0.34), 0 0 0 6px rgba(24, 169, 154, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 159, 154, 0.13), transparent 34rem),
    linear-gradient(180deg, #f8fbfd 0%, var(--background) 46%, #eef5f8 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
.btn,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent-dark));
  box-shadow: 0 10px 22px rgba(15, 61, 94, 0.18);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

button:hover,
.btn:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 61, 94, 0.2);
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary,
button.btn-secondary,
a.btn-secondary {
  color: var(--primary);
  background: #ffffff;
  border-color: var(--line-strong);
  box-shadow: none;
}

.btn-secondary:hover,
button.btn-secondary:hover,
a.btn-secondary:hover {
  background: var(--primary-soft);
  border-color: rgba(15, 159, 154, 0.45);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
.option:focus-visible,
.mode-pill:focus-within {
  outline: none;
  box-shadow: var(--focus);
}

input {
  min-height: 44px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input::placeholder {
  color: #7c8d9d;
}

input:focus {
  border-color: var(--accent);
  background: #ffffff;
}

select {
  min-height: 44px;
  color: var(--text);
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(205, 187, 159, 0.8);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hidden {
  display: none !important;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(216, 228, 236, 0.9);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(15, 61, 94, 0.06);
}

.header-content {
  width: min(1240px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-mark,
.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--primary);
  text-decoration: none;
}

.logo {
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 1px solid rgba(15, 159, 154, 0.25);
  border-radius: 14px;
  background: linear-gradient(145deg, #ffffff, #e6f7f6);
  box-shadow: 0 8px 22px rgba(15, 61, 94, 0.1);
}

.header h1,
.brand-name {
  margin: 0;
  color: var(--primary-dark);
  font-size: 21px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
}

.header-nav,
.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

main {
  width: 100%;
  max-width: 1250px;
  margin: 28px auto;
  padding: 20px max(20px, env(safe-area-inset-right)) 20px max(20px, env(safe-area-inset-left));
}

.toolbar,
.panel,
.question-block,
.billing-card,
.reset-card,
.admin-panel,
.stat-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.toolbar {
  padding: 18px;
  margin-bottom: 18px;
}

.auth-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.auth-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.auth-form input {
  min-width: 185px;
  max-width: 100%;
  padding: 10px 12px;
  font-size: 14px;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 10px;
  align-items: stretch;
}

#topic {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border-width: 1px;
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(15, 61, 94, 0.04);
}

#generateBtn {
  min-width: 138px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
}

button.is-loading::before,
.btn-secondary.is-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-secondary.is-loading::before {
  border-color: rgba(15, 61, 94, 0.2);
  border-top-color: var(--accent);
}

.app-error,
.app-success,
.loading-box,
.notice-box,
.empty-state,
.score {
  border-radius: var(--radius-sm);
  line-height: 1.45;
}

.app-error {
  margin-top: 12px;
  padding: 12px 14px;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #f2b8c2;
  border-left: 5px solid var(--danger);
  font-size: 14px;
}

.app-success {
  margin-top: 12px;
  padding: 12px 14px;
  color: var(--success);
  background: var(--success-bg);
  border: 1px solid #a9dfc2;
  border-left: 5px solid var(--success);
  font-size: 14px;
}

.loading-box,
.notice-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  color: var(--primary);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.notice-box.warning {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: #f1d7a9;
}

.notice-box.error {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f2b8c2;
}

.ai-loading {
  min-height: 96px;
  box-shadow: var(--shadow-soft);
}

.muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-strong);
}

.empty-state.compact {
  padding: 8px;
}

#emailVerificationBanner {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 12px;
}

#emailVerificationBanner .btn-secondary {
  flex: 0 0 auto;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(15, 61, 94, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  flex: 0 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.mode-label {
  color: var(--primary);
  font-weight: 800;
}

.mode-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--primary);
  font-size: 13px;
}

.mode-pill {
  cursor: pointer;
  user-select: none;
}

.mode-pill input {
  margin: 0;
  accent-color: var(--accent);
}

.toast-container {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1000;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}

.toast {
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--primary);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: toastIn 0.2s ease-out;
  line-height: 1.4;
}

.toast-success {
  color: var(--success);
  border-color: #a9dfc2;
}

.toast-error {
  color: var(--danger);
  border-color: #f2b8c2;
}

.toast-hide {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#progress-container {
  position: relative;
  width: 100%;
  height: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(15, 61, 94, 0.08);
  border-radius: 999px;
  background: #dbeaf0;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #38c7d5);
  transition: width 0.2s ease;
}

#progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.score {
  padding: 13px 15px;
  margin-bottom: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  box-shadow: var(--shadow-soft);
  font-weight: 800;
}

.score-teacher {
  border-left-color: var(--accent);
}

.score-student {
  border-left-color: var(--primary);
}

.layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.progress-panel {
  padding: 16px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 250, 0.94));
  border: 1px solid rgba(184, 207, 207, 0.72);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.progress-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.progress-dashboard {
  display: grid;
  gap: 12px;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.progress-card,
.progress-trend,
.progress-activity {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(184, 207, 207, 0.68);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.progress-card {
  display: grid;
  gap: 5px;
  min-height: 116px;
  padding: 14px;
}

.progress-card span,
.progress-trend span,
.progress-activity-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.progress-card strong {
  color: var(--indigo);
  font-size: 25px;
  line-height: 1.1;
}

.progress-card small,
.progress-trend small,
.progress-activity small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.progress-details {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.4fr);
  gap: 12px;
}

.progress-trend {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border-left: 4px solid var(--line);
}

.progress-trend.positive {
  border-left-color: var(--accent);
}

.progress-trend.negative {
  border-left-color: #d55f5a;
}

.progress-trend.stable {
  border-left-color: #c9a76a;
}

.progress-trend strong {
  color: var(--primary-dark);
  font-size: 17px;
  line-height: 1.3;
}

.progress-activity {
  padding: 14px;
}

.progress-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.progress-activity ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.progress-activity li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(216, 228, 236, 0.72);
}

.progress-activity li:first-child {
  border-top: 0;
}

.progress-activity li span {
  display: grid;
  min-width: 0;
}

.progress-activity li strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.progress-activity li small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-activity li b {
  color: var(--indigo);
  font-size: 14px;
  white-space: nowrap;
}

.progress-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(184, 207, 207, 0.68);
  border-radius: var(--radius-sm);
}

.progress-empty h3 {
  margin: 0 0 5px;
  color: var(--primary-dark);
  font-size: 16px;
}

.progress-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.recommendations-panel {
  padding: 16px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(24, 169, 154, 0.12), transparent 18rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 240, 0.92));
  border: 1px solid rgba(205, 187, 159, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.recommendations-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.recommendations-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.recommendation-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(205, 187, 159, 0.58);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.recommendation-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.recommendation-type {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  color: var(--accent-dark);
  background: rgba(237, 248, 245, 0.9);
  border: 1px solid rgba(24, 169, 154, 0.28);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.recommendation-card h3 {
  margin: 0;
  color: var(--indigo);
  font-size: 16px;
  line-height: 1.25;
}

.recommendation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.recommendation-card button {
  width: 100%;
}

.panel {
  padding: 16px;
}

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

.panel h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 16px;
  letter-spacing: 0;
}

.list {
  display: grid;
  gap: 9px;
}

.list-item {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: var(--radius-sm);
  padding: 11px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.list-item:hover {
  background: var(--primary-soft);
  border-color: rgba(15, 159, 154, 0.35);
  transform: translateY(-1px);
}

.list-item .title {
  margin-bottom: 4px;
  color: var(--primary-dark);
  font-weight: 800;
}

.list-item .meta {
  color: var(--muted);
  font-size: 12px;
}

.history-actions,
.notice-action {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.history-filters {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.history-filters input,
.history-filters select,
.history-filters button {
  width: 100%;
  min-width: 0;
}

.history-confirm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  user-select: none;
}

.history-confirm-toggle input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}

.history-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.category-badge,
.history-tags span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
}

.category-badge {
  padding: 5px 8px;
  color: var(--primary-dark);
  background: linear-gradient(135deg, var(--champagne-soft), #eef8f5);
  border: 1px solid rgba(216, 183, 106, 0.52);
  font-size: 11px;
  font-weight: 850;
}

.history-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.history-tags span {
  padding: 4px 7px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(205, 187, 159, 0.42);
  font-size: 11px;
}

.content {
  min-width: 0;
}

.qcm-title {
  margin: 0 0 14px;
  color: var(--primary-dark);
  font-size: 24px;
  line-height: 1.2;
}

.text-error {
  color: var(--danger);
}

.question-block {
  padding: 18px;
  margin-bottom: 15px;
  border-left: 5px solid var(--accent);
  animation: cardIn 0.2s ease-out;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-block h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 18px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.option {
  position: relative;
  padding: 12px 13px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  overflow-wrap: anywhere;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.option:hover {
  background: #eef7f8;
  border-color: rgba(15, 159, 154, 0.4);
  transform: translateY(-1px);
}

.option.selected {
  border: 2px solid var(--accent);
  background: #e8f8f7;
  box-shadow: 0 0 0 3px rgba(15, 159, 154, 0.12);
}

.option.correct {
  color: var(--success) !important;
  background: var(--success-bg) !important;
  border-color: #68c293 !important;
}

.option.wrong {
  color: var(--danger) !important;
  background: var(--danger-bg) !important;
  border-color: #e58c9a !important;
}

.option.locked {
  cursor: default;
  opacity: 0.97;
}

.explanation {
  margin-top: 12px;
  padding: 12px;
  color: var(--primary);
  background: #f6fbfc;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
}

.table-wrap,
.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.table-wrap {
  max-height: 520px;
}

.scores-table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.scores-table th,
.scores-table td,
.admin-table th,
.admin-table td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf3f6;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.scores-table th,
.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--primary);
  background: #f3f8fa;
  font-weight: 800;
}

.footer {
  margin-top: 42px;
  padding: 22px max(16px, env(safe-area-inset-right)) 22px max(16px, env(safe-area-inset-left));
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0;
}

.footer-note {
  max-width: 720px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.footer-links {
  display: inline-flex;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.footer-links a,
.legal-link {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.footer-links a:hover,
.legal-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.legal-page {
  max-width: 920px;
}

.legal-card {
  padding: 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.legal-card h2 {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 30px;
  line-height: 1.15;
}

.legal-updated {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}

.legal-notice {
  margin: 18px 0 24px;
  padding: 14px 16px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(15, 159, 154, 0.28);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.legal-summary {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding: 16px;
  color: var(--text);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(205, 187, 159, 0.62);
  border-radius: var(--radius-sm);
}

.legal-summary strong {
  color: var(--indigo);
  font-size: 15px;
}

.legal-summary ul {
  margin: 0;
  padding-left: 20px;
}

.legal-summary li {
  line-height: 1.55;
}

.legal-section {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.legal-section h3 {
  margin: 0 0 9px;
  color: var(--primary-dark);
  font-size: 20px;
}

.legal-section p,
.legal-section li {
  color: var(--text);
  line-height: 1.65;
}

.legal-section p {
  margin: 0 0 10px;
}

.legal-section ul {
  margin: 0;
  padding-left: 20px;
}

.billing-page,
.reset-page {
  max-width: 760px;
}

.reset-page {
  max-width: 580px;
}

.billing-card,
.reset-card {
  padding: 24px;
}

.billing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.billing-header h2,
.reset-card h2,
.admin-title h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 26px;
  letter-spacing: 0;
}

.billing-subtitle,
.reset-card p,
.admin-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.billing-status,
.reset-form {
  display: grid;
  gap: 12px;
}

.billing-status {
  margin-bottom: 20px;
}

.billing-status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.subscription-active .billing-status-row:first-child {
  border-color: #a9dfc2;
  background: var(--success-bg);
}

.billing-label {
  color: var(--muted);
  font-size: 14px;
}

.billing-value {
  color: var(--primary-dark);
  font-weight: 800;
  text-align: right;
}

.subscription-active #subscriptionStatus {
  color: var(--success);
}

.billing-actions,
.reset-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  margin-bottom: 16px;
}

.billing-message,
.reset-message {
  min-height: 22px;
  color: var(--primary);
  font-size: 14px;
  line-height: 1.45;
}

.billing-message.error,
.reset-message.error {
  color: var(--danger);
}

.reset-message.success {
  color: var(--success);
}

.reset-form input {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

#loadingState {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.admin-page {
  max-width: 1180px;
}

.admin-topbar,
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-topbar {
  margin-bottom: 16px;
}

.admin-actions,
.admin-search,
.admin-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
}

.stat-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  color: var(--primary-dark);
  font-size: 27px;
  font-weight: 850;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.admin-panel {
  min-width: 0;
  padding: 16px;
}

.admin-panel.full {
  margin-bottom: 14px;
}

.admin-panel-header {
  margin-bottom: 12px;
}

.admin-panel h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 17px;
}

.admin-panel-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.admin-search input {
  min-width: 240px;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-table-wrap {
  max-height: 520px;
}

.admin-message {
  margin-bottom: 14px;
}

.admin-pagination {
  justify-content: space-between;
  margin-top: 12px;
}

.feedback-admin-actions,
.admin-feedback-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-feedback-filters {
  margin-bottom: 14px;
}

.admin-feedback-filters select {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
}

.admin-check-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 750;
}

.admin-check-filter input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

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

.admin-feedback-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
}

.admin-feedback-card.is-unread {
  border-left-color: var(--accent);
  background: linear-gradient(180deg, rgba(246, 255, 252, 0.96), rgba(255, 255, 255, 0.92));
}

.admin-feedback-card.is-read {
  opacity: 0.88;
}

.feedback-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.feedback-card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-card-top h4 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 16px;
  overflow-wrap: anywhere;
}

.feedback-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.feedback-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid rgba(15, 159, 154, 0.22);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.feedback-badge.unread {
  color: var(--accent-dark);
  background: rgba(237, 248, 245, 0.95);
  border-color: rgba(24, 169, 154, 0.32);
}

.feedback-badge.read {
  color: var(--muted);
  background: rgba(246, 248, 249, 0.95);
  border-color: var(--line);
}

.feedback-delete-btn {
  color: var(--danger);
  border-color: rgba(213, 95, 90, 0.34);
  background: rgba(255, 247, 246, 0.92);
}

.feedback-delete-btn:hover:not(:disabled) {
  color: #a4342f;
  border-color: rgba(213, 95, 90, 0.58);
  background: rgba(255, 238, 236, 0.98);
}

.feedback-message {
  margin: 0;
  color: var(--text);
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.feedback-meta-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.feedback-meta-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  background: rgba(246, 250, 252, 0.82);
  border: 1px solid rgba(216, 228, 236, 0.82);
  border-radius: var(--radius-sm);
}

.feedback-meta-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.feedback-meta-item strong {
  color: var(--primary-dark);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.landing-body {
  background:
    radial-gradient(circle at 78% 8%, rgba(56, 199, 213, 0.22), transparent 25rem),
    radial-gradient(circle at 8% 2%, rgba(15, 61, 94, 0.12), transparent 22rem),
    linear-gradient(180deg, #fbfdfe 0%, #f4f8fb 48%, #eef5f8 100%);
}

.landing-main {
  max-width: none;
  margin: 0;
  padding: 0;
}

.landing-nav,
.landing-section,
.landing-footer {
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
}

.landing-nav {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 42px;
  align-items: center;
  padding: 66px 0 54px;
}

.eyebrow,
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 18px;
  padding: 8px 12px;
}

.eyebrow::before,
.trust-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.landing-hero h1 {
  margin: 0;
  max-width: 760px;
  color: var(--primary-dark);
  font-size: clamp(40px, 6vw, 70px);
  line-height: 1.02;
  letter-spacing: 0;
}

.subtitle {
  max-width: 680px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.trust-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.btn-large {
  min-height: 50px;
  padding: 14px 20px;
}

.trust-badge {
  padding: 8px 11px;
}

.product-panel {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), #38c7d5, var(--primary));
}

.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  color: var(--primary-dark);
  font-size: 17px;
  font-weight: 850;
}

.panel-status {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.mock-question {
  padding: 15px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.mock-topic {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  margin-bottom: 12px;
  border: 1px solid rgba(216, 183, 106, 0.5);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--champagne-soft), #f6fbf8);
}

.mock-topic span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mock-topic strong {
  color: var(--primary-dark);
  line-height: 1.35;
}

.mock-question strong {
  display: block;
  margin-bottom: 10px;
  color: var(--primary-dark);
  line-height: 1.35;
}

.mock-option {
  padding: 10px 11px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
}

.mock-option.good {
  color: var(--success);
  background: var(--success-bg);
  border-color: #a9dfc2;
  font-weight: 800;
}

.mock-progress {
  height: 10px;
  overflow: hidden;
  margin-top: 15px;
  border-radius: 999px;
  background: #dbeaf0;
}

.mock-progress span {
  display: block;
  width: 72%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #38c7d5);
}

.landing-section {
  padding: 52px 0;
}

.landing-section h2 {
  margin: 0 0 14px;
  color: var(--primary-dark);
  font-size: 31px;
  letter-spacing: 0;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 24px;
}

.section-intro {
  max-width: 720px;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 17px;
}

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

.feature-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.landing-card {
  min-height: 154px;
  padding: 19px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 13px;
  border-radius: var(--radius-sm);
  color: var(--primary);
  background: linear-gradient(145deg, #edf8f8, #ffffff);
  border: 1px solid rgba(15, 159, 154, 0.18);
  font-weight: 900;
}

.landing-card h3 {
  margin: 0 0 8px;
  color: var(--primary-dark);
  font-size: 18px;
}

.landing-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 15px;
}

.transparency-section {
  padding-top: 24px;
}

.transparency-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.transparency-card {
  min-height: 168px;
  padding: 18px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(205, 187, 159, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.transparency-card h3 {
  margin: 0 0 9px;
  color: var(--primary-dark);
  font-size: 18px;
}

.transparency-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.transparency-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 0;
  padding-bottom: 34px;
}

.proof-item {
  padding: 17px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(205, 187, 159, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.proof-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--indigo);
  font-size: 20px;
  line-height: 1.15;
}

.proof-item span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.workflow-card {
  position: relative;
  min-height: 190px;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(24, 169, 154, 0.12), transparent 13rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 240, 0.9));
  border: 1px solid rgba(205, 187, 159, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.workflow-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--champagne), var(--accent));
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  color: var(--primary-dark);
  background: linear-gradient(145deg, #fff8e8, #edf8f5);
  border: 1px solid rgba(216, 183, 106, 0.42);
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
}

.workflow-card h3 {
  margin: 0 0 8px;
  color: var(--indigo);
  font-size: 19px;
}

.workflow-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.center-cta {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.reassurance-grid .landing-card {
  min-height: 174px;
}

.final-cta {
  margin-top: 28px;
  padding: 26px;
  background:
    radial-gradient(circle at 90% 0%, rgba(216, 183, 106, 0.18), transparent 18rem),
    linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(237, 248, 245, 0.82));
  border: 1px solid rgba(205, 187, 159, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.final-cta h2 {
  margin-bottom: 8px;
}

.final-cta p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.landing-band {
  background: rgba(255, 255, 255, 0.64);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.landing-footer {
  padding: 30px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}

.landing-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .input-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding-top: 34px;
  }

  .feature-grid,
  .feature-grid.three,
  .proof-strip,
  .workflow-grid,
  .progress-grid,
  .transparency-grid,
  .recommendations-list,
  .stats-grid,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feedback-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .header-content,
  .landing-nav {
    width: min(100% - 24px, 1240px);
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .header-nav,
  .nav-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-nav a,
  .header-nav button,
  .nav-actions a {
    flex: 1 1 140px;
  }

  .header h1,
  .brand-name {
    font-size: 20px;
  }

  main {
    margin: 14px auto;
    padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  }

  .toolbar,
  .panel,
  .question-block,
  .billing-card,
  .reset-card,
  .admin-panel,
  .stat-card {
    border-radius: 10px;
  }

  .auth-row,
  .auth-form,
  .input-row,
  .mode-row,
  .panel-header,
  .billing-status-row,
  .admin-actions,
  .admin-search,
  .admin-pagination {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .auth-form input,
  #topic,
  button,
  .btn,
  .btn-secondary,
  .status-pill,
  .mode-pill,
  .billing-actions a,
  .billing-actions button,
  .reset-actions a,
  .reset-actions button,
  .admin-search input,
  .admin-actions a,
  .admin-actions button {
    width: 100%;
    min-width: 0;
  }

  button,
  .btn,
  .btn-secondary {
    min-height: 48px;
    padding: 12px 14px;
    text-align: center;
  }

  #emailVerificationBanner {
    align-items: stretch;
  }

  #emailVerificationBanner .btn-secondary {
    width: 100%;
  }

  .question-block {
    padding: 14px;
    border-left-width: 4px;
  }

  .question-block h3 {
    font-size: 16px;
  }

  .option {
    padding: 13px;
  }

  .table-wrap {
    max-height: none;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
  }

  .landing-section,
  .landing-footer {
    width: min(100% - 24px, 1140px);
  }

  .landing-hero h1 {
    font-size: 40px;
  }

  .subtitle {
    font-size: 17px;
  }

  .cta-row .btn,
  .proof-strip,
  .workflow-grid,
  .progress-grid,
  .transparency-grid,
  .recommendations-list,
  .feature-grid,
  .feature-grid.three,
  .stats-grid,
  .admin-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .landing-footer {
    display: grid;
  }

  .legal-card {
    padding: 20px;
  }

  .legal-card h2 {
    font-size: 25px;
  }
}

/* Premium visual refresh */
body {
  background:
    radial-gradient(circle at 8% -6%, rgba(216, 183, 106, 0.24), transparent 28rem),
    radial-gradient(circle at 88% 6%, rgba(24, 169, 154, 0.2), transparent 30rem),
    linear-gradient(180deg, #fffaf0 0%, #f7f2e9 42%, #edf4ef 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(12, 16, 37, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 16, 37, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 72%);
}

button,
.btn,
.btn-secondary {
  border-radius: 999px;
  letter-spacing: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button,
.btn {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(135deg, var(--primary-dark), var(--primary) 48%, var(--accent-dark));
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 32px rgba(7, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

button:hover,
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(7, 23, 42, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.btn-secondary,
button.btn-secondary,
a.btn-secondary {
  color: var(--primary-dark);
  background: rgba(255, 253, 248, 0.78);
  border-color: rgba(205, 187, 159, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(7, 23, 42, 0.05);
}

.btn-secondary:hover,
button.btn-secondary:hover,
a.btn-secondary:hover {
  color: var(--primary-dark);
  background: linear-gradient(135deg, #fffdf8, var(--champagne-soft));
  border-color: rgba(216, 183, 106, 0.72);
}

input {
  background: rgba(255, 253, 248, 0.88);
  border-color: rgba(205, 187, 159, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

input:focus {
  border-color: var(--champagne);
  background: #fffdf8;
}

.header {
  background: rgba(255, 250, 240, 0.82);
  border-bottom-color: rgba(205, 187, 159, 0.52);
  box-shadow: 0 14px 38px rgba(7, 23, 42, 0.08);
}

.logo {
  padding: 6px;
  border-color: rgba(216, 183, 106, 0.45);
  background: linear-gradient(145deg, #fffdf8, #f6ead0);
  box-shadow: 0 12px 26px rgba(7, 23, 42, 0.14);
}

.brand-name,
.header h1 {
  color: var(--indigo);
}

.brand-subtitle,
.subtitle,
.section-intro,
.landing-card p,
.card p,
.muted {
  color: var(--muted);
}

.toolbar,
.panel,
.question-block,
.billing-card,
.reset-card,
.admin-panel,
.stat-card,
.legal-card,
.product-panel,
.landing-card {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 240, 0.92)),
    rgba(255, 253, 248, 0.95);
  border-color: rgba(205, 187, 159, 0.62);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.toolbar,
.product-panel {
  position: relative;
  overflow: hidden;
}

.toolbar::before,
.product-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--champagne), var(--accent), var(--primary));
}

.toolbar {
  padding-top: 22px;
}

.status-pill,
.mode-pill,
.eyebrow,
.trust-badge,
.panel-status {
  color: var(--primary-dark);
  background: rgba(255, 253, 248, 0.78);
  border-color: rgba(205, 187, 159, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.eyebrow,
.trust-badge {
  color: #28324a;
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(12px);
}

.eyebrow::before,
.trust-badge::before {
  background: linear-gradient(135deg, var(--champagne), var(--accent));
  box-shadow: 0 0 0 4px rgba(216, 183, 106, 0.16);
}

#generateBtn {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    linear-gradient(135deg, var(--accent-dark), var(--accent), var(--primary));
}

.loading-box,
.notice-box,
.empty-state,
.score,
.explanation,
.mock-question,
.billing-status-row,
.list-item {
  background: rgba(255, 250, 240, 0.72);
  border-color: rgba(205, 187, 159, 0.58);
}

.app-success,
.option.correct,
.mock-option.good,
.subscription-active .billing-status-row:first-child {
  background: linear-gradient(180deg, #eef9f1, #e7f5ed) !important;
  border-color: rgba(20, 118, 83, 0.34) !important;
}

.app-error,
.option.wrong {
  background: linear-gradient(180deg, #fff4f5, #ffecef) !important;
}

.notice-box.warning {
  background: linear-gradient(180deg, #fff8e8, #fdf0d1);
  border-color: rgba(216, 183, 106, 0.54);
}

#progress-container,
.mock-progress {
  background: rgba(205, 187, 159, 0.28);
  border-color: rgba(205, 187, 159, 0.4);
}

#progress-bar,
.mock-progress span {
  background: linear-gradient(90deg, var(--champagne), var(--accent), #3dd6ca);
}

.layout {
  gap: 18px;
}

.question-block {
  border-left-color: var(--champagne);
}

.question-block:hover,
.panel:hover,
.landing-card:hover,
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.question-block,
.panel,
.landing-card,
.stat-card,
.list-item,
.option,
.mock-option {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.option,
.mock-option {
  background: rgba(255, 253, 248, 0.86);
  border-color: rgba(205, 187, 159, 0.62);
}

.option:hover {
  background: linear-gradient(135deg, #fffdf8, #f5fbf8);
  border-color: rgba(24, 169, 154, 0.52);
}

.option.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, #f2fffb, #fff8e8);
  box-shadow: 0 0 0 3px rgba(24, 169, 154, 0.13), 0 12px 26px rgba(7, 23, 42, 0.08);
}

.list-item:hover {
  background: linear-gradient(135deg, #fffdf8, #f7f1df);
  border-color: rgba(216, 183, 106, 0.65);
}

.table-wrap,
.admin-table-wrap {
  background: rgba(255, 253, 248, 0.72);
  border-color: rgba(205, 187, 159, 0.55);
}

.scores-table th,
.admin-table th {
  color: var(--indigo);
  background: rgba(246, 239, 228, 0.96);
}

.scores-table td,
.admin-table td {
  border-bottom-color: rgba(205, 187, 159, 0.34);
}

.footer {
  background: rgba(255, 250, 240, 0.78);
  border-top-color: rgba(205, 187, 159, 0.45);
}

.footer-links a,
.landing-footer a,
.legal-link {
  color: var(--primary-dark);
}

.footer-links a:hover,
.landing-footer a:hover,
.legal-link:hover {
  color: var(--accent-dark);
}

.landing-body {
  background:
    radial-gradient(circle at 78% 4%, rgba(216, 183, 106, 0.28), transparent 25rem),
    radial-gradient(circle at 12% 8%, rgba(24, 169, 154, 0.22), transparent 28rem),
    linear-gradient(135deg, #fffaf0 0%, #f6efe4 42%, #edf4ef 100%);
}

.landing-hero {
  padding-top: 78px;
  padding-bottom: 66px;
}

.landing-hero h1 {
  color: var(--indigo);
  text-wrap: balance;
}

.landing-hero h1,
.landing-section h2,
.legal-card h2 {
  letter-spacing: 0;
}

.product-panel {
  background:
    radial-gradient(circle at 100% 0%, rgba(24, 169, 154, 0.16), transparent 14rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 250, 240, 0.9));
}

.hero-illustration {
  display: block;
  width: min(100%, 520px);
  margin: -6px auto 16px;
  filter: drop-shadow(0 22px 30px rgba(7, 23, 42, 0.12));
}

.illustration-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 24px;
}

.illustration-row img,
.panel-illustration,
.app-empty-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.illustration-row img {
  padding: 8px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(205, 187, 159, 0.5);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.illustration-row img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.panel-illustration {
  margin: -2px 0 12px;
  padding: 4px;
  opacity: 0.94;
}

.app-empty-visual {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 10% 0%, rgba(216, 183, 106, 0.18), transparent 18rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 250, 240, 0.88));
  border: 1px solid rgba(205, 187, 159, 0.62);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.app-empty-visual img {
  max-width: 330px;
  justify-self: center;
}

.app-empty-visual h2 {
  margin: 0 0 10px;
  color: var(--indigo);
  font-size: 25px;
  line-height: 1.18;
}

.app-empty-visual p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.panel-top {
  border-bottom-color: rgba(205, 187, 159, 0.5);
}

.panel-title,
.panel h2,
.qcm-title,
.question-block h3,
.landing-card h3,
.admin-panel h3,
.billing-header h2,
.reset-card h2,
.admin-title h2,
.stat-value,
.legal-section h3 {
  color: var(--indigo);
}

.card-icon {
  color: var(--primary-dark);
  background: linear-gradient(145deg, #fff8e8, #edf8f5);
  border-color: rgba(216, 183, 106, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.landing-band {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.55), rgba(246, 239, 228, 0.58));
  border-color: rgba(205, 187, 159, 0.46);
}

.landing-footer {
  color: var(--muted);
}

.toast {
  background: rgba(255, 253, 248, 0.96);
  border-color: rgba(205, 187, 159, 0.6);
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 23, 42, 0.54);
  backdrop-filter: blur(10px);
}

.feedback-modal {
  width: min(620px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: 22px;
  background:
    radial-gradient(circle at 0% 0%, rgba(216, 183, 106, 0.16), transparent 18rem),
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 250, 240, 0.94));
  border: 1px solid rgba(205, 187, 159, 0.68);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feedback-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.feedback-modal h2 {
  margin: 0;
  color: var(--indigo);
  font-size: 24px;
}

.feedback-modal p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-close {
  flex: 0 0 auto;
}

.feedback-form {
  display: grid;
  gap: 13px;
}

.feedback-form label {
  display: grid;
  gap: 7px;
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 800;
}

.feedback-form textarea {
  min-height: 150px;
  resize: vertical;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid rgba(205, 187, 159, 0.8);
  border-radius: var(--radius-sm);
  font: inherit;
  line-height: 1.45;
}

.feedback-form textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.feedback-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
}

.feedback-status.error {
  color: var(--danger);
}

.feedback-status.success {
  color: var(--success);
}

.feedback-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.legal-notice {
  background: linear-gradient(135deg, var(--champagne-soft), #eef8f5);
  border-color: rgba(216, 183, 106, 0.46);
  border-left-color: var(--champagne);
}

@media (max-width: 700px) {
  body::before {
    background-size: 34px 34px;
  }

  .landing-hero {
    padding-top: 42px;
    padding-bottom: 42px;
  }

  .toolbar {
    padding-top: 18px;
  }

  .illustration-row,
  .app-empty-visual {
    grid-template-columns: 1fr;
  }

  .hero-illustration {
    margin-top: 0;
  }

  .panel-illustration {
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
  }

  .feedback-modal {
    padding: 18px;
  }

  .feedback-modal-header,
  .feedback-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Mobile UX polish */
html {
  scroll-padding-top: 92px;
}

body.modal-open {
  overflow: hidden;
}

input,
select,
textarea,
button,
.btn,
.btn-secondary {
  -webkit-tap-highlight-color: transparent;
}

textarea {
  font: inherit;
}

.loading-box,
.notice-box {
  align-items: flex-start;
}

.table-wrap,
.admin-table-wrap,
.feedback-modal {
  -webkit-overflow-scrolling: touch;
}

.scores-table,
.admin-table {
  min-width: 520px;
}

.option {
  min-height: 48px;
  display: flex;
  align-items: center;
  line-height: 1.45;
}

.history-actions button,
.history-actions .btn-secondary {
  min-height: 40px;
  padding: 9px 12px;
}

.history-confirm-toggle {
  min-height: 42px;
  padding: 4px 0;
}

.legal-section p,
.legal-section li,
.landing-card p,
.mock-option,
.explanation {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .product-panel {
    max-width: 680px;
  }

  .admin-panel-header {
    align-items: stretch;
  }

  .admin-search {
    width: 100%;
  }
}

@media (max-width: 700px) {
  html {
    scroll-padding-top: 132px;
  }

  body {
    background-attachment: scroll;
  }

  .header {
    position: sticky;
  }

  .header-content,
  .landing-nav {
    gap: 12px;
  }

  .header-brand {
    width: 100%;
    align-items: center;
  }

  .logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex: 0 0 auto;
  }

  .brand-name {
    font-size: 19px;
  }

  .brand-subtitle {
    font-size: 12px;
  }

  .header-nav,
  .nav-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #openFeedbackBtn {
    grid-column: 1 / -1;
  }

  .header-nav a,
  .header-nav button,
  .nav-actions a,
  .nav-actions button {
    flex: none;
    min-height: 46px;
    padding: 11px 12px;
    font-size: 14px;
    white-space: normal;
  }

  main {
    margin-top: 10px;
  }

  .toolbar,
  .panel,
  .question-block,
  .billing-card,
  .reset-card,
  .admin-panel,
  .stat-card,
  .legal-card,
  .landing-card,
  .product-panel {
    box-shadow: 0 10px 28px rgba(7, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  .toolbar {
    padding: 16px;
  }

  .auth-row {
    gap: 12px;
  }

  .auth-form {
    padding: 12px;
    border: 1px solid rgba(205, 187, 159, 0.46);
    border-radius: var(--radius-sm);
    background: rgba(255, 253, 248, 0.52);
  }

  .auth-form input,
  #topic,
  .reset-form input,
  .admin-search input,
  .history-filters input,
  .history-filters select,
  .feedback-form select,
  .feedback-form textarea {
    min-height: 50px;
    font-size: 16px;
  }

  .status-pill,
  .mode-pill {
    justify-content: center;
    min-height: 42px;
    white-space: normal;
    text-align: center;
  }

  .input-row {
    gap: 9px;
  }

  #generateBtn,
  #regenBtn,
  #checkBtn {
    min-height: 52px;
  }

  .mode-row {
    gap: 9px;
  }

  #progress-container {
    height: 18px;
    margin-bottom: 12px;
  }

  .score {
    padding: 12px 13px;
    font-size: 14px;
  }

  .layout {
    gap: 14px;
  }

  .progress-panel,
  .recommendations-panel {
    padding: 14px;
    margin-bottom: 14px;
  }

  .progress-panel .panel-header,
  .recommendations-panel .panel-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .progress-subtitle,
  .recommendations-subtitle {
    font-size: 13px;
  }

  .progress-details,
  .progress-empty {
    grid-template-columns: 1fr;
  }

  .progress-empty {
    display: grid;
    align-items: stretch;
  }

  .progress-activity-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .progress-activity li {
    align-items: flex-start;
  }

  .recommendation-top {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .panel-header {
    gap: 8px;
  }

  .panel-header h2 {
    font-size: 17px;
  }

  .history-filters {
    gap: 9px;
  }

  .history-confirm-toggle {
    align-items: flex-start;
    font-size: 13px;
  }

  .history-confirm-toggle input {
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    margin-top: 1px;
  }

  .list-item {
    padding: 12px;
  }

  .history-item-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .category-badge {
    justify-self: start;
  }

  .history-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .qcm-title {
    font-size: 21px;
    line-height: 1.25;
  }

  .question-block {
    margin-bottom: 12px;
  }

  .question-block h3 {
    font-size: 16px;
    line-height: 1.45;
  }

  .options {
    gap: 9px;
  }

  .option {
    min-height: 52px;
    padding: 13px 12px;
    font-size: 15px;
  }

  .explanation {
    font-size: 14px;
  }

  .app-empty-visual {
    padding: 16px;
    gap: 14px;
  }

  .app-empty-visual img {
    max-width: 230px;
  }

  .app-empty-visual h2 {
    font-size: 21px;
  }

  .landing-hero {
    gap: 26px;
  }

  .landing-hero h1 {
    font-size: 34px;
    line-height: 1.08;
  }

  .subtitle,
  .section-intro {
    font-size: 16px;
  }

  .cta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .trust-row {
    gap: 8px;
  }

  .trust-badge {
    flex: 1 1 145px;
    justify-content: center;
    text-align: center;
  }

  .hero-note {
    font-size: 13px;
  }

  .proof-strip {
    padding-bottom: 24px;
  }

  .proof-item,
  .workflow-card,
  .final-cta {
    padding: 17px;
  }

  .workflow-card {
    min-height: 0;
  }

  .product-panel {
    padding: 16px;
  }

  .panel-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .panel-status {
    justify-self: start;
    white-space: normal;
  }

  .landing-section {
    padding: 38px 0;
  }

  .landing-card {
    min-height: 0;
    padding: 17px;
  }

  .billing-page,
  .reset-page,
  .legal-page {
    min-height: auto;
  }

  .billing-card,
  .reset-card {
    padding: 20px;
  }

  .billing-header {
    display: grid;
    gap: 12px;
  }

  .billing-status-row {
    gap: 6px;
  }

  .billing-value,
  .billing-label {
    overflow-wrap: anywhere;
  }

  .reset-actions,
  .billing-actions {
    gap: 9px;
  }

  .legal-card {
    padding: 18px;
  }

  .legal-section {
    margin-top: 22px;
  }

  .legal-section p,
  .legal-section li,
  .legal-summary li {
    font-size: 15px;
    line-height: 1.65;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card,
  .admin-panel {
    padding: 14px;
  }

  .admin-topbar,
  .admin-panel-header,
  .feedback-card-top {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .feedback-admin-actions,
  .admin-feedback-filters,
  .feedback-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .admin-feedback-filters select,
  .admin-check-filter {
    width: 100%;
  }

  .feedback-meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-table-wrap,
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .scores-table,
  .admin-table {
    font-size: 12px;
  }

  .scores-table th,
  .scores-table td,
  .admin-table th,
  .admin-table td {
    padding: 10px 9px;
  }

  .footer,
  .landing-footer {
    font-size: 13px;
  }

  .footer-links {
    gap: 8px 12px;
  }

  .modal-backdrop {
    align-items: end;
    place-items: end stretch;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .feedback-modal {
    width: 100%;
    max-height: min(88dvh, 720px);
    padding: 18px;
    border-radius: 18px 18px 12px 12px;
  }

  .feedback-modal h2 {
    font-size: 22px;
  }

  .modal-close {
    justify-self: stretch;
  }

  .feedback-form {
    gap: 12px;
  }

  .feedback-form textarea {
    min-height: 170px;
    max-height: 34vh;
  }

  .feedback-actions button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .header-nav,
  .nav-actions,
  .history-actions {
    grid-template-columns: 1fr;
  }

  .landing-hero h1 {
    font-size: 31px;
  }

  .brand-subtitle {
    display: none;
  }

  .mock-question,
  .question-block,
  .list-item {
    padding: 12px;
  }

  .feedback-modal {
    max-height: 92dvh;
  }
}

/* Product finish: calmer medical SaaS layer */
:root {
  --primary: #0f3d5a;
  --primary-dark: #092133;
  --primary-soft: #eef7f8;
  --accent: #18a6a0;
  --accent-dark: #0b756f;
  --background: #f5f8fb;
  --surface: #ffffff;
  --surface-strong: #f8fbfc;
  --text: #142033;
  --muted: #657389;
  --line: #dbe5ec;
  --line-strong: #b8c9d4;
  --champagne: #b9924c;
  --champagne-soft: #fff8e8;
  --shadow: 0 18px 48px rgba(9, 33, 51, 0.12);
  --shadow-soft: 0 10px 26px rgba(9, 33, 51, 0.08);
  --radius: 10px;
  --radius-sm: 8px;
  --focus: 0 0 0 3px rgba(24, 166, 160, 0.22), 0 0 0 6px rgba(15, 61, 90, 0.1);
}

body,
.landing-body {
  background: linear-gradient(180deg, #f8fbfd 0%, #f2f7f9 48%, #eef5f1 100%);
}

body::before {
  display: none;
}

main {
  margin-top: 22px;
}

button,
.btn,
.btn-secondary {
  border-radius: var(--radius-sm);
  min-height: 46px;
}

button,
.btn {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 55%, var(--accent-dark));
}

.btn-secondary,
button.btn-secondary,
a.btn-secondary {
  background: #ffffff;
  border-color: var(--line);
}

input,
select,
textarea,
.feedback-form textarea {
  background: #ffffff;
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
}

.header {
  background: rgba(248, 251, 253, 0.92);
  border-bottom-color: rgba(219, 229, 236, 0.9);
}

.toolbar,
.panel,
.question-block,
.billing-card,
.reset-card,
.admin-panel,
.stat-card,
.legal-card,
.product-panel,
.landing-card,
.progress-panel,
.recommendations-panel,
.app-empty-visual,
.final-cta,
.workflow-card,
.proof-item,
.transparency-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.toolbar::before,
.product-panel::before {
  background: linear-gradient(90deg, var(--primary), var(--accent), #6fb7c8);
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  margin-bottom: 18px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 248, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.app-hero h1 {
  max-width: 820px;
  margin: 0;
  color: var(--indigo);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.app-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.app-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topic-field,
.difficulty-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.topic-field span,
.difficulty-field span,
.reset-form label {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 850;
}

.topic-field #topic,
.difficulty-field select {
  min-height: 52px;
}

.input-row {
  grid-template-columns: minmax(280px, 1fr) minmax(150px, 0.28fr) auto auto auto;
  align-items: end;
  padding: 14px;
  background: linear-gradient(180deg, #f8fbfc, #ffffff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-form {
  padding: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.progress-panel,
.recommendations-panel {
  background: #ffffff;
}

.progress-card,
.progress-trend,
.progress-activity,
.recommendation-card {
  background: var(--surface-strong);
  border-color: var(--line);
}

.question-block {
  border-left: 0;
  border-top: 4px solid var(--accent);
}

.question-block:hover,
.panel:hover,
.landing-card:hover,
.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.option {
  background: #ffffff;
  border-color: var(--line);
}

.option:hover {
  background: #f2fbfb;
  border-color: rgba(24, 166, 160, 0.48);
}

.option.selected {
  background: #effbfa;
  border-width: 1px;
}

.explanation {
  background: #f6fbfd;
  border-style: solid;
}

.score {
  background: #ffffff;
  border-left-color: var(--accent);
}

.skeleton-stack {
  display: grid;
  gap: 7px;
  width: min(440px, 100%);
  margin-top: 12px;
}

.skeleton-stack span {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #e7eef2, #f8fbfc, #e7eef2);
  background-size: 220% 100%;
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.skeleton-stack span:nth-child(2) {
  width: 82%;
}

.skeleton-stack span:nth-child(3) {
  width: 64%;
}

@keyframes skeletonPulse {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}

.billing-page,
.reset-page {
  display: grid;
  gap: 16px;
}

.billing-hero {
  padding: 24px;
  background: linear-gradient(135deg, #ffffff, #edf8f7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.billing-hero h1 {
  max-width: 700px;
  margin: 0;
  color: var(--indigo);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

.billing-hero p:not(.eyebrow) {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.billing-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.billing-benefits article {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.billing-benefits strong {
  color: var(--primary-dark);
}

.billing-benefits span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.reset-card {
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
}

.reset-form label {
  margin-bottom: -5px;
}

.admin-page .toolbar {
  background: linear-gradient(135deg, #ffffff, #f5f9fb);
}

.stat-card {
  border-top: 3px solid var(--accent);
}

.admin-table th,
.scores-table th {
  background: #f1f6f8;
}

.admin-feedback-card {
  background: #ffffff;
}

.admin-feedback-card.is-unread {
  background: linear-gradient(180deg, #f3fffc, #ffffff);
}

.landing-hero {
  min-height: min(720px, calc(100vh - 90px));
  align-items: center;
}

.landing-hero h1 {
  max-width: 820px;
}

.product-panel {
  background: linear-gradient(180deg, #ffffff, #f7fbfc);
}

.landing-band {
  background: rgba(255, 255, 255, 0.58);
}

@media (max-width: 900px) {
  .app-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .app-hero-actions {
    justify-content: stretch;
  }

  .app-hero-actions a {
    flex: 1 1 180px;
  }

  .billing-benefits {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .app-hero,
  .billing-hero {
    padding: 18px;
  }

  .app-hero h1,
  .billing-hero h1 {
    font-size: 29px;
  }

  .input-row {
    padding: 12px;
  }

  .topic-field,
  .difficulty-field,
  .topic-field #topic,
  .difficulty-field select {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
