/* =========================================================
   extend.css — 디자인 핸드오프(app.css)에 없는 화면을 기존 시스템에서 파생한 스타일.
   규칙(핸드오프 README 7장): 새 색·그림자·반경을 만들지 않고 tokens.css 의 토큰만 쓴다.
   app.css·tokens.css 는 핸드오프 원본 그대로 두고 여기에만 추가한다.
   ========================================================= */

/* ---------- 문서 바탕 ---------- */
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-sans); font-size: var(--fs-base); line-height: var(--lh-tight);
  color: var(--text); background: var(--bg-app); word-break: keep-all;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.003em;
}

/* ---------- 버튼 보강 ---------- */
.btn-block { width: 100%; justify-content: center; }
.btn-danger { color: var(--urgent); }
.btn-danger:hover { background: var(--urgent-subtle); }
a.btn { text-decoration: none; }

/* ---------- 폼 필드 (S4 규칙: 라벨 위·입력 아래, 선택 항목에 "선택") ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: var(--space-4); }
.field-label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-secondary); }
.field-label .faint { font-weight: var(--fw-regular); margin-left: 2px; }
.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea,
.field select {
  width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-md);
  background: var(--bg-panel); box-shadow: inset 0 0 0 1px var(--border-strong);
  font-size: var(--fs-base); outline: none;
  transition: box-shadow var(--duration-fast) var(--ease-out);
}
.field textarea { height: auto; min-height: 80px; padding: 8px 10px; line-height: var(--lh-base); resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-disabled); }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: inset 0 0 0 1.5px var(--focus-ring); }
.field input[readonly] { background: var(--bg-subtle); color: var(--text-secondary); }
.field.has-error input, .field.has-error textarea { box-shadow: inset 0 0 0 1.5px var(--urgent); }
.field-error, .field-error ul { margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--urgent); }
.field-help { margin: 0; font-size: var(--fs-sm); color: var(--text-tertiary); line-height: var(--lh-base); }
.field-help a { color: var(--accent); }
.field-help ul { margin: 4px 0 0; padding-left: 16px; }
.field-check label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); color: var(--text-secondary); cursor: pointer; }
.field-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }

/* ---------- 인증 화면 (S13: 앱 골격 없이 중앙 폭 360 카드 하나) ---------- */
.auth {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-5); padding: var(--space-8) var(--space-4);
}
.auth-wordmark { margin: 0; }
.auth-card { width: 100%; max-width: 360px; padding: var(--space-7) var(--space-7) var(--space-6); overflow: visible; }
.auth-card-wide { max-width: 520px; }
.auth-title { margin: 0 0 var(--space-2); font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: var(--ls-title); line-height: var(--lh-tight); }
.auth-subtitle { margin: 0 0 var(--space-3); font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: var(--ls-title); }
.auth-text { margin: 0 0 var(--space-5); color: var(--text-secondary); line-height: var(--lh-base); }
.auth-text a, .auth-foot a { color: var(--accent); }
.auth-text a:hover, .auth-foot a:hover { text-decoration: underline; }
.auth-form { display: flex; flex-direction: column; }
.auth-title + .auth-form { margin-top: var(--space-4); }
.auth-actions { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-6); }
.auth-button-group { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.auth-button-group.is-vertical { flex-direction: column; }
.auth-button-group form { margin: 0; }
.auth-foot { margin: var(--space-5) 0 0; font-size: var(--fs-sm); color: var(--text-tertiary); text-align: center; line-height: var(--lh-base); }
.auth-hr { border: 0; height: 1px; background: var(--border); margin: var(--space-5) 0; }
.auth-alert { margin: 0 0 var(--space-4); padding: 10px 12px; border-radius: var(--radius-md); background: var(--urgent-subtle); color: var(--urgent); font-size: var(--fs-sm); line-height: var(--lh-base); }
.auth-alert p { margin: 0; }
.auth-messages { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: flex; flex-direction: column; gap: 6px; }
.auth-messages li { padding: 8px 12px; border-radius: var(--radius-md); background: var(--bg-subtle); color: var(--text-secondary); font-size: var(--fs-sm); line-height: var(--lh-base); }
.auth-messages li[data-level~="error"] { background: var(--urgent-subtle); color: var(--urgent); }
.auth-section + .auth-section { margin-top: var(--space-6); padding-top: var(--space-6); box-shadow: 0 -1px 0 var(--border); }
.auth-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--bg-inset); color: var(--text-secondary); font-size: var(--fs-xs); font-weight: var(--fw-medium); }
.auth-details summary { cursor: pointer; color: var(--text-secondary); font-size: var(--fs-sm); }
.auth-table td, .auth-table th { white-space: normal; }
.auth-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-4); font-size: var(--fs-sm); color: var(--text-tertiary); }
.auth-links a:hover, .auth-links .text-btn:hover { color: var(--text); }
.auth-links form { margin: 0; }
.auth-card pre, .auth-card code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--fs-sm); }
.auth-card img { max-width: 100%; height: auto; }
/* 2단계 인증 QR 코드: 휴대폰으로 찍기 충분한 크기로 제한해 입력칸이 한 화면에 들어오게 */
.auth-card img[src^="data:image"] { display: block; width: 184px; height: 184px; margin: var(--space-2) auto var(--space-4); padding: 8px; background: #fff; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--border); image-rendering: pixelated; }
.auth-links .text-btn { font-size: inherit; font-weight: inherit; color: inherit; }

@media (max-width: 420px) {
  .auth-card { padding: var(--space-6) var(--space-5); }
}

/* =========================================================
   앱 화면 (2단계) — 시안은 고정 크기라 스크롤이 막혀 있다(overflow: hidden).
   실제 앱에서는 목록·로그·정보 열이 각자 스크롤된다 (핸드오프 4장 "두 열은 독립 스크롤").
   ========================================================= */
.app { height: 100vh; height: 100dvh; }
.project-list, .log-scroll, .panel-scroll, .info-col { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.list-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel { container-type: inline-size; }

/* 패널 요청 중 상단 2px 진행선 (7.9) */
.app.is-loading-panel .panel::before { content: ""; position: absolute; top: 0; left: 0; height: 2px; width: 40%; background: var(--accent); z-index: 3; animation: pm-progress 900ms var(--ease-out) infinite; }
@keyframes pm-progress { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- 필터: 실제 체크박스·select 를 시안 모양으로 ---------- */
.chip { cursor: pointer; }
.chip:has(input:checked) { background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-raise); }
.chip:has(input:checked) .count { color: var(--text-tertiary); }
.chip:has(input:checked) .sg { opacity: 1; }
.chip:has(input:focus-visible), .toggle:has(input:focus-visible), .dropdown:has(select:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
#active-filters:empty { display: none; }
.toggle { cursor: pointer; }
.toggle .check svg { opacity: 0; width: 10px; height: 10px; stroke-width: 2.5; }
.toggle:has(input:checked) { color: var(--text); }
.toggle:has(input:checked) .check { background: var(--accent); box-shadow: none; color: #fff; }
.toggle:has(input:checked) .check svg { opacity: 1; }
.dropdown { position: relative; cursor: pointer; }
.dropdown select { appearance: none; -webkit-appearance: none; border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; outline: none; }
.dropdown select option { color: var(--text); background: var(--bg-panel); }

/* ---------- 목록 ---------- */
a.project-item { cursor: pointer; }
.list-empty { padding: 16px 12px; font-size: var(--fs-sm); color: var(--text-tertiary); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.list-empty p { margin: 0; }

/* 창 폭별 밀도 (README 3.4) — 항목마다 is-mid/is-compact 를 붙이는 대신 .app[data-density] 로 같은 규칙 적용 */
.app[data-density="mid"] .project-item { padding: 8px 12px 9px; }
.app[data-density="mid"] .project-item .pi-log { display: none; }
.app[data-density="compact"] .project-item { padding: 6px 10px 6px 16px; gap: 0; border-radius: var(--radius-md); }
.app[data-density="compact"] .project-item::before { content: ""; position: absolute; left: 7px; top: 50%; width: 3px; height: 12px; margin-top: -6px; border-radius: 2px; background: var(--s); }
.app[data-density="compact"] .project-item .pi-meta, .app[data-density="compact"] .project-item .pi-log { display: none; }
.app[data-density="compact"] .project-item .pi-name { font-size: var(--fs-sm); line-height: 17px; }
.app[data-density="compact"] .project-item .dday { font-size: var(--fs-xs); }
/* 컴팩트: 필터는 한 줄 요약(.filter-summary)으로 접고, 누르면(F) 펼친다 */
.filters .filter-summary { display: none; margin: 0; cursor: pointer; }
.filters .filter-summary svg { margin-left: 4px; flex: none; }
.app[data-density="compact"] .filters .filter-summary { display: flex; }
.app[data-density="compact"] .filters:not(.is-expanded) .chips,
.app[data-density="compact"] .filters:not(.is-expanded) .filter-row { display: none; }
.app[data-density="compact"] .filters.is-expanded .filter-summary svg { transform: rotate(180deg); }
.app[data-density="compact"] .cmdk span:not(.kbd) { display: none; }
.app[data-density="compact"] .cmdk { width: auto; }
.app[data-density="compact"] .wordmark { font-size: 0; gap: 0; margin-right: 8px; }

/* 휴대폰 폭 (< 520): 목록 ↔ 상세 1단 전환 (PLAN 4.2 예외) */
.app[data-density="phone"] .main { grid-template-columns: 100%; padding: 0 6px; }
.app[data-density="phone"] .panel { display: none; }
.app[data-density="phone"].has-open .sidebar { display: none; }
.app[data-density="phone"].has-open .panel { display: flex; }

/* ---------- 상단 바: 계정 메뉴 ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 220px; padding: 6px; border-radius: var(--radius-lg); background: var(--bg-panel); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }
.menu-pop form { margin: 0; }
.menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.menu-head .faint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-md); background: none; color: var(--text); font-size: var(--fs-base); text-align: left; cursor: pointer; }
.menu-row svg { color: var(--text-tertiary); }
.menu-row:hover, .menu-row:focus-visible { background: var(--bg-hover-panel); outline: none; }

/* ---------- 토스트 (7.9: 작업 패널 하단 좌측) ---------- */
.toasts { position: fixed; left: calc(var(--list-w, var(--list-w-full)) + 24px); bottom: calc(var(--statusbar-h) + 16px); z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; pointer-events: none; }
.app[data-density="mid"] .toasts { left: calc(var(--list-w-mid) + 24px); }
.app[data-density="compact"] .toasts { left: calc(var(--list-w-compact) + 24px); }
.app[data-density="phone"] .toasts { left: 16px; }
.toasts .toast { pointer-events: auto; animation: pm-toast-in var(--duration-base) var(--ease-out); }
.toast-timer { width: 100%; transform-origin: left; animation: pm-toast-timer linear forwards; }
@keyframes pm-toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes pm-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 오늘의 요약 (S1) ---------- */
.today { max-width: 860px; }
.today-head { display: flex; align-items: flex-end; gap: 16px; }
.today-title { margin: 0; font-size: 22px; font-weight: var(--fw-semibold); letter-spacing: -0.015em; }
.today-head .seg-tabs { margin-left: auto; }
.today-stats { margin-top: 20px; }
.stat { cursor: pointer; }
.stat-num.is-zero { color: var(--text-disabled); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; margin-top: 28px; }
.today-activity { margin-top: 28px; }
.row-list { border-top: 1px solid var(--border); }
.row-empty { margin: 0; padding: 10px 0; font-size: var(--fs-sm); color: var(--text-tertiary); border-bottom: 1px solid var(--border); }
.due-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 12px; height: 34px; border-bottom: 1px solid var(--border); padding: 0 8px; margin: 0 -8px; border-radius: 6px; }
.due-row:hover { background: var(--bg-hover-panel); }
.due-row-main { display: flex; gap: 8px; align-items: center; min-width: 0; }
.due-row-main .trunc { font-weight: var(--fw-medium); }
.due-row-main .is-strong { font-weight: var(--fw-semibold); }
.due-row-client, .due-row-date { font-size: var(--fs-sm); }
.act-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; min-height: 36px; border-bottom: 1px solid var(--border); padding: 6px 8px; margin: 0 -8px; border-radius: 6px; }
.act-row:hover { background: var(--bg-hover-panel); }
.act-project { font-weight: var(--fw-medium); }
.act-time { font-size: var(--fs-sm); }
.task-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; min-height: 34px; border-bottom: 1px solid var(--border); }
.task-row a { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.task-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-project { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
.task-row .todo-check { margin-top: 0; cursor: pointer; }
.task-row .dday { font-size: var(--fs-xs); }
@container (max-width: 640px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-inner { padding: 22px 20px 32px; }
}

/* ---------- 프로젝트 상세 (S2) ---------- */
.detail-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.detail-wrap > .detail { flex: 1; }
.crumbs a:hover { color: var(--text); }
.crumbs .trunc { max-width: 40ch; }
.crumbs .crumb-parent .trunc { max-width: 24ch; }
.crumb-client, .crumb-parent { display: contents; }
.icon-btn-sm { width: 26px; height: 26px; }
.icon-btn[disabled] { opacity: .4; cursor: default; }
.menu-row.is-danger, .text-btn.is-danger { color: var(--urgent); }
.menu-row.is-danger svg { color: var(--urgent); }
.toolbar-end .menu-pop { width: 180px; }
.log-empty, .aside-empty { margin: 16px 0; font-size: var(--fs-sm); color: var(--text-tertiary); }
.aside-empty { margin: 0; }
.aside-empty a { color: var(--accent); }
.log-body { min-width: 0; }
.log-note .prose { overflow-wrap: anywhere; }
.log-note.is-editing { padding: 10px 0; }
.log-note.is-editing .composer textarea { min-height: 64px; }
.log-note.is-editing .composer-foot { gap: 12px; margin-top: 6px; }
.log-event > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.composer textarea { max-height: 40vh; overflow-y: auto; }
.composer:focus-within { background: var(--bg-panel); box-shadow: inset 0 0 0 1.5px var(--focus-ring), 0 0 0 4px var(--accent-subtle); }
.desc-body.is-expanded { max-height: none; }
.desc-body.is-expanded::after { display: none; }
.info-col .fade-more::after { background: linear-gradient(to bottom, transparent, var(--bg-subtle)); }
.info-props { padding-top: 10px; padding-bottom: 14px; }
.info-props .timeline-bar { margin: 6px 0 0 64px; }
.schedule-row { justify-content: space-between; }
button.tag { border: 0; cursor: pointer; }
button.tag:hover { background: var(--bg-hover); color: var(--text); }

/* 선택기 팝오버 (S9 파생: .palette 축소형, --shadow-pop, radius 8) */
.picker { position: relative; }
.picker > summary { list-style: none; cursor: pointer; }
.picker > summary::-webkit-details-marker { display: none; }
.picker[open] > summary { background: var(--bg-hover-panel); }
.picker-pop { position: absolute; z-index: 30; left: -8px; top: calc(100% + 4px); width: 240px; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: var(--radius-lg); background: var(--bg-panel); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 1px; margin: 0; }
.picker-pop.is-narrow { width: 160px; }
.picker-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-md); background: none; color: var(--text); font-size: var(--fs-base); text-align: left; cursor: pointer; flex: none; }
.picker-row:hover, .picker-row:focus-visible { background: var(--accent-subtle); outline: none; }
.picker-row.is-current { font-weight: var(--fw-medium); }
.picker-row input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.picker-check { margin-left: auto; color: var(--accent); }
.picker-icon { width: 12px; display: inline-grid; place-items: center; }
.picker-tags { display: flex; flex-direction: column; gap: 1px; max-height: 200px; overflow-y: auto; }
.picker-new { display: flex; gap: 6px; padding: 6px 4px 2px; margin-top: 4px; border-top: 1px solid var(--border); }
.picker-new input { flex: 1; min-width: 0; height: 26px; padding: 0 8px; border: 0; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--border-strong); background: var(--bg-panel); font-size: var(--fs-sm); outline: none; }
.picker-new input:focus { box-shadow: inset 0 0 0 1.5px var(--focus-ring); }
.prop-value .tag-add { height: 22px; padding: 0 6px; margin-left: 0; font-size: var(--fs-sm); color: var(--text-tertiary); }

/* 할 일 */
.todo-check { cursor: pointer; }
.todo-check svg { width: 10px; height: 10px; stroke-width: 2.5; }
.todo-text { border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; cursor: text; overflow-wrap: anywhere; min-width: 0; }
.todo-done > summary { list-style: none; cursor: pointer; }
.todo-done > summary::-webkit-details-marker { display: none; }
.todo-done[open] > summary svg { transform: rotate(90deg); }
.todo-done .todo-list { margin-top: 2px; }
.todo-add { cursor: text; }
.todo-add input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; color: var(--text); }
.todo-add input::placeholder { color: var(--text-tertiary); }
.todo-add:focus-within { background: var(--bg-panel); box-shadow: inset 0 0 0 1.5px var(--focus-ring); }
.todo-add:focus-within .kbd { display: none; }
.todo-edit { display: flex; flex-direction: column; gap: 8px; padding: 8px; margin: 2px -8px; border-radius: var(--radius-md); background: var(--bg-panel); box-shadow: inset 0 0 0 1.5px var(--focus-ring); }
.todo-edit > input, .todo-edit select, .todo-edit-field input { height: 28px; padding: 0 8px; border: 0; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--border-strong); background: var(--bg-panel); font: inherit; color: var(--text); outline: none; min-width: 0; }
.todo-edit > input:focus, .todo-edit select:focus, .todo-edit-field input:focus { box-shadow: inset 0 0 0 1.5px var(--focus-ring); }
.todo-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.todo-edit-field { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-xs); }
.todo-edit-field select, .todo-edit-field input { width: 100%; font-size: var(--fs-sm); }
.todo-edit-actions { display: flex; align-items: center; gap: 10px; }

/* 상세 1열 전환 — 패널 폭 < 820 (README 3.4: 시안 없음, 규칙으로 구현) */
@container (max-width: 819px) {
  .detail.is-split { display: flex; flex-direction: column; overflow-y: auto; }
  .detail.is-split .info-col { order: -1; border-left: 0; border-bottom: 1px solid var(--border); overflow: visible; flex: none; }
  .detail.is-split .info-col::after { display: none; }
  .detail.is-split .log-col { flex: none; min-height: auto; }
  .detail.is-split .log-scroll { overflow: visible; }
  .detail.is-split .log-scroll::after { display: none; }
  .log-col-head { padding: 0 20px; }
  .log-scroll { padding: 0 20px 24px; }
  .crumbs .crumb-client { display: none; }
  /* 시안 S2-1024: 1열에서는 상태 세그먼트를 폭 전체로 늘리지 않고 내용만큼 */
  .detail.is-split .info-col .segment.is-fill { display: inline-grid; grid-template-columns: repeat(5, auto); width: auto; max-width: 100%; }
  .detail.is-split .info-col .segment.is-fill .segment-btn { padding: 0 10px; }
  .detail.is-split .info-col .timeline-bar { max-width: 320px; }
}

/* ---------- 프로젝트 등록·수정 (S4) ---------- */
.pform { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pform-inner { max-width: 640px; }
.pform-title { margin: 0 0 var(--space-6); font-size: 22px; font-weight: var(--fw-semibold); letter-spacing: -0.015em; }
.pform fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pform legend { padding: 0; margin-bottom: 6px; }
.field + .field-pair, .field-pair + .field, .field-pair + .field-pair { margin-top: var(--space-4); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.field-pair > .field + .field { margin-top: 0; }
.field .segment { margin-top: 0; }
.segment-btn { cursor: pointer; }
.segment-btn:has(input:checked) { background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-raise); }
.segment-btn:has(input:checked) .sg { opacity: 1; }
.segment-btn:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.segment.is-fill.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.date-preview-slot { min-height: 16px; }
.date-preview { font-size: var(--fs-sm); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.date-preview.is-error { color: var(--urgent); }
.quick-dates { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 -9px; }
.pform-actions { display: flex; align-items: center; gap: 8px; padding: 12px 40px; border-top: 1px solid var(--border); background: var(--bg-panel); flex: none; }
@container (max-width: 640px) {
  .field-pair { grid-template-columns: minmax(0, 1fr); }
  .pform-actions { padding: 12px 20px; }
}

/* ---------- 확인 대화상자 (S11: 폭 400, --shadow-modal, 버튼 안에 키 표기) ---------- */
.dialog-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; place-items: start center; padding-top: 18vh; animation: pm-fade var(--duration-fast) var(--ease-out); }
.dialog { width: min(400px, calc(100vw - 32px)); padding: 20px 20px 16px; border-radius: 12px; background: var(--bg-panel); box-shadow: var(--shadow-modal); font-family: var(--font-sans); }
.dialog-text { margin: 0 0 18px; font-size: var(--fs-base); line-height: var(--lh-base); color: var(--text); word-break: keep-all; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-danger-solid { background: var(--urgent); color: #fff; box-shadow: none; }
.btn-danger-solid:hover { background: var(--urgent); filter: brightness(.95); }
.btn-danger-solid .kbd { background: rgba(255, 255, 255, .18); color: inherit; }
@keyframes pm-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 멤버 관리 (S14) ---------- */
.members { max-width: 860px; }
.members-sec + .members-sec { margin-top: var(--space-7); }
.invite-row { display: flex; gap: 8px; max-width: 520px; }
.invite-row input { flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 0; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--border-strong); background: var(--bg-panel); font: inherit; color: var(--text); outline: none; }
.invite-row input:focus { box-shadow: inset 0 0 0 1.5px var(--focus-ring); }
.members-sec .field-help, .members-sec .field-error { margin-top: 8px; }
.member-name { display: inline-flex; align-items: center; gap: 8px; }
.table tr.is-inactive td { color: var(--text-tertiary); }
.members .table td.r { white-space: nowrap; }
.table-wrap { overflow-x: auto; max-width: 100%; }
@container (max-width: 640px) { .table .col-wide { display: none; } }

/* ---------- 정보 열 발주 섹션 ---------- */
.aside-sum { color: var(--text-secondary); letter-spacing: 0; font-weight: var(--fw-medium); }
button.mini-order-top { border: 0; background: none; padding: 0; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.mini-order-top:hover .order-vendor { color: var(--accent-strong); }
.mini-order-content { font-size: var(--fs-sm); min-width: 0; }
.mini-order-foot { display: flex; align-items: center; gap: 8px; }
.mini-order-foot .btn { margin-left: auto; }
.mini-order .steps .step-line { width: 12px; margin: 0 5px; }
.mini-order-done { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: baseline; width: 100%; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px); border: 0; border-radius: var(--radius-md); background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-secondary); text-align: left; cursor: pointer; }
.mini-order-done:hover { background: var(--bg-hover-panel); }
.mini-order-done .order-vendor { font-weight: var(--fw-medium); }
.mini-order-done .amount { font-size: var(--fs-sm); }
.order-add { width: calc(100% + 16px); border: 0; background: none; font: inherit; cursor: pointer; margin-top: 6px; }
.order-add .kbd { margin-left: auto; }

/* ---------- 발주 입력 시트 (S5 결정: 작업 패널 위 시트 — 목록은 그대로 보인다) ---------- */
.main { position: relative; }
.sheet-host { position: absolute; top: 0; bottom: 8px; right: 8px; left: var(--list-w, var(--list-w-full)); z-index: 30; display: flex; justify-content: flex-end; border-radius: var(--radius-panel); overflow: hidden; }
.app[data-density="mid"] .sheet-host { left: var(--list-w-mid); }
.app[data-density="compact"] .sheet-host { left: var(--list-w-compact); }
.app[data-density="phone"] .sheet-host { left: 6px; right: 6px; }
.sheet-host:empty { display: none; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); animation: pm-fade var(--duration-fast) var(--ease-out); }
.sheet { position: relative; display: flex; flex-direction: column; width: min(520px, 100%); height: 100%; background: var(--bg-panel); box-shadow: var(--shadow-modal); font-family: var(--font-sans); animation: pm-sheet-in var(--duration-base) var(--ease-out); }
@keyframes pm-sheet-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 12px 24px; flex: none; }
.sheet-heading { min-width: 0; flex: 1; }
.sheet-title { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: var(--ls-title); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 24px 20px; }
.sheet-body .field-help { margin: 8px 0 0; }
.sheet-body .field-help + .field { margin-top: var(--space-4); }
.sheet-foot { display: flex; align-items: center; gap: 8px; padding: 12px 20px 12px 24px; border-top: 1px solid var(--border); flex: none; }
.field-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: var(--space-4); }
.field-trio > .field + .field { margin-top: 0; }
.field .amount-input { text-align: right; font-variant-numeric: tabular-nums; font-weight: var(--fw-medium); }
.amount-preview { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.date-preview.is-warn { color: var(--warn); }
@container (max-width: 480px) { .field-trio { grid-template-columns: minmax(0, 1fr); } }
.sheet { container-type: inline-size; }

/* ---------- 발주 현황 (S6) — 시안의 인라인 스타일을 클래스로 ---------- */
.orders-page { padding: 24px 32px 32px; }
.orders-head { display: flex; align-items: center; gap: 12px; }
.orders-title { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.orders-range { font-size: var(--fs-sm); }
.orders-head .btn { margin-left: auto; }
.orders-filters { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.seg-tab { cursor: pointer; }
.seg-tab:has(input:checked) { background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-raise); }
.seg-tab:has(input:checked) .count { color: var(--text-tertiary); }
.seg-tab:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.dropdown.is-boxed { border: 1px solid var(--border); height: 30px; padding: 0 8px; }
.orders-search { width: 240px; height: 30px; margin-left: auto; }
.order-summary { margin: 16px 0 6px; }
.orders-table { table-layout: fixed; }
.orders-table .c-date { width: 64px; }
.orders-table .c-project { width: 25%; }
.orders-table .c-vendor { width: 136px; }
.orders-table .c-amount { width: 112px; }
.orders-table .c-stage { width: 104px; }
.orders-table .c-action { width: 76px; }
.orders-table .order-project { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orders-table td.trunc { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }  /* display 는 건드리지 않는다 — 반응형 숨김 규칙이 이겨야 함 */
.orders-table .cell-order, .orders-table .cell-content { display: none; color: var(--text-tertiary); }
.order-project:hover { color: var(--accent-strong); }
.order-content-btn { display: block; width: 100%; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.order-content-btn:hover { color: var(--accent-strong); }
.mini-steps { display: inline-flex; gap: 3px; align-items: center; margin-right: 6px; }
.mini-steps i { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--border-strong); }
.mini-steps i.on { background: var(--text-secondary); border-color: var(--text-secondary); }
.row-action { visibility: hidden; }
.orders-table tr.is-cursor .row-action, .orders-table tr:hover .row-action, .row-action:focus-visible { visibility: visible; }
.foot-label .faint, .foot-vat { font-weight: var(--fw-regular); }
.foot-vat { font-size: var(--fs-sm); }
.orders-empty { margin-top: 8px; }
/* 패널이 좁으면 날짜 열을 단계 표시(툴팁)로 접는다 — S6 규칙 */
@container (max-width: 900px) {
  .orders-table .col-mid { display: none; }
  /* 발주내용 열이 몇 글자밖에 안 남으므로 접고, 프로젝트 칸 둘째 줄에 내용을 보인다 */
  .orders-table .col-content { display: none; }
  .orders-table .cell-client { display: none; }
  .orders-table .cell-content { display: block; }
  .orders-table .c-project { width: auto; }
}
@container (max-width: 640px) {
  .orders-page { padding: 20px 16px 24px; }
  .orders-table .col-wide, .orders-table .col-content { display: none; }
  .orders-table .cell-client { display: none; }
  .orders-table .cell-order { display: block; }
  .orders-table .cell-content { display: none; }
  .orders-table .c-project { width: auto; }
  .orders-table .c-amount { width: 104px; }
  .orders-table .c-stage { width: 36px; }
  .orders-table .stage { font-size: 0; }  /* 좁으면 점 3개만 — 단계명은 title 툴팁 */
  .orders-table .stage .mini-steps { margin: 0; }
  .orders-table .c-action { width: 58px; }
  .orders-table td, .orders-table th { padding: 0 6px; }
  .orders-table .row-action { visibility: visible; }
  .orders-table .row-action .kbd { display: none; }
  .orders-table tfoot .foot-label { white-space: nowrap; }
  .orders-search { width: 100%; margin-left: 0; }
  .orders-head { flex-wrap: wrap; }
}

/* ---------- 오늘의 요약: 발주 블록 ---------- */
.today-side { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.today-label { display: flex; justify-content: space-between; }
.order-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.order-stats .stat + .stat { border-left: 1px solid var(--border); }
.order-stats-foot { font-size: var(--fs-sm); margin: 8px 0 0; }

/* ---------- 발주처 관리 (S7) ---------- */
.vendors { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100%; min-height: 0; }
.vendor-list-col { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--bg-subtle); }
.vendor-list-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 16px 8px 20px; }
.vendor-filters { display: flex; flex-direction: column; gap: 6px; padding: 4px 12px 8px; }
.vendor-filters .search-field { background: var(--bg-panel); box-shadow: inset 0 0 0 1px var(--border); }
.vendor-filters .toggle:hover, .vendor-filters .dropdown:hover { background: var(--bg-hover-panel); }
.vendor-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.vendor-item:hover { background: var(--bg-hover-panel); }
.vendor-meta { gap: 6px; }
.vendor-detail-col { min-width: 0; min-height: 0; overflow-y: auto; }
.vendor-detail, .vendor-form { padding: 24px 32px 32px; max-width: 760px; }
.vendor-back { display: none; margin-bottom: 12px; }
.vendor-head { display: flex; align-items: flex-start; gap: 12px; }
.vendor-head > div:first-child { flex: 1; min-width: 0; }
.vendor-actions { display: flex; gap: 6px; flex: none; }
.vendor-stats { margin-top: 18px; }
.vendor-stats .stat { cursor: default; }
.vendor-stats .stat-num { font-size: 22px; }
.vendor-stats .vendor-last { font-variant-numeric: tabular-nums; }
.vendor-props { margin-top: 16px; }
.vendor-props .prop { grid-template-columns: 84px minmax(0, 1fr); }
.prop-top { align-items: start; padding-top: 8px; }
.link { color: var(--accent-strong); }
.link:hover { text-decoration: underline; }
.vendor-history-label { margin-top: 24px; }
.vendor-history { table-layout: fixed; }
.vendor-history td.trunc { max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vendor-history .order-project { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-merge { margin-top: 24px; }
.vendor-merge summary { list-style: none; cursor: pointer; }
.vendor-merge summary::-webkit-details-marker { display: none; }
.vendor-merge[open] summary svg { transform: rotate(90deg); }
.vendor-merge .invite-row { margin-top: 10px; }
.vendor-empty { padding: 40px 32px; color: var(--text-secondary); }
.vendor-empty p { margin: 0 0 6px; }
.vendor-form .info-title { margin-bottom: var(--space-5); }
.vendor-form-actions { display: flex; gap: 8px; margin-top: var(--space-6); }
.similar-list { margin: 6px 0 8px; padding-left: 18px; }
.similar-list a { color: inherit; text-decoration: underline; }
@container (max-width: 760px) {
  .vendors { grid-template-columns: minmax(0, 1fr); }
  .vendors.has-detail .vendor-list-col { display: none; }
  .vendors:not(.has-detail) .vendor-detail-col { display: none; }
  .vendors .vendor-list-col { border-right: 0; background: none; }
  .vendor-back { display: inline-flex; }
  .vendor-detail, .vendor-form { padding: 20px 16px 24px; }
  .vendor-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vendor-history .col-wide { display: none; }
}

/* 상단 내비게이션: 좁은 창에서는 아이콘만 */
.app[data-density="compact"] .nav-link span, .app[data-density="phone"] .nav-link span { display: none; }
.app[data-density="compact"] .nav-link, .app[data-density="phone"] .nav-link { padding: 0 8px; }

/* =========================================================
   3단계 — 키보드: 명령 팔레트(S8)·도움말(S10)·선택기(S9)·입력 대화상자·리더 키
   ========================================================= */
.palette-root { position: absolute; inset: 0; z-index: 50; font-family: var(--font-sans); }
.palette-root .scrim { animation: pm-fade var(--duration-fast) var(--ease-out); }
.palette { width: min(600px, calc(100% - 32px)); top: min(96px, 10vh); }
.palette-field { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: var(--fs-md); color: var(--text); }
.palette-field::placeholder { color: var(--text-tertiary); }
.palette-hint { font-size: var(--fs-sm); white-space: nowrap; }
.palette-body { max-height: min(460px, 60vh); overflow-y: auto; }
.palette-row { cursor: pointer; }
.palette-row .trunc { flex: 0 1 auto; }
.palette-row .row-sub { flex: 1 1 auto; min-width: 0; }
.palette-row .row-end .kbd { margin-left: 2px; }
.palette-row .icon-slot .sg { width: 10px; height: 10px; }
.palette-empty { margin: 0; padding: 18px 12px; color: var(--text-tertiary); font-size: var(--fs-sm); }
.palette-foot-end { margin-left: auto; }

/* 도움말 (S10: .palette 폭 720, 영역별 2열 그리드, 각 행 라벨 … 키캡) */
.palette.help { width: min(720px, calc(100% - 32px)); }
.help-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; padding: 8px 18px 16px; max-height: min(560px, 66vh); overflow-y: auto; }
.help-group { break-inside: avoid; margin-bottom: 10px; }
.help-group h3 { margin: 10px 0 4px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-tertiary); letter-spacing: .02em; }
.help-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; font-size: var(--fs-sm); color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.help-keys { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.help-keys .faint { font-size: var(--fs-xs); margin: 0 2px; }
@media (max-width: 760px) { .help-body { grid-template-columns: minmax(0, 1fr); } }

/* 선택기 키보드 상태 */
.picker-search { width: 100%; height: 30px; padding: 0 10px; margin-bottom: 4px; border: 0; border-radius: var(--radius-md); background: var(--bg-subtle); box-shadow: inset 0 0 0 1px var(--border); font: inherit; font-size: var(--fs-sm); color: var(--text); outline: none; flex: none; }
.picker-search:focus { box-shadow: inset 0 0 0 1.5px var(--focus-ring); background: var(--bg-panel); }
.picker-row.is-active { background: var(--accent-subtle); }
.picker-empty { padding: 8px 10px; font-size: var(--fs-sm); color: var(--text-tertiary); }

/* 입력 대화상자 (날짜 지정) */
.dialog.prompt .field { margin: 0; }
.prompt-preview { margin: 6px 0 14px; }

/* 리더 키 (G·F) 안내 — 상태줄 */
.leader-hint { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }

/* =========================================================
   4단계 — 사용성 다듬기
   ========================================================= */
/* (a) 목록 폭 조절 */
.resize-handle { z-index: 5; }
.resize-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; border-radius: 1px; background: transparent; transition: background var(--duration-fast) var(--ease-out); }
.resize-handle:hover::after, .app.is-resizing .resize-handle::after { background: var(--focus-ring); }
.app[data-density="compact"] .resize-handle, .app[data-density="phone"] .resize-handle { display: none; }
.app.is-resizing, .app.is-resizing * { cursor: col-resize !important; user-select: none; }

/* (b) 열린 프로젝트로 */
.list-wrap { position: relative; }
.list-jump { cursor: pointer; z-index: 4; }
.list-jump.is-top { bottom: auto; top: 36px; }
.list-jump[hidden] { display: none; }

/* (c) 접힘 섹션: 넓은 패널에선 그냥 제목, 좁은 패널에선 눌러서 펼침 */
.aside-fold > summary { list-style: none; }
.aside-fold > summary::-webkit-details-marker { display: none; }
.aside-fold:not(.is-foldable) > summary { cursor: default; }
.aside-fold.is-foldable > summary { cursor: pointer; margin-bottom: 0; min-height: 22px; }
.aside-fold.is-foldable > summary::before { content: ""; width: 6px; height: 6px; margin-right: 8px; border: solid var(--text-tertiary); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform var(--duration-fast) var(--ease-out); flex: none; }
.aside-fold.is-foldable[open] > summary::before { transform: rotate(45deg); }
.aside-fold.is-foldable > summary > span:first-child { margin-right: auto; }
.aside-fold.is-foldable[open] > summary { margin-bottom: 10px; }

/* 키보드 커서 — 할 일·발주 카드에도 (목록·표는 app.css 에 있음) */
.mini-order.is-cursor { box-shadow: inset 0 0 0 1.5px var(--focus-ring); }
.vendor-item.is-cursor { box-shadow: inset 0 0 0 1.5px var(--focus-ring); }

/* (g) 계정 설정 — 작업 패널 안 (인증 화면 요소 스타일을 그대로 쓰되 카드 없이) */
.account-panel { max-width: 560px; }
.account-tabs { margin: 6px 0 22px; }
.account-tabs .seg-tab { text-decoration: none; }
.account-body .auth-title { font-size: var(--fs-lg); }
.account-body .auth-form { max-width: 420px; }
.account-body .btn-block { width: auto; align-self: flex-start; }
.account-body .auth-actions { flex-direction: row; }

/* ================================================================ 4.5-C 상태 화면 (S15) · 연결 상태 */
.state-panel { padding: 24px 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.state-line { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-base, 14px); color: var(--text-secondary); line-height: 1.5; }
.state-line svg { flex: none; margin-top: 3px; color: var(--text-tertiary); }
.state-line b { color: var(--text); font-weight: var(--fw-semibold); margin-right: 4px; }
.state-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-card .state-line { margin-bottom: 4px; }
.conn-state { display: inline-flex; align-items: center; gap: 5px; color: var(--urgent); font-weight: var(--fw-medium); margin-right: 12px; }
.conn-state[hidden] { display: none; }
.app.is-offline #refreshed-at { opacity: .5; }

/* ================================================================ 4.5-E 포커스 링: 스크롤 영역 안 행은 안쪽으로 (잘리지 않게) */
.project-item:focus-visible, .vendor-item:focus-visible, .todo-item:focus-visible, .mini-order:focus-visible,
.palette-row:focus-visible, .orders-table tr:focus-visible, .seg-tab:focus-visible { outline-offset: -2px; }
.picker-row:focus-visible, .menu-row:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring); }

/* ================================================================ 4.5-F 시안 대비 보정 */
/* 다크: 입력창 바탕(--bg-subtle)과 키 표시(--bg-inset)가 거의 같은 색 → 얇은 테두리로 구분 */
.composer .kbd { box-shadow: inset 0 0 0 1px var(--border); }
/* 시안 S2-640: 좁은 창에서는 새 프로젝트 버튼을 아이콘 + N 만 */
@media (max-width: 759px) {
  .topbar .btn-label { display: none; }
  .topbar .btn-primary { padding: 0 8px; }
}
.filter-summary .filter-summary-key { margin-left: auto; }
.orders-table tfoot .foot-vat { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 20px; }

/* 목록 강조는 하나만 (PLAN 13.1-A 보완): 키보드 커서가 다른 항목에 있으면 그 커서가 곧 열릴 항목이다.
   커서는 바로 카드 모양으로, 아직 패널에 남은 이전 항목의 카드는 지운다 — 0.15초 뒤 미리 보기가 따라온다 */
#project-list .project-item.is-cursor { background: var(--bg-panel); }
#project-list:has(.is-cursor) .project-item.is-open:not(.is-cursor) { background: transparent; box-shadow: none; }
#project-list:has(.is-cursor) .project-item.is-open:not(.is-cursor) .pi-name { color: inherit; }

/* ================================================================ 4.6 협업: 참여자 · 내 작업 완료 · 할 일 권한 (PLAN 13.2) */
.member-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.member-chip { position: relative; display: inline-flex; }
.member-chip.is-done .avatar { opacity: .45; }
.member-chip .member-check { position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; padding: 1px; border-radius: 50%; background: var(--status-done); color: var(--bg-panel); stroke-width: 3; }
.member-done-btn { gap: 6px; }
.my-done-label { display: inline-flex; align-items: center; gap: 4px; color: var(--status-done); font-weight: var(--fw-medium); margin-right: 6px; }
.awaiting-badge, .pi-flag { display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 6px; border-radius: 9px; font-size: var(--fs-xs, 11px); font-weight: var(--fw-medium); white-space: nowrap; flex: none; }
.awaiting-badge, .pi-awaiting { background: var(--warn-subtle); color: var(--warn); }
.pi-mydone { background: var(--status-done-subtle); color: var(--status-done); }
.pi-flag svg { width: 11px; height: 11px; }
.due-row-main .pi-flag { margin-left: 6px; }

/* 목록: 참여자 겹침 (책임자 먼저, 완료한 사람은 흐리게) */
.avatar-stack { display: inline-flex; align-items: center; flex: none; }
.avatar-stack .avatar-slot { display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--bg-app); }
.avatar-stack .avatar-slot + .avatar-slot { margin-left: -5px; }
.project-item.is-open .avatar-stack .avatar-slot, #project-list .project-item.is-cursor .avatar-stack .avatar-slot { box-shadow: 0 0 0 1.5px var(--bg-panel); }
.avatar-stack .avatar-slot.is-done .avatar { opacity: .4; }
.avatar-stack .avatar-more { margin-left: 3px; font-size: 10px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

/* 할 일: 보기 전환 · 내 할 일 강조 · 잠긴 체크 */
.todo-scope { display: flex; align-items: center; gap: 2px; margin: 0 0 6px; }
.todo-scope-btn { height: 22px; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-tertiary); font: inherit; font-size: var(--fs-xs, 11px); font-weight: var(--fw-medium); cursor: pointer; }
.todo-scope-btn:hover { color: var(--text); }
.todo-scope-btn.is-current { background: var(--bg-inset); color: var(--text); }
.todo-scope-btn .num { color: var(--text-tertiary); margin-left: 2px; }
.todo-others { margin-left: auto; font-size: var(--fs-xs, 11px); display: none; }
#info-tasks[data-scope="mine"] .todo-others { display: inline; }
#info-tasks[data-scope="mine"] .todo-item:not(.is-mine) { display: none; }
#info-tasks[data-scope="all"] .todo-item:not(.is-mine):not(.is-done) .todo-text { color: var(--text-secondary); }
.todo-check.is-locked, .todo-check:disabled { cursor: not-allowed; box-shadow: inset 0 0 0 1.5px var(--border); background: var(--bg-subtle); }
.task-row .todo-check.is-locked { opacity: .7; }
.today-awaiting { margin: 28px 0 0; }
.today-awaiting .section-label .faint { font-weight: var(--fw-regular); }

/* ================================================================ 4.7 상위·하위 프로젝트 (PLAN 13.3) */
.rel-row, .rel-list { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.rel-list { flex-direction: column; align-items: stretch; gap: 2px; }
.rel-link { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 2px 6px; margin-left: -6px; border-radius: var(--radius-md); color: var(--text); font-weight: var(--fw-medium); }
.rel-link:hover { background: var(--bg-hover-panel); color: var(--accent-strong); }
.rel-link.is-closed { color: var(--text-secondary); font-weight: var(--fw-regular); }
.rel-link .rel-state { margin-left: auto; font-size: var(--fs-xs, 11px); font-weight: var(--fw-regular); flex: none; }
.rel-row .rel-link { flex: 0 1 auto; }
.rel-add { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; padding: 2px 6px; margin-left: -6px; border-radius: var(--radius-md); color: var(--text-tertiary); font-size: var(--fs-sm); }
.rel-add:hover { background: var(--bg-hover-panel); color: var(--text); }
.rel-add .kbd { margin-left: 2px; }
.picker-pop.is-wide { width: 340px; }
.rel-option .rel-client { margin-left: auto; max-width: 40%; font-size: var(--fs-xs, 11px); }
.picker-loading { margin: 6px 8px; font-size: var(--fs-sm); }
.pi-child { display: inline-flex; flex: none; color: var(--text-tertiary); }
.pi-child svg { width: 12px; height: 12px; }
.crumbs .crumb-parent a { color: inherit; }
.crumbs .crumb-parent a:hover { color: var(--accent-strong); }

/* ================================================================ 4.8-L 작업 로그: 메모 · 변경 기록 분리 */
.log-col-head { flex-wrap: wrap; row-gap: 6px; }
.log-col-head .log-tabs { margin-left: auto; }
.log-tabs .new-dot { margin-left: 4px; }
.log-scope { display: flex; align-items: center; gap: 2px; }
.log-scope .log-others { margin-left: 6px; font-size: var(--fs-xs, 11px); }
.log-scroll:has(#log-list[data-kind="change"]) .composer { display: none; }
.log-write { display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 4px; }
#log-list[data-kind="change"] .log-event { padding-top: 5px; padding-bottom: 5px; }

/* ================================================================ 4.8-A 정보 열 정리 */
.prop-rel.is-empty:not(:has(details[open])) { display: none; }
.member-done-btn { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; margin-left: 2px; border: 0; border-radius: 11px; background: var(--bg-inset); color: var(--text-secondary); font: inherit; font-size: var(--fs-xs, 11px); font-weight: var(--fw-medium); cursor: pointer; }
.member-done-btn:hover { color: var(--text); background: var(--bg-hover-panel); }
.member-done-btn.is-done { background: var(--status-done-subtle); color: var(--status-done); }
.member-done-btn .kbd { background: none; padding: 0; min-width: 0; font-size: 10px; color: var(--text-tertiary); }
.desc-body.is-short { max-height: none; }
.desc-body.is-short::after { display: none; }

/* ================================================================ 4.8-C 입력 간소화 */
.todo-add { flex-wrap: wrap; }
.todo-add-preview { flex-basis: 100%; padding-left: 24px; font-size: var(--fs-xs, 11px); min-height: 0; }
.todo-add-preview:empty { display: none; }
.todo-add-preview .is-error { color: var(--urgent); }
.mention-menu { position: absolute; z-index: 30; min-width: 180px; max-width: 260px; padding: 4px; border-radius: 8px; background: var(--bg-panel); box-shadow: var(--shadow-pop); }
.mention-menu .picker-row { width: 100%; }
.parent-field { position: relative; }
.parent-field .picker { display: block; }
.parent-trigger { display: flex; align-items: center; width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--border-strong); background: var(--bg-panel); cursor: pointer; }
.parent-trigger:focus-visible { box-shadow: inset 0 0 0 1.5px var(--focus-ring); outline: none; }
.parent-label:not(:empty) + .parent-empty { display: none; }

/* ================================================================ 4.8-B 새 소식 배지 · 오늘의 요약 내 할 일 두 줄 */
.nav-link { position: relative; }
.nav-badge { display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; line-height: 1; }
.nav-badge[hidden] { display: none; }
.app[data-density="compact"] .nav-link .nav-badge, .app[data-density="phone"] .nav-link .nav-badge { display: inline-grid; position: absolute; top: 2px; right: 0; margin: 0; }
.app[data-density="compact"] .nav-link .nav-badge[hidden], .app[data-density="phone"] .nav-link .nav-badge[hidden] { display: none; }
.task-row-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.task-row-body .task-row-title { display: flex; align-items: center; gap: 6px; }
.task-row-body .task-row-project { font-size: var(--fs-xs, 11px); }

/* ================================================================ 4.8-D 목록 표시 아이콘 */
.pi-icon { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; flex: none; }
.pi-icon svg { width: 11px; height: 11px; stroke-width: 2.25; }
.pi-icon.pi-awaiting { background: var(--warn-subtle); color: var(--warn); }
.pi-icon.pi-mydone { background: var(--status-done-subtle); color: var(--status-done); }
/* 두 줄 '내 할 일': 기존 .task-row a(가로 배치)보다 우선 */
.task-row a.task-row-body { flex-direction: column; align-items: stretch; gap: 2px; padding: 7px 0; }
.mail-off { display: flex; align-items: flex-start; gap: 6px; color: var(--warn); }
.mail-off svg { flex: none; margin-top: 3px; }
