:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-pressed: #0062c4;
  --control: #efeff2;
  --focus: rgba(0, 113, 227, .24);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body { margin: 0; background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button, a, summary, input, textarea { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; border: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, summary { touch-action: manipulation; }
button, input, textarea, select { max-width: 100%; }
button, p, h1, h2, h3, label, li { overflow-wrap: anywhere; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
button { transition: background-color .16s, box-shadow .16s, color .16s; }
button:active:not(:disabled) { filter: brightness(.97); }
[hidden] { display: none !important; }
summary { list-style: none; cursor: pointer; min-height: 44px; }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ""; }
.skip { position: fixed; top: -80px; left: 16px; z-index: 100; display: flex; align-items: center; min-height: 44px; padding: 10px 18px; background: var(--ink); color: white; border-radius: 12px; }
.skip:focus { top: 12px; }

/* A compact, translucent application bar — not a marketing masthead. */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .84);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.header-inner { max-width: 1104px; min-height: 72px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { min-width: 0; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: var(--ink); color: white; font-size: 16px; font-weight: 600; }
.brand strong { font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.brand-divider { width: 1px; height: 16px; background: #d2d2d7; margin: 0 4px; }
.brand-product { font-size: 13px; color: var(--muted); font-weight: 400; }
.header-actions { min-width: 0; display: flex; align-items: center; gap: 8px; }
.header-button { min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 13px; }
.header-button:hover { background: rgba(0, 0, 0, .04); color: var(--ink); }
#context-name { display: block; max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { font-size: 14px; line-height: 1; color: var(--muted); flex-shrink: 0; }
.more-menu, .scene-switch { position: relative; min-width: 0; }
.more-menu > summary { width: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); font-size: 15px; letter-spacing: 2px; }
.more-menu > summary:hover, .more-menu[open] > summary { background: rgba(0, 0, 0, .045); color: var(--ink); }
.menu-popover, .scene-options {
  position: absolute; z-index: 50; top: calc(100% + 8px);
  width: 228px; max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(0, 0, 0, .08); border-radius: 15px; padding: 6px;
  box-shadow: 0 12px 38px rgba(0, 0, 0, .12);
}
.menu-popover { right: 0; }
.menu-popover button, .menu-popover a, .scene-options button {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: flex-start;
  gap: 10px; padding: 11px 12px; border-radius: 9px; background: transparent;
  color: var(--ink); text-align: left; font-size: 14px; line-height: 1.5;
}
.menu-popover a:hover, .menu-popover button:hover, .scene-options button:hover { background: var(--page); text-decoration: none; }
.scene-options button.selected, .scene-options button.active, .scene-options button[aria-pressed="true"], .scene-options button[aria-current="true"] { background: #edf5ff; color: #0065cc; font-weight: 600; }
.scene-options .nav-icon { width: 25px; height: 25px; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.scene-options .nav-selected-dot { margin-left: auto; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }

main { width: min(100%, 840px); margin: 0 auto; padding: 36px 32px 24px; outline: none; }
.welcome { margin: 0 0 32px; }
.preview-label { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.preview-label > span { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.welcome h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.3; letter-spacing: -.035em; font-weight: 650; }
.welcome-description { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.6; }
#main.is-working { padding-top: 24px; }
#main.is-working .welcome { display: none; }
.task-space { min-width: 0; }
.task-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.scene-switch { flex-shrink: 0; }
.scene-switch > summary { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-radius: 9px; }
.scene-switch > summary:hover .chevron { color: var(--ink); }
.scene-caption { color: var(--muted); font-size: 12px; }
.scene-switch strong { font-size: 15px; font-weight: 600; }
.scene-options { left: 0; }
.segmented { display: flex; align-items: stretch; flex: 0 1 auto; width: max-content; max-width: 100%; padding: 3px; gap: 2px; border-radius: 12px; background: #e9e9ed; }
.segmented:empty { display: none; }
.segmented .type-label { display: none; }
.type-button { flex: 1 1 0; min-width: 0; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 8px 16px; background: transparent; color: #55555a; border-radius: 9px; font-size: 13px; font-weight: 500; line-height: 1.35; text-align: center; white-space: nowrap; }
.type-button:hover { color: var(--ink); background: rgba(255, 255, 255, .5); }
.type-button.selected, .type-button[aria-pressed="true"] { color: var(--ink); background: white; box-shadow: 0 1px 5px rgba(0, 0, 0, .1), 0 1px 1px rgba(0, 0, 0, .04); }
.type-button:active:not(:disabled) { background: #f7f7f9; }
.task-meta { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
#task-label { color: #55555a; font-size: 13px; }
#progress-label { white-space: nowrap; }
.progress-track { width: 100%; height: 3px; margin-bottom: 22px; overflow: hidden; border-radius: 3px; background: #e1e1e6; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .24s ease; }

/* One focus card, one prominent next action. */
.focus-card { min-width: 0; border: 1px solid rgba(0, 0, 0, .055); border-radius: 24px; background: var(--surface); box-shadow: 0 8px 30px rgba(0, 0, 0, .035); overflow: hidden; }
.focus-overview { padding: 32px; }
.step-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.step-counter { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.focus-title { margin: 0; font-size: 28px; font-weight: 650; line-height: 1.35; letter-spacing: -.035em; }
.focus-description { max-width: 580px; margin-top: 13px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.focus-context { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 23px; padding: 12px 15px; border-radius: 12px; background: #f7f7f9; color: var(--muted); font-size: 13px; line-height: 1.6; }
.focus-context:empty { display: none; }
.focus-context strong, .focus-context b { color: #55555a; font-weight: 500; }
.focus-context button { margin-left: auto; }
.focus-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 30px; }
.focus-footer p { font-size: 13px; color: var(--muted); }
.primary-button, .secondary-button, .subtle-button, .text-button, .danger-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 11px 20px; border-radius: 11px;
  font-size: 14px; font-weight: 500; line-height: 1.45; text-align: center;
}
.primary-button { color: #fff; background: var(--blue); }
.primary-button:hover { background: var(--blue-hover); text-decoration: none; }
.primary-button:active:not(:disabled) { background: var(--blue-pressed); filter: none; }
.primary-button.large { min-height: 50px; padding: 14px 25px; font-size: 15px; border-radius: 12px; }
.secondary-button { background: var(--control); color: var(--ink); }
.secondary-button:hover { background: #e5e5e9; }
.secondary-button:active:not(:disabled) { background: #dbdbe0; }
.text-button { color: var(--blue); background: transparent; padding: 9px 5px; }
.text-button:hover { color: #005bb5; background: rgba(0, 113, 227, .04); }
.subtle-button { color: var(--muted); background: transparent; padding: 10px 12px; }
.subtle-button:hover { color: var(--ink); background: var(--page); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 3px 9px; border-radius: 8px; background: var(--control); color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; }
.status-pill.complete, .status-pill.done { background: #edf5ff; color: #0065cc; }
.status-pill.warning { background: #fff4e5; color: #805411; }

/* All steps remain available, but are not another competing workspace. */
.steps-disclosure { margin-top: 18px; }
.steps-disclosure > summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; color: var(--muted); font-size: 13px; }
.steps-disclosure > summary:hover { color: var(--ink); }
.disclosure-plus { font-size: 18px; font-weight: 300; transition: transform .18s; }
.steps-disclosure[open] > summary .disclosure-plus { transform: rotate(45deg); }
.step-list { display: grid; margin: 0; padding: 0; background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.step-item { width: 100%; min-width: 0; min-height: 60px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #efeff2; background: transparent; color: var(--muted); text-align: left; }
.step-item:last-child { border-bottom: 0; }
.step-item:hover { background: #f8f8fa; color: var(--ink); }
.step-item.current { background: #f0f6ff; color: var(--ink); }
.step-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #f0f0f3; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.current .step-number { color: white; background: var(--blue); }
.is-done:not(.current) .step-number { color: #55555a; background: #e9e9ed; }
.step-label { font-size: 14px; font-weight: 500; line-height: 1.5; }
.step-state { justify-self: end; color: var(--muted); font-size: 12px; text-align: right; }
.step-connector { display: none; }

/* Work is progressive: one of three phases is visible at a time. */
.work-view { min-width: 0; }
.work-heading { padding: 20px 32px 24px; }
.work-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 0 0 9px -5px; padding: 8px 5px; border-radius: 8px; color: var(--muted); background: transparent; font-size: 13px; }
.work-back:hover { color: var(--blue); }
.work-heading .step-caption { margin-bottom: 10px; }
.work-heading .focus-title, .work-heading h2 { font-size: 25px; line-height: 1.35; letter-spacing: -.025em; font-weight: 600; }
.work-heading .focus-description { margin-top: 9px; font-size: 14px; }
.work-phase-nav { display: flex; align-items: stretch; gap: 8px; margin: 0 32px; border-bottom: 1px solid var(--line); }
.phase-button { position: relative; flex: 1 1 0; min-width: 0; min-height: 48px; padding: 10px 4px 13px; background: transparent; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }
.phase-button:hover { color: var(--ink); }
.phase-button.is-active, .phase-button[aria-selected="true"] { color: var(--blue); font-weight: 600; }
.phase-button.is-active::after, .phase-button[aria-selected="true"]::after { content: ""; position: absolute; height: 2px; left: 10px; right: 10px; bottom: -1px; border-radius: 2px; background: var(--blue); }
.phase-panel { min-width: 0; padding: 25px 32px 28px; }
.section-label { display: block; margin: 0 0 11px; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.6; }
.phase-panel h3 { font-size: 16px; font-weight: 600; line-height: 1.5; margin-bottom: 12px; }
.phase-help { margin: 0 0 15px; color: var(--muted); font-size: 14px; line-height: 1.7; }
input:not([type="checkbox"]):not([type="file"]), textarea, select {
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 13px;
  border: 1px solid #d2d2d7; border-radius: 10px; background: white;
  color: var(--ink); font-size: 15px; line-height: 1.6;
  transition: border-color .15s, box-shadow .15s;
}
textarea { display: block; resize: vertical; }
input::placeholder, textarea::placeholder { color: #76767b; opacity: 1; font-size: 14px; }
input:not([type="checkbox"]):focus, textarea:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--focus); }
.source-editor { min-height: 155px; }
.draft-editor { min-height: 220px; }
.field-note { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.attachment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.file-button { display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px; min-height: 44px; padding: 8px 0; border-radius: 7px; background: transparent; color: var(--blue); font-size: 13px; text-align: left; }
.file-button:hover { color: #005bb5; }
.file-button > span:first-child { font-size: 18px; line-height: 1; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment-list:empty { display: none; }
.attachment { min-width: 0; max-width: 100%; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 8px; padding: 7px 11px; border-radius: 9px; background: #f3f3f5; color: #55555a; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.attachment small { color: var(--muted); font-size: 12px; }
.attachment button { min-width: 44px; min-height: 44px; padding: 6px; color: var(--muted); background: transparent; border-radius: 8px; }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 20px; }
.local-save-label { display: inline-block; color: var(--muted); font-size: 12px; line-height: 1.6; }
.review-summary { padding: 16px; margin: 0 0 20px; border-radius: 12px; background: #f7f7f9; color: #55555a; font-size: 14px; line-height: 1.7; }
.review-summary p + p { margin-top: 6px; }
.review-summary strong, .review-summary b { color: var(--ink); font-weight: 500; }
.review-name { margin: 18px 0 14px; }
.review-name label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 500; }
.review-name input { max-width: 360px; }
.approval-label { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; margin-top: 16px; padding: 8px 0; color: #55555a; font-size: 14px; line-height: 1.7; cursor: pointer; }
.approval-label input { flex-shrink: 0; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue); cursor: pointer; }
.method-disclosure { margin-top: 23px; border-top: 1px solid var(--line); }
.method-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 13px 0; color: var(--muted); font-size: 13px; }
.method-disclosure > summary::after { content: "＋"; color: var(--muted); font-size: 18px; font-weight: 300; }
.method-disclosure[open] > summary::after { content: "−"; }
.method-content { padding: 3px 0 8px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.method-content h3, .method-content h4 { margin: 16px 0 7px; color: #55555a; font-size: 14px; font-weight: 600; }
.method-content p { margin: 6px 0; }
.method-content ul, .method-content ol { margin: 8px 0; padding-left: 21px; }
.method-content li + li { margin-top: 6px; }
.acceptance-list { padding-left: 20px; margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.acceptance-list li + li { margin-top: 6px; }
.work-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 18px; padding: 17px 32px; border-top: 1px solid var(--line); background: #fcfcfd; }
.work-bottom > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.warning-note { margin-top: 13px; padding: 11px 13px; border-radius: 10px; background: #fff6e9; color: #805411; font-size: 13px; line-height: 1.65; }
.warning-note:empty { display: none; }

.page-footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 9px; margin-top: 17px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.page-footer button { min-height: 44px; padding: 8px 1px; color: var(--muted); background: transparent; font-size: 12px; }
.page-footer button:hover { color: var(--blue); }
.footer-dot { color: #99999f; }
#storage-status.is-warning, #storage-status.warning { color: #805411; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: min(520px, calc(100vw - 32px)); padding: 13px 19px; background: rgba(29, 29, 31, .95); color: white; border-radius: 13px; box-shadow: 0 8px 30px rgba(0, 0, 0, .15); font-size: 14px; line-height: 1.6; text-align: center; }

/* Grouped forms in a single modal sheet. */
dialog { width: min(600px, calc(100vw - 40px)); max-height: calc(100dvh - 64px); margin: auto; padding: 28px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid rgba(0, 0, 0, .06); border-radius: 22px; background: white; color: var(--ink); box-shadow: 0 24px 90px rgba(0, 0, 0, .2); }
dialog::backdrop { background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -4px -7px 5px 0; }
.dialog-heading h2 { font-size: 23px; font-weight: 600; line-height: 1.4; letter-spacing: -.025em; }
.dialog-close { display: grid; place-items: center; flex-shrink: 0; width: 44px; min-height: 44px; border-radius: 50%; background: transparent; color: var(--muted); font-size: 27px; line-height: 1; font-weight: 300; }
.dialog-close:hover { background: var(--control); color: var(--ink); }
.dialog-description { margin-bottom: 21px; color: var(--muted); font-size: 14px; line-height: 1.7; }
#context-form > label, .form-columns label { display: block; margin: 17px 0 7px; color: #55555a; font-size: 14px; font-weight: 500; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-columns > div { min-width: 0; }
#context-form textarea { min-height: 102px; }
.dialog-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 23px; padding-top: 16px; border-top: 1px solid var(--line); }
.dialog-actions .primary-button { min-width: 88px; }
.source-content h3 { margin: 22px 0 8px; font-size: 15px; font-weight: 600; line-height: 1.5; }
.source-content p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.source-content .dialog-description { margin-bottom: 10px; }
.source-links { display: grid; gap: 0; margin: 18px 0; }
.source-links a { display: flex; align-items: center; min-height: 44px; font-size: 14px; }
.danger-button { margin-top: 4px; padding-left: 0; padding-right: 0; color: #b42318; background: transparent; font-size: 13px; }
.danger-button:hover { color: #891b12; }

@media (max-width: 767px) {
  .header-inner { min-height: 64px; padding: 0 22px; gap: 12px; }
  main { padding: 27px 22px 20px; }
  .welcome { margin-bottom: 26px; }
  .welcome h1 { font-size: 28px; }
  .task-controls { gap: 12px; margin-bottom: 18px; }
  .type-button { padding-left: 13px; padding-right: 13px; }
  .focus-overview { padding: 27px; }
  .focus-title { font-size: 26px; }
  .focus-description { font-size: 15px; }
  .focus-footer { margin-top: 25px; }
  .work-heading { padding: 17px 27px 21px; }
  .work-phase-nav { margin-left: 27px; margin-right: 27px; }
  .phase-panel { padding: 23px 27px 25px; }
  .work-bottom { padding: 16px 27px; }
}

@media (max-width: 560px) {
  html { scroll-padding-top: 76px; }
  .header-inner { padding: 0 16px; gap: 8px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 16px; }
  .brand-divider, .brand-product { display: none; }
  .header-actions { gap: 2px; }
  .header-button { padding-left: 9px; padding-right: 9px; }
  #context-name { max-width: 120px; }
  main { padding: 24px 16px 16px; }
  .welcome { margin-bottom: 25px; }
  .preview-label { margin-bottom: 10px; }
  .welcome h1 { font-size: 26px; }
  .welcome-description { margin-top: 9px; font-size: 14px; }
  .task-controls { align-items: flex-start; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 17px; }
  .scene-switch > summary { padding-top: 7px; padding-bottom: 7px; }
  .segmented { flex-grow: 0; }
  .type-button { padding: 8px 12px; font-size: 13px; }
  .task-meta { gap: 5px 12px; margin-bottom: 9px; }
  .progress-track { margin-bottom: 18px; }
  .focus-card { border-radius: 20px; }
  .focus-overview { padding: 24px 22px; }
  .focus-title { font-size: 25px; }
  .focus-description { margin-top: 11px; font-size: 14px; line-height: 1.8; }
  .focus-context { margin-top: 20px; padding: 11px 12px; }
  .focus-footer { align-items: stretch; flex-direction: column; gap: 12px; margin-top: 23px; }
  .focus-footer .primary-button { width: 100%; }
  .focus-footer .local-save-label { text-align: center; }
  .work-heading { padding: 14px 22px 20px; }
  .work-heading .focus-title, .work-heading h2 { font-size: 23px; }
  .work-back { margin-bottom: 7px; }
  .work-phase-nav { gap: 4px; margin-left: 22px; margin-right: 22px; }
  .phase-button { font-size: 14px; }
  .phase-panel { padding: 21px 22px 24px; }
  .source-editor { min-height: 150px; }
  .draft-editor { min-height: 210px; }
  input:not([type="checkbox"]):not([type="file"]), textarea, select { font-size: 16px; }
  .inline-actions { gap: 8px 13px; margin-top: 16px; }
  .inline-actions .primary-button { flex: 1 1 140px; }
  .inline-actions .local-save-label { flex-basis: 100%; }
  .review-name input { max-width: none; }
  .work-bottom { gap: 10px; padding: 15px 22px; }
  .work-bottom > .primary-button { flex: 1 1 160px; }
  .work-bottom .local-save-label { font-size: 12px; }
  .step-item { min-height: 60px; gap: 10px; padding: 12px 15px; }
  .step-label { font-size: 14px; }
  .step-state { max-width: 90px; font-size: 12px; }
  .method-content, .acceptance-list { font-size: 14px; }
  .page-footer { margin-top: 12px; }
  dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 22px; border-radius: 22px; }
  .dialog-heading h2 { font-size: 21px; }
  .form-columns { grid-template-columns: 1fr; gap: 0; }
  .dialog-actions { gap: 8px; }
}

@media (max-width: 359px) {
  .header-inner { padding-left: 12px; padding-right: 12px; }
  #context-name { max-width: 96px; }
  main { padding-left: 12px; padding-right: 12px; }
  .welcome h1 { font-size: 24px; }
  .task-controls { display: grid; justify-content: stretch; gap: 9px; }
  .scene-switch { justify-self: start; }
  .segmented { width: 100%; }
  .type-button { padding-left: 7px; padding-right: 7px; font-size: 12px; }
  .focus-overview { padding: 22px 19px; }
  .focus-title { font-size: 24px; }
  .work-heading { padding-left: 19px; padding-right: 19px; }
  .work-phase-nav { margin-left: 19px; margin-right: 19px; }
  .phase-panel { padding-left: 19px; padding-right: 19px; }
  .work-bottom { padding-left: 19px; padding-right: 19px; }
  .work-bottom > div { width: 100%; justify-content: space-between; }
  .work-bottom > .primary-button { width: 100%; flex-basis: 100%; }
  .dialog-actions .text-button { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: white; }
  .site-header, .welcome, .task-controls, .steps-disclosure, .work-phase-nav, .work-back, .work-bottom, .page-footer, .toast, .skip, button, .attachment-actions { display: none !important; }
  main, #main.is-working { width: 100%; max-width: none; margin: 0; padding: 0; }
  .focus-card { box-shadow: none; border: 0; border-radius: 0; }
  .phase-panel[hidden] { display: block !important; }
  textarea { min-height: 100px; border-color: #ccc; }
  .method-disclosure { border: 0; }
  .method-content { display: block; }
}

/* Integrated current-step heading and context-sensitive help. */
.work-heading-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:7px}
.work-heading-bar .work-back{margin-bottom:0}
.focus-footer>span{font-size:13px;line-height:1.65;color:var(--muted);max-width:360px}
.review-summary>span{display:block;color:var(--muted);font-size:12px}
.review-summary>strong{display:block;margin-top:5px}
.method-disclosure{margin:0 32px 18px}
@media(max-width:767px){.method-disclosure{margin-left:27px;margin-right:27px}}
@media(max-width:560px){.method-disclosure{margin-left:22px;margin-right:22px}.focus-footer>span{font-size:12px;text-align:center}}
@media(max-width:359px){.method-disclosure{margin-left:19px;margin-right:19px}}
