@charset "UTF-8";

/* Shared semantic tokens keep every screen in the selected visual theme. */
:root,
:root[data-theme="calm"] {
  --bg: #f6f7f5;
  --ink: #182b2b;
  --muted: #566764;
  --card: #ffffff;
  --surface-subtle: #f0f4f1;
  --surface-hover: #f0f7f4;
  --line: #dce3de;
  --line-soft: #e9eeea;
  --line-strong: #738a7f;
  --accent: #176b62;
  --accent-dark: #105047;
  --on-accent: #ffffff;
  --pale: #e5f2ed;
  --pale-ink: #205d50;
  --pale-line: #bfdacf;
  --neutral-bg: #edf1ef;
  --neutral-ink: #4d6058;
  --notice-bg: #edf2f1;
  --notice-ink: #415d55;
  --notice-line: #d4e0da;
  --danger: #9c352f;
  --danger-bg: #fff0ed;
  --danger-line: #d8aaa4;
  --warning-bg: #fff2d9;
  --warning-ink: #765014;
  --warning-line: #dcc28e;
  --focus: #956014;
  --input-bg: #ffffff;
  --input-line: #738a7f;
  --table-head: #f3f6f4;
  --table-head-ink: #41564e;
  --dummy-bg: #f3f5f4;
  --dummy-line: #a8b6ae;
  --status-unknown: #75887f;
  --sidebar-bg: #ffffff;
  --sidebar-ink: #233a32;
  --sidebar-muted: #617169;
  --sidebar-line: #e4eae5;
  --sidebar-hover: #f0f5f1;
  --sidebar-selected: #e2f0e9;
  --sidebar-selected-ink: #155b4d;
  --sidebar-marker: #176b62;
  --sidebar-focus: #956014;
  --brand-bg: #176b62;
  --brand-ink: #ffffff;
  --shadow: 0 2px 10px rgb(24 43 43 / 3%);
  --radius: 12px;
  --radius-control: 7px;
  --radius-small: 6px;
  --sidebar-width: 232px;
  --page-gutter: 28px;
  --page-top: 26px;
  --card-padding: 24px;
  --section-gap: 20px;
  --grid-gap: 22px;
  --field-gap: 20px;
  --row-padding: 14px;
  --nav-padding: 9px;
  --header-height: 64px;
  --body-leading: 1.65;
  --heading-size: 1.9rem;
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: var(--body-leading);
  color: var(--ink);
  background: var(--bg);
}

:root[data-theme="precision"] {
  --bg: #f3f5f8;
  --ink: #142234;
  --muted: #526278;
  --card: #ffffff;
  --surface-subtle: #edf1f8;
  --surface-hover: #f0f3fe;
  --line: #d6deea;
  --line-soft: #e5eaf2;
  --line-strong: #7889a6;
  --accent: #405cdd;
  --accent-dark: #2b43b4;
  --on-accent: #ffffff;
  --pale: #e8edff;
  --pale-ink: #2c438d;
  --pale-line: #c8d3fa;
  --neutral-bg: #edf0f5;
  --neutral-ink: #4b5a70;
  --notice-bg: #edf1f8;
  --notice-ink: #405572;
  --notice-line: #cfd9e8;
  --danger: #a32f36;
  --danger-bg: #fff0f1;
  --danger-line: #d9a3ab;
  --warning-bg: #fff2dc;
  --warning-ink: #774c0e;
  --warning-line: #dcc38f;
  --focus: #b25c12;
  --input-bg: #ffffff;
  --input-line: #7889a6;
  --table-head: #f0f3fa;
  --table-head-ink: #384b68;
  --dummy-bg: #f1f3f8;
  --dummy-line: #a5afc5;
  --status-unknown: #74839a;
  --sidebar-bg: #142234;
  --sidebar-ink: #f1f5fc;
  --sidebar-muted: #b8c6d9;
  --sidebar-line: #334459;
  --sidebar-hover: #23364e;
  --sidebar-selected: #334dbb;
  --sidebar-selected-ink: #ffffff;
  --sidebar-marker: #b2c4ff;
  --sidebar-focus: #f0c47b;
  --brand-bg: #405cdd;
  --brand-ink: #ffffff;
  --shadow: 0 1px 4px rgb(20 34 52 / 3%);
  --radius: 7px;
  --radius-control: 5px;
  --radius-small: 4px;
  --sidebar-width: 224px;
  --page-gutter: 26px;
  --page-top: 24px;
  --card-padding: 22px;
  --section-gap: 20px;
  --grid-gap: 18px;
  --field-gap: 17px;
  --row-padding: 11px;
  --nav-padding: 9px;
  --header-height: 64px;
  --body-leading: 1.6;
  --heading-size: 1.85rem;
}

:root[data-theme="care"] {
  --bg: #f8f5ee;
  --ink: #303a33;
  --muted: #626c5f;
  --card: #fffefa;
  --surface-subtle: #f0f1e9;
  --surface-hover: #f1f4eb;
  --line: #dfdfd1;
  --line-soft: #eaeade;
  --line-strong: #7b8b72;
  --accent: #48664e;
  --accent-dark: #354d39;
  --on-accent: #ffffff;
  --pale: #e6ede0;
  --pale-ink: #435b41;
  --pale-line: #cbd8c2;
  --neutral-bg: #edeee5;
  --neutral-ink: #586252;
  --notice-bg: #f2eee5;
  --notice-ink: #625443;
  --notice-line: #dfd7c9;
  --danger: #934e33;
  --danger-bg: #faeee6;
  --danger-line: #d7b39e;
  --warning-bg: #f8ecd8;
  --warning-ink: #785329;
  --warning-line: #d9bc93;
  --focus: #934e33;
  --input-bg: #fffefa;
  --input-line: #7b8b72;
  --table-head: #f2f2e9;
  --table-head-ink: #525e49;
  --dummy-bg: #f3f1e8;
  --dummy-line: #b7b59f;
  --status-unknown: #6f8875;
  --sidebar-bg: #fffdf7;
  --sidebar-ink: #354835;
  --sidebar-muted: #697360;
  --sidebar-line: #e5e3d5;
  --sidebar-hover: #f0f2e8;
  --sidebar-selected: #e2eadc;
  --sidebar-selected-ink: #3c543c;
  --sidebar-marker: #6f8875;
  --sidebar-focus: #934e33;
  --brand-bg: #48664e;
  --brand-ink: #ffffff;
  --shadow: 0 3px 14px rgb(67 72 44 / 4%);
  --radius: 18px;
  --radius-control: 10px;
  --radius-small: 8px;
  --sidebar-width: 240px;
  --page-gutter: 28px;
  --page-top: 28px;
  --card-padding: 24px;
  --section-gap: 22px;
  --grid-gap: 22px;
  --field-gap: 22px;
  --row-padding: 16px;
  --nav-padding: 9px;
  --header-height: 68px;
  --body-leading: 1.7;
  --heading-size: 2rem;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: var(--bg); word-break: keep-all; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 2.8vw, var(--heading-size)); letter-spacing: -.05em; line-height: 1.35; margin-bottom: 12px; overflow-wrap: anywhere; }
h2 { font-size: 1.25rem; letter-spacing: -.03em; line-height: 1.5; margin-bottom: 18px; }
h3 { font-size: 1.08rem; line-height: 1.5; margin-bottom: 8px; }
p { margin-bottom: 16px; }
small { font-size: .82rem; }
code { overflow-wrap: anywhere; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
input, select, textarea { max-width: 100%; min-width: 0; width: 100%; min-height: 46px; border: 1px solid var(--input-line); border-radius: var(--radius-control); padding: 10px 12px; background: var(--input-bg); color: var(--ink); }
textarea { resize: vertical; }
input[type="checkbox"] { width: 44px; min-height: 44px; height: 44px; padding: 0; accent-color: var(--accent); vertical-align: middle; }
label { display: block; font-size: .9rem; font-weight: 650; margin-bottom: 7px; }
summary { min-height: 44px; cursor: pointer; padding: 8px 0; color: var(--ink); }
[hidden] { display: none !important; }

/* Desktop shell: the body column may shrink without widening the document. */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.anonymous .app-shell { grid-template-columns: minmax(0, 1fr); }
.app-body { display: flex; flex-direction: column; min-width: 0; }
.app-sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; padding: 24px 16px 20px; background: var(--sidebar-bg); color: var(--sidebar-ink); border-right: 1px solid var(--sidebar-line); }
.app-sidebar .brand { padding: 0 10px; margin-bottom: 28px; color: var(--sidebar-ink); }
.app-sidebar .brand small { color: var(--sidebar-muted); }
.app-sidebar :focus-visible { outline-color: var(--sidebar-focus); }
.nav-section-label { margin: 0 12px 10px; color: var(--sidebar-muted); font-size: .7rem; font-weight: 700; letter-spacing: .1em; }
.primary-nav { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; }
.nav-group-label { margin: 14px 14px 5px; color: var(--sidebar-muted); font-size: .7rem; font-weight: 650; }
.primary-nav a { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: var(--nav-padding) 14px; border-radius: var(--radius-small); color: var(--sidebar-ink); text-decoration: none; font-size: .85rem; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; }
.primary-nav a:hover { color: var(--sidebar-ink); background: var(--sidebar-hover); }
.primary-nav a[aria-current="page"] { color: var(--sidebar-selected-ink); background: var(--sidebar-selected); box-shadow: inset 3px 0 var(--sidebar-marker); font-weight: 750; }
.sidebar-note { margin: auto 10px 0; padding-top: 28px; color: var(--sidebar-muted); font-size: .76rem; line-height: 1.7; overflow-wrap: anywhere; }
.sidebar-note::before { display: block; content: ""; border-top: 1px solid var(--sidebar-line); margin-bottom: 16px; }
.sidebar-note strong { font-size: .77rem; font-weight: 650; }
.sidebar-note small { display: block; margin-top: 4px; font-size: .7rem; }
.sidebar-note .status-dot { width: 8px; height: 8px; margin: 0 7px 0 0; }
.nav-toggle { display: none; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: var(--header-height); padding: 10px var(--page-gutter); background: var(--card); border-bottom: 1px solid var(--line); }
.workspace-label { color: var(--muted); font-size: .84rem; font-weight: 650; margin: 0; }
.header-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 16px 24px; min-width: 0; }
.theme-control { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; max-width: 320px; }
.theme-picker { position: relative; }
.theme-trigger { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.4; list-style: none; white-space: nowrap; }
.theme-trigger::-webkit-details-marker { display: none; }
.theme-trigger:hover, .theme-picker[open] .theme-trigger { background: var(--surface-subtle); color: var(--ink); }
.theme-swatch { width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--pale); }
.theme-chevron { width: 14px; height: 14px; margin-left: 2px; }
.theme-picker[open] .theme-chevron { transform: rotate(180deg); }
.theme-panel { position: absolute; z-index: 20; top: calc(100% + 10px); right: 0; width: 312px; max-width: calc(100vw - 28px); padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 12px 36px rgb(20 34 52 / 14%), 0 2px 6px rgb(20 34 52 / 5%); }
.theme-options { min-width: 0; margin: 0; padding: 0; border: 0; }
.theme-options legend { margin-bottom: 14px; padding: 0; color: var(--ink); font-size: .85rem; font-weight: 700; }
.theme-option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-option { position: relative; display: block; min-width: 0; margin: 0; cursor: pointer; }
.theme-option input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.theme-option-card { display: block; padding: 5px; border: 1px solid var(--line-strong); border-radius: 10px; }
.theme-option:hover .theme-option-card { background: var(--surface-subtle); }
.theme-option input:checked + .theme-option-card { border-color: var(--accent); background: var(--pale); box-shadow: 0 0 0 1px var(--accent); }
.theme-option input:focus-visible + .theme-option-card { outline: 3px solid var(--focus); outline-offset: 3px; }
.theme-option-name { display: flex; align-items: center; justify-content: space-between; gap: 2px; padding: 8px 2px 3px; color: var(--ink); font-size: .74rem; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.theme-option-name svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--accent); visibility: hidden; }
.theme-option input:checked + .theme-option-card .theme-option-name svg { visibility: visible; }
/* Miniatures use the actual palette of each theme, independent of the selection. */
.theme-preview { --preview-bg: #f6f7f5; --preview-sidebar: #ffffff; --preview-accent: #176b62; --preview-card: #ffffff; --preview-line: #dce3de; display: flex; height: 54px; overflow: hidden; border: 1px solid var(--preview-line); border-radius: 5px; background: var(--preview-bg); }
.theme-preview-navy { --preview-bg: #f3f5f8; --preview-sidebar: #142234; --preview-accent: #405cdd; --preview-line: #d6deea; }
.theme-preview-sand { --preview-bg: #f8f5ee; --preview-sidebar: #fffdf7; --preview-accent: #48664e; --preview-card: #fffefa; --preview-line: #dfdfd1; }
.theme-preview-sidebar { width: 19px; flex-shrink: 0; padding: 8px 4px; border-right: 1px solid var(--preview-line); background: var(--preview-sidebar); }
.theme-preview-sidebar::before, .theme-preview-sidebar::after { content: ""; display: block; height: 3px; border-radius: 2px; background: var(--preview-accent); }
.theme-preview-sidebar::after { margin-top: 6px; opacity: .35; }
.theme-preview-content { flex: 1; min-width: 0; padding: 8px 5px; }
.theme-preview-content i { display: block; height: 11px; margin-top: 4px; border: 1px solid var(--preview-line); border-radius: 2px; background: var(--preview-card); }
.theme-preview-content i:first-child { width: 65%; height: 3px; margin: 0 0 6px; border: 0; background: var(--preview-accent); }
.theme-hint { margin: 14px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.6; }
.theme-feedback { flex-basis: 100%; margin: 0; padding: 8px 10px; border-radius: var(--radius-small); color: var(--warning-ink); background: var(--warning-bg); font-size: .74rem; line-height: 1.65; overflow-wrap: anywhere; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; line-height: 1.2; font-size: 1.3rem; font-weight: 800; white-space: nowrap; }
.brand small { display: block; font-size: .65rem; color: var(--muted); font-weight: 500; letter-spacing: .025em; margin-top: 6px; }
.brand-symbol { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; background: var(--brand-bg); border-radius: var(--radius-control); color: var(--brand-ink); font-size: 1.8rem; font-weight: 600; }
.account { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 11px; min-width: 0; font-size: .8rem; }
.account-name { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account form { margin: 0; }
.role { padding: 3px 9px; border-radius: var(--radius-small); background: var(--pale); color: var(--pale-ink); font-weight: 700; white-space: nowrap; }
.link-button { min-height: 44px; padding: 8px 3px; border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; font-size: .8rem; }
main { width: 100%; max-width: 1344px; min-width: 0; flex: 1; margin: 0 auto; padding: var(--page-top) var(--page-gutter) 64px; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; width: 100%; max-width: 1344px; margin: auto auto 0; padding: 22px var(--page-gutter); border-top: 1px solid var(--line); font-size: .76rem; color: var(--muted); }
.anonymous main, .anonymous .site-footer { max-width: 1200px; }
.anonymous .site-header { padding-inline: max(var(--page-gutter), calc((100vw - 1200px) / 2 + var(--page-gutter))); }
.reference-banner { padding: 10px var(--page-gutter); background: var(--warning-bg); border-bottom: 1px solid var(--warning-line); text-align: center; color: var(--warning-ink); font-size: .82rem; font-weight: 700; }

.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: var(--section-gap); }
.page-heading > div { min-width: 0; }
.page-heading p:last-child { margin-bottom: 0; }
.eyebrow { font-size: .73rem; letter-spacing: .02em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.lead { font-size: .9rem; color: var(--muted); line-height: 1.75; }
.context-note { margin-bottom: var(--section-gap); padding: 0 16px; border: 1px solid var(--notice-line); border-radius: var(--radius-control); background: var(--notice-bg); color: var(--notice-ink); font-size: .82rem; }
.context-note summary { display: list-item; padding: 11px 0; color: inherit; font-weight: 600; }
.context-note p { margin: 0 0 14px; }
.muted { color: var(--muted); font-size: .88rem; }
.help { color: var(--muted); font-size: .8rem; line-height: 1.75; margin: 9px 0 14px; overflow-wrap: anywhere; }
.card { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--card-padding); margin-bottom: var(--section-gap); box-shadow: var(--shadow); }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap); align-items: start; }
.two-columns > * { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 16px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.section-heading > a { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; max-width: 100%; padding: 10px 19px; background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-control); color: var(--on-accent); text-decoration: none; font-size: .9rem; font-weight: 700; line-height: 1.5; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }
.button.secondary { color: var(--accent); background: var(--card); border-color: var(--line-strong); }
.button.secondary:hover { background: var(--pale); border-color: var(--accent); }
.button.danger { background: var(--card); color: var(--danger); border-color: var(--danger-line); }
.button.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.full-width { width: 100%; }
.badge { display: inline-block; max-width: 100%; padding: 4px 10px; font-size: .75rem; background: var(--pale); color: var(--pale-ink); border-radius: var(--radius-small); font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.badge.neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--grid-gap); margin-bottom: var(--section-gap); }
.stat { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.stat > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.stat > strong { font-size: 2rem; font-weight: 700; letter-spacing: -.04em; line-height: 1.5; overflow-wrap: anywhere; }
.stat strong small { font-size: .85rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat > a { display: inline-flex; align-items: center; min-height: 44px; font-size: .8rem; margin-top: 5px; }
.status-stat { background: var(--pale); border-color: var(--pale-line); }
.status-stat strong { font-size: 1.4rem; display: block; }
.status-stat > small { color: var(--pale-ink); }
.notice { display: flex; align-items: flex-start; gap: 14px; padding: 17px 20px; background: var(--notice-bg); border: 1px solid var(--notice-line); border-radius: var(--radius-control); font-size: .85rem; margin-bottom: var(--section-gap); }
.notice strong { flex-shrink: 0; }
.notice span { color: var(--notice-ink); min-width: 0; overflow-wrap: anywhere; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: calc(var(--row-padding) + 3px) 0; border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; min-width: 0; }
.list-item > div { min-width: 0; }
.list-item:first-child { border-top: 0; }
.list-item strong { display: block; font-size: .95rem; overflow-wrap: anywhere; }
.list-item span:not(.badge):not(.arrow) { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; overflow-wrap: anywhere; }
.list-item:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.arrow { color: var(--accent); font-size: 1.3rem; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty h2, .empty h3 { color: var(--ink); }
.empty p { font-size: .88rem; margin-bottom: 0; }
.empty.compact { padding: 20px 8px; }
.field { margin-bottom: var(--field-gap); min-width: 0; }
.required { color: var(--accent); }
.field-error { padding: 8px 12px; background: var(--danger-bg); color: var(--danger); font-size: .85rem; border-radius: var(--radius-small); margin-bottom: 12px; overflow-wrap: anywhere; }
.field-error ul { list-style: none; padding: 0; margin: 0; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--danger); }
.wide-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--grid-gap); }
.wide-form > .field-error, .wide-form > .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.form-actions .help { margin: 0; }
.search-form { display: flex; gap: 10px; margin-bottom: 12px; }
.search-form input { min-width: 0; }
.search-form .button { flex-shrink: 0; }
.pagination { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; font-size: .84rem; }
.pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; font-size: .85rem; text-decoration: none; }
.description { white-space: normal; color: var(--muted); margin-bottom: var(--section-gap); overflow-wrap: anywhere; }
.course { border-top: 1px solid var(--line); padding: var(--section-gap) 0 8px; }
.course h3 { margin-top: 12px; }
.course:first-of-type { border-top: 0; }
.step-form { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-control); padding: 20px; margin: 20px 0; }
.step-form legend { padding: 0 9px; max-width: 100%; color: var(--accent); font-size: .85rem; font-weight: 750; }
.step-form .field:last-child { margin-bottom: 0; }
.steps { list-style: none; padding: 0; margin: 20px 0; }
.steps li { display: flex; align-items: flex-start; gap: 15px; padding: var(--row-padding) 0; border-bottom: 1px solid var(--line-soft); }
.steps li > div { min-width: 0; }
.steps li:last-child { border-bottom: 0; }
.step-number { width: 31px; height: 31px; border-radius: 50%; background: var(--pale); color: var(--pale-ink); display: grid; place-items: center; flex-shrink: 0; font-size: .82rem; font-weight: 750; }
.steps strong { font-size: .94rem; }
.steps p { font-size: .83rem; color: var(--muted); margin: 3px 0 0; overflow-wrap: anywhere; }
.steps p.instruction { color: var(--ink); margin-top: 10px; }
.assigned-plan { padding: 14px 17px; background: var(--pale); border-radius: var(--radius-control); display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; margin-bottom: 12px; font-size: .86rem; }
.assigned-plan span { color: var(--pale-ink); }
.plan-form { margin-top: 20px; }
.workout-summary { padding: 22px 24px; background: var(--surface-subtle); border-radius: var(--radius-control); margin-top: 22px; }
.workout-summary h3 { font-size: 1.45rem; }
.workout-summary p:last-child { margin-bottom: 0; font-size: .9rem; }
.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.device-grid.vertical { grid-template-columns: 1fr; }
.device { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-control); display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; font-size: .85rem; }
.device-grid.vertical .device { flex-wrap: wrap; }
.device .help { width: 100%; margin: 2px 0; }
.details { margin-top: 26px; }
.details div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: .86rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; text-align: right; overflow-wrap: anywhere; max-width: 66%; }
.messages { margin-bottom: var(--section-gap); }
.message { border-radius: var(--radius-control); padding: 15px 20px; background: var(--pale); color: var(--pale-ink); border: 1px solid var(--pale-line); margin-bottom: 10px; font-size: .9rem; overflow-wrap: anywhere; }
.message.error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 64px; align-items: center; padding: 52px 0; }
.login-intro h1 { font-size: clamp(2rem, 3.5vw, 3.2rem); margin-bottom: 25px; }
.login-intro .lead { font-size: 1.1rem; }
.intro-note { border-left: 3px solid var(--pale-line); padding-left: 20px; margin-top: 42px; color: var(--muted); font-size: .87rem; }
.login-card { padding: calc(var(--card-padding) + 10px); margin-bottom: 0; }
.login-card h2 { font-size: 1.4rem; margin-top: 20px; }
.login-card form { margin-top: 25px; }
.narrow { max-width: 650px; margin: 40px auto; }
.skip-link { position: absolute; top: -100px; left: 10px; min-height: 44px; padding: 10px 15px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-control); z-index: 20; }
.skip-link:focus { top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--status-unknown); margin-bottom: 15px; }

.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; margin: 14px 0 20px; border-radius: var(--radius-small); }
table { width: 100%; border-collapse: collapse; font-size: .83rem; text-align: left; }
th, td { padding: var(--row-padding) 14px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { font-weight: 700; background: var(--table-head); color: var(--table-head-ink); white-space: nowrap; }
td { min-width: 90px; max-width: 280px; }
tbody tr:hover { background: var(--surface-hover); }
td a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; align-items: end; margin: 20px 0; }
.filter-grid .field { margin-bottom: 10px; }
.filter-grid > .button { align-self: end; margin-bottom: 10px; }
.filter-grid > a { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 0; }
.export-form { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.export-form .field { max-width: 520px; }
.guide-timer { padding: 25px 20px; background: var(--pale); border-radius: var(--radius); margin: 25px 0; text-align: center; }
.guide-timer span, .guide-timer small { display: block; color: var(--pale-ink); }
.guide-timer strong { display: block; font-variant-numeric: tabular-nums; letter-spacing: .03em; font-size: clamp(3rem, 6vw, 4.8rem); line-height: 1.6; color: var(--accent); overflow-wrap: anywhere; }
.exercise-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.exercise-actions .button { flex: 1 1 140px; }
.dummy-analysis { border: 2px dashed var(--dummy-line); background: var(--dummy-bg); }
.dummy-analysis h2 { margin-top: 18px; }
.received-result { padding-top: 20px; border-top: 1px solid var(--line); margin-top: 20px; }
.measurement-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 15px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.measurement-summary small { grid-column: 1 / -1; color: var(--muted); }
.measurement-summary > * { min-width: 0; overflow-wrap: anywhere; }
.structured-value, .details .structured-value { display: block; min-width: 0; padding: 0; border: 0; text-align: left; }
.measurement-value-summary { display: block; overflow-wrap: anywhere; }
.measurement-raw { margin-top: 8px; }
.measurement-raw > summary { cursor: pointer; color: var(--accent); }
.measurement-raw pre { max-height: 18rem; max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; background: var(--surface-subtle); border: 1px solid var(--line); border-radius: var(--radius-control); font-size: .75rem; text-align: left; }
.record-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; font-size: .83rem; }
.record-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.reference-content { font-size: .9rem; line-height: 1.9; white-space: normal; overflow-wrap: anywhere; background: var(--surface-subtle); border-radius: var(--radius-control); padding: 20px; margin-top: 20px; }
#workspace-content .message { overflow-wrap: anywhere; }

@media (min-width: 901px) and (max-width: 1180px) {
  .site-header { align-items: flex-start; }
  .header-controls { gap: 8px 14px; }
  .account-name { display: none; }
  .two-columns { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 12px; }
  .stat { padding: 18px; }
  .notice { flex-direction: column; gap: 5px; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-sidebar { position: static; height: auto; min-height: 76px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px 24px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--sidebar-line); }
  .app-sidebar .brand { padding: 0; margin: 0; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 60px; min-height: 44px; padding: 8px 13px; border: 1px solid var(--sidebar-line); border-radius: var(--radius-control); background: var(--sidebar-hover); color: var(--sidebar-ink); font-size: .82rem; font-weight: 650; }
  .nav-section-label { grid-column: 1 / -1; margin: 8px 0 0; }
  .primary-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .nav-group-label { grid-column: 1 / -1; margin: 10px 12px 0; }
  .primary-nav a { padding: 11px 12px; }
  .sidebar-note { grid-column: 1 / -1; margin: 0; padding-top: 2px; }
  .sidebar-note::before { margin-bottom: 8px; }
  .app-sidebar[data-menu-open="false"] .primary-nav,
  .app-sidebar[data-menu-open="false"] .nav-section-label,
  .app-sidebar[data-menu-open="false"] .sidebar-note { display: none; }
  .site-header { gap: 16px; flex-wrap: wrap; padding: 13px 24px; min-height: 70px; }
  .header-controls { margin-left: auto; gap: 8px 20px; }
  main { padding: 28px 24px 54px; }
  .site-footer { padding: 22px 24px; }
  .two-columns { grid-template-columns: minmax(0, 1fr); }
  .stats { gap: 12px; }
  .stat { padding: 18px; }
  .notice { flex-direction: column; gap: 5px; }
  .login-layout { gap: 30px; }
  .device-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { align-items: flex-start; }
  .login-card { padding: 28px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid > .button { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .app-sidebar { padding: 10px 16px; min-height: 64px; }
  .primary-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primary-nav a { font-size: .8rem; }
  .site-header { padding: 8px 16px; gap: 8px; min-height: 60px; }
  .anonymous .site-header { padding-inline: 16px; }
  .workspace-label { display: none; }
  .header-controls { width: 100%; justify-content: space-between; gap: 8px; }
  .anonymous .header-controls { width: auto; }
  .authenticated .theme-panel { right: auto; left: 0; }
  .account { gap: 8px; }
  .account-name { display: none; }
  .brand { font-size: 1.15rem; }
  .brand-symbol { width: 36px; height: 36px; }
  main { padding: 20px 16px 48px; }
  .page-heading { flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .status-stat { grid-column: 1 / -1; }
  .card { padding: 21px 18px; }
  .wide-form { grid-template-columns: minmax(0, 1fr); }
  .filter-grid { grid-template-columns: minmax(0, 1fr); }
  .stats .stat > strong { font-size: 1.7rem; }
  .login-layout { grid-template-columns: minmax(0, 1fr); padding: 16px 0; gap: 26px; }
  .login-intro h1 { font-size: 2.2rem; }
  .intro-note { display: none; }
  .login-intro .lead { font-size: .97rem; }
  .site-footer { flex-direction: column; gap: 5px; padding: 20px 18px; }
  .notice { padding: 16px; }
  .section-heading { align-items: flex-start; }
  .details div { font-size: .82rem; }
  .device { flex-wrap: wrap; }
  .button { min-height: 48px; padding-inline: 16px; }
  .step-form { padding: 16px 12px; }
  .form-actions { gap: 12px; }
  .back-link { margin-bottom: 14px; }
  .workout-summary { padding: 18px; }
  .reference-banner { font-size: .76rem; padding: 10px 16px; }
  th, td { padding: 11px; }
  .reference-content { padding: 15px; }
  .exercise-actions { gap: 8px; }
  .exercise-actions .button { flex-basis: 130px; }
}

@media (max-width: 380px) {
  .app-sidebar, .site-header { padding-inline: 14px; }
  .anonymous .site-header { padding-inline: 14px; }
  main { padding-inline: 14px; }
  .card { padding: 18px 14px; }
  .header-controls { align-items: flex-start; }
  .account { margin-left: auto; }
  .role { padding-inline: 6px; font-size: .73rem; }
  .filter-grid { grid-template-columns: minmax(0, 1fr); }
  .details div { gap: 10px; }
  .details dd { max-width: 58%; }
  .stat { padding: 15px; }
  .measurement-summary { grid-template-columns: minmax(0, 1fr); }
  .measurement-summary small { grid-column: 1; }
  .search-form { flex-wrap: wrap; }
  .search-form input { flex: 1 1 150px; }
  .guide-timer { padding-inline: 12px; }
}

@media (forced-colors: active) {
  .primary-nav a[aria-current="page"] { outline: 2px solid currentColor; outline-offset: -2px; }
  .brand-symbol, .badge, .role { border: 1px solid currentColor; }
}
