:root {
  color-scheme: light;
  --bg: #f6f8f7;
  --panel: #ffffff;
  --ink: #15211f;
  --muted: #66726e;
  --soft: #e6ece8;
  --line: #d6ded9;
  --nav: #172522;
  --nav-muted: #a8b8b1;
  --teal: #0c7f71;
  --teal-dark: #075f55;
  --coral: #dc684e;
  --amber: #c58b1d;
  --blue: #396c98;
  --danger: #b63f34;
  --shadow: 0 18px 45px rgba(16, 32, 29, 0.08);
  --radius: 8px;
  --mono: "SFMono-Regular", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(12, 127, 113, 0.08), transparent 320px),
    var(--bg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(12, 127, 113, 0.1), transparent 360px),
    var(--bg);
}

.auth-card {
  display: grid;
  width: min(520px, 100%);
  gap: 22px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand .brand-name {
  color: var(--ink);
}

.auth-brand .brand-subtitle {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  min-width: 0;
}

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

.auth-actions button {
  flex: 1 1 150px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  color: #fff;
  background: var(--nav);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: #eef8f4;
  color: var(--nav);
  font-weight: 800;
}

.brand-name,
.brand-subtitle,
.meta-label,
.lede,
p {
  margin: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 750;
}

.brand-subtitle {
  color: var(--nav-muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button,
.ghost-button,
.primary-button,
.tool-button,
.record-button,
.stop-button,
.segment {
  border: 0;
  border-radius: var(--radius);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--nav-muted);
  background: transparent;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.sidebar-status {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-status strong {
  display: block;
  margin: 4px 0 10px;
  font-size: 18px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--nav-muted);
  font-size: 12px;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54d3a4;
}

.main-panel {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.12;
}

h1 {
  font-size: 30px;
  font-weight: 800;
}

h2 {
  font-size: 22px;
  font-weight: 760;
}

h3 {
  font-size: 16px;
  font-weight: 750;
}

.lede {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
}

.lede.narrow {
  max-width: 620px;
}

.topbar-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
}

.account-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(20, 36, 34, 0.06);
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu[open] summary {
  border-color: rgba(12, 127, 113, 0.42);
  box-shadow: 0 0 0 3px rgba(12, 127, 113, 0.12);
}

.account-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  width: min(360px, calc(100vw - 52px));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 54px rgba(16, 32, 29, 0.18);
}

.account-panel label {
  min-width: 0;
}

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

.account-actions button {
  min-width: 0;
  width: 100%;
}

.ghost-button,
.primary-button,
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

.tool-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.ghost-button:hover,
.tool-button:hover,
.primary-button:hover,
.record-button:hover,
.stop-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover,
.record-button:hover {
  background: var(--teal-dark);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 980px);
  justify-content: center;
  gap: 18px;
}

.workbench,
.analysis-panel,
.report-summary,
.report-card,
.source-panel,
.settings-card,
.workflow-card,
.settings-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.workbench {
  min-width: 0;
  padding: 18px;
}

.analysis-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head.compact {
  align-items: flex-start;
}

.meta-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  min-width: 260px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef3f0;
}

.segment {
  min-height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.segment.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 8px 18px rgba(20, 36, 34, 0.08);
}

.control-row {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

select,
input {
  min-height: 38px;
  padding: 0 10px;
  font-size: 14px;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(12, 127, 113, 0.13);
}

.block-progress {
  margin: 18px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

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

.block-progress-top strong {
  font-family: var(--mono);
  font-size: 15px;
}

.block-progress-track {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #e5ede9;
}

.block-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--coral));
  transition: width 180ms ease;
}

.flash-panel,
.sight-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(12, 127, 113, 0.12), transparent 38%),
    linear-gradient(315deg, rgba(220, 104, 78, 0.12), transparent 36%),
    #ffffff;
}

.flash-panel {
  min-height: 310px;
}

.clean-flash-panel {
  display: grid;
}

.flash-meta,
.sight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.prompt-surface {
  position: relative;
  display: grid;
  min-height: 232px;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.clean-flash-panel .prompt-surface {
  min-height: 308px;
}

.prompt-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.prompt-surface strong {
  display: block;
  max-width: min(92%, 760px);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  font-size: clamp(38px, 8vw, 80px);
  font-weight: 850;
  line-height: 1.05;
}

.prompt-surface.term-multiword strong {
  max-width: min(94%, 860px);
  font-size: clamp(34px, 6.4vw, 68px);
  line-height: 1.08;
}

.prompt-surface.term-long strong {
  font-size: clamp(30px, 5.2vw, 54px);
  line-height: 1.12;
}

.prompt-surface.hidden-prompt strong {
  color: transparent;
  text-shadow: none;
}

.prompt-surface.hidden-prompt .prompt-kicker {
  color: var(--teal);
}

.prompt-surface.recall-state .prompt-kicker,
.prompt-surface.recall-state #promptHint,
.prompt-surface.visual-transition .prompt-kicker,
.prompt-surface.visual-transition strong,
.prompt-surface.visual-transition #promptHint {
  visibility: hidden;
}

.prompt-surface.recall-state::before,
.prompt-surface.visual-transition::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(360px, 62%);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(12, 127, 113, 0.62), rgba(220, 104, 78, 0.48), transparent);
  transform: translate(-50%, -50%);
}

.prompt-surface.recall-state::before {
  opacity: 0.42;
}

.prompt-surface.visual-transition::before {
  animation: softSweep 680ms ease-in-out infinite alternate;
}

.prompt-surface.visual-transition::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(50% + 12px);
  width: min(180px, 38%);
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(21, 33, 31, 0.18), transparent);
  transform: translateX(-50%);
  animation: softSweep 680ms ease-in-out infinite alternate-reverse;
}

@keyframes softSweep {
  from {
    opacity: 0.28;
    transform: translate(-50%, -50%) scaleX(0.82);
  }

  to {
    opacity: 0.76;
    transform: translate(-50%, -50%) scaleX(1);
  }
}

#promptHint {
  max-width: 560px;
  color: var(--muted);
}

.timeline {
  height: 6px;
  background: #e5ede9;
}

.timeline span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--coral));
}

.timeline span.running {
  animation: fillFlash var(--flash-ms, 500ms) linear forwards;
}

.sight-timer-row {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 2px 18px 16px;
}

.sight-timer-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: fit-content;
  min-width: 184px;
  margin: 0 auto;
  padding: 11px 22px 15px;
  overflow: hidden;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(12, 127, 113, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(19, 43, 38, 0.08);
  backdrop-filter: blur(8px);
}

.sight-timer-current {
  color: var(--teal);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.sight-timer-total {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.sight-timer-separator {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.sight-timer-progress {
  position: absolute;
  right: 16px;
  bottom: 8px;
  left: 16px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ede9;
}

.sight-timer-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--coral));
}

@keyframes fillFlash {
  to {
    width: 100%;
  }
}

.sight-panel {
  min-height: 400px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.sight-header {
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--sans);
}

.sight-text {
  max-height: 300px;
  overflow: auto;
  padding: 8px 24px 24px;
  font-size: 22px;
  line-height: 1.75;
}

.sight-text .active-word {
  border-radius: 4px;
  background: rgba(12, 127, 113, 0.14);
}

.recorder-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

.record-button,
.stop-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 18px;
  font-weight: 800;
}

.record-button {
  background: var(--teal);
  color: #fff;
}

.record-button span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
}

.stop-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--danger);
}

.stop-button span {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
}

.record-button:disabled,
.stop-button:disabled,
.tool-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.recording-state {
  display: grid;
  min-width: 120px;
  padding-left: 4px;
}

.recording-state strong {
  font-size: 14px;
}

.recording-state span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.transcript-area {
  padding-top: 4px;
}

textarea {
  min-height: 114px;
  margin-top: 12px;
  padding: 12px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.5;
}

.score-ring {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 5px solid rgba(12, 127, 113, 0.2);
  border-top-color: var(--teal);
  border-radius: 50%;
  font-weight: 850;
}

.analysis-result {
  display: grid;
  gap: 10px;
  min-height: 142px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.analysis-result p {
  color: var(--muted);
}

.analysis-result strong {
  display: block;
}

.alignment-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.alignment-table table {
  min-width: 620px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #ecf3f0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 750;
}

.pill.warning {
  background: #fff3df;
  color: #8b5c08;
}

.pill.danger {
  background: #fde9e3;
  color: #9b3a2c;
}

.mini-chart,
.weak-list {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.report-queue-head {
  margin-top: 16px;
}

.chart-head strong {
  color: var(--ink);
}

.sparkline {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: end;
  gap: 4px;
  height: 76px;
}

.sparkline span {
  min-height: 5px;
  border-radius: 4px 4px 0 0;
  background: var(--teal);
}

.trend-details,
.review-plan {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.trend-details div,
.review-plan div {
  display: grid;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid var(--soft);
}

.review-plan div {
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
}

.review-plan strong {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #ecf3f0;
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 12px;
}

.weak-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding-left: 12px;
  list-style: none;
}

.weak-list li {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--soft);
}

.weak-list li:last-child {
  border-bottom: 0;
}

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

.priority-list p {
  margin-top: 2px;
}

.report-grid,
.content-layout,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
}

.report-summary,
.report-card,
.source-panel,
.settings-card,
.workflow-card,
.settings-note {
  min-width: 0;
  padding: 18px;
}

.report-card.wide,
.report-summary.wide {
  grid-column: 1 / -1;
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--soft);
}

.report-metrics div {
  display: grid;
  gap: 2px;
}

.report-metrics span,
.report-metrics small,
.trend-details span,
.priority-list p,
.review-plan p {
  color: var(--muted);
  font-size: 12px;
}

.report-metrics strong {
  font-family: var(--mono);
  font-size: 24px;
  line-height: 1.15;
}

.breakdown,
.bucket-grid,
.source-list,
.profile-bars,
.settings-form,
.provider-card,
.workflow-list,
.settings-note dl {
  display: grid;
  gap: 12px;
}

.breakdown-row,
.bucket,
.source-list li,
.workflow-list li,
.settings-note dl div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.profile-bars > div {
  display: grid;
  gap: 5px;
}

meter {
  width: 100%;
  height: 12px;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.history-date-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.history-date-controls input {
  width: 150px;
}

.history-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
}

.history-search {
  display: grid;
  gap: 6px;
  width: min(520px, 100%);
}

.history-search input {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.weak-explorer {
  display: grid;
  gap: 12px;
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  background: #fbfcfb;
}

.weak-explorer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weak-explorer-head h4,
.weak-detail-head h4 {
  margin: 0;
}

.weak-explorer-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.weak-item-button {
  display: grid;
  gap: 5px;
  min-height: 86px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.weak-item-button:hover,
.weak-item-button.active {
  border-color: rgba(12, 127, 113, 0.45);
  background: rgba(12, 127, 113, 0.05);
}

.weak-item-button.active {
  box-shadow: 0 0 0 2px rgba(12, 127, 113, 0.08);
}

.weak-item-button strong,
.weak-item-button span,
.weak-item-button small {
  min-width: 0;
}

.weak-item-button span,
.weak-item-button small,
.weak-empty {
  color: var(--muted);
}

.weak-detail-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(12, 127, 113, 0.22);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.weak-detail-head,
.weak-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.weak-detail-head p,
.weak-detail-panel p,
.weak-detail-panel ul {
  margin: 4px 0 0;
  color: var(--muted);
}

.weak-detail-head > strong {
  min-width: 54px;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(12, 127, 113, 0.08);
  color: var(--accent-strong);
  text-align: center;
  font-size: 22px;
}

.weak-detail-panel ul {
  padding-left: 18px;
}

.mini-alignment {
  display: grid;
  gap: 8px;
}

.mini-alignment div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--soft);
}

.mini-alignment div:last-child {
  border-bottom: 0;
}

.mini-alignment span,
.mini-alignment small {
  color: var(--muted);
}

.weak-attempt-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weak-attempt-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.weak-attempt-chip span {
  color: var(--muted);
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.history-more-row {
  display: flex;
  justify-content: center;
  padding-top: 12px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--soft);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.attempt-row {
  cursor: pointer;
  transition: background-color 0.15s;
}

.attempt-row:hover {
  background: rgba(12, 127, 113, 0.04);
}

.attempt-row[aria-expanded="true"] {
  background: rgba(12, 127, 113, 0.08);
}

.date-group-header td {
  background: var(--surface);
  padding: 12px 16px 8px;
  font-size: 14px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}

.time-col {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.attempt-detail-row td {
  padding: 0;
  background: #fbfcfb;
}

.attempt-detail {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--soft);
}

.attempt-detail p,
.attempt-detail ul {
  margin: 4px 0 0;
  color: var(--muted);
}

.attempt-detail ul {
  padding-left: 18px;
}

.bucket-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.bucket strong {
  display: block;
  margin-bottom: 6px;
}

.bucket span {
  color: var(--muted);
  font-size: 13px;
}

.source-panel p,
.workflow-card p,
.workflow-card li,
.settings-note p,
.settings-note dd {
  color: var(--muted);
}

.source-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.source-list a {
  color: var(--teal-dark);
  font-weight: 750;
}

.settings-form {
  grid-template-columns: 1fr;
  margin-top: 18px;
}

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

.provider-status-grid div {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--soft);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}

.provider-status-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.provider-status-grid strong {
  color: var(--ink);
  font-size: 15px;
}

.provider-status-grid .configured strong {
  color: var(--accent-strong);
}

.provider-status-grid .not-configured strong {
  color: #9a4b41;
}

.provider-card {
  min-width: 0;
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.provider-card:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.provider-card legend {
  padding: 0 0 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.provider-card .full-field,
.form-actions,
.material-status {
  grid-column: 1 / -1;
}

.material-status {
  padding: 10px 0 0;
  border-top: 1px solid var(--soft);
  color: var(--muted);
  font-size: 13px;
}

.workflow-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.workflow-list li {
  border: 0;
  border-left: 3px solid var(--teal);
  border-radius: 0;
  background: transparent;
}

.settings-note dl {
  margin: 18px 0 0;
}

.settings-note dt {
  font-weight: 800;
}

.settings-note dd {
  margin: 2px 0 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--nav);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

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

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px 12px;
  }

  .brand {
    justify-content: center;
  }

  .brand div:last-child {
    display: none;
  }

  .nav-button {
    font-size: 0;
  }

  .nav-button {
    justify-content: center;
    padding: 0;
  }

  .sidebar-status {
    display: none;
  }

  .practice-layout,
  .report-grid,
  .content-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .auth-gate {
    padding: 16px;
  }

  .auth-card {
    padding: 20px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .nav-button {
    width: 42px;
  }

  .main-panel {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .history-head,
  .recorder-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .form-actions {
    flex-wrap: wrap;
  }

  .account-menu,
  .account-menu summary {
    width: 100%;
  }

  .history-date-controls,
  .history-date-controls input {
    width: 100%;
  }

  .history-date-controls button {
    flex: 1 1 68px;
  }

  .history-tools,
  .weak-explorer-head {
    flex-direction: column;
    align-items: stretch;
  }

  .weak-detail-head,
  .weak-detail-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .weak-explorer-list {
    grid-template-columns: 1fr;
    max-height: 320px;
  }

  .mini-alignment div {
    grid-template-columns: 1fr;
  }

  .account-panel {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .segmented,
  .settings-form,
  .provider-card,
  .provider-status-grid {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr;
  }

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

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

  .prompt-surface strong {
    font-size: clamp(32px, 16vw, 58px);
  }

  .prompt-surface.term-multiword strong {
    font-size: clamp(28px, 10vw, 46px);
    line-height: 1.1;
  }

  .prompt-surface.term-long strong {
    font-size: clamp(24px, 8.5vw, 38px);
    line-height: 1.14;
  }

  .sight-text {
    font-size: 18px;
  }

  .settings-form label,
  .settings-form label:nth-child(3),
  .settings-form label:nth-child(5),
  .provider-card .full-field,
  .form-actions {
    grid-column: auto;
  }
}

@media (max-width: 460px) {
  .report-metrics {
    grid-template-columns: 1fr;
  }

  .bucket-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 25px;
  }

  .workbench,
  .analysis-panel,
  .report-summary,
  .report-card,
  .source-panel,
  .settings-card,
  .workflow-card,
  .settings-note {
    padding: 14px;
  }
}
