:root {
  --bg: #f5f7f3;
  --bg-strong: #e9f0ec;
  --panel: #ffffff;
  --panel-soft: #f8faf7;
  --panel-tint: #eef6f4;
  --ink: #202622;
  --ink-soft: #66746f;
  --muted: #7a8782;
  --line: #dce5df;
  --line-strong: #c7d5ce;
  --accent: #0f766e;
  --accent-deep: #0a5c56;
  --accent-soft: #d8efeb;
  --blue: #375a9e;
  --ok: #2f7d4f;
  --warning: #a16207;
  --danger: #c24130;
  --danger-soft: #f8ded8;
  --shadow: 0 18px 48px rgba(31, 47, 42, 0.1);
  --shadow-soft: 0 10px 28px rgba(31, 47, 42, 0.07);
  --radius: 8px;
  --ui-font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  --reading-font: "STSong", "SimSun", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 32%),
    linear-gradient(180deg, var(--bg-strong) 0%, var(--bg) 42%, #fbfcfa 100%);
  color: var(--ink);
  font-family: var(--ui-font);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 29, 0.5);
  backdrop-filter: blur(4px);
}

.guide-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(86vh, 920px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(210, 222, 215, 0.96);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(31, 47, 42, 0.22);
}

.guide-dialog h2,
.guide-dialog h3 {
  margin: 0;
}

.guide-dialog h2 {
  font-family: var(--reading-font);
  font-size: clamp(1.6rem, 2vw, 2rem);
  line-height: 1.2;
}

.guide-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 24px 16px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(220, 229, 223, 0.9);
}

.guide-dialog h3 {
  margin-top: 18px;
  font-size: 1rem;
  color: var(--ink);
}

.guide-content {
  max-height: calc(min(86vh, 920px) - 110px);
  overflow: auto;
  padding: 0 24px 22px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.guide-content p,
.guide-content ol {
  margin: 10px 0 0;
}

.guide-content ol {
  padding-left: 1.4em;
}

.guide-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  margin-top: 2px;
  color: var(--ink-soft);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.guide-close-btn:hover {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line-strong);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.74);
  border-right: 1px solid rgba(199, 213, 206, 0.88);
  backdrop-filter: blur(16px);
}

.brand,
.sidebar-block,
.support-card,
.controls-card,
.metric-card,
.content-card,
.records-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(210, 222, 215, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.brand {
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.11), rgba(55, 90, 158, 0.05)),
    var(--panel);
}

.brand h1,
.hero h2,
.section-head h3,
.sidebar-title-row h2,
.record-column h4 {
  margin: 0;
}

.brand h1 {
  font-family: var(--reading-font);
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sidebar-note,
.section-meta,
.hero-author,
.status-text,
.record-meta,
.empty-state {
  color: var(--ink-soft);
}

.sidebar-note {
  margin: 12px 0 0;
  font-size: 0.95rem;
  line-height: 1.7;
}

.sidebar-block,
.support-card {
  padding: 16px;
}

.sidebar-block {
  min-height: 0;
}

.sidebar-block:has(.article-list) {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.sidebar-title-row h2 {
  font-size: 1.04rem;
}

.sidebar-meta {
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.search-field {
  position: relative;
  display: block;
  margin-bottom: 12px;
}

.search-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 38px;
  color: var(--ink);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-field input::placeholder {
  color: #8d9a95;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  transform: translateY(-56%);
  pointer-events: none;
}

.search-icon::after {
  position: absolute;
  right: -6px;
  bottom: -5px;
  width: 7px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  content: "";
  transform: rotate(45deg);
}

.article-list {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 2px 4px 4px 0;
}

.article-list::-webkit-scrollbar,
.article-body::-webkit-scrollbar,
.transcript-box::-webkit-scrollbar {
  width: 9px;
}

.article-list::-webkit-scrollbar-thumb,
.article-body::-webkit-scrollbar-thumb,
.transcript-box::-webkit-scrollbar-thumb {
  background: #c7d5ce;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

.article-item {
  position: relative;
  width: 100%;
  min-height: 66px;
  padding: 12px 13px 12px 16px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.article-item::before {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: transparent;
  border-radius: 0 4px 4px 0;
  content: "";
}

.article-item:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 47, 42, 0.08);
  transform: translateY(-1px);
}

.article-item.active {
  border-color: rgba(15, 118, 110, 0.36);
  background: var(--panel-tint);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.article-item.active::before {
  background: var(--accent);
}

.article-item strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1.35;
}

.article-item small {
  display: block;
  margin-top: 5px;
  color: var(--ink-soft);
  line-height: 1.35;
}

.support-card {
  display: grid;
  gap: 10px;
  box-shadow: none;
}

.support-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.side-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 0.82rem;
}

.side-state.success {
  color: var(--ok);
  background: #e8f5ed;
  border-color: rgba(47, 125, 79, 0.24);
}

.side-state.warning {
  color: var(--warning);
  background: #fff7df;
  border-color: rgba(161, 98, 7, 0.24);
}

.side-state.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(194, 65, 48, 0.24);
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.12), rgba(55, 90, 158, 0.08) 48%, rgba(255, 255, 255, 0.68)),
    rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(210, 222, 215, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero h2 {
  font-family: var(--reading-font);
  font-size: clamp(1.9rem, 3vw, 3.1rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.hero-author {
  margin: 10px 0 0;
  font-size: 1rem;
}

.status-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 420px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(199, 213, 206, 0.92);
  border-radius: 999px;
  font-size: 0.84rem;
  line-height: 1.2;
  white-space: normal;
}

.badge.success {
  color: var(--ok);
  border-color: rgba(47, 125, 79, 0.26);
}

.badge.warning {
  color: var(--warning);
  border-color: rgba(161, 98, 7, 0.26);
}

.badge.danger {
  color: var(--danger);
  border-color: rgba(194, 65, 48, 0.26);
}

.badge.muted {
  color: var(--ink-soft);
}

.guide-open-btn {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.guide-open-btn:hover {
  background: #ffffff;
  border-color: rgba(15, 118, 110, 0.42);
}

.controls-card,
.records-card,
.content-card {
  margin-top: 16px;
}

.controls-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.logic-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.logic-picker-label {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.logic-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}

.logic-option input {
  margin: 0;
}

.logic-picker-hint {
  margin: -2px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.task-builder {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(220, 229, 223, 0.92);
}

.task-builder-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
}

.task-summary {
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

.paragraph-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.paragraph-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
}

.paragraph-option:hover {
  border-color: rgba(15, 118, 110, 0.34);
}

.paragraph-option input {
  margin: 0;
}

.paragraph-number {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.paragraph-preview {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.mini-action {
  min-height: 34px;
  padding: 0 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}

.mini-action.primary {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.mini-action:hover:not(:disabled) {
  border-color: rgba(15, 118, 110, 0.42);
}

.mini-action.primary:hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.mini-action:disabled,
.paragraph-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.52;
}

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

.action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.action:hover:not(:disabled) {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 8px 18px rgba(31, 47, 42, 0.09);
  transform: translateY(-1px);
}

.action.primary {
  color: #ffffff;
  background: linear-gradient(180deg, #12857b 0%, var(--accent-deep) 100%);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.action.subtle {
  color: var(--ink-soft);
  background: var(--panel-soft);
}

.action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.button-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: currentColor;
}

.icon-record {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.icon-record::after {
  position: absolute;
  inset: 3px;
  background: currentColor;
  border-radius: 50%;
  content: "";
}

.icon-stop::before {
  position: absolute;
  inset: 3px;
  background: currentColor;
  border-radius: 3px;
  content: "";
}

.icon-section::before,
.icon-section::after {
  position: absolute;
  left: 2px;
  right: 2px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  content: "";
}

.icon-section::before {
  top: 4px;
  box-shadow: 0 4px 0 currentColor;
}

.icon-section::after {
  bottom: 2px;
  width: 8px;
}

.icon-clear::before,
.icon-clear::after {
  position: absolute;
  left: 3px;
  top: 7px;
  width: 11px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  content: "";
}

.icon-clear::before {
  transform: rotate(45deg);
}

.icon-clear::after {
  transform: rotate(-45deg);
}

.attempt-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  background: #e6eee9;
  border: 1px solid rgba(199, 213, 206, 0.76);
  border-radius: 999px;
}

.attempt-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: inherit;
  transition: width 220ms ease;
}

.status-text {
  margin: 0;
  min-height: 24px;
  line-height: 1.6;
}

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

.metric-card {
  position: relative;
  min-height: 112px;
  padding: 16px;
  overflow: hidden;
}

.metric-card::before {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  content: "";
}

.metric-card:nth-child(2)::before {
  background: var(--ok);
}

.metric-card:nth-child(3)::before {
  background: var(--danger);
}

.metric-card:nth-child(4)::before {
  background: var(--blue);
}

.metric-label {
  display: block;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.metric-value {
  display: block;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.1;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.metric-value.danger {
  color: var(--danger);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.content-grid.reciting {
  grid-template-columns: minmax(0, 1fr);
}

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

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 14px;
}

.section-head h3 {
  font-size: 1.05rem;
}

.section-meta {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: right;
}

.article-body {
  max-height: 66vh;
  min-height: 340px;
  overflow: auto;
  padding: 26px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.04) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.04) 0 1px, transparent 1px 100%),
    #fffefb;
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--reading-font);
}

.article-paragraph {
  margin: 0 0 1.05rem;
  font-size: clamp(1.1rem, 1.25vw, 1.24rem);
  line-height: 2.08;
  text-indent: 2em;
  word-break: break-word;
}

.char {
  border-radius: 4px;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.char.correct {
  background: rgba(47, 125, 79, 0.14);
  box-shadow: 0 0 0 1px rgba(47, 125, 79, 0.07);
}

.char.manual {
  background: rgba(15, 118, 110, 0.14);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.char.wrong,
.char.missing {
  color: var(--danger);
  background: rgba(194, 65, 48, 0.15);
  box-shadow: 0 0 0 1px rgba(194, 65, 48, 0.08);
}

.transcript-box {
  max-height: 66vh;
  min-height: 340px;
  overflow: auto;
  padding: 24px;
  color: var(--ink);
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--reading-font);
  line-height: 1.9;
  word-break: break-word;
}

.content-grid.reciting .transcript-box {
  min-height: 440px;
  font-size: 1.08rem;
}

.transcript-paragraph {
  margin: 0 0 1rem;
  line-height: 2.32;
  text-indent: 2em;
}

.transcript-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7em;
  height: 1.7em;
  margin: 0 0.08em 0.2em;
  color: transparent;
  background: #ffffff;
  border: 1px solid #cbd9d2;
  border-radius: 6px;
  font-size: 1.02rem;
  line-height: 1;
  text-indent: 0;
  vertical-align: middle;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.transcript-slot.filled {
  color: var(--ink);
  background: #e7f5ed;
  border-color: rgba(47, 125, 79, 0.42);
  box-shadow: inset 0 -2px 0 rgba(47, 125, 79, 0.08);
}

.transcript-slot.manual {
  background: var(--accent-soft);
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: inset 0 -2px 0 rgba(15, 118, 110, 0.08);
}

.transcript-slot.editable {
  cursor: text;
}

.transcript-slot.editable:hover,
.transcript-slot.active {
  border-color: rgba(15, 118, 110, 0.54);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.transcript-slot-input {
  width: 100%;
  height: 100%;
  padding: 0;
  color: var(--ink);
  text-align: center;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  line-height: 1;
}

.transcript-punctuation {
  display: inline-block;
  min-width: 0.65em;
  color: rgba(102, 116, 111, 0.68);
  text-indent: 0;
}

.debug-panel {
  margin-top: 16px;
  padding: 16px;
  background: #f6f7f2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.debug-head {
  margin-bottom: 10px;
}

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

.debug-item {
  min-width: 0;
}

.debug-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.debug-text {
  min-height: 72px;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #d7e2dc;
  border-radius: 10px;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.records-card {
  padding: 18px;
}

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

.record-column {
  min-width: 0;
}

.record-column h4 {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.record-list {
  display: grid;
  gap: 9px;
  margin-top: 10px;
}

.record-item {
  padding: 13px 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.record-score {
  color: var(--accent-deep);
  font-weight: 800;
}

.record-meta {
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 14px;
  background: var(--panel-soft);
  border: 1px dashed #b9c9c1;
  border-radius: var(--radius);
  line-height: 1.6;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(199, 213, 206, 0.88);
  }

  .sidebar-block:has(.article-list) {
    flex: none;
  }

  .article-list {
    max-height: 360px;
  }
}

@media (max-width: 900px) {
  .main-panel {
    padding: 18px;
  }

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

  .status-panel {
    justify-content: flex-start;
    max-width: none;
  }

  .metrics-grid,
  .content-grid,
  .record-columns {
    grid-template-columns: 1fr;
  }

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

  .section-meta {
    text-align: left;
  }

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

  .paragraph-picker {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .guide-modal {
    padding: 14px;
  }

  .guide-dialog {
    max-height: 88vh;
  }

  .guide-header {
    padding: 22px 16px 14px;
  }

  .guide-content {
    max-height: calc(88vh - 98px);
    padding: 0 16px 18px;
  }

  .sidebar,
  .main-panel {
    padding: 14px;
  }

  .brand,
  .sidebar-block,
  .hero,
  .controls-card,
  .metric-card,
  .content-card,
  .records-card {
    padding: 14px;
  }

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

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

  .action,
  .mini-action {
    width: 100%;
  }

  .article-body,
  .transcript-box {
    min-height: 260px;
    max-height: none;
    padding: 16px;
  }

  .article-paragraph,
  .transcript-paragraph {
    line-height: 2;
  }
}
