/* 둥글기 규칙: 패널 14px, 카드 12px, 버튼·입력 10px, 알약형 표시 999px
   상태색: --good/--warn/--bad 는 막대·지도·게이지를 채우는 밝은 색, -ink 는 글자·아이콘용 진한 색 */
:root {
  --bg: #f3f6fb;
  --rail: #ffffff;
  --panel: #ffffff;
  --panel-2: #f5f8fc;
  --panel-3: #e9eef6;
  --line: #e2e8f0;
  --line-2: #d0d8e4;
  --text: #0f1729;
  --text-2: #3a4659;
  --muted: #647189;
  --accent: #1f6feb;
  --accent-ink: #1557c0;
  --accent-soft: #e8f0fe;
  --on-accent: #ffffff;
  --good: #2fb36b;
  --good-ink: #15803d;
  --good-soft: #e7f7ee;
  --warn: #f5a524;
  --warn-ink: #b45309;
  --warn-soft: #fef3e0;
  --bad: #ef5350;
  --bad-ink: #c81e1e;
  --bad-soft: #fdecec;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 6px rgba(16, 24, 40, 0.05);
  --shadow: 0 2px 4px rgba(16, 24, 40, 0.05), 0 10px 24px rgba(16, 24, 40, 0.08);
  --map-ctx: #e6ebf2;
  --map-edge: #ffffff;
  --glow: radial-gradient(1200px 460px at 12% -12%, rgba(31, 111, 235, 0.08), transparent 60%);
  --sans: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --serif: "Nanum Myeongjo", "Batang", "AppleMyungjo", serif; /* 공문서 본문(개조식)용 명조 */
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 var(--sans);
  word-break: keep-all; /* 한국어는 어절 단위로 줄바꿈 */
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.muted { color: var(--muted); }
.good-t { color: var(--good-ink); }
.warn-t { color: var(--warn-ink); }
.bad-t { color: var(--bad-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.app { display: flex; min-height: 100dvh; }
.rail {
  width: 232px; flex-shrink: 0; background: var(--rail); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100dvh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0;
}
.brand-mark svg { width: 30px; height: 30px; }
.brand-mark path { fill: var(--accent); }
.brand-name { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name strong { font-size: 15.5px; letter-spacing: -0.01em; }
.brand-name small { font-size: 12px; color: var(--muted); }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a {
  display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 9px 12px; border-radius: 10px; font-weight: 500;
}
#nav a i { font-size: 19px; }
#nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
#nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.rail-foot { margin-top: auto; padding: 16px 8px 4px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.slogan { font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--text); }
.goal-line { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.goal-line b { color: var(--text-2); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20;
}
.page-head h1 { font-size: 20px; letter-spacing: -0.02em; }
.page-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.variant { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); }
.variant button { border: 0; background: transparent; padding: 5px 11px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.variant button:hover { color: var(--text); }
.variant button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.clock { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sync { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.pill.mock { background: var(--warn-soft); color: var(--warn-ink); }
#view { padding: 22px 28px 56px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- building blocks ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; min-width: 0; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-head h2 i { color: var(--accent); font-size: 18px; }
.panel-head small { color: var(--muted); font-size: 12px; font-weight: 400; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.s-3 { grid-column: span 3; } .s-4 { grid-column: span 4; } .s-5 { grid-column: span 5; } .s-6 { grid-column: span 6; }
.s-7 { grid-column: span 7; } .s-8 { grid-column: span 8; } .s-12 { grid-column: span 12; }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill.info { background: var(--accent-soft); color: var(--accent-ink); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-2); white-space: nowrap; }
.tag.on { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; font-weight: 500; white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.btn i { font-size: 16px; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 8px; }
.btn.sm i { font-size: 14px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel-2); justify-self: start; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.seg button.on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; cursor: pointer; font-size: 13px; color: var(--text-2);
}
.chip b { font-weight: 700; color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent-ink); }
.chip.on b { color: var(--accent-ink); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); }
.search i { color: var(--muted); }
.search input { border: 0; background: transparent; outline: none; width: 160px; }
.search input::placeholder { color: var(--muted); }
select.input, input.input { height: 34px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); padding: 0 10px; }

.meter { display: grid; grid-template-columns: 68px 1fr 46px; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.meter .track { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter .track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter .track i.warn { background: var(--warn); }
.meter b { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.meter.off .track { background: repeating-linear-gradient(135deg, var(--line) 0 4px, transparent 4px 8px); }

.goalbar { display: block; position: relative; height: 8px; border-radius: 99px; background: var(--panel-3); }
.goalbar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--st, var(--accent)); }
.goalbar b { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--text); opacity: 0.55; }

.ring-wrap { position: relative; flex-shrink: 0; }
.ring { display: block; transform: rotate(-90deg); }
.ring .track { stroke: var(--line-2); }
.ring .val { stroke: var(--st, var(--accent)); transition: stroke-dasharray 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.ring .goal { stroke: var(--text); opacity: 0.6; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label strong { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ring-label small { font-size: 10.5px; color: var(--muted); }
.s-good { --st: var(--good); --st-ink: var(--good-ink); }
.s-warn { --st: var(--warn); --st-ink: var(--warn-ink); }
.s-bad { --st: var(--bad); --st-ink: var(--bad-ink); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12px; text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table th.num { text-align: right; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--panel-2); }
.table tr.divider td { background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 600; }
.table tr.total td { font-weight: 700; background: var(--panel-2); }
.st-cell { display: flex; align-items: center; gap: 8px; }
.st-cell::before { content: ""; width: 3px; height: 18px; border-radius: 2px; background: var(--st); }
.row-bar { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.row-bar .goalbar { flex: 1; height: 6px; }
.row-bar strong { font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }

.empty { color: var(--muted); padding: 28px; text-align: center; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.hint i { color: var(--st-ink, var(--warn-ink)); font-size: 16px; margin-top: 1px; }
.hint b { color: var(--text); font-weight: 600; }
.detail { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .k-label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .k-label i { font-size: 15px; }
.kpi .k-value { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.kpi .k-value small { font-size: 14px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.kpi .k-sub { font-size: 12px; color: var(--text-2); }
.kpi.lead { flex-direction: row; align-items: center; gap: 14px; }
.kpi.lead .k-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

/* ---------- A안: 상황실형 ---------- */
.mon-a { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.mon-a .side { display: flex; flex-direction: column; gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.rcard {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 15px 16px 13px;
  display: flex; flex-direction: column; gap: 12px; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; cursor: pointer; box-shadow: var(--shadow-sm);
}
.rcard::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--st); }
.rcard:hover, .rcard.hl { border-color: var(--line-2); box-shadow: var(--shadow); transform: translateY(-2px); }
.rc-head { display: flex; align-items: center; gap: 8px; }
.rc-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.rc-head .tag { margin-left: auto; }
.rc-main { display: flex; align-items: center; gap: 14px; }
.rc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; flex: 1; min-width: 0; }
.rc-stats div { min-width: 0; }
.rc-stats dt { font-size: 11px; color: var(--muted); }
.rc-stats dd { margin: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-meters { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.rc-next { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.rc-next i { color: var(--accent); }
.rc-foot { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.rc-foot .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.feed li:last-child { border-bottom: 0; }
.feed li.new { animation: feed-in 0.5s cubic-bezier(0.16, 1, 0.3, 1); }
.feed .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 16px; }
.feed .ic.good { background: var(--good-soft); color: var(--good-ink); }
.feed .ic.warn { background: var(--warn-soft); color: var(--warn-ink); }
.feed p { line-height: 1.4; }
.feed small { display: block; color: var(--muted); font-size: 11.5px; }
.feed time { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
@keyframes feed-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.today { display: flex; flex-direction: column; gap: 10px; }
.today-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.today-item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.today-item strong { font-size: 13px; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-right: 5px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }

.award { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.award li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.award .rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.award li:first-child .rank { background: var(--accent); color: var(--on-accent); }

/* ---------- B안: 상태 보드형 ---------- */
.ribbon { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.ribbon .r-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ribbon .r-title i { color: var(--accent); font-size: 18px; }
.ribbon .r-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--panel-2); }
.ribbon .r-item b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 12px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.bcol { display: flex; flex-direction: column; gap: 12px; }
.bcol-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--st); box-shadow: var(--shadow-sm); }
.bcol-head h2 { font-size: 15px; }
.bcol-head .count { margin-left: auto; font-size: 20px; font-weight: 700; color: var(--st-ink); font-variant-numeric: tabular-nums; }
.bcol-head p { font-size: 12px; color: var(--muted); }
.bcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.bcard:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.bc-head { display: flex; align-items: center; gap: 8px; }
.bc-head h3 { font-size: 16px; }
.bc-head .tag { margin-left: auto; }
.bc-rate { display: flex; align-items: baseline; gap: 10px; }
.bc-rate strong { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bc-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); }
.spark-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.spark { width: 100%; height: 38px; display: block; }
.spark .line { fill: none; stroke: var(--st); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: var(--st); opacity: 0.1; }
.spark .goal { stroke: var(--muted); stroke-dasharray: 3 3; stroke-width: 1; }
.forecast { text-align: right; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.forecast strong { display: block; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.bc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bc-grid div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bc-grid dt { font-size: 11px; color: var(--muted); }
.bc-grid dd { margin: 0; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.action { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--st) 10%, transparent); font-size: 12.5px; line-height: 1.45; }
.action i { color: var(--st-ink); font-size: 16px; margin-top: 1px; }
.action b { display: block; color: var(--text); }
.bc-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.bc-foot .who { flex: 1; }

/* ---------- C안: 지도 연동형 ---------- */
.mon-c { display: flex; flex-direction: column; gap: 16px; }
.mon-c .top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: stretch; }
.map-panel { display: flex; flex-direction: column; }
.map-box { position: relative; flex: 1; display: grid; place-items: center; }
.map-box .map { max-height: 560px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .ramp { width: 120px; height: 10px; border-radius: 99px; }
.brief { display: flex; flex-direction: column; gap: 14px; }
.brief-head { display: flex; align-items: center; gap: 10px; }
.brief-head h2 { font-size: 20px; letter-spacing: -0.02em; }
.brief-main { display: flex; gap: 16px; align-items: center; }
.brief-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.brief-trend { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); }
.brief-trend .bt-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.brief-trend .spark { height: 64px; }
.mini-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mcard {
  position: relative; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 7px; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; box-shadow: var(--shadow-sm);
}
.mcard::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--st); }
.mcard:hover, .mcard.hl { border-color: var(--line-2); box-shadow: var(--shadow); }
.mcard.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm); }
.mcard .m-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.mcard .m-name { font-size: 14px; font-weight: 700; }
.mcard strong { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mcard small { font-size: 11.5px; color: var(--muted); }

/* ---------- map ---------- */
.map { width: 100%; height: auto; display: block; overflow: visible; }
.map .ctx path { fill: var(--map-ctx); stroke: var(--map-edge); stroke-width: 1.2; }
.map .reg { stroke: var(--map-edge); stroke-width: 1.3; fill-opacity: 0.8; cursor: pointer; transition: fill-opacity 0.2s; }
.map .reg:hover, .map .reg.hl { fill-opacity: 1; }
.map .reg.sel { fill-opacity: 0.95; }
.map .sel-outline { fill: none; stroke: var(--text); stroke-width: 2.6; pointer-events: none; }
.map .hl-outline { fill: none; stroke: var(--text); stroke-width: 1.8; stroke-dasharray: 5 3; pointer-events: none; }
.map.dim .reg:not(.sel) { fill-opacity: 0.2; }
.map .lbl { font-size: 13px; font-weight: 700; fill: var(--text); text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 3.5px; stroke-linejoin: round; }
.map .lbl .v { font-size: 11.5px; font-weight: 600; fill: var(--text-2); }
.map .ctx-lbl { font-size: 11.5px; fill: var(--muted); text-anchor: middle; pointer-events: none; }
.tip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 200px; max-width: 260px; background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 12.5px; display: flex; flex-direction: column; gap: 6px;
}
.tip[hidden] { display: none; } /* display:flex 가 hidden 속성을 덮어쓰지 않게 */
.tip .t-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.tip dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.tip dt { color: var(--muted); }
.tip dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- region detail ---------- */
.region-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; }
.region-hero h2 { font-size: 24px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.region-hero .sub { color: var(--text-2); font-size: 13px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.region-hero .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-map { max-width: 260px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; border-radius: 12px; background: var(--panel-2); display: flex; flex-direction: column; gap: 2px; }
.tile span { font-size: 12px; color: var(--muted); }
.tile strong { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile small { font-size: 11.5px; color: var(--text-2); }
.chart-box { position: relative; height: 240px; }

/* ---------- schedule ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal .dow { padding: 8px; font-size: 12px; color: var(--muted); text-align: center; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { background: color-mix(in srgb, var(--panel-2) 50%, transparent); }
.cal .dnum { font-size: 12px; color: var(--muted); align-self: flex-start; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.cal .day.today .dnum { background: var(--accent); color: var(--on-accent); border-radius: 999px; font-weight: 700; }
.ev {
  font-size: 11.5px; padding: 2px 7px; border-radius: 6px; border: 0; cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent-ink); border-left: 2px solid var(--accent);
}
.ev.extra { background: transparent; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); }
.ev.past { background: var(--panel-2); color: var(--muted); border-left-color: var(--line-2); }
.ev.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.more { font-size: 11px; color: var(--muted); padding-left: 4px; }

/* ---------- reports ---------- */
.report-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.report-cfg { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.cfg-block { display: flex; flex-direction: column; gap: 8px; }
.cfg-block > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.toggle-list { display: flex; flex-direction: column; gap: 6px; }
.toggle { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer; font-size: 13px; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.toggle small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.paper-wrap { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.report-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* 종이 문서: 화면과 관계없이 흰 종이 (인쇄물 미리보기) */
.paper { background: #ffffff; color: #111111; border-radius: 6px; padding: 34px 40px; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12); }
.paper .map { --text: #111827; --text-2: #374151; --muted: #6b7280; --bg: #ffffff; --map-ctx: #eef1f5; --map-edge: #ffffff; --good: #2f9e5f; --warn: #e89a1c; --bad: #e0483f; }

/* 공문서 형식: 결재란, 겹줄 제목, 개조식(□ ○ -) 본문은 명조, 표는 고딕 */
.doc { font-family: var(--serif); font-size: 13.5px; line-height: 1.65; }
.doc .appr { margin-left: auto; border-collapse: collapse; font-family: var(--sans); font-size: 11px; }
.doc .appr th, .doc .appr td { border: 1px solid #333333; width: 66px; text-align: center; }
.doc .appr th { background: #f2f2f2; padding: 3px 0; font-weight: 600; }
.doc .appr td { height: 46px; }
.doc .doc-title {
  margin: 18px 0 8px; padding: 12px 0; border-top: 3px double #111111; border-bottom: 3px double #111111;
  text-align: center; font-family: var(--sans); font-size: 21px; font-weight: 800; letter-spacing: -0.02em;
}
.doc .doc-date { text-align: right; font-size: 13px; margin-bottom: 8px; }
.doc .b1 { font-family: var(--sans); font-size: 15px; font-weight: 700; margin: 18px 0 6px; }
.doc .b2 { margin: 3px 0 2px 16px; padding-left: 17px; text-indent: -17px; }
.doc .b3 { margin: 1px 0 1px 38px; padding-left: 12px; text-indent: -12px; font-size: 13px; }
.doc .note { margin: 6px 0 0 4px; font-size: 12px; color: #333333; }
.doc .unit { text-align: right; font-family: var(--sans); font-size: 11px; margin: 8px 0 4px; }
.doc table.st { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 11.5px; line-height: 1.4; }
.doc table.st th { background: #dce4f2; border: 1px solid #555555; padding: 6px 5px; font-weight: 700; text-align: center; white-space: nowrap; }
.doc table.st td { border: 1px solid #777777; padding: 5px 6px; white-space: nowrap; }
.doc table.st td.num { text-align: right; font-variant-numeric: tabular-nums; }
.doc table.st td.c { text-align: center; }
.doc table.st tr.sum td { background: #f2f2f2; font-weight: 700; }
.doc table.st tr.sum td:first-child { text-align: center; }
.doc .doc-two { display: grid; grid-template-columns: 38% 1fr; gap: 16px; align-items: start; margin: 10px 0 4px; }
.doc .doc-legend { font-family: var(--sans); font-size: 11px; text-align: center; margin-top: 4px; }
.doc .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 3px 0 8px; vertical-align: -1px; }
.doc .lg.good { background: #2f9e5f; } .doc .lg.warn { background: #e89a1c; } .doc .lg.bad { background: #e0483f; }
.doc .doc-foot { margin-top: 22px; text-align: center; font-family: var(--sans); font-size: 10.5px; color: #888888; }

/* 화면용 통계표: 공무원이 보는 표 형식 (격자선, 연번, 맨 위 "계" 행, 단위 표기) */
.stat-cap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.stat-cap h2 { font-size: 15px; font-weight: 700; }
.stat-cap span { font-size: 12px; color: var(--muted); margin-left: auto; }
.table.stat { border: 1px solid var(--line-2); }
.table.stat th { text-align: center; background: #e9eff8; color: var(--text); border: 1px solid var(--line-2); padding: 9px 10px; }
.table.stat td { border: 1px solid var(--line); padding: 9px 10px; }
.table.stat td.c { text-align: center; }
.table.stat tr.sum td { background: #f4f7fb; font-weight: 700; }
.table.stat tr.sum td:first-child { text-align: center; }
.note-line { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.kpis.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- staff ---------- */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person { display: flex; flex-direction: column; gap: 12px; }
.person-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.person-head h3 { font-size: 15px; }
.person-head p { font-size: 12px; color: var(--muted); }
.person .contact { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.person .contact a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.person .contact a i { color: var(--muted); font-size: 16px; }
.person-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- settings ---------- */
.range { width: 100%; accent-color: var(--accent); }
.goal-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.list li:last-child { border-bottom: 0; }

/* ---------- 해석형 화면: 판정 배너, 진도, 전망 그룹, 숫자 풀이, 진단 ---------- */
.s-info { --st: var(--accent); --st-ink: var(--accent-ink); }
.pill i { font-size: 13px; }
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; border-left: 4px solid var(--st); }
.verdict .v-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; background: color-mix(in srgb, var(--st) 14%, transparent); color: var(--st-ink); }
.verdict h2 { font-size: 22px; letter-spacing: -0.025em; line-height: 1.35; }
.verdict .v-body > p { margin-top: 8px; max-width: 78ch; font-size: 14.5px; line-height: 1.7; color: var(--text-2); }
.verdict .v-body > p b { color: var(--text); }
.verdict .note-line { margin-top: 4px; }
.v-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.pace { position: relative; height: 16px; margin: 46px 6px 44px; border-radius: 99px; background: var(--panel-3); }
.pace .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--st); }
.pace .fore {
  position: absolute; top: 0; bottom: 0; border-radius: 0 99px 99px 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--st) 50%, transparent) 0 6px, color-mix(in srgb, var(--st) 22%, transparent) 6px 12px);
}
.pace .mk { position: absolute; top: -7px; bottom: -7px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); }
.pace .mk.need { background: var(--muted); }
.pace .lb { position: absolute; transform: translateX(-50%); white-space: nowrap; font-size: 12.5px; color: var(--text-2); }
.pace .lb b { color: var(--text); }
.pace .lb.up { bottom: 24px; }
.pace .lb.down { top: 26px; }
/* 좁은 화면에서는 막대 위아래 이름표 대신 범례로 보여 준다 */
.pace-legend { display: none; list-style: none; margin: 0 0 12px; padding: 0; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12.5px; color: var(--text-2); }
.pace-legend li { display: flex; align-items: center; gap: 6px; }
.pace-legend b { color: var(--text); }
.pace-legend .sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pace-legend .sw.now { background: var(--st); }
.pace-legend .sw.fore { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--st) 55%, transparent) 0 3px, color-mix(in srgb, var(--st) 20%, transparent) 3px 6px); }
.pace-legend .sw.need { width: 3px; height: 14px; background: var(--muted); }
.pace-legend .sw.goal { width: 3px; height: 14px; background: var(--text); }

.groups { display: flex; flex-direction: column; gap: 18px; }
.grp { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.grp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: color-mix(in srgb, var(--st) 9%, var(--panel)); border-bottom: 1px solid var(--line); }
.grp-head > i { font-size: 20px; color: var(--st-ink); }
.grp-head h3 { font-size: 15px; }
.grp-head .n { color: var(--st-ink); font-weight: 800; margin-left: 2px; }
.grp-head p { font-size: 12.5px; color: var(--text-2); }
.grp .empty { padding: 16px; }
.brow {
  display: grid; grid-template-columns: 76px minmax(160px, 1fr) 120px minmax(0, 1.25fr) 18px; gap: 16px; align-items: center;
  padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.brow:last-child { border-bottom: 0; }
.brow:hover { background: var(--panel-2); }
.brow > i { color: var(--muted); }
.bullet { position: relative; display: block; height: 12px; border-radius: 99px; background: var(--panel-3); }
.bullet .now { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--st); }
.bullet .fore {
  position: absolute; top: 0; bottom: 0; border-radius: 0 99px 99px 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--st) 50%, transparent) 0 5px, color-mix(in srgb, var(--st) 20%, transparent) 5px 10px);
}
.bullet .goal { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); opacity: 0.55; }
.brow .vals { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; line-height: 1.3; }
.brow .vals b { font-size: 15.5px; }
.brow .vals small { font-size: 12px; color: var(--muted); }
.brow .why { font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; line-height: 1.45; }
.brow .why b { color: var(--st-ink); }
.brow .why small { font-size: 12px; color: var(--muted); }

.strip-box { max-width: 920px; margin: 14px 0 4px; }
.strip { width: 100%; height: auto; display: block; overflow: visible; }
.strip .grid { stroke: var(--line); }
.strip .tick { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.strip .goal { stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 6 4; }
.strip .goalt { font-size: 11.5px; font-weight: 700; fill: var(--good-ink); text-anchor: middle; }
.strip .axis { stroke: var(--line-2); }
.strip .lane { font-size: 13px; font-weight: 700; fill: var(--text); }
.strip .lane2 { font-size: 11.5px; font-weight: 500; fill: var(--text-2); }
.strip .dot { stroke: #ffffff; stroke-width: 2; }
.strip .dot.on { fill: var(--accent); }
.strip .dot.off { fill: #9aa6b9; }
.strip .dl { font-size: 11px; fill: var(--text-2); text-anchor: middle; }
.strip .avg { stroke-width: 2.5; stroke-dasharray: 3 3; }
.strip .avg.on { stroke: var(--accent); }
.strip .avg.off { stroke: #9aa6b9; }

.explain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ex-card { display: flex; flex-direction: column; gap: 4px; }
.ex-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.ex-label i { font-size: 16px; color: var(--accent); }
.ex-num { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.ex-num small { font-size: 14px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.ex-say { font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.ex-sub { font-size: 12px; color: var(--muted); line-height: 1.5; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.picto { display: flex; flex-wrap: wrap; gap: 2px; margin: 6px 0 4px; }
.picto i { font-size: 18px; color: var(--line-2); }
.picto i.on { color: var(--accent); }
.picto i.bad { color: var(--bad); }
.picto i.warn { color: var(--warn); }
.picto .sq { width: 15px; height: 15px; border-radius: 4px; background: var(--line); }
.picto .sq.on { background: var(--accent); }

.dg-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dg-row {
  display: grid; grid-template-columns: 76px minmax(160px, 1.1fr) 84px 92px 76px minmax(0, 1.5fr); gap: 16px; align-items: center;
  padding: 11px 16px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
}
.dg-row:last-child { border-bottom: 0; }
.dg-row:not(.dg-head):hover { background: var(--panel-2); }
.dg-row:not(.dg-head)::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--st); }
.dg-head { background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--muted); cursor: default; }
.dg-bar { display: flex; flex-direction: column; gap: 4px; }
.dg-bar .line { display: block; height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.dg-bar .line i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.dg-bar small { font-size: 12px; color: var(--text-2); }
.dg-say { display: flex; flex-direction: column; line-height: 1.45; font-size: 13px; }
.dg-say b { color: var(--st-ink); }
.dg-say small { font-size: 12px; color: var(--text-2); }

@media (max-width: 1200px) {
  .explain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .verdict { grid-template-columns: 1fr; }
  .verdict h2 { font-size: 18px; }
  .pace { margin: 18px 4px 14px; }
  .pace .lb { display: none; }
  .pace-legend { display: grid; }
  .brow { grid-template-columns: 64px minmax(0, 1fr) 76px; gap: 10px; }
  .brow .why, .brow > i { grid-column: 1 / -1; }
  .brow > i { display: none; }
  .explain { grid-template-columns: 1fr; }
  .dg-head { display: none; }
  .dg-row { grid-template-columns: 70px minmax(0, 1fr) auto; gap: 8px 10px; }
  .dg-row .dg-say { grid-column: 1 / -1; }
  .dg-row > span.tnum { display: none; }
}

/* ---------- login ---------- */
.app[hidden], .login[hidden], .toast[hidden] { display: none; } /* display 지정이 hidden 속성을 덮지 않게 */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(440px, 0.88fr); background: var(--panel); }
.login-brand {
  position: relative; overflow: hidden; padding: 40px 56px 36px; display: flex; flex-direction: column;
  background: linear-gradient(155deg, #eaf2ff 0%, #f6f9ff 52%, #e6f0ff 100%); border-right: 1px solid var(--line);
}
.login-brand > * { position: relative; z-index: 1; animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.login-brand > :nth-child(2) { animation-delay: 0.08s; }
.login-brand > :nth-child(4) { animation-delay: 0.16s; }
.lb-top { display: flex; align-items: center; gap: 12px; }
.lb-top .brand-mark { width: 44px; height: 44px; background: #ffffff; box-shadow: var(--shadow-sm); }
.lb-top .brand-name strong { font-size: 16px; }
.lb-copy { margin-top: clamp(40px, 11vh, 120px); max-width: 500px; }
.lb-copy h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.24; letter-spacing: -0.035em; font-weight: 800; }
.lb-copy h1 em { font-style: normal; color: var(--accent); }
.lb-copy > p { margin-top: 16px; font-size: 15.5px; line-height: 1.65; color: var(--text-2); max-width: 36ch; }
.lb-points { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-direction: column; gap: 14px; }
.lb-points li { display: flex; gap: 12px; align-items: center; }
.lb-points i { width: 40px; height: 40px; border-radius: 12px; background: #ffffff; color: var(--accent); display: grid; place-items: center; font-size: 19px; box-shadow: var(--shadow-sm); flex-shrink: 0; }
.lb-points b { display: block; font-size: 14.5px; }
.lb-points span span { font-size: 13px; color: var(--text-2); }
.lb-map { position: absolute; z-index: 0; right: -5%; bottom: -6%; width: 64%; max-width: 660px; animation: map-in 1.2s cubic-bezier(0.16, 1, 0.3, 1) both; }
.lb-map path { fill: rgba(31, 111, 235, 0.06); stroke: rgba(31, 111, 235, 0.32); stroke-width: 1.3; }
.lb-foot { margin-top: auto; padding-top: 28px; font-size: 13px; color: var(--text-2); }
.lb-foot b { color: var(--text); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes map-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

.login-side { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; padding: 40px 32px; background: var(--bg); }
.login-card {
  width: 100%; max-width: 408px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 34px 32px 28px;
  box-shadow: var(--shadow); animation: rise 0.6s 0.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-card h2 { font-size: 24px; letter-spacing: -0.025em; }
.lc-sub { margin-top: 6px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.lc-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin: 22px 0 20px; }
.lc-tabs button { padding: 8px 0; }
.lc-form { margin-top: 24px; }
.lc-tabs + .lc-form { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .input { height: 48px; width: 100%; font-size: 15px; padding: 0 14px; border-radius: 12px; }
.field .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid .input { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.field .err { font-size: 12.5px; color: var(--bad-ink); }
.field .err:empty { display: none; }
.field .caps { font-size: 12px; color: var(--warn-ink); }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: grid; place-items: center; font-size: 19px; cursor: pointer; }
.pw-eye:hover { background: var(--panel-2); color: var(--text); }
.lc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 18px; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.linkish { border: 0; background: transparent; padding: 0; color: var(--accent-ink); font-size: 13px; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.btn.lg { width: 100%; height: 50px; font-size: 15.5px; border-radius: 12px; }
.btn.busy { opacity: 0.75; pointer-events: none; }
.lc-note { margin-top: 14px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.lc-help { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; line-height: 1.55; }
.gpki-box { display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin-bottom: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.gpki-box i { font-size: 28px; color: var(--accent); }
.gpki-box b { font-size: 14px; }
.gpki-box p { margin-top: 3px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.otp { text-align: center; font-size: 22px !important; letter-spacing: 0.45em; font-variant-numeric: tabular-nums; }
.back-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 0; margin-bottom: 16px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.login-legal { max-width: 408px; font-size: 11.5px; line-height: 1.65; color: var(--muted); }
.login-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

.user { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.user i { font-size: 20px; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13.5px;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast i { color: var(--good-ink); font-size: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1440px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .mon-a { grid-template-columns: 1fr; }
  .mon-a .side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .mon-c .top, .report-layout { grid-template-columns: 1fr; }
  .report-cfg { position: static; }
  .board { grid-template-columns: 1fr; }
  .grid > [class*="s-"] { grid-column: span 12; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 22px 20px 26px; border-right: 0; border-bottom: 1px solid var(--line); }
  .lb-copy { margin-top: 22px; }
  .lb-copy h1 { font-size: 24px; }
  .lb-copy > p { font-size: 14px; }
  .lb-points, .lb-map { display: none; }
  .lb-foot { padding-top: 14px; }
  .login-side { justify-content: flex-start; padding: 24px 16px 40px; }
  .login-card { padding: 26px 20px 22px; }
}
@media (max-width: 1024px) {
  .rail { width: 76px; padding: 16px 10px; }
  .brand { justify-content: center; padding-bottom: 16px; }
  .brand-name, #nav a span, .rail-foot { display: none; }
  #nav a { justify-content: center; padding: 11px 0; }
}
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .rail { width: auto; height: auto; position: static; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; }
  #nav { flex-direction: row; overflow-x: auto; }
  #nav a { padding: 9px 12px; }
  .topbar { position: static; padding: 12px 16px; }
  .tools { gap: 8px; }
  .variant button { padding: 5px 8px; }
  #view { padding: 16px 16px 40px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .kpi:nth-child(-n + 2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line); }
  .kpi.lead { flex-direction: column; align-items: flex-start; }
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .region-hero { grid-template-columns: 1fr; }
  .cal .day { min-height: 70px; }
  .ev { font-size: 10px; padding: 1px 4px; }
  .paper { padding: 18px; }
  .doc .doc-two { grid-template-columns: 1fr; }
  .kpis.kpis-4 { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- print (PDF 저장) ---------- */
#print-area { display: none; }
@page { size: A4; margin: 12mm; }
@media print {
  body { background: #ffffff; }
  .app, .tip { display: none !important; }
  #print-area { display: block; }
  #print-area .paper { box-shadow: none; padding: 0; border-radius: 0; }
  #print-area tr { break-inside: avoid; }
}
