/* 생산스케줄 현황판 — 토큰(라이트/다크) + 컴포넌트. 인라인 스타일 없음. */
:root {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #eef1f5; --line: #dbe1e8; --line-soft: #e8ecf1;
  --text: #17202a; --muted: #56616d; --accent: #1f6fb5; --accent-soft: #e8f2fb; --focus: #0b57d0;
  --ok: #1b6e3f; --ok-soft: #e2f4e9; --warn: #8f5300; --warn-soft: #fdf0d8; --bad: #b3261e; --bad-soft: #fde8e6; --info: #1f5fa8; --info-soft: #e6eefa;
  --sat-bg: rgba(60, 80, 110, .035); --sun-bg: rgba(60, 80, 110, .09); --grid-line: rgba(60, 80, 110, .16); --grid-day: rgba(60, 80, 110, .06); --today: #d6336c;
  --shadow: 0 1px 2px rgba(20, 30, 45, .08), 0 4px 14px rgba(20, 30, 45, .07); --shadow-lg: 0 8px 30px rgba(10, 20, 35, .22);
  --radius: 10px; --font: Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Noto Sans', sans-serif;
  --label-w: 184px;
  --c0-bg: #1f6fb5; --c1-bg: #b84f08; --c2-bg: #2e7d4f; --c3-bg: #8a4fbf; --c4-bg: #b5365a; --c5-bg: #0f7c8a; --c6-bg: #e8b923; --c7-bg: #86bfe8; --c8-bg: #7a4e2d; --c9-bg: #34457a; --c10-bg: #c9473d; --c11-bg: #7f9a1f; --c12-bg: #d98cb3; --c13-bg: #e6a77a; --c14-bg: #6cc4a1; --c15-bg: #a9a3e8; --c16-bg: #6e8aa8; --c17-bg: #c8b27a; --cn-bg: #5d6874;
  --c0-fg: #fff; --c1-fg: #fff; --c2-fg: #fff; --c3-fg: #fff; --c4-fg: #fff; --c5-fg: #fff; --c6-fg: #1b1b1b; --c7-fg: #10202e; --c8-fg: #fff; --c9-fg: #fff; --c10-fg: #fff; --c11-fg: #1b1b1b; --c12-fg: #1b1b1b; --c13-fg: #1b1b1b; --c14-fg: #1b1b1b; --c15-fg: #1b1b1b; --c16-fg: #fff; --c17-fg: #1b1b1b; --cn-fg: #fff;
  --cbd: rgba(0, 0, 0, .28);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1116; --surface: #151b23; --surface-2: #1c2430; --line: #2a3441; --line-soft: #222b36;
    --text: #e6ebf1; --muted: #9ba8b6; --accent: #5aa8f0; --accent-soft: #19324a; --focus: #8ab4ff;
    --ok: #62d08f; --ok-soft: #153324; --warn: #f2b84f; --warn-soft: #3a2c10; --bad: #ff8f86; --bad-soft: #43201d; --info: #7db6f5; --info-soft: #172c47;
    --sat-bg: rgba(255, 255, 255, .02); --sun-bg: rgba(255, 255, 255, .06); --grid-line: rgba(255, 255, 255, .13); --grid-day: rgba(255, 255, 255, .05); --today: #ff6fa3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .4); --shadow-lg: 0 8px 30px rgba(0, 0, 0, .65);
    --c0-bg: #6db3f2; --c1-bg: #f09a5b; --c2-bg: #6fc48e; --c3-bg: #b997ea; --c4-bg: #ee8aa6; --c5-bg: #5bc4d1; --c6-bg: #f2d04a; --c7-bg: #c4e0f7; --c8-bg: #d1a27b; --c9-bg: #8fa1e0; --c10-bg: #ee8d84; --c11-bg: #b9cf5e; --c12-bg: #e8add0; --c13-bg: #f0c3a2; --c14-bg: #8fdcc0; --c15-bg: #c6c1f2; --c16-bg: #a3b8cd; --c17-bg: #ddcfa6; --cn-bg: #9aa8b6;
  --c0-fg: #0b0f14; --c1-fg: #0b0f14; --c2-fg: #0b0f14; --c3-fg: #0b0f14; --c4-fg: #0b0f14; --c5-fg: #0b0f14; --c6-fg: #0b0f14; --c7-fg: #0b0f14; --c8-fg: #0b0f14; --c9-fg: #0b0f14; --c10-fg: #0b0f14; --c11-fg: #0b0f14; --c12-fg: #0b0f14; --c13-fg: #0b0f14; --c14-fg: #0b0f14; --c15-fg: #0b0f14; --c16-fg: #0b0f14; --c17-fg: #0b0f14; --cn-fg: #0b0f14;
    --cbd: rgba(255, 255, 255, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1116; --surface: #151b23; --surface-2: #1c2430; --line: #2a3441; --line-soft: #222b36;
  --text: #e6ebf1; --muted: #9ba8b6; --accent: #5aa8f0; --accent-soft: #19324a; --focus: #8ab4ff;
  --ok: #62d08f; --ok-soft: #153324; --warn: #f2b84f; --warn-soft: #3a2c10; --bad: #ff8f86; --bad-soft: #43201d; --info: #7db6f5; --info-soft: #172c47;
  --sat-bg: rgba(255, 255, 255, .02); --sun-bg: rgba(255, 255, 255, .06); --grid-line: rgba(255, 255, 255, .13); --grid-day: rgba(255, 255, 255, .05); --today: #ff6fa3;
  --c0-bg: #6db3f2; --c1-bg: #f09a5b; --c2-bg: #6fc48e; --c3-bg: #b997ea; --c4-bg: #ee8aa6; --c5-bg: #5bc4d1; --c6-bg: #f2d04a; --c7-bg: #c4e0f7; --c8-bg: #d1a27b; --c9-bg: #8fa1e0; --c10-bg: #ee8d84; --c11-bg: #b9cf5e; --c12-bg: #e8add0; --c13-bg: #f0c3a2; --c14-bg: #8fdcc0; --c15-bg: #c6c1f2; --c16-bg: #a3b8cd; --c17-bg: #ddcfa6; --cn-bg: #9aa8b6;
  --c0-fg: #0b0f14; --c1-fg: #0b0f14; --c2-fg: #0b0f14; --c3-fg: #0b0f14; --c4-fg: #0b0f14; --c5-fg: #0b0f14; --c6-fg: #0b0f14; --c7-fg: #0b0f14; --c8-fg: #0b0f14; --c9-fg: #0b0f14; --c10-fg: #0b0f14; --c11-fg: #0b0f14; --c12-fg: #0b0f14; --c13-fg: #0b0f14; --c14-fg: #0b0f14; --c15-fg: #0b0f14; --c16-fg: #0b0f14; --c17-fg: #0b0f14; --cn-fg: #0b0f14; --cbd: rgba(255, 255, 255, .35);
}
.bc-0 { --bar-bg: var(--c0-bg); --bar-fg: var(--c0-fg); } .bc-1 { --bar-bg: var(--c1-bg); --bar-fg: var(--c1-fg); } .bc-2 { --bar-bg: var(--c2-bg); --bar-fg: var(--c2-fg); } .bc-3 { --bar-bg: var(--c3-bg); --bar-fg: var(--c3-fg); } .bc-4 { --bar-bg: var(--c4-bg); --bar-fg: var(--c4-fg); }
.bc-5 { --bar-bg: var(--c5-bg); --bar-fg: var(--c5-fg); } .bc-6 { --bar-bg: var(--c6-bg); --bar-fg: var(--c6-fg); } .bc-7 { --bar-bg: var(--c7-bg); --bar-fg: var(--c7-fg); } .bc-8 { --bar-bg: var(--c8-bg); --bar-fg: var(--c8-fg); } .bc-9 { --bar-bg: var(--c9-bg); --bar-fg: var(--c9-fg); } .bc-10 { --bar-bg: var(--c10-bg); --bar-fg: var(--c10-fg); } .bc-11 { --bar-bg: var(--c11-bg); --bar-fg: var(--c11-fg); } .bc-12 { --bar-bg: var(--c12-bg); --bar-fg: var(--c12-fg); } .bc-13 { --bar-bg: var(--c13-bg); --bar-fg: var(--c13-fg); } .bc-14 { --bar-bg: var(--c14-bg); --bar-fg: var(--c14-fg); } .bc-15 { --bar-bg: var(--c15-bg); --bar-fg: var(--c15-fg); } .bc-16 { --bar-bg: var(--c16-bg); --bar-fg: var(--c16-fg); } .bc-17 { --bar-bg: var(--c17-bg); --bar-fg: var(--c17-fg); } .bc-none { --bar-bg: var(--cn-bg); --bar-fg: var(--cn-fg); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 200; box-shadow: var(--shadow); }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); } .block { display: block; } .small-t { font-size: 12px; } .pad { padding: 16px; } .pad-s { padding: 0 0 10px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 아이콘 */
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ico.big { width: 40px; height: 40px; stroke-width: 1.5; color: var(--muted); }
.ico.caret { margin-left: 2px; width: 14px; height: 14px; }
.search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; font-weight: 500; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
:root[data-theme="dark"] .btn.primary { color: #0b0f14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0b0f14; } }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon.small { width: 30px; padding: 0; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0 6px; text-decoration: underline; text-underline-offset: 2px; }
.btn.link:hover { background: none; }
.btn.block { width: 100%; justify-content: center; margin-top: 12px; height: 42px; }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
:root[data-theme="dark"] .count { color: #0b0f14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .count { color: #0b0f14; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.center-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; }
.login-card { width: min(420px, 92vw); padding: 28px 26px; display: grid; gap: 8px; justify-items: stretch; }
.login-card h1 { font-size: 22px; margin-top: 8px; }
.login-card label { font-weight: 600; margin-top: 10px; display: block; font-size: 13px; }
.login-card input { width: 100%; height: 42px; margin-top: 4px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.big-ico { font-size: 40px; }
.brand-mark svg { display: block; } .bm-bg { fill: var(--accent); } .bm-fg { fill: #fff; } .bm-2 { opacity: .85; } .bm-3 { opacity: .7; }
.lang-mini { text-align: right; margin-top: 4px; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--info-soft); color: var(--info); font-size: 13px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.notice.warn .ico { margin-top: 3px; }
.error-text { color: var(--bad); font-size: 13px; font-weight: 500; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 앱 바 */
.app-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.app-title h1 { font-size: 19px; line-height: 1.2; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 12px; }
.app-actions { display: flex; gap: 10px; align-items: center; }
.user-name { font-size: 13px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 16px 24px 40px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.stage, .view { min-width: 0; }
main:focus { outline: none; }

/* 공장 칩 */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 14px; min-width: 76px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; text-align: left; line-height: 1.25; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .chip.on { color: #0b0f14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { color: #0b0f14; } }
.chip-name { font-weight: 700; font-size: 14px; }
.chip-sub { font-size: 11.5px; opacity: .85; display: flex; gap: 4px; align-items: center; }
.chip.stale:not(.on) { border-color: var(--warn); }
.chip.stale:not(.on) .chip-sub { color: var(--warn); opacity: 1; font-weight: 600; }
.chip.on.stale .chip-sub { font-weight: 700; text-decoration: underline; }

/* 도구 모음 */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.tb-group { display: flex; gap: 6px; align-items: center; }
.range-label { margin-left: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg-item { position: relative; }
.seg-item > span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg-item input:checked + span { background: var(--surface); box-shadow: var(--shadow); font-weight: 700; color: var(--accent); }
.seg-item input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.view-seg { margin-left: auto; }
.search { position: relative; }
.search input { width: 260px; height: 36px; padding: 0 10px 0 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
select { width: 168px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 8px; max-width: 220px; }
.pop-wrap { position: relative; }
.popover { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 220px; max-height: 340px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; }
.pop-item { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.pop-item:hover { background: var(--surface-2); }
.pop-item input { width: 16px; height: 16px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--bar-bg); border: 1px solid var(--cbd); flex: none; }
.swatch.bc-none { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .5) 0 2px, transparent 2px 4px); }

/* 요약 */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tile { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 14px 10px; display: grid; gap: 0; align-content: start; min-height: 80px; position: relative; }
.tile-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tile-val { font-size: 26px; font-weight: 750; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-val.none { font-size: 16px; font-weight: 600; color: var(--muted); padding-top: 8px; letter-spacing: 0; }
.tile-sub { color: var(--muted); font-size: 12px; }
.tile.attn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.tile.attn .tile-val { color: var(--warn); }
.tile-btn { border-color: var(--accent); background: var(--accent-soft); }
.tile-btn:hover { filter: brightness(.97); }
.tile-btn .tile-val { color: var(--accent); }
.tile-go { display: inline-flex; gap: 2px; align-items: center; color: var(--accent); font-size: 12.5px; font-weight: 600; margin-top: 2px; }

.freshness { display: grid; gap: 8px; }
.freshness:empty { display: none; }
.factory-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.fresh-meta { font-size: 12.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.fresh-row { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12.5px; }
.fr .sep { margin: 0 4px 0 8px; color: var(--muted); } .fr.stale { color: var(--warn); font-weight: 600; }
.fetched { margin-left: 8px; }
.banner { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; font-weight: 500; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.banner .ico { margin-top: 3px; }

/* 상태 박스 */
.stage { position: relative; min-height: 200px; }
.stage.loading .view { opacity: .55; transition: opacity .15s; pointer-events: none; }
.state-box { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; }
.state-box.inline { border: 0; background: none; }
.state-box h3 { font-size: 18px; }
.state-box.skeleton { justify-items: stretch; border-style: solid; }
.state-box.skeleton .spinner { justify-self: center; }
.sk-row { height: 38px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--line-soft), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* 간트 도구 */
.gantt-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.legend { display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; }
.lg { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px 3px 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; font-size: 12.5px; }
.lg.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.lg.static { cursor: default; }
.lg-marks { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; margin-left: 8px; flex-wrap: wrap; }
.mk-demo { color: var(--text); } .mk-demo.late { color: var(--bad); }
.osr-demo { display: inline-grid; place-items: center; width: 13px; height: 13px; border: 1px solid var(--muted); border-radius: 3px; font-size: 9px; font-weight: 800; }
.zoom { display: flex; align-items: center; gap: 6px; }
.zoom input[type=range] { width: 120px; accent-color: var(--accent); }
.kbd-hint { color: var(--muted); font-size: 12px; margin-bottom: 6px; }

/* 간트 본체 */
.gantt-scroll { --lane-h: 44px; overflow: auto; max-height: calc(100vh - 120px); min-height: 320px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); position: relative; scroll-padding-left: var(--label-w); scroll-padding-top: 60px; overscroll-behavior: contain; }
.g { position: relative; width: calc(var(--label-w) + var(--days) * var(--ppd)); min-width: 100%; }
.g-head { display: flex; position: sticky; top: 0; z-index: 8; background: var(--surface); border-bottom: 1px solid var(--line); }
.g-corner { position: sticky; left: 0; z-index: 9; flex: 0 0 var(--label-w); width: var(--label-w); height: 54px; background: var(--surface); border-right: 1px solid var(--line); display: flex; align-items: flex-end; padding: 0 10px 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.g-hdays { position: relative; flex: 0 0 calc(var(--days) * var(--ppd)); height: 54px; }
.g-weeks, .g-daysrow { position: absolute; left: 0; right: 0; }
.g-weeks { top: 0; height: 26px; } .g-daysrow { top: 26px; height: 28px; border-top: 1px solid var(--line-soft); }
.g-week { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * var(--ppd)); width: calc(var(--n) * var(--ppd)); border-left: 1px solid var(--grid-line); padding: 4px 6px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.g-week span { color: var(--muted); }
.g-week.cur b { color: var(--accent); }
.g-day { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * var(--ppd)); width: var(--ppd); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; line-height: 1.15; color: var(--muted); border-left: 1px solid var(--grid-day); overflow: hidden; }
.g-day .dn, .g-day .wd { display: none; }
.showdays .g-day .dn { display: block; font-weight: 600; color: var(--text); }
.tiny .g-day { font-size: 9.5px; letter-spacing: -.04em; }
.showwd .g-day .wd { display: block; font-size: 10px; }
.g-day.sun { background: var(--sun-bg); } .g-day.sun .dn, .g-day.sun .wd { color: var(--bad); }
.g-day.sat { background: var(--sat-bg); }
.g-day.today { background: var(--today); } .g-day.today .dn, .g-day.today .wd { color: #fff; }
.g-body { position: relative; }
.g-bg { position: absolute; top: 0; bottom: 0; left: var(--label-w); width: calc(var(--days) * var(--ppd)); pointer-events: none; z-index: 1; background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px); background-size: calc(var(--ppd) * 7) 100%; }
.dayl .g-bg { background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px), linear-gradient(to right, var(--grid-day) 1px, transparent 1px); background-size: calc(var(--ppd) * 7) 100%, var(--ppd) 100%; }
.bgd { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * var(--ppd)); width: var(--ppd); }
.bgd.sun { background: var(--sun-bg); } .bgd.sat { background: var(--sat-bg); }
.today-line { position: absolute; top: 0; bottom: 0; z-index: 4; left: calc(var(--label-w) + var(--x) * var(--ppd) + var(--ppd) / 2 - 1px); width: 2px; background: var(--today); pointer-events: none; opacity: .9; }
.today-line span { display: none; }
.g-row { display: flex; border-bottom: 1px solid var(--line-soft); position: relative; }
.g-label { position: sticky; left: 0; z-index: 6; flex: 0 0 var(--label-w); width: var(--label-w); background: var(--surface); border-right: 1px solid var(--line); padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; min-height: var(--lane-h); }
.lname { font-size: 13px; } .lname .lw { color: var(--muted); } .lsub { color: var(--muted); font-size: 11.5px; }
.g-track { position: relative; flex: 0 0 calc(var(--days) * var(--ppd)); height: calc(var(--lanes, 1) * var(--lane-h)); }
.g-frow { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.g-frow .g-label { background: var(--surface-2); }
.g-frow .g-track { height: 44px; }
.fbtn { display: flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; text-align: left; font-weight: 700; font-size: 14px; }
.fbtn .chev { color: var(--muted); } .fname { font-size: 14px; } .fcount { font-weight: 500; font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.fsub { font-size: 11.5px; color: var(--muted); padding-left: 20px; display: flex; gap: 4px; align-items: center; }
.fsub.stale { color: var(--warn); font-weight: 700; }
.stale-note { position: sticky; left: calc(var(--label-w) + 12px); display: inline-flex; gap: 6px; align-items: center; height: 44px; color: var(--warn); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.mini { position: absolute; z-index: 2; left: calc(var(--x) * var(--ppd)); width: calc(var(--w) * var(--ppd)); top: calc(var(--y) * 1px); height: 5px; border-radius: 3px; background: var(--bar-bg); opacity: .85; }

.bar { position: absolute; z-index: 2; left: calc(var(--x) * var(--ppd) + 1px); width: max(6px, calc(var(--w) * var(--ppd) - 2px)); top: calc(var(--lane) * var(--lane-h) + 3px); height: 28px; padding: 0; display: flex; align-items: center; text-align: left; overflow: clip;
  background: var(--bar-bg); color: var(--bar-fg); border: 1px solid var(--cbd); border-radius: 7px; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.bar:hover { filter: brightness(1.07); z-index: 5; }
.bar:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; z-index: 7; }
.bar.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); z-index: 6; }
.bar.bc-none { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .22) 0 4px, transparent 4px 8px); }
.bar.bc-7, .bar.bc-6, .bar.bc-9, .bar.bc-11, .bar.bc-12, .bar.bc-13, .bar.bc-14, .bar.bc-15, .bar.bc-17 { text-shadow: none; }
.bar.clipl { border-left-style: dashed; border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
.bar.clipr { border-right-style: dashed; border-top-right-radius: 2px; border-bottom-right-radius: 2px; }
.bar-in { position: sticky; left: calc(var(--label-w) + 3px); display: flex; align-items: center; gap: 6px; padding: 0 3px; min-width: 0; max-width: 100%; }
.bar.sm .bar-in { padding: 0; }
.bn { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bq { font-size: 11px; font-weight: 600; opacity: .92; white-space: nowrap; padding-right: 14px; font-variant-numeric: tabular-nums; }
.bq::before { content: '· '; }
.pip { position: absolute; top: 1px; right: 1px; width: 12px; height: 12px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800; line-height: 1; color: #fff; background: var(--bad); border: 1px solid #fff; }
.pip.new { background: var(--info); }
:root[data-theme="dark"] .pip { border-color: #0b0f14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pip { border-color: #0b0f14; } }
.bar.xs .pip { right: auto; left: 50%; transform: translateX(-50%); }
.thumb { display: inline-grid; place-items: center; overflow: hidden; background: var(--surface-2); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ini { font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.bt { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .5); }
.bt .ini { font-size: 8.5px; }
.mk { position: absolute; z-index: 3; left: calc(var(--x) * var(--ppd) + var(--ppd) / 2 - 6px); top: calc(var(--lane) * var(--lane-h) + 31px); width: 12px; text-align: center; font-size: 11px; line-height: 12px; color: var(--bar-bg); cursor: pointer; -webkit-text-stroke: .7px var(--text); paint-order: stroke fill; }
.mk.late { color: var(--bad); font-weight: 800; }
.osr { position: absolute; z-index: 3; left: calc(var(--x) * var(--ppd) + var(--ppd) / 2 - 6px); top: calc(var(--lane) * var(--lane-h) + 31px); width: 12px; height: 12px; display: grid; place-items: center; border: 1px solid var(--muted); color: var(--muted); border-radius: 3px; font-size: 9px; font-weight: 800; background: var(--surface); cursor: help; }

.tooltip { position: fixed; z-index: 120; max-width: 330px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px 12px; font-size: 12.5px; pointer-events: none; }
.tt-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; overflow-wrap: anywhere; }
.tt-row { display: flex; gap: 8px; } .tt-k { color: var(--muted); flex: 0 0 64px; }
.tt-flag, .tt-warn { display: flex; gap: 6px; align-items: flex-start; margin-top: 3px; font-size: 12px; } .tt-flag.warn { color: var(--warn); } .tt-flag.bad, .tt-warn { color: var(--bad); } .tt-flag.info { color: var(--info); }
.tt-sub { margin-top: 6px; color: var(--muted); font-size: 11.5px; }

/* 카드 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.run-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; }
.run-card:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.run-card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.card-ph { width: 100%; aspect-ratio: 4 / 3; border-radius: 0; background: var(--surface-2); }
.card-ph .ini { font-size: 34px; color: var(--muted); }
.card-body { padding: 10px 12px 12px; display: grid; gap: 5px; align-content: start; flex: 1; }
.card-h { font-size: 15px; line-height: 1.3; }
.card-open { all: unset; cursor: pointer; font-weight: 700; display: block; overflow-wrap: anywhere; }
.card-open::after { content: ''; position: absolute; inset: 0; }
.card-open:focus-visible { outline: none; }
.run-card:has(.card-open:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; }
.fl { color: var(--muted); font-size: 12.5px; }
.bchip { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 12.5px; overflow-wrap: anywhere; }
.card-period { display: flex; gap: 6px; align-items: center; font-variant-numeric: tabular-nums; }
.card-qty b { font-size: 18px; font-variant-numeric: tabular-nums; }
.card-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; font-size: 12.5px; }
.card-flags { display: flex; gap: 4px; flex-wrap: wrap; }
.fl-tag { display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.fl-tag.warn { background: var(--warn-soft); color: var(--warn); } .fl-tag.bad { background: var(--bad-soft); color: var(--bad); } .fl-tag.info { background: var(--info-soft); color: var(--info); }
.fl-tag.big { font-size: 13px; padding: 4px 10px 4px 8px; border-radius: 8px; }
.fl-tag .ico { width: 14px; height: 14px; }
.badge { display: inline-flex; gap: 4px; align-items: center; padding: 1px 8px 1px 6px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); } .badge.warnb { background: var(--warn-soft); color: var(--warn); }
.dchip { display: inline-flex; gap: 4px; align-items: baseline; padding: 0 7px; border-radius: 6px; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dchip.soon { background: var(--warn-soft); color: var(--warn); } .dchip.far { background: var(--surface-2); color: var(--text); } .dchip.past { background: var(--surface-2); color: var(--muted); }
.more-wrap { display: grid; place-items: center; margin: 14px 0; }

/* 표 */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.table-wrap.tight { border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; padding: 0; font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th > span, .sortbtn { display: flex; gap: 6px; padding: 9px 10px; align-items: center; }
.sortbtn { border: 0; background: none; font-weight: 700; width: 100%; text-align: left; }
.sortbtn:hover { background: var(--line-soft); }
.arr { font-size: 9px; color: var(--accent); }
.data-table td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tr.sel { background: var(--accent-soft); }
.tbl-ph { width: 44px; height: 44px; border-radius: 6px; } .tbl-ph .ini { font-size: 12px; color: var(--muted); }
.linklike { border: 0; background: none; padding: 0; font-weight: 650; text-align: left; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.flagicons { display: inline-flex; gap: 4px; }
.fi { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.fi.warn { background: var(--warn-soft); color: var(--warn); } .fi.bad { background: var(--bad-soft); color: var(--bad); } .fi.info { background: var(--info-soft); color: var(--info); }

/* 드로어 */
.scrim { position: fixed; inset: 0; background: rgba(8, 14, 22, .45); z-index: 80; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); z-index: 90; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .18s ease-out; }
.drawer.wide { width: min(560px, 100vw); }
.drawer:focus { outline: none; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-title { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.drawer-body { overflow: auto; padding: 14px 16px 40px; display: grid; gap: 14px; align-content: start; flex: 1; }
.gallery { display: grid; gap: 8px; }
.g-big { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 0; overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; cursor: zoom-in; }
.g-big img { width: 100%; height: 100%; object-fit: contain; display: block; }
.noimg-big { color: var(--muted); }
.g-strip { display: flex; gap: 8px; }
.g-th { width: 64px; height: 64px; padding: 0; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.g-th.on { border-color: var(--accent); }
.g-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-none { aspect-ratio: 16 / 7; border-radius: 12px; display: grid; place-content: center; justify-items: center; gap: 2px; background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line); }
.g-none .ini { font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.d-top { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.flaglist { display: grid; gap: 6px; }
.kvs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.kvs.compact { grid-template-columns: 1fr; gap: 3px; margin-top: 6px; }
.kvs.compact .kv { display: grid; grid-template-columns: 72px 1fr; gap: 6px; }
.kv dt { color: var(--muted); font-size: 12px; font-weight: 600; } .kv dd { font-weight: 500; overflow-wrap: anywhere; }
.kv dd b { font-size: 15px; }
.d-sec { display: grid; gap: 8px; }
.d-sec > h3 { font-size: 13px; color: var(--muted); text-transform: none; letter-spacing: .01em; border-bottom: 1px solid var(--line-soft); padding-bottom: 4px; }
.plain li { padding: 2px 0; overflow-wrap: anywhere; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table th { text-align: left; background: var(--surface-2); padding: 6px 8px; font-weight: 700; white-space: nowrap; } .mini-table td { padding: 5px 8px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.mini-table .rawtxt { color: var(--muted); overflow-wrap: anywhere; }
.os-list { display: grid; gap: 10px; }
.os-card { border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.os-card.linked { border-left-color: var(--ok); } .os-card.candidate { border-left-color: var(--muted); } .os-card.ambiguous { border-left-color: var(--warn); }
.os-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .osno { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 13px; font-weight: 700; }
.confirm { margin-top: 10px; display: grid; gap: 6px; }
.confirm label { font-size: 12px; font-weight: 700; }
.confirm textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); padding: 6px 8px; }
.confirm textarea:disabled { opacity: .6; }
.timeline { display: grid; gap: 10px; border-left: 2px solid var(--line); margin-left: 6px; padding-left: 14px; }
.timeline li { position: relative; } .timeline li::before { content: ''; position: absolute; left: -20px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.tl-d { font-size: 12.5px; overflow-wrap: anywhere; }
.rawbox { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.rawbox summary { cursor: pointer; font-weight: 700; }
.rawdl { display: grid; grid-template-columns: 90px 1fr; gap: 4px 10px; margin-top: 8px; font-size: 12.5px; } .rawdl dt { color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; } .rawdl dd { overflow-wrap: anywhere; white-space: pre-wrap; }

/* 변경 패널 */
.chg-group { display: grid; gap: 6px; }
.chg-group h3 { display: flex; gap: 8px; align-items: center; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.chg-group h3 .count { background: var(--surface-2); color: var(--text); }
.chg-list { display: grid; gap: 4px; }
.chg-item { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line-soft); background: var(--surface); border-radius: 8px; }
button.chg-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.chg-title { font-weight: 700; overflow-wrap: anywhere; } .chg-meta { display: flex; gap: 4px 10px; flex-wrap: wrap; align-items: center; } .chg-diff { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(5, 8, 12, .88); display: grid; place-items: center; padding: 24px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.lb-close { position: absolute; top: 14px; right: 14px; }
.lightbox:focus { outline: none; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 160; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* 반응형 */
@media (max-width: 1180px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  :root { --label-w: 104px; }
  .app-bar { padding: 10px 14px; } .app-title h1 { font-size: 16px; } .sub { display: none; } .user-name { display: none; }
  main { padding: 12px 14px 32px; gap: 12px; }
  .toolbar { gap: 8px; } .tb-group.search { flex: 1 1 100%; } .search input { width: 100%; }
  .view-seg { margin-left: auto; } select { max-width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; } .chip { flex: none; scroll-snap-align: start; }
  .tb-group.range { flex: 1 1 100%; flex-wrap: nowrap; } .range-label { margin-left: 4px; font-size: 12.5px; white-space: nowrap; }
  #btn-filters { display: inline-flex; gap: 6px; align-items: center; } .tb-group.filters { display: none; } .tb-group.filters.open { display: flex; flex: 1 1 100%; flex-wrap: wrap; } .tb-group.filters .sel { flex: 1 1 0; min-width: 0; } .tb-group.filters select { width: 100%; font-size: 13px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .tile { padding: 7px 9px 8px; min-height: 0; } .tile-label { font-size: 11px; line-height: 1.25; } .tile-val { font-size: 20px; } .tile-val.none { font-size: 12.5px; padding-top: 4px; } .tile-sub { display: none; } .tile-go span { display: none; } .tile-go { margin: 0; }
  .fcount { display: none; } .fsub { padding-left: 0; font-size: 11px; } .g-frow .g-label { padding-left: 8px; }
  .zoom input[type=range] { width: 90px; }
  .gantt-scroll { max-height: 75vh; }
  .lg-marks { margin-left: 0; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card-body { padding: 8px 10px 10px; } .card-h { font-size: 14px; } .card-qty b { font-size: 16px; }
  .drawer, .drawer.wide { width: 100vw; border-left: 0; }
  .kvs { grid-template-columns: 1fr 1fr; }
  /* 표 → 카드(의미 구조는 role 속성으로 유지) */
  .table-wrap { border: 0; background: none; overflow: visible; }
  .data-table, .data-table tbody { display: block; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table thead tr { display: block; }
  .data-table tr[data-id] { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 2px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
  .data-table td { display: block; padding: 0; border: 0; }
  .data-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
  .data-table td.c-photo { grid-row: 1 / span 2; } .data-table td.c-photo::before, .data-table td.c-style::before { display: none; }
  .data-table td.c-style { grid-column: 2 / 4; font-size: 15px; }
  .data-table td.c-flags { grid-column: 1 / -1; }
  .tbl-ph { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print { .app-bar, .toolbar, .drawer { display: none; } }

.edit-form{display:grid;gap:.5rem;margin:.25rem 0}
.edit-form .ef-row{display:grid;gap:.2rem}
.edit-form label{font-size:.85rem;font-weight:600}
.edit-form input,.edit-form textarea{font:inherit;padding:.4rem .5rem;border:1px solid var(--line,#bbb);border-radius:6px;background:var(--bg,#fff);color:inherit;min-height:2.4rem}
.edit-form textarea{resize:vertical}
.chk{display:inline-flex;align-items:center;gap:.3rem;margin:.15rem .8rem .15rem 0;font-weight:400}.chk-row{display:flex;flex-wrap:wrap}fieldset.ef-row{border:1px solid var(--line,#ccc);border-radius:6px;padding:.4rem .6rem}

/* ============ 디자인 다듬기 (2026-10-05): 색·그림자·여백·카드·상단바 ============ */
:root {
  --bg: #f2f4f9; --surface: #ffffff; --surface-2: #eef1f8; --line: #dde3ee; --line-soft: #e9edf5;
  --text: #121a2b; --muted: #5a6478; --accent: #2b5fd9; --accent-soft: #e8eefc; --focus: #1d4ed8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 26, 43, .06), 0 6px 18px -6px rgba(18, 26, 43, .10);
  --shadow-lg: 0 18px 50px -12px rgba(10, 20, 45, .35);
  --bar-ink: #0f1b3d; --bar-ink-2: #1b2c5e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0b0f1a; --surface: #131a29; --surface-2: #1a2336; --line: #27324a; --line-soft: #202a3f; --accent: #6b9bff; --accent-soft: #1a2c52; --bar-ink: #0a1022; --bar-ink-2: #131d3a; }
}
:root[data-theme="dark"] { --bg: #0b0f1a; --surface: #131a29; --surface-2: #1a2336; --line: #27324a; --line-soft: #202a3f; --accent: #6b9bff; --accent-soft: #1a2c52; --bar-ink: #0a1022; --bar-ink-2: #131d3a; }
body { background: radial-gradient(1100px 380px at 12% -120px, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%), var(--bg); background-attachment: fixed; letter-spacing: -.003em; }

/* 상단바: 짙은 남색 + 흰 글자 */
.app-bar { position: sticky; top: 0; z-index: 60; background: linear-gradient(100deg, var(--bar-ink), var(--bar-ink-2)); border-bottom: 0; color: #fff; padding: 11px 28px; box-shadow: 0 6px 22px -10px rgba(10, 20, 45, .6); }
.app-bar .sub, .app-bar .user-name { color: rgba(255, 255, 255, .72); }
.app-title h1 { font-size: 18px; font-weight: 750; letter-spacing: -.015em; }
.app-bar .btn { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(6px); }
.app-bar .btn:hover:not(:disabled) { background: rgba(255, 255, 255, .20); }
.bm-bg { fill: #fff; } .bm-fg { fill: var(--bar-ink); }
main { padding: 20px 28px 48px; gap: 16px; }

/* 버튼·입력 */
.btn { border-radius: 10px; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); box-shadow: 0 1px 2px rgba(20, 40, 120, .3), inset 0 1px 0 rgba(255, 255, 255, .25); }
input, select, textarea { border-radius: 10px; }
input:not([type=checkbox]):not([type=radio]), select, textarea { border: 1px solid var(--line); background: var(--surface); }
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* 공장 칩 */
.chip { border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(18, 26, 43, .04); transition: transform .12s, box-shadow .12s, border-color .12s; }
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.chip.on { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #1b1f5e)); border-color: transparent; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.seg { border-radius: 12px; background: var(--surface-2); }
.seg-item > span { border-radius: 9px; }

/* 요약 타일 */
.tiles { gap: 12px; }
.tile { position: relative; overflow: hidden; border-radius: var(--radius); padding: 12px 16px 13px; box-shadow: var(--shadow); border-color: var(--line-soft); }
.tile::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); opacity: .85; }
.tile.attn::before { background: var(--warn); }
.tile-btn::before { background: var(--accent); }
.tile-label { font-size: 12px; letter-spacing: .01em; text-transform: none; }
.tile-val { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }

/* 카드 */
.run-card { border-radius: 16px; border-color: var(--line-soft); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.run-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -12px rgba(18, 26, 43, .28); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.card-ph, .run-card img { background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.card-body { padding: 12px 14px 14px; gap: 6px; }
.card-h { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.card-qty b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.fl-tag { border-radius: 999px; font-weight: 600; }

/* 간트 */
.gantt-scroll { border-radius: 16px; border-color: var(--line-soft); box-shadow: var(--shadow); }
.g-head { background: color-mix(in srgb, var(--surface) 92%, var(--accent)); }
.bar { border-radius: 8px; box-shadow: 0 1px 2px rgba(10, 20, 45, .22), inset 0 1px 0 rgba(255, 255, 255, .18); transition: filter .12s, transform .12s, box-shadow .12s; }
.bar:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 14px -4px rgba(10, 20, 45, .4); }

/* 오른쪽 패널·표 */
.drawer { box-shadow: var(--shadow-lg); border-left-color: var(--line-soft); }
.drawer-head { background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 94%, var(--accent))); }
.drawer-title { font-weight: 750; letter-spacing: -.015em; }
.mini-table th { background: var(--surface-2); font-weight: 650; }
.login-card { border-radius: 20px; box-shadow: var(--shadow-lg); padding: 32px 28px; }
.card { border-radius: 16px; }
.toast, #toast { border-radius: 12px; box-shadow: var(--shadow-lg); }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
@media (max-width: 760px) { .app-bar { padding: 10px 14px; } main { padding: 14px 12px 40px; } .tile-val { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .run-card, .chip, .bar, .btn { transition: none; } .run-card:hover, .chip:hover, .bar:hover { transform: none; } }
@media (max-width: 760px) {
  .app-bar { flex-wrap: wrap; row-gap: 8px; }
  .app-title { flex: 1 1 100%; }
  .app-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-actions { flex: 1 1 100%; flex-wrap: wrap; gap: 6px; }
  .app-actions .btn { height: 32px; }
}
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile-val { overflow-wrap: normal; font-size: 24px; } }

/* 1년 보기: 칸이 좁으면 주차 번호만 표시(날짜는 마우스를 올리면) */
.g.micro .g-week b { display: none; }
.g.micro .g-week span { margin: 0; font-weight: 700; }
@media (max-width: 520px) { .tb-group.range { flex-wrap: wrap; row-gap: 6px; } .tb-group.range .range-label { flex: 1 1 100%; } }
.ex-row{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;padding:8px 0;border-bottom:1px solid var(--line-soft)}
.pop-wrap{position:relative;display:inline-block}#pop-vers{min-width:min(420px,92vw);right:0}.ver-row{display:grid;grid-template-columns:70px 1fr;gap:8px;align-items:center;padding:4px 0}.ver-f{font-weight:700}#btn-vers.on{border-color:var(--warn);background:var(--warn-soft)}
#pop-vers { width: min(520px, 92vw); max-height: 72vh; overflow: auto; }
.ver-row { grid-template-columns: 64px minmax(0, 1fr); }
.ver-row select { width: 100%; min-width: 0; }
@media (max-width: 520px) { .pop-wrap { position: static; } #pop-vers { position: fixed; left: 4vw; right: 4vw; top: 90px; width: auto; z-index: 120; } }

/* ---- UI 감사 보완 (2026-10-05) ---- */
/* 드로어 본문(grid)의 자식이 표 때문에 화면보다 넓어지지 않게: 표는 자기 상자 안에서 가로 스크롤 */
.drawer-body { grid-template-columns: minmax(0, 1fr); }
.drawer-body > * { min-width: 0; }
/* 체크박스에는 입력칸용 높이·여백을 적용하지 않는다 */
.edit-form input[type=checkbox] { min-height: 0; width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--accent); }
.edit-form .chk { min-height: 36px; }
/* 버전 팝오버: 공장별 선택 칸이 select 기본 최대폭(220px)에 잘리지 않게 */
.ver-row select { max-width: none; }
@media (max-width: 760px) {
  /* 좁은 화면: 필터 줄을 줄바꿈해 OS 연결·납기 위험 선택 칸이 한 글자만 보이지 않게 */
  .tb-group.filters { flex-wrap: wrap; }
  .tb-group.filters .sel { flex: 1 1 140px; }
  .table-wrap.tight .mini-table { min-width: 460px; }
  .app-actions .btn { min-height: 36px; }
}
/* 터치 화면: 작은 버튼·분할 버튼도 손가락으로 누를 수 있는 높이(36px 이상) */
@media (pointer: coarse), (max-width: 760px) {
  .btn.small { min-height: 36px; }
  .btn.icon.small { min-width: 36px; }
  .seg-item > span { height: 36px; }
  .linklike { display: inline-flex; align-items: center; min-height: 36px; }
  .drawer .btn.small, .up-dlg .btn.small { min-height: 40px; }
}

/* 수정 초안 */
.notice.draft { background: var(--info-soft); color: var(--info); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 500; }
.notice.ok { background: var(--ok-soft, #e6f4ea); color: var(--ok, #1b6e3c); padding: 8px 10px; border-radius: 8px; margin: 8px 0; }
.dr-ops { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.dr-op { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 4px; }
.dr-op.stale { border-color: var(--warn, #b26a00); background: var(--warn-soft); }
.dr-op .btn { justify-self: start; min-height: 32px; }
.warn-t { color: var(--warn, #b26a00); }
.block { display: block; }
@media (pointer: coarse), (max-width: 760px) { .dr-op .btn, #draft-banner .btn { min-height: 40px; } }
#draft-panel .ef-row { display: grid; gap: .2rem; margin: 8px 0; }
#draft-panel textarea { width: 100%; box-sizing: border-box; min-height: 56px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; font: inherit; }
#draft-panel .row-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }

/* 데스크톱: 열린 창(드로어)이 상단 바의 언어·로그아웃 버튼을 가리지 않도록 바 아래에서 시작한다(--bar-h는 app.js가 바 높이로 맞춘다). */
@media (min-width: 761px) { .drawer, .drawer.wide { top: var(--bar-h, 58px); } .app-bar { z-index: 95; } }

/* ===== 읽기 편한 화면 =====
 * 항상 적용: 보조 글자색을 진하게(대비 7:1 이상). "큰 글씨"(기본 켜짐, 헤더 버튼으로 끔)일 때: 본문 17px, 버튼·입력칸 44px 이상, 표 16px·줄 간격 넓게·줄무늬,
 * 막대 글씨 16px·막대 높이 38px·구간 줄 높이 58px, 날짜 머리글 12px 이상, 상세창 글씨 16px. */
:root { --muted: #3e4853; }
html.big { --label-w: 232px; }
html.big body { font-size: 17px; line-height: 1.55; }
html.big .btn { min-height: 44px; font-size: 16px; padding: 0 16px; }
html.big .btn.small, html.big .btn.icon { min-height: 42px; height: auto; font-size: 15.5px; padding: 0 14px; }
html.big input, html.big select, html.big textarea { min-height: 44px; font-size: 16px; }
html.big textarea { min-height: 72px; }
html.big .small-t, html.big .sub, html.big .tile-sub, html.big .chip-sub, html.big .fresh-meta, html.big .fresh-row, html.big .lg-marks, html.big .kbd-hint { font-size: 14.5px; }
html.big .notice, html.big .error-text { font-size: 15.5px; }
html.big .app-title h1 { font-size: 21px; }
html.big .user-name { font-size: 15px; }
html.big .tab-btn { font-size: 17px; padding-block: 12px; }
html.big .chip { padding: 8px 16px; }
html.big .chip-name { font-size: 18px; }
html.big .tile-label { font-size: 15.5px; }
html.big .tile-val { font-size: 32px; }
html.big .tile-go { font-size: 15px; }
html.big .data-table { font-size: 16px; }
html.big .data-table th > span, html.big .sortbtn { padding: 12px 12px; }
html.big .data-table td { padding: 12px 12px; }
html.big .data-table tbody tr:nth-child(even) { background: var(--surface-2); }
html.big .data-table tbody tr:hover { background: var(--accent-soft); }
html.big .tbl-ph { width: 56px; height: 56px; }
html.big .card-h { font-size: 19px; }
html.big .card-body { font-size: 16px; gap: 7px; padding: 14px 16px 16px; }
html.big .bar { height: 38px; font-size: 16px; top: calc(var(--lane) * var(--lane-h) + 4px); }
html.big .mk, html.big .osr { top: calc(var(--lane) * var(--lane-h) + 44px); }
html.big .g-label { font-size: 16px; padding: 8px 12px; }
html.big .g-day { font-size: 12.5px; }
html.big .tiny .g-day { font-size: 11.5px; letter-spacing: 0; }
html.big .drawer, html.big .drawer * { font-size: 16px; }
html.big .drawer .drawer-title { font-size: 20px; }
html.big .drawer h3 { font-size: 17px; }
html.big .badge { font-size: 14px; padding: 3px 10px; }
html.big #btn-big { font-weight: 700; }
html.big .popover { font-size: 16px; }
html.big .popover select { min-height: 44px; }
@media (max-width: 760px) { html.big .data-table td::before { font-size: 13.5px; } html.big .data-table td { font-size: 16px; } }
html.big .bchip { font-size: 15.5px; }
html.big .dchip { font-size: 15px; padding: 3px 10px; }
html.big .dchip b { font-size: 15.5px; }
html.big .swatch { width: 14px; height: 14px; }
html.big .tb-group.filters select, html.big .tb-group select { font-size: 16px; }
@media (max-width: 760px) { html.big .tb-group.filters { flex-wrap: wrap; } html.big .tb-group.filters .sel { flex: 1 1 45%; } html.big .tb-group.filters select { font-size: 16px; width: 100%; } html.big .app-actions { flex-wrap: wrap; } }
@media (max-width: 760px) { html.big .tb-group.seg { flex-wrap: wrap; max-width: 100%; } html.big .seg-item { padding-inline: 10px; } }
/* language select (한국어 / English / Bahasa Indonesia): one compact control instead of a toggle button */
.lang-sel { min-height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; font-size: 13.5px; }
.app-bar .lang-sel { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .22); color: #fff; }
.app-bar .lang-sel option { color: #111; }
html.big .lang-sel { min-height: 44px; font-size: 16px; }

/* phones (also with "큰 글씨"): the top bar scrolls away instead of covering a quarter of the screen, its buttons are compact, the line column leaves room for the bars,
   the keyboard hint is for keyboards. Reported from a real phone, 2026-10-06. */
@media (max-width: 760px) {
  .app-bar { position: static; padding: 8px 12px; row-gap: 8px; }
  .app-bar .btn, html.big .app-bar .btn, .app-bar .lang-sel, html.big .app-bar .lang-sel { min-height: 40px; font-size: 14.5px; padding: 0 12px; }
  html.big .app-title h1 { font-size: 18px; }
  html.big .tab-btn { min-height: 40px; font-size: 16px; padding-inline: 14px; }
  html.big { --label-w: 120px; }
  html.big .g-label { font-size: 14px; padding: 6px 8px; }
  .kbd-hint { display: none; }
  .gantt-scroll { max-height: none; min-height: 0; overflow-y: visible; overscroll-behavior: auto; touch-action: pan-x pan-y; }   /* 세로는 페이지가 스크롤: 안쪽 스크롤에 갇히지 않게 */
}

#btn-filters { display: none; }
@media (max-width: 760px) { #btn-filters { display: inline-flex; } #btn-filters .count { color: var(--accent); } }

.bc-sh { --bar-bg: #2f9e5a; --bar-fg: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bc-sh { --bar-bg: #4fcf84; --bar-fg: #0b0f14; } }
:root[data-theme="dark"] .bc-sh { --bar-bg: #4fcf84; --bar-fg: #0b0f14; }

#btn-menu { display: none; }
@media (max-width: 760px) {
  #btn-menu { display: inline-flex; margin-left: auto; align-self: center; min-height: 36px; }
  .app-bar { flex-wrap: wrap; align-items: center; }
  .app-bar .app-title { flex: 1 1 auto; min-width: 0; }
  .app-actions { display: none; }
  .app-actions.open { display: flex; }
}

@media (max-width: 760px) {
  #weeks-seg, html.big #weeks-seg { flex-wrap: nowrap; width: 100%; justify-content: space-between; padding: 3px; }
  #weeks-seg .seg-item { flex: 1 1 0; min-width: 0; padding-inline: 0; }
  #weeks-seg .seg-item > span { width: 100%; justify-content: center; padding: 0 2px; font-size: 14px; }
}

/* 휴대폰: 요약 카드와 도구 줄의 위아래 간격 축소 */
@media (max-width: 760px) {
  main { gap: 8px; }
  .tiles { gap: 8px; }
  .tile, html.big .tile { padding: 6px 10px 7px 12px; min-height: 0; }
  .tile-val, html.big .tile-val { font-size: 22px; line-height: 1.1; }
  .tile-label, html.big .tile-label { font-size: 12.5px; line-height: 1.2; }
  .tile-sub, html.big .tile-sub { font-size: 12px; line-height: 1.25; }
  .toolbar { gap: 6px; }
  .app-actions #btn-addrun, .app-actions #btn-export { height: 32px; min-height: 36px; font-size: 14.5px; padding: 0 12px; }
}

/* 휴대폰: 위쪽 조회 줄을 줄인다 — 올해 전체(=1년과 중복) 숨김, 날짜 범위는 이동 버튼 옆 한 줄, 검색과 필터를 한 줄, 새로고침은 아이콘만 */
@media (max-width: 760px) {
  #btn-year { display: none; }
  .tb-group.range, .tb-group.range { flex-wrap: nowrap; row-gap: 0; }
  .tb-group.range .range-label { flex: 1 1 auto; min-width: 0; margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
  .tb-group.search { flex: 1 1 0; min-width: 0; }
  .view-seg { flex: 1 1 100%; margin-left: 0; }
  .view-seg .seg-item { flex: 1 1 0; } .view-seg .seg-item > span { width: 100%; justify-content: center; }
  .refresh-btn span { display: none; }
  .fresh-meta { flex-wrap: wrap; font-size: 11px; gap: 0; } .fresh-meta { position: relative; padding-right: 34px; } .fresh-meta .refresh-btn { position: absolute; right: 0; top: -4px; padding: 0 6px; min-height: 28px; } .fresh-meta > * { white-space: nowrap; } 
}

/* 휴대폰: 상세 창의 큰 사진이 첫 화면을 다 차지하지 않게, 바이어 범례 칩은 누르기 편한 높이로 */
@media (max-width: 760px) {
  .g-big { aspect-ratio: auto; height: 190px; }
  .g-big img { max-height: 190px; width: 100%; object-fit: contain; }
  .lg:not(.static) { min-height: 34px; }
}

.pip.chg { background: var(--warn); }

/* 공장 선택 칸(전체·DCBJ·DDB…)을 작게 */
.chips, html.big .chips { gap: 6px; }
.chip, html.big .chip { padding: 3px 10px; min-width: 0; border-radius: 10px; }
.chip-name, html.big .chip-name { font-size: 15px; line-height: 1.25; }
.chip-sub, html.big .chip-sub { font-size: 11.5px; line-height: 1.2; }

/* 위쪽 메뉴·필터 전체를 작게(상세 창·입력 창은 그대로) */
html.big .app-bar .btn, html.big .app-bar .btn.small, html.big .toolbar .btn, html.big .toolbar .btn.icon, html.big .app-bar .lang-sel, html.big .toolbar select, html.big .toolbar input[type=search] { height: 32px; min-height: 0; font-size: 14px; padding: 0 10px; border-radius: 8px; }
html.big .toolbar .btn.icon { width: 32px; padding: 0; }
html.big .toolbar .sel select { padding-right: 24px; }
html.big .seg-item > span { height: 26px; font-size: 13.5px; padding: 0 9px; }
html.big .tab-btn { min-height: 34px; font-size: 15px; padding-inline: 12px; }
html.big .fresh-meta, html.big .toolbar .range-label { font-size: 12.5px; }
html.big .app-title h1 { font-size: 18px; }
@media (max-width: 760px) {
  html.big .app-bar .btn, html.big .app-bar .btn.small, html.big .toolbar .btn, html.big .app-bar .lang-sel, html.big .toolbar select, html.big .toolbar input[type=search] { height: 36px; }
  html.big .toolbar select, html.big .toolbar input[type=search] { font-size: 16px; }       /* iOS는 16px 미만 입력칸을 눌러 확대한다 */
  html.big .toolbar .btn.icon { width: 36px; }
  html.big .app-bar .tab-btn { min-height: 36px; }
}
html.big .toolbar input[type=search] { padding-left: 32px; }
html.big .tb-group.filters select, html.big .tb-group.filters .sel select { font-size: 14px; }
html.big .tile-label { font-size: 13.5px; } html.big .tile-val { font-size: 28px; } html.big .tile-sub, html.big .tile-go { font-size: 13px; }
@media (max-width: 760px) {
  html.big .tb-group.filters select, html.big .tb-group.filters .sel select { font-size: 16px; }
  html.big .tile-val { font-size: 22px; } html.big .tile-label { font-size: 12.5px; } html.big .tile-sub { font-size: 12px; }
}

.tile-link { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.tile-link:hover { border-color: var(--accent); }
.tile-link .tile-go { margin-top: 2px; }
.chg-diff.bad { color: var(--bad); font-weight: 600; }

.lp-chips { flex-wrap: wrap; overflow: visible; padding: 0 0 4px; }

/* ===== 전체 컴팩트 정리: 뚱뚱한 요소를 줄이고 가능한 한 한 줄에 ===== */
html.big body { font-size: 15px; line-height: 1.45; }
html.big { --label-w: 200px; }
/* 간트 */
html.big .bar { height: 32px; font-size: 14px; top: calc(var(--lane) * var(--lane-h) + 4px); }
html.big .mk, html.big .osr { top: calc(var(--lane) * var(--lane-h) + 37px); }
html.big .g-label { font-size: 14px; padding: 5px 10px; }
html.big .g-day { font-size: 12px; }
.g-frow .g-label { flex-direction: row; align-items: center; gap: 8px; min-height: 0; padding-block: 3px; }
.g-frow .g-track { height: 34px; }
.fsub { padding-left: 0; }
/* 요약 카드: 이름 / 숫자+설명을 한 줄, 화살표는 오른쪽 위 */
.tiles, html.big .tiles { gap: 8px; }
.tile, html.big .tile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 7px 12px 8px 14px; min-height: 0; }
html.big .tile-label, .tile-label { flex: 1 1 100%; font-size: 13px; line-height: 1.25; padding-right: 14px; }
html.big .tile-val, .tile-val { font-size: 24px; line-height: 1.15; }
html.big .tile-sub, .tile-sub { flex: 1 1 0; min-width: 0; font-size: 12px; line-height: 1.25; }
.tile-link .tile-go, .tile-btn .tile-go { position: absolute; top: 7px; right: 9px; margin: 0; font-size: 0; }
.tile-link .tile-go svg, .tile-btn .tile-go svg { width: 14px; height: 14px; }
/* 위쪽 도구: 1줄 = 기간·주수·검색·보기전환, 2줄 = 필터·작업 버튼 */
.toolbar > .tb-group.range { order: 1; } .toolbar > #weeks-seg { order: 2; } .toolbar > .tb-group.search { order: 3; }
.toolbar > #view-seg { order: 4; margin-left: auto; }
.toolbar > #btn-filters { order: 5; } .toolbar > .tb-group.filters { order: 6; } .toolbar > .btn { order: 7; }
.tb-group.search input { width: 220px; }
/* 범례·확대 */
.lg, html.big .lg { padding: 1px 8px 1px 6px; font-size: 12px; min-height: 0; }
.legend { gap: 4px 6px; }
.zoom .btn.icon.small, html.big .zoom .btn.icon.small { width: 28px; min-height: 0; height: 28px; }
.zoom input[type=range] { width: 90px; }
.zoom .btn.small, html.big .zoom .btn.small { min-height: 0; height: 28px; font-size: 13px; padding: 0 10px; }
.gantt-tools { margin-bottom: 4px; }
/* 공장 선택 줄 */
.factory-bar { gap: 4px 12px; }
main, html.big main { gap: 10px; }
@media (max-width: 760px) {
  html.big { --label-w: 104px; }
  html.big .g-label { font-size: 13px; padding: 4px 6px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .tile, html.big .tile { padding: 5px 8px 6px 10px; }
  html.big .tile-label, .tile-label { font-size: 11.5px; padding-right: 10px; }
  html.big .tile-val, .tile-val { font-size: 20px; }
  .tile-sub, html.big .tile-sub { display: none; }
  .toolbar > #view-seg { margin-left: 0; order: 4; }
  .toolbar > .tb-group.search { flex: 1 1 0; }
  .tb-group.search input { width: 100%; }
  .legend { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; } .legend::-webkit-scrollbar { display: none; }
  .legend .lg { flex: none; }
  .lg-marks { flex: none; flex-wrap: nowrap; white-space: nowrap; }
  .gantt-tools { gap: 6px; }
  .zoom { flex: 1 1 100%; }
  .zoom input[type=range] { flex: 1 1 auto; width: auto; min-width: 0; }
}
.tile-go span { display: none; }
.tile-link .tile-go svg, .tile-btn .tile-go svg { display: block; }
.tb-group.search input { width: 250px; }
@media (min-width: 761px) {
  .gantt-tools { flex-wrap: nowrap; align-items: flex-end; }
  .gantt-tools .legend { flex: 1 1 0; min-width: 0; }
  .gantt-tools .zoom { flex: none; }
}
@media (max-width: 760px) { .toolbar > #btn-filters { order: 3; } }
@media (max-width: 760px) { .tb-group.search input { width: 100%; } }
/* 위쪽 바: 부제목 숨기고 한 줄로(영어처럼 글자가 긴 언어에서도) */
@media (max-width: 760px) { .app-bar .sub { display: none; } }
.app-bar .sub { font-size: 12.5px; }
.app-bar { padding-block: 8px; }
@media (min-width: 761px) { .app-bar { flex-wrap: nowrap; } .app-bar .app-actions { margin-left: auto; flex-wrap: nowrap; } .app-bar .user-name { max-width: 120px; } }
@media (max-width: 1280px) and (min-width: 761px) { .app-bar .user-name { display: none; } }
@media (max-width: 1180px) and (min-width: 761px) { html.big .app-bar .btn, html.big .app-bar .btn.small { padding: 0 8px; font-size: 13px; } .app-bar .lang-sel { max-width: 130px; } .app-title h1 { font-size: 16px; } .app-bar .tab-btn { padding-inline: 8px; } }
/* 카드·표 보기도 컴팩트하게 */
html.big .card-h { font-size: 15px; line-height: 1.3; }
html.big .card-body { font-size: 13.5px; gap: 4px; padding: 8px 10px 10px; }
html.big .bchip, html.big .fl { font-size: 13px; }
html.big .card-qty b { font-size: 16px; }
html.big .dchip { font-size: 12.5px; padding: 0 7px; } html.big .dchip b { font-size: 12.5px; }
.card-ph { aspect-ratio: 16 / 10; }
.card-period { white-space: nowrap; flex-wrap: nowrap; font-size: 13px; } .card-period .muted { white-space: nowrap; }
html.big .data-table { font-size: 14px; } html.big .data-table td { padding: 7px 10px; } html.big .data-table th > span, html.big .sortbtn { padding: 8px 10px; }
html.big .tbl-ph { width: 40px; height: 40px; }
@media (max-width: 760px) { html.big .data-table td { font-size: 14px; padding: 6px 10px; } .cards { gap: 8px; } }
@media (max-width: 760px) {
  .data-table tr[data-id] { grid-template-columns: 44px 1fr 1fr 1fr; gap: 2px 8px; padding: 8px; margin-bottom: 8px; }
  .data-table td.c-style { grid-column: 2 / 5; font-size: 14px; }
  .data-table td { font-size: 13px; overflow-wrap: anywhere; }
  .data-table td::before { font-size: 10.5px; }
  html.big .tbl-ph { width: 44px; height: 44px; }
}
@media (max-width: 760px) {
  .data-table tr[data-id] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-table td.c-photo { grid-row: auto; grid-column: 1; }
  .data-table td.c-style { grid-column: 2 / 4; }
}

/* 직전 대비 변경 목록 */
.chg-cats { margin-top: -2px; }
.chg-item.chg-bad { border-left: 3px solid var(--bad); } .chg-item.chg-warn { border-left: 3px solid var(--warn); }
.chg-item .card-flags { margin-top: 2px; }
.chg-more { color: var(--accent); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.chg-detail { margin: 4px 0 6px; padding: 8px 10px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: var(--surface-2); display: grid; gap: 6px; font-size: 13.5px; }
.chg-detail h4 { font-size: 13px; margin: 4px 0 0; color: var(--muted); }
.chg-diff-table, .chg-parts { width: 100%; border-collapse: collapse; font-size: 13px; } .chg-diff-table th, .chg-diff-table td, .chg-parts th, .chg-parts td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); font-weight: 500; } .chg-diff-table thead th, .chg-parts thead th { color: var(--muted); font-size: 12px; }
.chg-diff-table tbody th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.chg-d-bad { color: var(--bad); font-weight: 700; } .chg-d-warn { color: var(--warn); font-weight: 700; } .chg-d-ok { color: var(--ok); font-weight: 700; }
.fl-tag.muted { background: none; color: var(--muted); }

/* ===== 글자 둘레 여백 다듬기(좁지도 넓지도 않게, 위아래·양옆 균형) ===== */
.tile, html.big .tile { padding: 9px 14px 10px 16px; min-height: 62px; align-content: center; row-gap: 1px; }
.chip, html.big .chip { padding: 5px 12px; }
.chip-name, html.big .chip-name { line-height: 1.3; }
.lg, html.big .lg { padding: 3px 10px 3px 8px; }
.fl-tag { padding: 2px 9px 2px 7px; line-height: 1.35; }
.badge { padding: 2px 9px 2px 7px; }
.dchip, html.big .dchip { padding: 1px 8px; }
html.big .app-bar .btn, html.big .app-bar .btn.small, html.big .toolbar .btn, html.big .toolbar select, html.big .toolbar input[type=search] { padding-inline: 12px; }
html.big .toolbar input[type=search] { padding-left: 34px; }
html.big .seg-item > span { padding: 0 11px; }
html.big .g-label { padding: 6px 12px; }
.toolbar, html.big .toolbar { gap: 8px 10px; }
.chg-item { padding: 9px 12px; }
.chg-item .card-flags { gap: 5px; margin-top: 4px; }
.card-body, html.big .card-body { padding: 10px 12px 12px; gap: 5px; }
@media (max-width: 760px) {
  .tile, html.big .tile { padding: 7px 10px 8px 12px; min-height: 64px; }
  .chip, html.big .chip { padding: 4px 11px; }
  .lg, html.big .lg { padding: 3px 10px 3px 8px; }
  html.big .g-label { padding: 5px 8px; }
  .data-table tr[data-id] { padding: 10px; }
}

/* 알림 띠(수정 초안·기준 안내 등)를 얇게, 글자·버튼 한 줄 정렬 */
.notice, html.big .notice { padding: 6px 12px; font-size: 13px; line-height: 1.4; }
.notice.warn, .notice.draft, html.big .notice.warn, html.big .notice.draft { align-items: center; gap: 4px 10px; }
.notice.draft b { font-weight: 700; white-space: nowrap; }
.notice.draft .btn, html.big .notice.draft .btn, #draft-banner .btn { height: 28px; min-height: 0; padding: 0 12px; font-size: 13px; margin-left: auto; }
@media (pointer: coarse), (max-width: 760px) { #draft-banner .btn, .dr-op .btn { min-height: 0; height: 30px; } #draft-banner { padding: 6px 10px; } }
.summary { display: grid; gap: 8px; }

.tab-btn.ext::after { content: ' ↗'; font-size: .85em; opacity: .75; }

/* ===== 위쪽 정리: 맨 위 바 = 이동 + [작업] + [계정], 간트 위 = 조회 덩어리(공장·기간·검색·필터·보기) ===== */
.menu-wrap { position: relative; }
.menu-trigger .ico.caret { width: 14px; height: 14px; margin-left: 2px; }
.app-bar #btn-user .user-name { display: inline; max-width: 150px; overflow: hidden; text-overflow: ellipsis; color: inherit; }
.menu-pop { display: none; }
@media (min-width: 761px) {
  .app-bar .app-actions { gap: 8px; align-items: center; }
  .menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 230px; flex-direction: column; gap: 2px; padding: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
  .menu-pop.open { display: flex; }
  html.big .app-bar .menu-pop .btn, html.big .app-bar .menu-pop .btn.small, .app-bar .menu-pop .btn { width: 100%; justify-content: flex-start; height: 34px; border: 0; background: none; color: var(--text); font-size: 14px; padding: 0 10px; backdrop-filter: none; }
  html.big .app-bar .menu-pop .btn:hover:not(:disabled), .app-bar .menu-pop .btn:hover:not(:disabled) { background: var(--surface-2); }
  .app-bar .menu-pop .lang-sel, html.big .app-bar .menu-pop .lang-sel { width: 100%; height: 34px; background: var(--surface); color: var(--text); border: 1px solid var(--line); margin-bottom: 4px; }
  .menu-pop #btn-logout { border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; margin-top: 2px; }
}
/* 휴대폰: '메뉴' 버튼 하나에 모두 펼쳐 보인다(작업·계정 메뉴는 풀어서 나열) */
@media (max-width: 760px) {
  .menu-trigger { display: none; }
  .menu-wrap { display: contents; }
  .menu-pop { display: contents; }
}
/* 조회 덩어리: 공장 선택 → (기간·주수·보기 전환) → (검색·필터) */
.toolbar > .tb-group.range { order: 1; } .toolbar > #weeks-seg { order: 2; } .toolbar > #view-seg { order: 3; margin-left: auto; }
.toolbar > .tb-break { order: 4; flex: 0 0 100%; height: 0; }
.toolbar > .tb-group.search { order: 5; } .toolbar > #btn-filters { order: 6; } .toolbar > .tb-group.filters { order: 7; }
.toolbar { gap: 8px 10px; }
.factory-bar { margin-bottom: -2px; }
/* 걸린 필터는 파랗게 */
html.big .toolbar .btn.on, html.big .toolbar select.on, .toolbar .btn.on, .toolbar select.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.filter-summary { margin: -4px 0 0; font-size: 12.5px; color: var(--accent); font-weight: 600; }
@media (min-width: 761px) { .filter-summary { display: none; } .toolbar > .tb-group.filters { flex: 0 1 auto; } }
@media (max-width: 760px) {
  .toolbar > .tb-break { display: none; }
  .toolbar > .tb-group.range { order: 1; } .toolbar > #weeks-seg { order: 2; } .toolbar > .tb-group.search { order: 3; } .toolbar > #btn-filters { order: 3; } .toolbar > #view-seg { order: 4; margin-left: 0; flex: 1 1 100%; } .toolbar > .tb-group.filters { order: 5; }
}

/* ===== 다이어트: 두꺼운 것들 한꺼번에 줄이기 ===== */
/* 맨 위 바와 탭 */
.app-bar, html.big .app-bar { padding-block: 5px; min-height: 0; }
.app-bar .brand-mark svg { width: 26px; height: 26px; }
.app-title h1, html.big .app-title h1 { font-size: 16px; line-height: 1.2; }
.app-bar .sub { font-size: 11.5px; line-height: 1.2; }
.tab-btn, html.big .tab-btn { min-height: 0; height: 38px; padding: 0 14px; font-size: 14.5px; border-radius: 8px 8px 0 0; }
.app-tabs { align-self: flex-end; }
/* 요약 카드·공장 칸·범례·확대 */
.tile, html.big .tile { min-height: 0; padding: 6px 12px 7px 14px; }
html.big .tile-label, .tile-label { font-size: 12.5px; }
html.big .tile-val, .tile-val { font-size: 22px; line-height: 1.1; }
.chip, html.big .chip { padding: 3px 10px; }
.chip-name, html.big .chip-name { font-size: 14px; line-height: 1.2; }
.chip-sub, html.big .chip-sub { font-size: 11px; line-height: 1.15; }
.lg, html.big .lg { padding: 1px 9px 1px 7px; font-size: 11.5px; }
.zoom { height: 30px; gap: 4px; } .zoom .btn.icon.small, html.big .zoom .btn.icon.small { width: 26px; height: 26px; } .zoom .btn.small, html.big .zoom .btn.small { height: 26px; font-size: 12.5px; padding: 0 9px; }
.gantt-tools { margin-bottom: 2px; }
/* 간트 머리(주차·날짜 줄)와 공장 제목 줄 */
.g-corner { height: 44px; } .g-hdays { height: 44px; } .g-weeks { height: 21px; } .g-daysrow { top: 21px; height: 23px; }
.g-week { padding: 2px 6px; font-size: 11.5px; } .g-day, html.big .g-day { font-size: 11px; }
.g-frow .g-track { height: 28px; } .g-frow .g-label { padding-block: 2px; }
html.big { --label-w: 176px; }
@media (max-width: 760px) {
  .app-bar, html.big .app-bar { padding: 4px 12px 0; row-gap: 4px; }
  .tab-btn, html.big .tab-btn, html.big .app-bar .tab-btn { height: 34px; min-height: 0; font-size: 14px; padding: 0 12px; }
  #btn-menu { min-height: 32px; height: 32px; }
  html.big { --label-w: 100px; }
  .tile, html.big .tile { padding: 5px 8px 6px 10px; min-height: 0; }
  html.big .tile-val, .tile-val { font-size: 19px; } html.big .tile-label, .tile-label { font-size: 11.5px; }
}
html.big .app-bar .tab-btn, .app-bar .tab-btn { height: 34px; min-height: 0; padding-block: 0; line-height: 34px; }
@media (max-width: 760px) { html.big .app-bar .tab-btn, .app-bar .tab-btn { height: 32px; line-height: 32px; } }
.chg-item .chg-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tab-btn[hidden] { display: none; }

/* fold cover (<=340px): the date range row and the zoom row wrap instead of pushing the page sideways */
@media (max-width: 340px) {
  .toolbar .tb-group.range { flex-wrap: wrap !important; row-gap: 4px; }
  .toolbar .tb-group.range .range-label { flex: 1 1 100%; margin-left: 0; white-space: normal; }
  .zoom { flex-wrap: wrap; height: auto; row-gap: 4px; }
  .zoom input[type=range] { flex: 1 1 70px; width: auto; min-width: 50px; }
}

/* login language flags (factory staff asked for flags instead of a hidden dropdown) */
.flag-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.flag-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 6px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: inherit; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.flag-btn[aria-pressed="true"] { border-color: var(--accent, #2a5bd7); box-shadow: 0 0 0 2px rgba(42, 91, 215, .25); font-weight: 600; }
.flag-btn svg { width: 24px; height: 16px; border: 1px solid rgba(0, 0, 0, .25); border-radius: 2px; flex: none; }
.fl-w { fill: #fff; } .fl-red { fill: #e70011; } .fl-r { fill: #cd2e3a; } .fl-b { fill: #0047a0; } .fl-navy { fill: #3c3b6e; }
.fl-k { stroke: #111; stroke-width: 1.1; fill: none; } .fl-st { stroke: #b22234; stroke-width: 1.5; fill: none; }

/* 공통 디자인(DOOSAN 업무 디자인 v1) — 로그인·권한없음 화면: 초록 브랜드, 공통 상단 바, 같은 카드. 안쪽 화면은 그대로. */
#screen-login .ds-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--ds-brand); color: var(--ds-on-brand); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
#screen-login .ds-eyebrow { margin: 6px 0 0; }
#screen-login .login-card, #screen-denied .login-card { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: 14px; box-shadow: var(--ds-shadow); font-family: var(--ds-font); }
#screen-login .login-card h1 { font-family: var(--ds-font); font-size: var(--ds-fs-xl, 20px); letter-spacing: -.02em; margin: 0; }
#screen-login .login-card input { border-color: var(--ds-line); border-radius: var(--ds-r-md, 10px); background: var(--ds-surface); }
#screen-login .login-card input:focus { outline: 2px solid var(--ds-focus); outline-offset: 1px; }
#screen-login .btn.primary { background: var(--ds-brand); border-color: var(--ds-brand); color: var(--ds-on-brand); box-shadow: none; }
#screen-login .btn.primary:hover:not(:disabled) { background: var(--ds-brand-strong); filter: none; }
.flag-btn[aria-pressed="true"] { border-color: var(--ds-brand); box-shadow: 0 0 0 2px var(--ds-brand-bg); }
body:has(#screen-login:not([hidden])), body:has(#screen-denied:not([hidden])) { background: var(--ds-bg); }
#ds-bar[hidden] { display: none; }
/* sched decides dark by prefers-color-scheme as well as data-theme; give the shared tokens the same dark values */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ds-bg:#0f1a22;--ds-surface:#172530;--ds-surface-2:#1e2f3b;--ds-line:#2b3e4c;--ds-line-strong:#41586a;--ds-ink:#e6eef4;--ds-ink-2:#b9cad6;--ds-muted:#94a8b7;
  --ds-brand:#5fb0ec;--ds-brand-strong:#8cc8f3;--ds-brand-bg:#17324a;--ds-bar:#0c1820;--ds-on-brand:#08202f;--ds-focus:#5fb0ec;--ds-shadow:0 6px 22px rgba(0,0,0,.4); } }
#screen-login .login-card, #screen-denied .login-card { color: var(--ds-ink); }
#screen-login .lang-sel { background: var(--ds-surface); color: var(--ds-ink); border-color: var(--ds-line); font-family: var(--ds-font); }

#screen-login .lang-mini { display: none; }   /* flags above are the language switch on the login screen */
#screen-login .login-card { padding: 16px 18px 18px; gap: 6px; width: min(380px, 92vw); }
#screen-login .ds-login-head h1 { margin: 0; font-size: 20px; }
#screen-login .ds-login-head .flag-row { margin: 0; }
#screen-login .ds-login-head .flag-btn { padding: 2px 4px; min-height: 24px; gap: 0; }
#screen-login .ds-login-head .flag-btn span { display: none; }
#screen-login .ds-login-head .flag-btn svg { width: 22px; height: 15px; }
#screen-login .ds-mark { width: 34px; height: 34px; font-size: 13px; }
#screen-login .login-card label { margin-top: 6px; }
#screen-login, #screen-denied { min-height: auto; place-content: start center; padding: 48px 0 0; gap: 0; }
#screen-login .login-card { min-height: 236px; box-sizing: border-box; align-content: start; }
:root { --font: var(--ds-font); }   /* shared typography (ds.css v1.9) */
html body, html body .ds-nav a, html body .ds-brand { line-height: 1.4; }
html.big body { line-height: 1.4; }

/* common app bar (OS · shipment · weekly · schedule) stays visible after login; it replaces the old two-tab strip */
body.ds-nav .app-tabs{display:none}
body.ds-nav { flex-direction: column; align-items: stretch; }
body.ds-nav #ds-bar { width: 100%; flex: 0 0 auto; }
body.ds-nav #app { width: 100%; flex: 1 1 auto; min-width: 0; }
