/* Glove box log book — 스타일. 색은 모두 :root 토큰으로 관리 (다크 모드 자동).
 * 브랜드 색은 PIXEL LAB 로고에서: 파랑 #0877b8 · 초록 #0ca93b · 빨강 #bb0407 · 회색 #3f3f3e
 */
:root {
  color-scheme: light;
  --bg: #e9edf2;            /* 바탕: 흰색보다 한 톤 어둡게 해서 카드와 글자가 떠 보이게 */
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #dde3eb;     /* 표 머리줄 */
  --border: #cfd6e0;
  --border-strong: #a9b4c3;
  --text: #0f1722;
  --text-2: #2d3748;        /* 라벨 · 보조 제목 */
  --muted: #586274;
  --bar: #1c2533;           /* 상단바 */
  --bar-2: #273244;
  --bar-text: #c5cedb;
  --logo-ink: #ffffff;      /* 어두운 상단바 위 로고 글자 · 격자 */
  --accent: #0877b8;
  --accent-hover: #06659d;
  --accent-soft: #dcebf6;
  --accent-ink: #ffffff;
  --danger: #b3060a;
  --danger-soft: #f9e4e4;
  --ok: #08832f;
  --ok-soft: #dff3e6;
  --warn: #9a5800;
  --warn-soft: #fcefd8;
  --g1: #0877b8;            /* 묶음 색: Start */
  --g1-soft: #e6f1f9;
  --g2: #08953a;            /* Substrate */
  --g2-soft: #e5f5ea;
  --g3: #b3060a;            /* End */
  --g3-soft: #f9e8e8;
  --l-good: #0ca93b;        /* 신호등: Good / Normal / Bad */
  --l-good-soft: #dcf3e4;
  --l-good-ink: #076d27;
  --l-normal: #f2b705;
  --l-normal-soft: #fdf2cc;
  --l-normal-ink: #7a5600;
  --l-bad: #d0161b;
  --l-bad-soft: #fbe2e2;
  --l-bad-ink: #9b0a0e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .05);
  --font: "Pretendard", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "D2Coding", Consolas, ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0e131a;
    --surface: #161d27;
    --surface-2: #1b2330;
    --surface-3: #243042;
    --border: #2c3747;
    --border-strong: #435064;
    --text: #e9eef5;
    --text-2: #c6cfdb;
    --muted: #97a3b5;
    --bar: #0a0f15;
    --bar-2: #171f2a;
    --bar-text: #b9c3d1;
    --accent: #3b9fe0;
    --accent-hover: #5cb1e8;
    --accent-soft: #15324a;
    --accent-ink: #06121d;
    --danger: #f07a7a;
    --danger-soft: #3a1f22;
    --ok: #4fd283;
    --ok-soft: #173325;
    --warn: #e7b264;
    --warn-soft: #3a2e1a;
    --g1: #4aa8e6;
    --g1-soft: #142a3d;
    --g2: #45c873;
    --g2-soft: #13301f;
    --g3: #ef7676;
    --g3-soft: #361b1d;
    --l-good: #3ccf6a;
    --l-good-soft: #133322;
    --l-good-ink: #6fe194;
    --l-normal: #f5c63a;
    --l-normal-soft: #3a3011;
    --l-normal-ink: #f7d570;
    --l-bad: #f05a5e;
    --l-bad-soft: #3c1a1c;
    --l-bad-ink: #f79295;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 var(--font); letter-spacing: -0.005em;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.3; margin: 0; font-weight: 750; letter-spacing: -0.02em; color: var(--text); }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 700; color: var(--text); }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); padding: 0 5px; border-radius: 4px; word-break: break-all; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* ---------- 상단바 ---------- */
.topbar { background: var(--bar); position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.topbar-inner { max-width: 1800px; margin: 0 auto; padding: 0 20px; height: 58px; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; flex: none; }
.brand:hover { text-decoration: none; }
.brand .logo { height: 26px; width: auto; display: block; }
.brand .logo .ink { fill: var(--logo-ink); }
.brand-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .25); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; align-self: stretch; }
.nav a {
  display: flex; align-items: center; color: var(--bar-text); padding: 0 14px; font-weight: 600;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.nav a:hover { color: #fff; background: var(--bar-2); text-decoration: none; }
.nav a.active { color: #fff; border-bottom-color: var(--accent); }

.page { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
.page.wide { max-width: 2400px; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.head-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--danger); }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.icon-btn:disabled { opacity: .3; cursor: default; }

/* ---------- 카드 ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + section { margin-top: 16px; }
.prose { white-space: pre-wrap; word-break: break-word; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.notice { background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty.error { color: var(--danger); }
.foot { font-size: 12px; margin-top: 8px; }

/* ---------- 입력 ---------- */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 7px; padding: 7px 10px; min-width: 0;
}
input, select { height: 36px; }
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #8a94a3; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input:invalid { border-color: var(--warn); background: var(--warn-soft); }
input[type="color"] { width: 52px; padding: 3px; }
input:disabled { background: var(--surface-2); color: var(--muted); }

.form { display: flex; flex-direction: column; gap: 16px; }
.form label, .form .field { display: flex; flex-direction: column; gap: 5px; font-weight: 650; font-size: 13px; color: var(--text-2); }
.form label input, .form label select, .form label textarea,
.form .field input, .form .field select, .form .field textarea { font-weight: 400; font-size: 14px; color: var(--text); }
.form .field-label { font-weight: 650; font-size: 13px; color: var(--text-2); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form label.check input { height: auto; }
.row { display: grid; gap: 12px; }
.row.c2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row.c3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.row.c4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row-name { display: flex; gap: 12px; align-items: flex-end; }
.row-name .grow { flex: 1; }
.unit { color: var(--muted); font-weight: 500; font-size: 12px; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); margin-top: 2px; padding-top: 14px; }

/* 기록 항목: 묶음이 없는 칸은 그대로, 묶음은 색 띠가 있는 상자 */
.pfields:empty { display: none; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 12px; align-items: end; }
.pgrid .span-all, .pgrid > .pgroup { grid-column: 1 / -1; }
.pgrid .span2 { grid-column: span 2; }

/* 시간 범위 (시작 ~ 종료) */
.trange { display: flex; align-items: center; gap: 6px; }
.trange input, .trange select { flex: 1; min-width: 0; }
.trange > span { color: var(--muted); font-weight: 700; }

/* 앞 기호가 붙는 입력칸 (# 25) */
.affix { display: flex; }
.affix > span {
  display: flex; align-items: center; padding: 0 11px; border: 1px solid var(--border-strong); border-right: 0;
  border-radius: 7px 0 0 7px; background: var(--surface-3); color: var(--text-2); font-weight: 750;
}
.affix > input { flex: 1; min-width: 0; border-radius: 0 7px 7px 0; }

/* 신호등 선택 (미평가 / Good / Normal / Bad) */
.lights { display: flex; flex-wrap: wrap; gap: 6px; }
.form label.light { display: inline-flex; flex-direction: row; position: relative; cursor: pointer; }
.light input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.light .pill {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  font-weight: 650; font-size: 13px; color: var(--text-2); user-select: none;
}
.light .pill i { width: 13px; height: 13px; border-radius: 50%; background: var(--lc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.light:hover .pill { border-color: var(--muted); }
.light input:checked + .pill { border: 2px solid var(--lc); padding: 0 13px; background: var(--lc-soft); color: var(--lc-ink); }
.light input:focus-visible + .pill { outline: 3px solid var(--accent-soft); }
.light.none { --lc: transparent; --lc-soft: var(--surface-2); --lc-ink: var(--text-2); }
.light.none .pill i { border: 1.5px dashed var(--border-strong); box-shadow: none; }
.light.none input:checked + .pill { border-color: var(--border-strong); }
.good { --lc: var(--l-good); --lc-soft: var(--l-good-soft); --lc-ink: var(--l-good-ink); }
.normal { --lc: var(--l-normal); --lc-soft: var(--l-normal-soft); --lc-ink: var(--l-normal-ink); }
.bad { --lc: var(--l-bad); --lc-soft: var(--l-bad-soft); --lc-ink: var(--l-bad-ink); }
.light-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px 1px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 750; white-space: nowrap;
  background: var(--lc-soft, var(--surface-3)); color: var(--lc-ink, var(--text-2));
}
.light-badge i { width: 11px; height: 11px; border-radius: 50%; background: var(--lc, var(--muted)); }
.pgroup {
  --gc: var(--accent); --gs: var(--accent-soft);
  margin: 4px 0 0; padding: 18px 14px 14px; border: 1px solid var(--border); border-left: 4px solid var(--gc);
  border-radius: 8px; background: var(--gs);
}
.pgroup legend {
  background: var(--gc); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 10px; border-radius: 999px;
}
.g1 { --gc: var(--g1); --gs: var(--g1-soft); }
.g2 { --gc: var(--g2); --gs: var(--g2-soft); }
.g3 { --gc: var(--g3); --gs: var(--g3-soft); }
.gn { --gc: var(--text-2); --gs: var(--surface-3); }   /* 묶음 색이 없는 줄 (예: Spin coating step1~3) */

/* ---------- 필터 · 목록 ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .grow { flex: 1 1 260px; }
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 12.5px; font-weight: 700; color: var(--text-2); padding: 10px 12px;
  border-bottom: 2px solid var(--border-strong); background: var(--surface-3); white-space: nowrap; vertical-align: bottom;
}
table.list td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; background: var(--surface); }
table.list tbody tr:nth-child(even) td { background: var(--surface-2); }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr[data-href] { cursor: pointer; }
table.list tbody tr[data-href]:hover td { background: var(--accent-soft); }
table.list td.title-cell { font-weight: 650; }
table.list td.center { text-align: center; font-weight: 650; }
table.log th { white-space: normal; word-break: keep-all; min-width: 58px; line-height: 1.3; padding: 9px 10px; }
table.log td { font-size: 13.5px; padding: 9px 10px; }
table.log td.wrap-md { min-width: 190px; max-width: 240px; }
table.log td.wrap-sm { min-width: 120px; max-width: 200px; }
table.log td.remarks { min-width: 170px; max-width: 300px; }
/* Start / End 를 한 칸에 두 줄로 */
.se-row { display: flex; align-items: center; gap: 7px; line-height: 1.5; }
.se-row + .se-row { margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--border); }
.se-tag {
  min-width: 38px; text-align: center; font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  padding: 0 5px; border-radius: 4px; color: var(--gc); background: var(--gs);
}
/* 열이 많아 옆으로 밀어도 날짜 열은 왼쪽에 고정 */
table.log th:first-child, table.log td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--border-strong); }

/* 열 표시 패널 */
.colpick { position: relative; }
.colpanel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(520px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .18); padding: 12px 14px;
}
.colpanel-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.colpanel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; max-height: 60vh; overflow: auto; }
.colopt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 550; }
.colopt:hover { background: var(--surface-2); }
.colopt input { height: auto; margin: 0; accent-color: var(--accent); }
.colpanel > .sub { margin: 8px 0 0; }
.th-sub { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.list-foot { display: flex; justify-content: center; padding: 12px; }

/* ---------- 칩 · 배지 · 태그 ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--c, #888); flex: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 650; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.badge.gray { background: var(--surface-3); color: var(--text-2); }
.tag {
  display: inline-flex; align-items: center; gap: 2px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 0 7px; border-radius: 5px; line-height: 22px; white-space: nowrap; margin: 1px 0;
}
.tag button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 3px; font-size: 14px; line-height: 1; }
.tag button:hover { color: var(--danger); }
.clip { vertical-align: -2px; color: var(--muted); }

/* ---------- 상세 ---------- */
dl.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; font-weight: 600; }
dl.kv dd { margin: 0; word-break: break-word; }
table.rec { width: 100%; border-collapse: collapse; }
table.rec th, table.rec td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.rec tr:last-child > * { border-bottom: 0; }
table.rec tr.run-start > * { border-top: 2px solid var(--border-strong); }
table.rec th { font-weight: 650; color: var(--text-2); font-size: 13px; width: 240px; background: var(--surface-2); }
table.rec th.grp {
  width: 96px; color: var(--gc, var(--muted)); background: var(--gs, var(--surface-2)); border-left: 4px solid var(--gc, var(--muted));
  font-size: 12.5px; font-weight: 750; letter-spacing: .02em;
}
table.rec th[colspan] { border-left: 4px solid transparent; }
table.rec td { font-weight: 500; }

/* 첨부 */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 12px; }
.att { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 8px; min-width: 0; background: var(--surface-2); }
.att-thumb { width: 52px; height: 52px; border-radius: 6px; overflow: hidden; flex: none; background: var(--surface-3); display: flex; align-items: center; justify-content: center; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb.file { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--text-2); text-transform: uppercase; }
.att-thumb.file:hover { text-decoration: none; color: var(--accent); }
.att-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-meta a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dropzone {
  display: flex !important; align-items: center; justify-content: center; text-align: center; padding: 16px;
  border: 1.5px dashed var(--border-strong); border-radius: 8px; color: var(--muted); cursor: pointer;
  font-weight: 500 !important; background: var(--surface-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pending { display: flex; flex-wrap: wrap; gap: 6px; }
.pending:empty { display: none; }

/* 수정 이력 */
details.hist { border-top: 1px solid var(--border); padding: 8px 0; }
details.hist:first-of-type { border-top: 0; }
details.hist summary { cursor: pointer; font-weight: 600; }
table.diff { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
table.diff th, table.diff td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: pre-wrap; word-break: break-word; }
table.diff th { color: var(--muted); font-weight: 600; }
table.diff td.old { color: var(--danger); text-decoration: line-through; }
table.diff td.new { color: var(--ok); font-weight: 600; }

/* 기판 재고 */
.qty-input { width: 84px; height: 32px; text-align: right; font-weight: 700; }
.neg { color: var(--danger); font-weight: 800; }
.stock-now { display: flex; align-items: baseline; gap: 6px; padding: 4px 16px; border-left: 3px solid var(--accent); margin-right: 6px; }
.stock-now b { font-size: 28px; line-height: 1; }
table.sheet td { vertical-align: middle; }
table.sheet tr.entry-row td { background: var(--accent-soft) !important; border-bottom: 2px solid var(--border-strong); }
table.sheet tr.entry-row input { width: 100%; height: 34px; }
table.sheet tr.entry-row .count-input { width: 90px; text-align: right; }
table.sheet tfoot td { background: var(--surface-3); font-weight: 650; border-top: 2px solid var(--border-strong); padding: 9px 12px; }

/* 공정 종류 */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
a.type-card { display: block; color: var(--text); border-left: 5px solid var(--c); margin: 0; }
a.type-card:hover { text-decoration: none; border-color: var(--border-strong); border-left-color: var(--c); }
.type-card h3 { margin: 0 0 6px; font-size: 16px; }
.type-card .sub { display: block; }
.fe-head, .fe-row { display: grid; grid-template-columns: 110px minmax(150px, 1.6fr) 100px 64px 80px minmax(120px, 1.1fr) 130px 62px 92px; gap: 8px; align-items: center; }
.fe-check { display: flex !important; flex-direction: row !important; align-items: center; justify-content: center; gap: 4px; }
.fe-check input { width: auto; height: auto; }
.fe-check-label { display: none; font-size: 12px; font-weight: 500; }
/* 기록 작성: substrate 여러 개 */
.sub-block { position: relative; }
.sub-block .sub-del { position: absolute; top: 8px; right: 8px; }
.sub-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.batch-note { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.check-inline input { width: auto; height: auto; }
.fe-head { font-size: 12px; color: var(--muted); font-weight: 650; padding: 0 2px 4px; }
.fe-row { padding: 4px 0; }
.fe-row input, .fe-row select { font-weight: 400; }
.fe-btns { display: flex; gap: 2px; }

/* 설정: 큰 백업 버튼 + 더보기 */
.backup-main { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; border-left: 5px solid var(--accent); }
.backup-main .bm-text { flex: 1 1 360px; }
.backup-main h2 { margin-bottom: 6px; }
.backup-main p { margin: 0 0 6px; }
.btn.big { height: 48px; padding: 0 28px; font-size: 16px; border-radius: 10px; }
details.more > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; color: var(--text-2); padding: 8px 4px; user-select: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: "▾"; font-size: 12px; transition: transform .15s; }
details.more[open] > summary::after { transform: rotate(180deg); }
.more-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
details.opt { border-bottom: 1px solid var(--border); }
details.opt:last-child { border-bottom: 0; }
details.opt > summary {
  cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 12px; padding: 13px 18px;
}
details.opt > summary::-webkit-details-marker { display: none; }
details.opt > summary::before { content: "▸"; color: var(--muted); width: 10px; flex: none; transition: transform .15s; }
details.opt[open] > summary::before { transform: rotate(90deg); }
details.opt > summary:hover { background: var(--surface-2); }
details.opt > summary b { min-width: 190px; }
details.opt[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.opt-body { padding: 14px 18px 18px 40px; }
.opt-body > p:first-child { margin-top: 0; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.teams { background: #e8e6f8; color: #4b3fa6; }
.sync-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.sync-item {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; text-align: left; cursor: pointer;
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font: inherit; color: var(--text);
}
.sync-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.sync-item .path { flex-basis: 100%; font-family: var(--mono); font-size: 11.5px; }
.notice-plain { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 10px 14px; margin: 8px 0 12px; background: var(--surface-2); }
.notice-plain ol { margin: 6px 0 0; }
.fbrowser { border: 1px solid var(--accent); border-radius: 9px; padding: 10px 12px; margin: 6px 0 12px; background: var(--surface); }
.fb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fb-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.fb-dir {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface-2); font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.fb-dir:hover { border-color: var(--accent); color: var(--accent); }

/* 설정: 백업 · 공유 */
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.share-box { border: 1px solid var(--border); border-radius: 9px; padding: 14px 16px; background: var(--surface-2); }
.share-box h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; }
.share-box p { margin: 0 0 10px; font-size: 13px; }
.share-box .actions { margin-top: 6px; }
.step {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; flex: none;
}
.form.compact { gap: 10px; }
.warn-text { color: var(--warn); background: var(--warn-soft); border-radius: 7px; padding: 7px 10px; font-size: 13px; font-weight: 550; margin: 0; }
details.how { margin-top: 10px; font-size: 13px; }
details.how summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.how ol { margin-top: 6px; }
h3.sec { font-size: 14px; margin: 18px 0 8px; }
.imp-card { margin-top: 14px; border: 2px solid var(--warn); border-radius: 10px; padding: 14px 16px; background: var(--surface); }
.imp-card h3 { margin: 0 0 10px; }
.imp-card .warn-text { margin: 12px 0 0; }
.imp-card dl.kv { grid-template-columns: 70px 1fr; }

/* glove box 예약: 주간 달력 */
.card.week-wrap { padding: 0; overflow-x: auto; }   /* .card 의 좁은 화면 여백보다 우선 (시간 칸이 왼쪽 끝에 붙게) */
.week-grid {
  display: grid; grid-template-columns: 56px repeat(7, minmax(112px, 1fr));
  grid-template-rows: auto calc(var(--hours) * var(--hour-px)); min-width: 840px;
}
.wk-corner, .wk-head { border-bottom: 2px solid var(--border-strong); background: var(--surface-3); }
.wk-head { padding: 8px 10px; font-size: 13px; display: flex; gap: 6px; align-items: baseline; border-left: 1px solid var(--border); }
.wk-head span { color: var(--muted); }
.wk-head.weekend b { color: var(--danger); }
.wk-head.today { background: var(--accent); color: var(--accent-ink); }
.wk-head.today span, .wk-head.today b { color: var(--accent-ink); }
.wk-times { position: sticky; left: 0; z-index: 3; background: var(--surface); }   /* 좁은 화면에서 옆으로 밀어도 시간 칸은 고정 */
.wk-corner { position: sticky; left: 0; z-index: 3; }
.wk-time { height: var(--hour-px); position: relative; }
.wk-time span { position: absolute; top: -8px; right: 8px; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.wk-time:first-child span { top: 3px; }
.wk-day {
  position: relative; border-left: 1px solid var(--border); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour-px) - 1px),
    var(--border) calc(var(--hour-px) - 1px), var(--border) var(--hour-px));
}
.wk-day.today { background-color: var(--accent-soft); }
.wk-day:hover { background-color: var(--surface-2); }
.wk-day.today:hover { background-color: var(--accent-soft); }
.wk-block {
  position: absolute; margin-left: 2px; overflow: hidden; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 0; padding: 3px 6px; font: inherit; font-size: 12px; line-height: 1.3;
  border: 1px solid var(--border-strong); border-left: 4px solid var(--c); border-radius: 6px;
  background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}
@supports (background: color-mix(in srgb, red 10%, white)) {
  .wk-block { background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
}
.wk-block:hover { border-color: var(--c); z-index: 2; }
.wk-block b { font-size: 11.5px; }
.wk-block .who { font-weight: 700; }
.wk-block .what { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 로그인 · 작성자 · 외부 접속 */
.whoami { display: flex; align-items: center; gap: 10px; color: var(--bar-text); font-size: 13px; white-space: nowrap; flex: none; }
.whoami:empty { display: none; }
.whoami b, .who-name { color: #fff; font-weight: 700; }
.who-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bar-2); border-radius: 999px; padding: 4px 6px 4px 11px; }
.who-chip.plain { padding-right: 11px; }
.who-chip button, .who-link {
  background: none; border: 0; color: var(--bar-text); cursor: pointer; font: inherit; padding: 0 4px; line-height: 1;
}
.who-chip button { font-size: 16px; }
.who-link { text-decoration: underline; text-underline-offset: 3px; }
.who-chip button:hover, .who-link:hover { color: #fff; }
body.readonly .w { display: none !important; }
body.remote [data-nav="types"] { display: none; }
body.readonly [data-nav="settings"] { display: none; }
body.anon .nav, body.anon #top-new, body.anon .whoami { display: none; }
.author-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--text-2); white-space: nowrap; }
.form label.author-pick { flex-direction: row; align-items: center; }
.author-pick select { min-width: 150px; font-weight: 400; }
.login-wrap { min-height: calc(100vh - 150px); display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; padding: 26px 26px 22px; }
.login-card h1 { margin: 0; }
.login-card .muted { margin: 0; }
.login-card .btn.big { width: 100%; justify-content: center; }
.form.narrow { max-width: 420px; }
.inline-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.inline-row input { flex: 1 1 260px; min-width: 0; }
.inline-row input[readonly] { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); }
.opt-body label.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; }
.opt-body label.check input[type="checkbox"] { width: auto; height: auto; flex: none; }
.port-input { width: 90px !important; height: 30px; padding: 0 6px; display: inline-block; }
ol.setup { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
ol.setup > li { padding-left: 4px; }
ol.setup > li::marker { font-weight: 800; color: var(--accent); }
ol.setup .how { margin-top: 6px; }
tr.pw-row td { background: var(--surface-2); }

ul.plain { list-style: none; padding: 0; margin: 10px 0 0; }
ul.plain li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
ul.plain li:last-child { border-bottom: 0; }
ol.steps { margin: 0; padding-left: 20px; }
ol.steps li { margin: 4px 0; }

/* ---------- 토스트 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--bar); color: #fff; padding: 10px 18px; border-radius: 8px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); transition: opacity .15s, transform .15s; max-width: calc(100vw - 32px); z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); color: #fff; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 860px) {
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 8px 14px; padding: 10px 16px 0; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: calc(100% + 32px); margin: 0 -16px; padding: 0 6px; overflow-x: auto; height: 42px; }
  .page { padding: 18px 16px 48px; }
  h1 { font-size: 19px; }
  .card { padding: 14px; }
  table.rec th { width: auto; }
  .fe-head { display: none; }
  .fe-row { grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .fe-row > input[data-k="label"], .fe-row > input[data-k="options"] { grid-column: 1 / -1; }
  .fe-check { justify-content: flex-start; }
  .fe-check-label { display: inline; }
}
@media (max-width: 480px) {
  .brand-sep, .brand-name { display: none; }
  .pgrid .span2 { grid-column: 1 / -1; }
}
