/* Hallmark · shape: app screen · genre: playful · theme: Hum (deal 2/3, seed community-messenger-app-sign-f320·6bc79988·2026-11-26·r0)
 * nav: a top bar with the wordmark and its destinations, bottom tabs on the phone screens · signature: the screening sheet with its one seal · states: full, help line, disabled (loading, empty and error wait for the build)
 * axes: light/rounded-sans/chromatic-yellow · posture: full-palette · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E3 S4 R4 V5 · weakest: E, the ten screens draw the full state only; the build owes loading, empty and error */
/* Hallmark · answered F4 · .btn is the card stock control and only .btn--primary takes the pear fill, once on each screen */
/* Hallmark · answered F7 · every pill here is a control or a live count: nav links, segment labels, step markers, unread badges */
@import url("./tokens.css");
@import url("./base.css");

html { background: var(--color-paper); }
body { background: var(--grain), var(--color-paper); font-weight: var(--weight-body); word-break: keep-all; overflow-wrap: break-word; }
b, strong { font-weight: var(--weight-strong); }
h1, h2, h3 { line-height: 1.25; }
a { color: var(--color-accent-2); }
.ic { width: var(--icon); height: var(--icon); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.num { font-variant-numeric: tabular-nums; }

/* 틀 */
.page { min-height: 100dvh; display: flex; flex-direction: column; }
.app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); width: 100%; max-width: var(--container); height: 100dvh; margin-inline: auto; }
.app--room { grid-template-rows: auto auto minmax(0, 1fr) auto; max-width: var(--measure-room); }
.app--tabs { grid-template-rows: auto minmax(0, 1fr) auto; max-width: var(--measure-room); }
.bar { display: flex; align-items: center; gap: var(--space-md); min-height: var(--bar-h); padding-inline: var(--app-gutter); border-bottom: 1px solid var(--color-rule); }
.page > .bar, .page > .subnav { padding-inline: max(var(--app-gutter), calc((100% - var(--container)) / 2 + var(--app-gutter))); }
.bar__title { max-width: none; min-width: 0; overflow: hidden; font-size: var(--text-lg); text-overflow: ellipsis; white-space: nowrap; }
.bar__end { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; margin-inline-start: auto; }
.wordmark { color: var(--color-ink); font-size: var(--text-lg); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); text-decoration: none; white-space: nowrap; }
.nav, .subnav { display: flex; gap: var(--space-2xs); min-width: 0; overflow-x: auto; }
.subnav { padding-block: var(--space-xs); border-bottom: 1px solid var(--color-rule); }
.nav a, .subnav a { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--control-h); padding: 0 var(--space-sm); border-radius: var(--radius-pill); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: var(--weight-strong); text-decoration: none; white-space: nowrap; }
.nav a[aria-current="page"] { background: var(--color-ink); color: var(--color-paper); }
.subnav a[aria-current="page"] { background: var(--color-paper-3); color: var(--color-ink); }
@media (hover: hover) { .nav a:not([aria-current]):hover, .subnav a:not([aria-current]):hover { background: var(--color-paper-2); } }
.me { display: flex; align-items: baseline; gap: var(--space-xs); font-size: var(--text-sm); white-space: nowrap; }
.me__name { font-weight: var(--weight-strong); }
.me__rank { color: var(--color-muted); }
@media (max-width: 40rem) { .me { display: none; } }
.count { display: inline-grid; place-items: center; min-width: var(--badge); height: var(--badge); padding: 0 var(--space-2xs); border-radius: var(--radius-pill); background: var(--color-accent-3); color: var(--color-ink); font-size: var(--text-xs); font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; line-height: 1; }

.narrow, .wide { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--space-lg); width: 100%; margin-inline: auto; padding: var(--space-lg) var(--app-gutter) var(--space-2xl); }
.narrow { max-width: var(--measure-form); }
.wide { max-width: var(--container); }
.head { display: grid; gap: var(--space-xs); }
.head--row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-lg); }
.alt { font-size: var(--text-sm); color: var(--color-ink-2); }
.well { max-width: none; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-stock); background: var(--color-paper-2); color: var(--color-ink-2); font-size: var(--text-sm); }

/* 누르는 것 */
.btn { --e: var(--edge); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: var(--control-h); padding: 0 var(--space-md); border: 0; border-radius: var(--radius-input); background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-rule), 0 var(--e) 0 0 var(--color-edge); color: var(--color-ink); font-size: var(--text-sm); font-weight: var(--weight-strong); line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: translate var(--dur-micro) var(--ease-snap), box-shadow var(--dur-micro) var(--ease-snap); }
@media (hover: hover) { .btn:hover { --e: calc(var(--edge) + 1px); translate: 0 -1px; } }
.btn:active { --e: 1px; translate: 0 2px; }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; translate: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn--primary { background: var(--color-accent); box-shadow: 0 var(--e) 0 0 var(--color-accent-deep); color: var(--color-accent-ink); }
.btn--plain { background: transparent; box-shadow: none; color: var(--color-ink-2); }
@media (hover: hover) { .btn--plain:hover { background: var(--color-paper-2); translate: none; } }
.btn--danger { color: var(--color-error); }
.btn--lg { min-height: var(--control-h-lg); padding: 0 var(--space-lg); font-size: var(--text-md); }
.btn--block { width: 100%; }
.icon-btn { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; width: var(--control-h); height: var(--control-h); border: 0; border-radius: var(--radius-input); background: transparent; color: var(--color-ink-2); cursor: pointer; }
.icon-btn::before { content: ""; position: absolute; inset: calc(-1 * var(--space-2xs)); }
@media (hover: hover) { .icon-btn:hover { background: var(--color-paper-3); } }
.icon-btn:active { translate: 0 1px; }
.icon-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.icon-btn:disabled { opacity: 0.55; cursor: not-allowed; translate: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover, .btn:active, .icon-btn:active { translate: none; } }

/* 적는 칸 */
.form { display: grid; gap: var(--space-md); }
.field { display: grid; align-content: start; gap: var(--space-2xs); min-width: 0; }
.field > label, .label, legend { padding: 0; font-size: var(--text-sm); font-weight: var(--weight-strong); }
.req { margin-inline-start: var(--space-2xs); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-body); }
.input, .select, .textarea { width: 100%; min-height: var(--control-h); padding: 0 var(--space-sm); border: 1px solid var(--color-muted); border-radius: var(--radius-input); background: var(--color-card); color: var(--color-ink); font-size: var(--text-md); outline: 2px solid transparent; outline-offset: -3px; }
.textarea { min-height: 6rem; padding-block: var(--space-xs); line-height: 1.5; resize: vertical; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline-color: var(--color-focus); }
@media (hover: hover) { .input:hover, .select:hover, .textarea:hover { background: var(--color-paper); } }
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--color-error); }
.help { min-height: 1lh; max-width: none; color: var(--color-muted); font-size: var(--text-sm); }
.help--error { color: var(--color-error); }
input[type="checkbox"], input[type="radio"] { flex-shrink: 0; width: var(--box); height: var(--box); margin: 0; accent-color: var(--color-ink); }
.check { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: var(--control-h); font-size: var(--text-sm); cursor: pointer; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); min-width: 0; margin: 0; padding: 0; border: 0; }
.choices legend { margin-bottom: var(--space-2xs); }
.choice { display: flex; align-items: center; gap: var(--space-xs); min-height: var(--control-h-lg); padding: 0 var(--space-sm); border-radius: var(--radius-input); background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-rule); cursor: pointer; }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--color-ink); }
.choice:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.seg { position: relative; display: flex; flex-wrap: wrap; gap: var(--space-2xs); min-width: 0; margin: 0; padding: 0; border: 0; }
.seg legend { margin-bottom: var(--space-2xs); }
.seg input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.seg label { display: inline-flex; align-items: center; min-height: var(--control-h); padding: 0 var(--space-md); border-radius: var(--radius-pill); background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-rule); font-size: var(--text-sm); white-space: nowrap; cursor: pointer; }
.seg input:checked + label { background: var(--color-ink); box-shadow: none; color: var(--color-paper); }
.seg input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.seg--tint input:checked + label { background: var(--tint, var(--color-paper-3)); box-shadow: inset 0 0 0 2px var(--color-ink); color: var(--color-ink); }
.seg--tint label { background: var(--tint, var(--color-paper-3)); box-shadow: none; }

/* 순서 표시 */
.steps { display: flex; gap: var(--space-2xs); margin: 0; padding: 0; overflow-x: auto; list-style: none; font-size: var(--text-sm); }
.steps li { display: inline-flex; align-items: center; min-height: var(--chip-h); padding: 0 var(--space-sm); border-radius: var(--radius-pill); color: var(--color-muted); white-space: nowrap; }
.steps li[aria-current="step"] { background: var(--color-ink); color: var(--color-paper); font-weight: var(--weight-strong); }
.steps .is-done { color: var(--color-ink-2); }
/* 다섯 단계가 좁은 화면에서도 한 줄에 들어가게 */
@media (max-width: 30rem) { .steps li { padding: 0 var(--space-xs); } }
@media (max-width: 24rem) { .steps { gap: var(--space-3xs); font-size: var(--text-xs); } }

/* 심사서: 이 앱의 얼굴 */
.sheet { position: relative; display: grid; gap: var(--space-md); padding: var(--space-lg); border-radius: var(--radius-card); background: var(--grain), var(--color-card); box-shadow: var(--shadow-card); }
.sheet--compact { gap: var(--space-xs); padding: var(--space-md); }
.sheet > h1, .sheet > h2 { padding-inline-end: var(--space-3xl); }
.seal { position: absolute; inset-block-start: var(--space-md); inset-inline-end: var(--space-md); padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-pill); background: var(--color-accent); box-shadow: 0 2px 0 0 var(--color-accent-deep); color: var(--color-accent-ink); font-size: var(--text-sm); font-weight: var(--display-weight); rotate: var(--seal-tilt); white-space: nowrap; }
.seal--ok { background: var(--color-mint); box-shadow: 0 2px 0 0 var(--color-mint-deep); }
.qa { display: grid; gap: var(--space-sm); margin: 0; }
.qa > div { display: grid; gap: var(--space-3xs); }
.qa dt { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.qa dd { margin: 0; overflow-wrap: break-word; }
.more summary { display: inline-flex; align-items: center; min-height: var(--control-h); color: var(--color-accent-2); font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 0.16em; cursor: pointer; }
.more summary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.status { display: grid; gap: var(--space-sm); padding: var(--space-md) var(--app-gutter) var(--space-xs); }

/* 칸 나누기 */
.panes { display: grid; grid-template-columns: var(--pane-list) minmax(0, 1fr) var(--pane-side); min-height: 0; }
.panes--two { grid-template-columns: var(--pane-list) minmax(0, 1fr); }
.pane { min-width: 0; min-height: 0; border-inline-start: 1px solid var(--color-rule); }
.pane:first-child { border-inline-start: 0; }
.pane--list { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.pane--list > .rows { overflow-y: auto; }
.pane__head { display: grid; gap: var(--space-xs); padding: var(--space-md) var(--space-md) var(--space-xs); }
.pane__title { max-width: none; font-size: var(--text-lg); }
.pane--side { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.side__scroll, .scroll { min-height: 0; overflow-y: auto; }
.side__scroll { padding: var(--space-md); }
/* 좁은 화면: data-show 에 맞는 칸 하나만 보여요 (list → .pane--list, chat → .chat, side → .pane--side). 안 적으면 대화 칸. */
@media (max-width: 60rem) {
  .panes, .panes--two { grid-template-columns: minmax(0, 1fr); }
  .panes > .pane { display: none; border-inline-start: 0; }
  .panes[data-show="list"] > .pane--list, .panes[data-show="chat"] > .chat, .panes[data-show="side"] > .pane--side, .panes:not([data-show]) > .chat { display: grid; }
}
.pills { display: flex; gap: var(--space-2xs); overflow-x: auto; }
.pills a { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: var(--control-h); padding: 0 var(--space-sm); border-radius: var(--radius-pill); color: var(--color-ink-2); font-size: var(--text-sm); font-weight: var(--weight-strong); text-decoration: none; white-space: nowrap; }
.pills a[aria-current="true"] { background: var(--color-ink); color: var(--color-paper); }
@media (hover: hover) { .pills a:not([aria-current]):hover { background: var(--color-paper-2); } }

/* 줄 목록 */
.rows { display: grid; align-content: start; gap: var(--space-3xs); margin: 0; padding: var(--space-xs); list-style: none; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-sm); width: 100%; padding: var(--space-xs) var(--space-sm); border: 0; border-radius: var(--radius-stock); background: transparent; color: var(--color-ink); font-size: var(--text-md); text-align: start; text-decoration: none; cursor: pointer; }
.row[aria-current="true"] { background: var(--color-paper-3); }
@media (hover: hover) { .row:not([aria-current]):hover { background: var(--color-paper-2); } }
.row:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.row__main { display: grid; min-width: 0; }
.row__name { overflow: hidden; font-weight: var(--weight-strong); text-overflow: ellipsis; white-space: nowrap; }
.row__sub { overflow: hidden; color: var(--color-muted); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.row__meta { display: grid; justify-items: end; gap: var(--space-2xs); color: var(--color-muted); font-size: var(--text-xs); white-space: nowrap; }
.group__name { max-width: none; padding: var(--space-md) var(--space-md) 0; color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-strong); letter-spacing: 0; }
.avatar { position: relative; display: grid; place-items: center; flex-shrink: 0; width: var(--avatar); height: var(--avatar); border-radius: var(--radius-pill); background: var(--color-paper-3); color: var(--color-ink); font-size: var(--text-md); font-weight: var(--weight-strong); line-height: 1; }
.avatar--sm { width: var(--avatar-sm); height: var(--avatar-sm); font-size: var(--text-sm); }
.avatar--lg { width: var(--avatar-lg); height: var(--avatar-lg); font-size: var(--text-xl); }
.avatar--sugar { background: var(--color-sugar); }
.avatar--sand { background: var(--color-sand); }
.avatar--hill { background: var(--color-hill-2); }
.avatar--pear { background: var(--color-accent); }
.avatar[data-presence]::after { content: ""; position: absolute; inset-block-end: 0; inset-inline-end: 0; width: var(--dot); height: var(--dot); border: 2px solid var(--color-paper); border-radius: var(--radius-pill); background: var(--color-leaf); }
.avatar[data-presence="away"]::after { background: var(--color-sand); }
.avatar[data-presence="dnd"]::after { background: var(--color-accent-3); }
.chip { display: inline-flex; align-items: center; min-height: var(--chip-h); padding: 0 var(--space-sm); border-radius: var(--radius-pill); background: var(--tint, var(--color-paper-3)); color: var(--color-ink); font-size: var(--text-sm); font-weight: var(--weight-strong); white-space: nowrap; }
.tint-pear { --tint: var(--color-accent); }
.tint-sugar { --tint: var(--color-sugar); }
.tint-mint { --tint: var(--color-mint); }
.tint-sand { --tint: var(--color-sand); }

/* 대화 */
.chat { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.chat__head { display: flex; align-items: center; gap: var(--space-sm); min-height: var(--bar-h); padding: var(--space-xs) var(--space-md); border-bottom: 1px solid var(--color-rule); }
.chat__who { display: grid; min-width: 0; }
.chat__name { max-width: none; font-size: var(--text-md); }
.chat__sub { display: flex; gap: var(--space-xs); color: var(--color-muted); font-size: var(--text-sm); }
.msgs { display: flex; flex-direction: column; gap: var(--space-sm); min-height: 0; padding: var(--space-md); overflow-y: auto; }
.note { align-self: center; max-width: none; color: var(--color-muted); font-size: var(--text-sm); }
.msg { display: flex; align-items: flex-start; gap: var(--space-xs); max-width: min(100%, var(--bubble-max)); }
.msg__body { display: grid; justify-items: start; gap: var(--space-3xs); min-width: 0; }
.msg--me { display: grid; justify-items: end; align-self: flex-end; gap: var(--space-3xs); }
.msg__who { max-width: none; font-size: var(--text-sm); font-weight: var(--weight-strong); }
.msg__who span { margin-inline-start: var(--space-2xs); color: var(--color-muted); font-weight: var(--weight-body); }
.bubble { max-width: 100%; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-stock); background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-rule); line-height: 1.5; overflow-wrap: break-word; }
.msg--me .bubble { background: var(--color-bubble-me); box-shadow: inset 0 0 0 1px var(--color-bubble-edge); }
.msg__time { color: var(--color-muted); font-size: var(--text-xs); }
.composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-xs); padding: var(--space-sm) var(--space-md) calc(var(--space-sm) + var(--safe-b)); border-top: 1px solid var(--color-rule); }
.composer--attach { grid-template-columns: auto minmax(0, 1fr) auto; }
.composer .textarea { min-height: var(--control-h); border-radius: var(--radius-stock); resize: none; }
.composer .help { grid-column: 1 / -1; }

/* 승인 칸 */
.decide { display: grid; gap: var(--space-sm); padding: var(--space-md); border-top: 1px solid var(--color-rule); }
.decide--flow { padding: 0; border-top: 0; }
.decide__pair, .decide__acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }

/* 관리 */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; gap: var(--space-xl); }
@media (max-width: 60rem) { .split { grid-template-columns: minmax(0, 1fr); } .head--row { grid-template-columns: minmax(0, 1fr); } }
.builder { display: grid; gap: var(--space-md); min-width: 0; }
.qs { display: grid; margin: 0; padding: 0; list-style: none; }
.q { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--space-sm); padding-block: var(--space-md); border-top: 1px solid var(--color-rule); }
.q__move { display: grid; }
.q__body { display: grid; gap: var(--space-xs); min-width: 0; }
.q__line { display: grid; grid-template-columns: minmax(0, 1fr) 10rem; gap: var(--space-sm); }
.q__opts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.q__opts .input { width: 10rem; }
.builder__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm); padding-top: var(--space-md); border-top: 1px solid var(--color-rule); }
.preview { display: grid; gap: var(--space-xs); min-width: 0; margin: 0; }
.preview figcaption { color: var(--color-muted); font-size: var(--text-sm); }
.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th, .table td { padding: var(--space-xs) var(--space-sm); border-bottom: 1px solid var(--color-rule); text-align: start; vertical-align: middle; white-space: nowrap; }
.table th { color: var(--color-muted); font-weight: var(--weight-strong); }
.table th:first-child, .table td:first-child { padding-inline-start: 0; }
.table th:last-child, .table td:last-child { padding-inline-end: 0; }
.table .input, .table .select { width: 9rem; font-size: var(--text-sm); }
.who { display: flex; align-items: center; gap: var(--space-sm); }
.acts { display: flex; justify-content: flex-end; gap: var(--space-2xs); }
.acts--start { justify-content: flex-start; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-sm); min-width: 0; }
.filters .input, .filters .select { width: 12rem; max-width: 100%; }
.inline-form { display: grid; gap: var(--space-md); padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); }
.inline-form__row { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-md); }
.inline-form__row .input { width: 14rem; }

/* 휴대폰 아래 탭, 프로필 */
/* 60rem 아래에서만 보여요. 탭은 셋에서 다섯까지 같은 너비로 나눠요. */
.tabs { display: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding-bottom: var(--safe-b); border-top: 1px solid var(--color-rule); background: var(--color-paper); }
@media (max-width: 60rem) { .tabs { display: grid; } .app > .bar .nav, .page:has(> .tabs) > .bar .nav { display: none; } }
.page > .tabs { position: sticky; inset-block-end: 0; z-index: var(--z-sticky); margin-top: auto; }
.tabs a { position: relative; display: grid; align-content: center; justify-items: center; gap: var(--space-3xs); min-height: var(--tab-h); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-strong); text-decoration: none; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--color-ink); }
.tabs a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.tabs__ic { position: relative; display: grid; place-items: center; min-width: var(--avatar); min-height: var(--chip-h); border-radius: var(--radius-pill); }
.tabs a[aria-current="page"] .tabs__ic { background: var(--color-ink); color: var(--color-paper); }
.tabs .count { position: absolute; inset-block-start: calc(-1 * var(--space-2xs)); inset-inline-end: calc(-1 * var(--space-xs)); }
.overlay { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; align-items: end; justify-items: center; background: var(--color-scrim); }
.profile { display: grid; justify-items: center; gap: var(--space-md); width: 100%; max-width: var(--measure-room); padding: var(--space-lg) var(--space-lg) calc(var(--space-lg) + var(--safe-b)); border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--grain), var(--color-card); text-align: center; }
.profile h2 { font-size: var(--text-xl); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin: 0; }
.facts > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3xs); min-width: 0; padding-inline: var(--space-sm); border-inline-start: 1px solid var(--color-rule); }
.facts > div:first-child { border-inline-start: 0; }
.facts dt { color: var(--color-muted); font-size: var(--text-xs); }
.facts dd { min-width: 0; margin: 0; font-weight: var(--weight-strong); overflow-wrap: anywhere; }
.profile__acts { display: grid; gap: var(--space-xs); width: 100%; }

/* ===== 실제 앱에서 더한 것. 쓰는 법은 docs/화면조각.md ===== */

/* 틀: 칸 화면 안의 하위 메뉴, 좁은 화면에서만 보이는 것 */
.app:has(> .subnav:not(.subnav--narrow)) { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.app > .subnav { padding-inline: var(--app-gutter); }
.app > main { min-width: 0; min-height: 0; overflow-y: auto; }
.app--room > .pane { border-inline-start: 0; }
.subnav--narrow, .bar__narrow, .chat__back, .chat__head > a.icon-btn:first-child { display: none; }
@media (max-width: 60rem) {
  .app:has(> .subnav--narrow) { grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .subnav--narrow { display: flex; }
  .bar--titled .bar__wide { display: none; }
  .bar__title.bar__narrow { display: block; }
  .icon-btn.bar__narrow, .chat__back, .chat__head > a.icon-btn:first-child { display: inline-grid; }
}
.pane--blank { display: grid; place-items: center; }
/* 승인 칸이 길어져도 심사서가 가려지지 않게: 넓은 화면은 승인 칸만 따로 구르고, 좁은 화면은 칸 전체가 한 번에 굴러요 */
.pane--side > .decide { max-height: 62dvh; overflow-y: auto; }
@media (max-width: 60rem) {
  .panes[data-show="side"] > .pane--side { display: block; overflow-y: auto; }
  .pane--side > .side__scroll { overflow-y: visible; }
  .pane--side > .decide { max-height: none; overflow-y: visible; padding-bottom: var(--space-lg); }
}

/* 위 막대: 숫자 칸, 내 이름(누르면 내 설정) */
.nav a, .subnav a { position: relative; }
.count[hidden] + .visually-hidden { display: none; }
.bar__end form { display: flex; margin: 0; }
a.me { align-items: center; min-height: var(--control-h); padding-inline: var(--space-sm); border-radius: var(--radius-pill); color: var(--color-ink); text-decoration: none; }
a.me[aria-current="page"] { background: var(--color-paper-3); }
@media (hover: hover) { a.me:not([aria-current]):hover { background: var(--color-paper-2); } }
a.me:focus-visible, .nav a:focus-visible, .subnav a:focus-visible, .pills a:focus-visible, .wordmark:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.nav a:focus-visible, .subnav a:focus-visible, .pills a:focus-visible { outline-offset: -2px; }

/* 알림 한 줄 */
.notice { max-width: none; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-stock); background: var(--color-ok-bg); box-shadow: inset 0 0 0 1px var(--color-ok-edge); color: var(--color-ink); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.notice--error { background: var(--color-error-bg); box-shadow: inset 0 0 0 1px var(--color-error-edge); }
.pane > .notice, .pane__head > .notice { margin: var(--space-xs) var(--space-md) 0; }
.pane__head > .notice { margin-inline: 0; }

/* 빈 화면 */
.empty { display: grid; justify-items: center; align-content: center; gap: var(--space-xs); width: 100%; max-width: var(--empty-max); margin-inline: auto; padding: var(--space-xl) var(--space-md); text-align: center; }
.empty__title { max-width: none; font-size: var(--text-lg); }
.empty__line { max-width: none; color: var(--color-muted); font-size: var(--text-sm); }
.empty__act { margin-top: var(--space-xs); }

/* 목록 묶음(채널 · 1:1), 채널 줄 */
.group { display: grid; grid-template-columns: minmax(0, 1fr); }
.group__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-md) var(--space-md) 0; }
.group__head .group__name { padding: 0; }
.group__note { max-width: none; padding: var(--space-xs) var(--space-md) 0; color: var(--color-muted); font-size: var(--text-sm); }
.avatar--channel { border-radius: var(--radius-input); background: var(--color-paper-3); color: var(--color-ink-2); font-weight: var(--display-weight); }
.avatar--mint { background: var(--color-hill-2); }
.row--still { cursor: default; }
@media (hover: hover) { .row--still:not([aria-current]):hover { background: transparent; } }

/* 대화: 줄바꿈을 그대로, 보내는 중 · 못 보냄 */
.bubble, .qa dd { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__body, .msg--me { grid-template-columns: minmax(0, 1fr); }
.msgs { overflow-x: hidden; }
.msg.is-pending .bubble { opacity: 0.6; }
.msg.is-failed .bubble { box-shadow: inset 0 0 0 1px var(--color-error); }

/* 닫힌 화면 · 오류 화면 */
.closed { flex: 1 0 auto; align-content: center; }
.closed__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.closed__acts form { display: flex; margin: 0; }

/* 적는 칸: 오류 글, 체크 묶음, 한 번만 보여 주는 값 */
.select[aria-invalid="true"] { border-color: var(--color-error); }
.help--error { font-weight: var(--weight-strong); }
.checks { display: flex; flex-wrap: wrap; gap: 0 var(--space-md); min-width: 0; margin: 0; padding: 0; border: 0; }
.checks legend { margin-bottom: var(--space-2xs); }
.checks--col { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--checks-col)), 1fr)); }
.check { min-width: 0; }
.check:has(input:disabled) { color: var(--color-muted); cursor: not-allowed; }
.code { display: inline-block; max-width: 100%; padding: var(--space-xs) var(--space-md); border-radius: var(--radius-input); background: var(--color-paper-2); box-shadow: inset 0 0 0 1px var(--color-rule); font-family: var(--font-outlier); font-size: var(--text-xl); letter-spacing: var(--code-tracking); overflow-wrap: anywhere; user-select: all; }

/* 표 안의 작은 폼 */
.cell-form { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; margin: 0; }
.table .cell--wrap { min-width: var(--cell-wrap); white-space: normal; }
.table .input--wide { width: var(--input-wide); }
.table .seg { flex-wrap: nowrap; }
.table tr.is-off { color: var(--color-muted); }

/* 한 사람 · 한 채널 화면의 뜻풀이 목록 */
.dl { display: grid; margin: 0; }
.dl > div { display: grid; grid-template-columns: var(--dl-term) minmax(0, 1fr); align-items: baseline; gap: var(--space-sm); padding-block: var(--space-xs); border-bottom: 1px solid var(--color-rule); }
.dl dt { color: var(--color-muted); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.dl dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
/* 좁은 칸에서는 긴 직위 이름(12자)이 칸 밖으로 나가지 않게 줄을 바꿔요 */
.dl dd .chip, .qa dd .chip { max-width: 100%; white-space: normal; border-radius: var(--radius-card); }

/* 프로필: 바깥을 누르면 닫히는 링크, 넓은 화면에서는 가운데 */
.overlay__scrim { position: absolute; inset: 0; }
.profile { position: relative; }
@media (min-width: 60.01rem) {
  .overlay { align-items: center; padding: var(--space-lg); }
  .profile { max-width: var(--measure-form); padding-bottom: var(--space-lg); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
}

/* 간격 도우미 (style 속성을 못 쓰니 이것으로) */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
.stack--xs { gap: var(--space-xs); }
.stack--lg { gap: var(--space-lg); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); min-width: 0; }
.muted { color: var(--color-muted); }
.small { font-size: var(--text-sm); }
