/* 형제 프로젝트(브랜드별 매출 현황 · 월간 SF 점검 · 브랜드별 이슈 클리핑)와 동일한 레이아웃 비율/토큰.
   값을 바꿀 때는 ../../브랜드별 매출 현황/web_deploy/index.html 의 <style>과 먼저 대조할 것. */
@font-face {
  font-family: 'NanumBarunGothic';
  font-weight: 100 500;
  font-style: normal;
  font-display: swap;
  src: url('fonts/나눔바른고딕.ttf') format('truetype');
}
@font-face {
  font-family: 'NanumBarunGothic';
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
  src: url('fonts/나눔바른고딕Bold.ttf') format('truetype');
}
:root {
  color-scheme: light;
  --page: #f4f5fa;
  --surface-1: #ffffff;
  --surface-2: #ffffff;
  --text-primary: #0c1220;
  --text-secondary: #565f72;
  --text-muted: #8891a6;
  --grid: #e8e9f1;
  --border: rgba(15,23,42,0.09);
  --good: #0fa968;
  --good-text: #0c8a57;
  --critical: #e1444b;
  --series-1: #14a19b;
  --series-2: #7c5cfc;
  --series-3: #f5a524;
  --series-1-wash: rgba(20,161,155,0.10);
  --accent-chip-bg: rgba(20,161,155,0.10);
  --accent-chip-bg-soft: rgba(20,161,155,0.05);
  --accent-chip-border: #14a19b;
  --target-color: #f0990a;
  --good-bg: rgba(15,169,104,0.13);
  --critical-bg: rgba(225,68,75,0.12);
  --amber-bg: rgba(245,165,36,0.15);
  --amber-text: #93600a;
  --card-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 18px 36px -22px rgba(15,23,42,0.16);
  --zebra-bg: rgba(15,23,42,0.022);
  --font-disp: 'NanumBarunGothic', 'Malgun Gothic', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: 'NanumBarunGothic', 'Malgun Gothic', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: 'NanumBarunGothic', 'Malgun Gothic', system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #12151d;
    --surface-1: #191d28;
    --surface-2: #1e2330;
    --text-primary: #f2f3f8;
    --text-secondary: #a9b0c3;
    --text-muted: #767f95;
    --grid: #2a3040;
    --border: rgba(255,255,255,0.10);
    --good: #22c98b;
    --good-text: #3ddb9c;
    --critical: #ff6b71;
    --series-1: #2bd4cc;
    --series-2: #9c85ff;
    --series-3: #ffb74a;
    --series-1-wash: rgba(43,212,204,0.14);
    --accent-chip-bg: rgba(43,212,204,0.14);
    --accent-chip-bg-soft: rgba(43,212,204,0.07);
    --accent-chip-border: #2bd4cc;
    --target-color: #ffb74a;
    --good-bg: rgba(34,201,139,0.18);
    --critical-bg: rgba(255,107,113,0.18);
    --amber-bg: rgba(255,183,74,0.16);
    --amber-text: #ffb74a;
    --card-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 18px 36px -22px rgba(0,0,0,0.55);
    --zebra-bg: rgba(255,255,255,0.028);
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(900px 480px at 6% -8%, rgba(20,161,155,0.07), transparent 60%),
    radial-gradient(900px 480px at 98% -4%, rgba(124,92,252,0.08), transparent 60%),
    var(--page);
  background-attachment: fixed;
}
.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 20px 60px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- 헤더 ---- */
header.topbar { margin-bottom: 26px; position: relative; padding-right: 340px; min-height: 113px; }
.ci-logo-wrap { position: absolute; top: 28px; right: 20px; }
.ci-logo-wrap img { display: block; height: 113px; width: auto; }
.header-user-row { position: absolute; top: 0; right: 20px; display: flex; align-items: center; gap: 8px; }
.project-switch { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.switch-btn {
  font-family: var(--font-body); font-size: 12px; font-weight: 700; padding: 6px 13px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1);
  color: var(--text-secondary); text-decoration: none; cursor: pointer; transition: all .15s ease;
}
.switch-btn:hover { border-color: var(--accent-chip-border); color: var(--series-1); }
header.topbar h1 {
  font-family: var(--font-disp); font-weight: 900; letter-spacing: -0.02em; line-height: 1.08;
  font-size: clamp(26px, 3.6vw, 36px); margin: 0 0 8px; color: var(--text-primary);
}
header.topbar p.sub { margin: 0; color: var(--text-secondary); font-size: 13.5px; white-space: nowrap; }
.user-label { font-size: 12px; color: var(--text-muted); }
@media (max-width: 720px) {
  .ci-logo-wrap { display: none; }
  header.topbar { padding-right: 0; min-height: 0; }
  header.topbar p.sub { white-space: normal; }
}

/* ---- 카드 ---- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
}
.card + .card { margin-top: 16px; }
.card h2 {
  font-family: var(--font-body); font-size: 15px; font-weight: 700; margin: 0 0 14px; letter-spacing: -0.005em;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.card h2 .sub { font-size: 12px; font-weight: 400; color: var(--text-muted); }

.note-banner { display: flex; gap: 12px; align-items: flex-start; background: var(--amber-bg); border-radius: 10px; padding: 13px 16px; margin-bottom: 16px; font-size: 12.5px; color: var(--text-secondary); }
.note-banner .ni { font-size: 16px; flex: none; line-height: 1.3; }
.note-banner b { color: var(--amber-text); }
.note-banner a { color: var(--amber-text); font-weight: 700; cursor: pointer; text-decoration: underline; margin-left: 6px; }

/* ---- 상단 고정 탭 ---- */
.brand-tab-sticky {
  position: sticky; top: 0; z-index: 30; background: var(--page);
  padding: 12px 28px; margin: 0 0 16px; box-shadow: 0 8px 12px -8px rgba(0,0,0,0.12);
}
.brand-tab-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-tab {
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary);
  border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  user-select: none; font-family: var(--font-body); transition: all .15s; white-space: nowrap;
}
.brand-tab:hover { border-color: var(--accent-chip-border); color: var(--series-1); transform: translateY(-1px); }
.brand-tab.active {
  background: var(--series-1); border-color: var(--series-1); color: #fff;
  box-shadow: 0 2px 8px rgba(20,161,155,0.28);
}
.brand-tab .count { font-family: var(--font-mono); font-size: 11px; margin-left: 5px; opacity: .75; }
.panel { display: none; }
.panel.active { display: block; }

/* ---- KPI ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px 14px 18px; position: relative; overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: 0 14px 26px -16px rgba(15,23,42,0.22); }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--series-1); opacity: .9; }
.kpi-grid .kpi:nth-child(1)::before { background: var(--target-color); }
.kpi-grid .kpi:nth-child(4)::before { background: var(--series-2); }
.kpi .label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.kpi .value { font-family: var(--font-mono); font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.kpi .value .unit { font-size: 12px; color: var(--text-muted); margin-left: 2px; font-weight: 500; }
.kpi .value.warn { color: var(--amber-text); }
.kpi .delta { font-size: 11.5px; margin-top: 6px; font-weight: 600; color: var(--text-muted); }

/* ---- 버튼 ---- */
.btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; cursor: pointer; font-weight: 600;
  font-family: var(--font-body); transition: all .15s;
}
.btn:hover { border-color: var(--accent-chip-border); color: var(--series-1); background: var(--accent-chip-bg); }
.btn.small { padding: 4px 11px; font-size: 11.5px; font-weight: 500; }
.btn.primary { background: var(--series-1); border-color: var(--series-1); color: #fff; font-weight: 700; }
.btn.primary:hover { opacity: .92; color: #fff; background: var(--series-1); }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { border-color: var(--accent-chip-border); background: var(--accent-chip-bg); }
.actions-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.actions-row .err { color: var(--critical); font-size: 12px; margin-right: auto; }

/* ---- 폼 (필터 레이블은 형제의 .filter-col-title 톤) ---- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.col-span { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; position: relative; min-width: 0; }
.field label { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: .04em; }
.field .req { color: var(--critical); }
input[type=text], input[type=date], input[type=month], input[type=number], input[type=email], select, textarea {
  font-family: var(--font-body); font-size: 13px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-primary); outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-chip-border); }
textarea { resize: vertical; min-height: 64px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filter-row .field { width: 180px; }
.filter-row .field.grow { flex: 1; min-width: 220px; width: auto; }

/* 수령자 목록: 입력칸 폭이 아니라 내용(팀명·이름·직급·사번) 길이에 맞춤 */
.suggest { position: absolute; left: 0; width: max-content; min-width: 100%; max-width: calc(100vw - 40px); top: 100%; margin-top: 4px; z-index: 20; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--card-shadow); max-height: 360px; overflow: auto; display: none; }
.suggest div { padding: 8px 18px 8px 12px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.suggest div:hover, .suggest div.hl { background: var(--accent-chip-bg); }
.suggest .sub { color: var(--text-muted); font-size: 12px; margin-left: 6px; }
.suggest .chk { display: inline-block; width: 18px; color: var(--series-1); font-weight: 700; }
.suggest div.on { background: var(--accent-chip-bg-soft); }
.suggest .team { display: inline-block; min-width: 96px; margin-right: 6px; color: var(--text-secondary); font-size: 12.5px; }
.picked { font-size: 12px; color: var(--text-secondary); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.picked { min-height: 30px; align-content: flex-start; }
.mini-badge { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary); }
.mini-badge.missing { background: var(--amber-bg); border-color: transparent; color: var(--amber-text); }
.count-note { color: var(--series-1); letter-spacing: 0; margin-left: 4px; }
.suggest .team-row { color: var(--series-1); border-bottom: 1px solid var(--grid); }
.suggest .team-row b { font-weight: 700; }
.pick-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--accent-chip-bg); border: 1px solid var(--accent-chip-border); color: var(--text-primary); font-weight: 600; }
.pick-chip .t { color: var(--text-muted); font-weight: 400; font-size: 11px; }
.pick-chip .warn { color: var(--amber-text); font-size: 10.5px; }
.pick-chip button { border: none; background: none; cursor: pointer; color: var(--text-muted); font-size: 11px; padding: 1px 5px; border-radius: 999px; line-height: 1.4; }
.pick-chip button:hover { color: var(--critical); background: var(--critical-bg); }
.picked { max-height: 132px; overflow-y: auto; }
.search-box { position: relative; width: 340px; max-width: 100%; }  /* 수령자 입력칸: 목록(팀명·이름·직급·사번) 폭에 맞춤 */
/* 지급 등록 배치: 1행 수령자(340px)│팀 선택(나머지), 2행 선택된 수령자, 3행 지급일│지급 사유│메모 */
.reg-row { display: grid; gap: 14px 20px; }
.reg-row + .reg-row { margin-top: 14px; }
.reg-row.cols-2 { grid-template-columns: 340px 1fr; }  /* 수령자 입력칸 폭 그대로, 팀 선택이 바로 옆에서 나머지 폭 사용 */
.reg-row.cols-3 { grid-template-columns: 170px auto 1fr; }  /* 지급일·지급 사유는 필요한 만큼만, 남는 폭은 메모 */
@media (max-width: 760px) { .reg-row.cols-2, .reg-row.cols-3 { grid-template-columns: 1fr; } }
.hint-note { font-weight: 400; color: var(--text-muted); font-size: 11px; letter-spacing: 0; margin-left: 4px; }
.picked-empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; }
.purpose-row { display: flex; gap: 8px; }
.purpose-row > select { flex: 0 0 150px; }
.purpose-row > div { flex: 0 0 200px; }  /* '기타' 선택 시에만 보이는 직접 입력칸 */
.chip-break { flex-basis: 100%; height: 0; }
/* 팀 버튼(형제 프로젝트 .chip 규격) */
.team-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.team-chips .lbl { font-size: 11.5px; color: var(--text-muted); font-weight: 700; margin-right: 2px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; user-select: none;
  font-family: var(--font-body); transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--accent-chip-border); color: var(--series-1); transform: translateY(-1px); }
/* 팀 일부만 선택: 옅은 강조(점선 테두리) — 몇 명인지는 버튼에 마우스를 올리면 표시 */
.chip.partial { border-style: dashed; border-color: var(--accent-chip-border); color: var(--series-1); background: var(--accent-chip-bg-soft); }
.chip.active { background: var(--accent-chip-bg); border-color: var(--accent-chip-border); color: var(--series-1); font-weight: 700; box-shadow: 0 2px 8px rgba(20,161,155,0.20); }
.chip.all.active { background: var(--text-primary); border-color: var(--text-primary); color: var(--surface-1); box-shadow: none; }
.items-total { margin-top: 10px; font-size: 12.5px; color: var(--text-secondary); }
.items-total:empty { display: none; }
.items-total b { color: var(--series-1); }
.batch-sum { font-size: 12.5px; color: var(--text-secondary); margin: 4px 0 8px; }
.batch-sum b { color: var(--amber-text); }
.batch-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.batch-list a { color: var(--series-1); }
.sent-sec + .sent-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.sent-head { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.sent-head b { color: var(--series-1); }
.sent-head .sub { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.copied { font-size: 11px; color: var(--good-text); font-weight: 700; align-self: center; margin-left: 4px; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:disabled:hover { border-color: transparent; background: none; color: var(--text-secondary); }

.channels { display: flex; gap: 6px; flex-wrap: wrap; }
.channels label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 5px 13px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary); cursor: pointer; transition: all .15s;
}
.channels label:has(input:checked) { background: var(--accent-chip-bg); border-color: var(--accent-chip-border); color: var(--series-1); font-weight: 700; box-shadow: 0 2px 8px rgba(20,161,155,0.20); }
.channels label.disabled { opacity: .4; cursor: not-allowed; }
.channels input { accent-color: var(--series-1); margin: 0; }
.channels .note { font-size: 10.5px; color: var(--text-muted); }

/* ---- 테이블 (형제 공통: 숫자 우측·모노, 첫 열/텍스트 열 좌측) ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: right; font-size: 11px; color: var(--text-muted); font-weight: 600; font-family: var(--font-mono); letter-spacing: .05em;
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
thead th:first-child, thead th.left { text-align: left; font-family: var(--font-body); letter-spacing: 0; }
tbody td {
  padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--grid); vertical-align: top;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}
tbody td:first-child, tbody td.left { text-align: left; font-family: var(--font-body); font-variant-numeric: normal; color: var(--text-primary); }
tbody td.center, thead th.center { text-align: center; }
tbody tr:nth-of-type(even) { background: var(--zebra-bg); }
tbody tr.cancelled td { opacity: .45; }
tbody tr.inactive td:not(.use) { opacity: .45; }
tbody td.use { width: 56px; text-align: center; vertical-align: middle; }
.use-check { display: inline-flex; padding: 2px; cursor: pointer; }
.use-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--series-1); cursor: pointer; }
td .muted, .muted { color: var(--text-muted); font-size: 11.5px; font-family: var(--font-mono); }
td .line { display: block; line-height: 20px; }  /* 제품명·규격·수량 열의 줄 높이를 고정해 여러 품목도 가로로 정렬 */
td .line + .line { margin-top: 2px; }
td.strong { font-weight: 700; }
.empty-note { color: var(--text-muted); font-size: 13px; padding: 24px 0; text-align: center !important; }

/* 지급 제품 입력 표: 대표코드명 / 제품명 / 제품코드 / 규격 / 수량 비율 고정 */
.items-table { table-layout: fixed; }
.items-table col.c-brand { width: 14%; }
.items-table col.c-prod { width: 36%; }
.items-table col.c-code { width: 13%; }
.items-table col.c-spec { width: 13%; }
.items-table col.c-qty { width: 16%; }
.items-table col.c-del { width: 8%; }
.items-table tbody td { vertical-align: middle; border-bottom: 1px solid var(--grid); }
.items-table tbody tr:nth-of-type(even) { background: none; }
.items-table input[type=number] { text-align: right; font-family: var(--font-mono); }
.icon-btn { border: none; background: none; cursor: pointer; color: var(--text-muted); font-size: 14px; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { color: var(--critical); background: var(--critical-bg); }

.ch { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary); margin-right: 3px; font-family: var(--font-body); }
.row-actions { display: inline-flex; gap: 2px; }
.row-actions.stack { flex-direction: column; align-items: flex-start; gap: 0; }
.row-actions.stack .btn { padding: 2px 8px; }
/* 지급 내역: 열 너비 고정(colgroup) — 내용 길이에 따라 열이 늘었다 줄었다 하지 않음 */
table.list-table { table-layout: fixed; }
table.list-table td { overflow: hidden; text-overflow: ellipsis; }
table.list-table td.memo { max-width: none; }
table.list-table td.send .ch { display: inline-block; line-height: 16px; padding: 0 6px; margin: 0 3px 0 0; font-size: 11px; vertical-align: 1px; }
tbody td.memo { white-space: normal; min-width: 120px; max-width: 220px; color: var(--text-secondary); font-size: 12.5px; word-break: keep-all; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; font-family: var(--font-body); }
.badge.sent { background: var(--amber-bg); color: var(--amber-text); }
.badge.confirmed { background: var(--good-bg); color: var(--good-text); }
.badge.cancelled { background: var(--zebra-bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ---- 모달 · 토스트 · 맨 위로 ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(8,10,16,0.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px; max-width: 600px; width: 100%; padding: 28px 26px; box-shadow: var(--card-shadow); max-height: 90vh; overflow: auto; }
.modal h3 { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.modal .sub { color: var(--text-muted); font-size: 12.5px; margin-bottom: 16px; }
.msg-preview { border: 1px solid var(--border); background: var(--page); border-radius: 10px; padding: 12px 14px; font-size: 13px; white-space: pre-line; margin-bottom: 10px; }
.msg-preview .label { font-size: 11.5px; font-weight: 700; color: var(--series-1); margin-bottom: 6px; display: block; }
.msg-preview a { color: var(--series-1); word-break: break-all; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text-primary); color: var(--page); padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 700; opacity: 0; transition: .2s; pointer-events: none; z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.scroll-top-btn {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 44px; height: 44px;
  border-radius: 50%; border: none; background: var(--series-1); color: #fff; font-size: 20px;
  line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(20,161,155,0.35);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.scroll-top-btn.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.scroll-top-btn:hover { opacity: .85; }

/* ---- 로딩 · 로그인 · 권한 없음 (형제 프로젝트와 동일) ---- */
#loadingOverlay { display: flex; position: fixed; inset: 0; background: var(--page); align-items: center; justify-content: center; z-index: 50; flex-direction: column; gap: 10px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--series-1); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#loadingOverlay .msg { color: var(--text-secondary); font-size: 13px; font-family: var(--font-mono); }
.login-screen { display: none; position: fixed; inset: 0; z-index: 60; align-items: center; justify-content: center; background: var(--page); padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px; padding: 28px 26px; box-shadow: var(--card-shadow); }
.login-card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.login-card .login-sub { margin: 0 0 20px; color: var(--text-muted); font-size: 12.5px; }
.login-field { margin-bottom: 12px; }
.login-field label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 600; }
.login-field input { width: 100%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; font-family: var(--font-body); }
.login-field input:focus { outline: none; border-color: var(--accent-chip-border); }
.login-submit { width: 100%; margin-top: 6px; border: none; border-radius: 10px; padding: 10px 0; background: var(--series-1); color: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer; font-family: var(--font-body); }
.login-submit:hover { opacity: .92; }
.login-error { color: var(--critical); font-size: 12px; margin-top: 10px; min-height: 1.4em; }
.login-toggle { margin-top: 14px; font-size: 12px; color: var(--text-muted); text-align: center; }
.login-toggle a { color: var(--series-1); cursor: pointer; text-decoration: none; font-weight: 600; }

footer { margin-top: 32px; color: var(--text-muted); font-size: 11.5px; font-family: var(--font-mono); text-align: center; letter-spacing: .02em; }

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .brand-tab-sticky { padding: 12px 16px; }
}
