:root {
  color-scheme: light;
  --ink: #20211d;
  --ink-soft: #62645c;
  --muted: #8c8d84;
  --line: #ddd9cf;
  --line-soft: #e9e5dc;
  --paper: #fbfaf6;
  --canvas: #f3f0e9;
  --white: #fffefa;
  --accent: #dc5e3e;
  --accent-dark: #ba452b;
  --accent-soft: #fae7df;
  --shadow: 0 18px 50px rgba(54, 48, 37, 0.09);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 20% -10%, rgba(220, 94, 62, 0.08), transparent 28rem), var(--canvas);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(31, 33, 29, 0.1);
  background: rgba(243, 240, 233, 0.9);
  backdrop-filter: blur(18px);
}
.brand, .topbar-actions, .save-state { display: flex; align-items: center; }
.brand { gap: 10px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  font-family: var(--sans);
  font-weight: 800;
  font-size: 18px;
}
.brand-name { font-family: var(--sans); font-size: 18px; font-weight: 750; letter-spacing: 0.01em; }
.topbar-actions { gap: 18px; }
.save-state { gap: 7px; color: var(--muted); font-size: 12px; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: #79926b; }
.save-state.saving .save-dot { background: var(--accent); animation: pulse 800ms infinite alternate; }
.save-state.failed .save-dot { background: #b33429; }
@keyframes pulse { to { opacity: 0.35; } }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.button:hover { transform: translateY(-1px); }
.button-small { min-height: 38px; padding: 0 14px; font-size: 13px; }
.button-dark { color: #fff; background: var(--ink); }
.button-dark:hover { background: #34362f; }
.button-accent { color: #fff; background: var(--accent); }
.button-accent:hover { background: var(--accent-dark); }
.button-outline { border-color: var(--line); background: var(--white); }
.button-outline:hover, .button-quiet:hover { border-color: #c9c3b7; background: #f5f1e8; }
.button-danger { color: #a43f2b; }
.button-danger:hover { background: #f8e7e2; }

#app { min-height: calc(100vh - 68px); }
.loading {
  display: flex;
  min-height: calc(100vh - 68px);
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.loading span {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.connection-error {
  display: flex;
  min-height: calc(100vh - 68px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.connection-error .error-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  color: #a43f2b;
  background: var(--accent-soft);
  font-family: var(--serif);
  font-size: 28px;
}
.connection-error h1 { margin: 22px 0 8px; font-family: var(--serif); font-size: 34px; }
.connection-error p { margin: 0 0 18px; color: var(--ink-soft); }
.connection-error code {
  margin-bottom: 20px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  line-height: 1.8;
  text-align: left;
}

.home { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 72px 0 96px; }
.home-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 38px;
}
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; }
.home-heading h1, .empty-copy h1, .overview-heading h1, .editor-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.home-heading h1 { font-size: clamp(38px, 5vw, 60px); }
.home-heading p:last-child { max-width: 480px; margin: 12px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.75; }
.home-tools, .empty-actions { display: flex; gap: 10px; }
.home-tools { flex: 0 0 auto; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.project-card {
  position: relative;
  overflow: hidden;
  min-height: 245px;
  padding: 25px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 5px 22px rgba(54, 48, 37, 0.035);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.project-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}
.project-card:hover { border-color: #d3c9bc; box-shadow: var(--shadow); transform: translateY(-3px); }
.project-card:hover::before { transform: scaleX(1); }
.project-card-top, .project-card-footer, .section-heading, .chapter-topline, .segment-heading, .overview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.project-index { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; }
.card-delete {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  opacity: 0;
}
.project-card:hover .card-delete, .card-delete:focus-visible { opacity: 1; }
.card-delete:hover { color: #a43f2b; background: #f8e7e2; }
.project-card h2 { margin: 28px 0 12px; font-family: var(--serif); font-size: 24px; line-height: 1.35; }
.project-card-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.project-card-footer {
  position: absolute;
  right: 25px;
  bottom: 22px;
  left: 25px;
  color: var(--muted);
  font-size: 12px;
}
.card-arrow { color: var(--ink); font-size: 18px; }

.empty-state {
  display: grid;
  min-height: 520px;
  place-items: center;
  border: 1px dashed #cec8bc;
  border-radius: 24px;
  background: rgba(251, 250, 246, 0.55);
  text-align: center;
}
.empty-copy { max-width: 540px; padding: 58px 28px; }
.empty-symbol {
  position: relative;
  display: grid;
  width: 84px;
  height: 84px;
  margin: 0 auto 30px;
  place-items: center;
  border: 1px solid #d5cec1;
  border-radius: 50%;
  color: var(--accent);
  background: var(--white);
  box-shadow: 0 12px 30px rgba(52, 43, 31, 0.08);
  font-family: var(--serif);
  font-size: 30px;
}
.empty-copy h1 { font-size: 38px; }
.empty-copy > p { margin: 16px 0 28px; color: var(--ink-soft); line-height: 1.8; }
.empty-actions { justify-content: center; }

.workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar {
  position: sticky;
  top: 68px;
  overflow-y: auto;
  height: calc(100vh - 68px);
  padding: 22px 18px 34px;
  border-right: 1px solid var(--line);
  background: rgba(248, 246, 240, 0.78);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}
.back-link:hover { color: var(--ink); background: rgba(31, 33, 29, 0.05); }
.sidebar-project { padding: 21px 10px 23px; border-bottom: 1px solid var(--line); }
.sidebar-project h2 { margin: 0 0 7px; font-family: var(--serif); font-size: 20px; line-height: 1.4; }
.sidebar-project p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.sidebar-nav { padding-top: 15px; }
.overview-link, .chapter-link { width: 100%; border: 0; text-align: left; cursor: pointer; }
.overview-link {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
}
.overview-link:hover, .overview-link.active { background: var(--white); box-shadow: 0 3px 12px rgba(54, 48, 37, 0.05); }
.overview-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 11px; }
.section-heading { margin: 22px 9px 10px 12px; }
.section-heading span:first-child { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; }
.section-heading .count { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; color: var(--ink-soft); background: #e7e2d8; font-size: 10px; }
.chapter-list { display: grid; gap: 5px; }
.chapter-link {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  padding: 11px 9px;
  border-radius: 10px;
  background: transparent;
}
.chapter-link:hover, .chapter-link.active { background: var(--white); }
.chapter-link.active::before { position: absolute; top: 12px; bottom: 12px; left: 0; width: 3px; border-radius: 2px; background: var(--accent); content: ""; }
.chapter-number { padding-top: 1px; color: var(--muted); font-family: var(--serif); font-size: 12px; }
.chapter-link strong, .chapter-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-link strong { margin-bottom: 5px; font-size: 13px; font-weight: 650; }
.chapter-link small { color: var(--muted); font-size: 10px; }
.add-chapter { width: 100%; margin-top: 9px; border: 1px dashed #ccc5b8; background: transparent; }
.add-chapter:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }

.editor { min-width: 0; padding: 32px 24px 80px; }
.editor-inner { width: min(1280px, 100%); margin: 0 auto; }
.chapter-progress { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.workspace-kicker { margin: 0; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 0.13em; }
.chapter-stats { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.chapter-stats .missing-stat { color: var(--accent-dark); }
.chapter-topline { align-items: flex-start; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.chapter-copy { min-width: 0; flex: 1; }
.chapter-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.editor-title {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(31px, 4vw, 44px);
  line-height: 1.22;
}
.editor-title:focus { text-decoration: underline; text-decoration-color: rgba(220, 94, 62, 0.25); text-decoration-thickness: 5px; text-underline-offset: 6px; }
.chapter-summary {
  width: 100%;
  margin-top: 11px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink-soft);
  background: transparent;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.7;
  resize: none;
}
.segments-section { margin-top: 22px; }
.segment-heading { gap: 18px; margin-bottom: 13px; }
.segment-heading h2 { margin: 0; font-family: var(--serif); font-size: 19px; }
.segment-heading h2 span { margin-left: 8px; color: var(--muted); font-family: var(--sans); font-size: 12px; font-weight: 500; }
.segment-heading-actions { display: flex; align-items: center; gap: 8px; }
.filter-button { border-color: var(--line); color: var(--ink-soft); background: var(--white); }
.filter-button:hover, .filter-button.active { border-color: #e4a18e; color: var(--accent-dark); background: var(--accent-soft); }
.segments { display: grid; gap: 9px; }
.segment-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: 0 3px 14px rgba(54, 48, 37, 0.03);
}
.segment-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-right: 1px solid var(--line-soft); }
.segment-index { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: var(--accent-dark); background: var(--accent-soft); font-family: var(--serif); font-size: 10px; font-weight: 700; }
.rail-line { width: 1px; min-height: 18px; flex: 1; background: var(--line); }
.rail-button { display: grid; width: 24px; height: 22px; place-items: center; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.rail-button:hover:not(:disabled) { color: var(--ink); background: #ece7dd; }
.rail-button:disabled { cursor: default; opacity: 0.25; }
.segment-body {
  display: grid;
  min-width: 0;
  grid-template-columns: 112px repeat(3, minmax(0, 1fr)) 26px;
  gap: 10px;
  align-items: start;
  padding: 12px 14px 13px;
}
.segment-meta, .segment-fields { display: contents; }
.time-field { grid-column: 1; width: auto; }
.segment-meta .text-button { grid-column: 5; grid-row: 1; align-self: start; }
.segment-field:first-child { grid-column: 2; }
.segment-field:nth-child(2) { grid-column: 3; }
.segment-field:nth-child(3) { grid-column: 4; }
.segment-label-line { display: flex; min-height: 17px; align-items: center; justify-content: space-between; gap: 5px; margin-bottom: 5px; }
.segment-label-line > span:first-child, .segment-field > span, .detail-field > span, .field > span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 0.06em; }
.status-pill { flex: 0 0 auto; padding: 2px 5px; border-radius: 999px; font-size: 9px; font-weight: 750; letter-spacing: 0; }
.status-pill.missing { color: #a8422c; background: var(--accent-soft); }
.status-pill.complete { color: #536848; background: #e5edde; }
.time-field input, .segment-field textarea, .detail-field input, .detail-field textarea, .field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: var(--white);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.time-field input { width: 76px; height: 34px; padding: 0 9px; font-size: 12px; }
.auto-time { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.2; white-space: nowrap; }
.detail-field input, .field input { height: 43px; padding: 0 13px; }
.segment-field textarea { padding: 9px 10px; font-size: 13px; line-height: 1.55; resize: vertical; }
.detail-field textarea, .field textarea { padding: 12px 13px; line-height: 1.75; resize: vertical; }
.time-field input:focus, .segment-field textarea:focus, .detail-field input:focus, .detail-field textarea:focus, .field input:focus, .field textarea:focus { border-color: rgba(220, 94, 62, 0.75); box-shadow: 0 0 0 3px rgba(220, 94, 62, 0.1); }
.segment-field textarea { height: 68px; min-height: 68px; }
.text-button { display: grid; width: 26px; height: 26px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 18px; line-height: 1; cursor: pointer; }
.text-button:hover { color: #a43f2b; background: #f8e7e2; }
.material-row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(110px, 0.9fr) minmax(150px, 1.35fr) minmax(100px, 0.8fr) auto;
  gap: 8px;
  align-items: end;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}
.material-heading { align-self: center; padding: 15px 3px 0 0; color: var(--accent-dark); font-family: var(--serif); font-size: 12px; }
.material-field { min-width: 0; }
.material-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.material-field input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: var(--white);
  font-size: 11px;
}
.material-field input:focus { border-color: rgba(220, 94, 62, 0.75); box-shadow: 0 0 0 3px rgba(220, 94, 62, 0.1); }
.material-check { position: relative; display: flex; height: 32px; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: var(--white); font-size: 10px; cursor: pointer; white-space: nowrap; }
.material-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.checkmark { display: grid; width: 15px; height: 15px; place-items: center; border: 1px solid #c8c3b8; border-radius: 4px; color: transparent; background: #fff; font-size: 10px; }
.material-check input:checked + .checkmark { border-color: var(--accent); color: #fff; background: var(--accent); }
.material-check:focus-within { border-color: rgba(220, 94, 62, 0.75); box-shadow: 0 0 0 3px rgba(220, 94, 62, 0.1); }
.segments-empty { padding: 54px 24px; border: 1px dashed #cfc8bb; border-radius: 16px; color: var(--muted); text-align: center; }
.segments-empty p { margin: 0 0 17px; line-height: 1.7; }
.compact-empty { padding: 35px 24px; }

.overview-heading { align-items: flex-start; gap: 24px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.overview-heading h1 { font-size: clamp(34px, 5vw, 54px); }
.overview-heading p:last-child { margin: 10px 0 0; color: var(--ink-soft); line-height: 1.7; }
.detail-form { display: grid; gap: 24px; max-width: 760px; padding-top: 34px; }
.detail-field input { height: 50px; font-family: var(--serif); font-size: 18px; }
.detail-field textarea { min-height: 108px; resize: none; }
.detail-field textarea[name="intro"] { min-height: 220px; }
.dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(31, 27, 20, 0.22);
}
.dialog::backdrop { background: rgba(31, 30, 26, 0.42); backdrop-filter: blur(4px); }
.dialog-form { display: grid; gap: 19px; padding: 28px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.dialog-heading h2 { margin: 0; font-family: var(--serif); font-size: 30px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 24px; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: #ece8df; }
.field input, .field textarea { font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 5px; }
.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 12px 16px;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 12px 38px rgba(31, 29, 24, 0.24);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.error { background: #a43f2b; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .editor { padding-right: 30px; padding-left: 30px; }
  .segment-body { grid-template-columns: repeat(3, minmax(0, 1fr)) 26px; gap: 9px; }
  .time-field { grid-column: 1; grid-row: 1; width: 120px; }
  .segment-meta .text-button { grid-column: 4; grid-row: 1; }
  .segment-field:first-child { grid-column: 1; grid-row: 2; }
  .segment-field:nth-child(2) { grid-column: 2; grid-row: 2; }
  .segment-field:nth-child(3) { grid-column: 3; grid-row: 2; }
  .material-row { grid-row: 3; grid-template-columns: auto minmax(90px, 0.9fr) minmax(120px, 1.2fr) minmax(90px, 0.8fr) auto; }
}

@media (max-width: 680px) {
  .topbar { height: 60px; padding: 0 16px; }
  .brand-name, .save-state { display: none; }
  #app { min-height: calc(100vh - 60px); }
  .home { width: min(100% - 28px, 560px); padding: 42px 0 70px; }
  .home-heading { display: block; margin-bottom: 25px; }
  .home-heading h1 { font-size: 40px; }
  .home-tools { margin-top: 22px; }
  .project-grid { grid-template-columns: 1fr; }
  .card-delete { opacity: 1; }
  .empty-state { min-height: 440px; }
  .empty-actions { flex-direction: column; }
  .workspace { display: block; }
  .sidebar { position: static; overflow: visible; width: 100%; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-project { padding: 12px 8px 16px; }
  .sidebar-nav { display: flex; overflow-x: auto; gap: 7px; padding-top: 10px; scrollbar-width: none; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .overview-link, .chapter-link, .add-chapter { width: auto; min-width: max-content; }
  .overview-link { flex: 0 0 auto; }
  .section-heading { display: none; }
  .chapter-list { display: flex; gap: 7px; }
  .chapter-link { display: block; flex: 0 0 auto; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line-soft); }
  .chapter-link.active::before, .chapter-number, .chapter-link small { display: none; }
  .chapter-link strong { margin: 0; }
  .add-chapter { flex: 0 0 auto; margin: 0; }
  .editor { padding: 34px 16px 70px; }
  .chapter-progress { margin-bottom: 20px; }
  .chapter-topline, .overview-heading { gap: 12px; }
  .chapter-actions { flex-direction: column; }
  .editor-title, .overview-heading h1 { font-size: 35px; }
  .segment-card { grid-template-columns: 38px minmax(0, 1fr); }
  .segment-body { grid-template-columns: minmax(0, 1fr) 26px; gap: 9px; padding: 11px 12px 12px; }
  .time-field { grid-column: 1; grid-row: 1; width: 130px; }
  .segment-meta .text-button { grid-column: 2; grid-row: 1; }
  .segment-field:first-child { grid-column: 1 / -1; grid-row: 2; }
  .segment-field:nth-child(2) { grid-column: 1 / -1; grid-row: 3; }
  .segment-field:nth-child(3) { grid-column: 1 / -1; grid-row: 4; }
  .segment-field textarea { height: 72px; min-height: 72px; }
  .material-row { grid-row: 5; grid-template-columns: 1fr 1fr; }
  .material-heading { grid-column: 1 / -1; padding: 0; }
  .material-link { grid-column: 1 / -1; }
  .material-check { justify-content: center; }
  .segment-heading-actions { gap: 6px; }
  .dialog-form { padding: 22px; }
}

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