/* 로고 전용: Pretendard Bold 라틴 글자만 (약 20KB).
   본문 글꼴 "Pretendard" 와 이름을 나눠, 본문까지 굵어지지 않게 합니다. */
@font-face {
  font-family: "Pretendard Brand";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/packages/pretendard/dist/web/static/woff2-dynamic-subset/Pretendard-Bold.subset.91.woff2") format("woff2");
}

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #16181d;
  --muted: #646a75;
  --line: #e2e5ea;
  --accent: #3d68f5;
  --accent-ink: #ffffff;
  --danger: #c4372f;
  --viewer: #eef0f4;
  --radius: 10px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --panel: #191c21;
    --ink: #e9ebef;
    --muted: #9aa1ad;
    --line: #2a2e36;
    --accent: #6d8cff;
    --accent-ink: #0b0d12;
    --danger: #ff7a70;
    --viewer: #15181d;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); display: flex; flex-direction: column; }

.top {
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 56px; flex: none;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-family: "Pretendard Brand", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-weight: 700; letter-spacing: -0.02em; font-size: 18px; color: var(--ink); text-decoration: none; }

.layout { flex: 1; display: grid; grid-template-columns: 360px 1fr; min-height: 0; }

.panel {
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 20px; overflow-y: auto;
}
.group { margin-bottom: 20px; }
h2 { font-size: 14px; margin: 0 0 10px; }

input, select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
select { padding: 6px 8px; font-size: 13px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.hint.error { color: var(--danger); }
code { font-size: 12px; }

.params { display: grid; gap: 10px; }
.field { display: grid; grid-template-columns: 1fr 132px; align-items: center; gap: 8px; }
.field label { font-size: 13px; }
.field label small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.field .input { display: flex; align-items: center; gap: 6px; }
.field input, .field select { width: 100%; padding: 7px 8px; font-size: 14px; text-align: right; }
.field select { text-align: left; }
.field .unit { font-size: 12px; color: var(--muted); min-width: 28px; }

.run {
  width: 100%; padding: 12px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
}
.run:disabled { opacity: 0.6; cursor: progress; }
.status { min-height: 20px; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.status.error { color: var(--danger); }

.view { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.viewer { position: relative; flex: 1; min-height: 320px; background: var(--viewer); }
.canvas { position: absolute; inset: 0; }
.canvas canvas { display: block; }
.viewer-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
.viewer-tools button, .ghost {
  font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
}

.result { background: var(--panel); border-top: 1px solid var(--line); padding: 16px 20px 20px; max-height: 42%; overflow-y: auto; }
.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.result-head h2 { margin: 0; }
.summary { border-collapse: collapse; width: 100%; font-size: 14px; }
.summary th, .summary td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.summary th { color: var(--muted); font-weight: 500; width: 140px; }
.summary td { font-variant-numeric: tabular-nums; }
.notes { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 860px) {
  .top { padding: 0 16px; gap: 12px; }
  #user-name { display: none; }
  .layout { display: flex; flex-direction: column; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; overflow: visible; }
  .viewer { min-height: 60vh; }
  .result { max-height: none; padding: 16px; }
}

/* ---------------------------------------------------------------- login */
.user { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.user .ghost { padding: 4px 10px; }

/* 로그인 화면: 카드를 화면 정중앙에 (가로·세로) */
body.login-body { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; height: auto; }
.login-wrap { width: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: 100%; max-width: 360px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px;
}
.login-brand { font-size: 24px; margin-bottom: 6px; }
.login-sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.login-field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.login-field input { width: 100%; padding: 10px 12px; font-size: 15px; }
.login-card .run { margin-top: 6px; }

/* ---------------------------------------------------------------- menu */
.crumb { font-size: 14px; color: var(--muted); }
.menu {
  flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-content: center;
}
.card {
  min-height: min(56vh, 480px); padding: 40px 28px; border-radius: 20px;
  background: var(--panel); border: 2px solid var(--line); color: var(--ink); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center;
  transition: border-color .15s, transform .15s;
}
.card svg { width: 128px; height: 96px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card-title { font-size: clamp(22px, 2.3vw, 30px); font-weight: 700; letter-spacing: -0.02em; word-break: keep-all; }
.card-note { font-size: 15px; color: var(--accent); font-weight: 700; }
a.card:hover { border-color: var(--accent); transform: translateY(-3px); }
a.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.card.off { opacity: .5; cursor: not-allowed; }
.card.off svg { stroke: var(--muted); }
.card.off .card-note { color: var(--muted); }

/* ------------------------------------------------------ apartment review */
[hidden] { display: none !important; }
.alert { margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--danger); color: var(--danger); font-size: 13px; }
.file { display: block; padding: 12px; border: 1px dashed var(--muted); border-radius: 8px; font-size: 14px; text-align: center; cursor: pointer; overflow-wrap: anywhere; }
.file:hover, .file:focus-within { border-color: var(--accent); }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.found-list { margin-top: 10px; }
.found { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.found span { color: var(--muted); white-space: nowrap; }
.found b { font-weight: 500; text-align: right; word-break: keep-all; }
.found.miss b { color: var(--danger); }
.checks { border: 0; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.checks legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 6px; }
.checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.run:disabled { cursor: not-allowed; }
.legend { position: absolute; left: 12px; top: 12px; right: 150px; display: flex; flex-wrap: wrap; gap: 6px; }
.legend button { display: flex; align-items: center; gap: 6px; font: inherit; font-size: 12px; padding: 4px 9px; border-radius: 99px; cursor: pointer; background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.legend button[aria-pressed="false"] { opacity: .45; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.busy { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } .card { transition: none; } }
.nums { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; margin-bottom: 10px; }
.num { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 2px; }
.num span, .num small { font-size: 12px; color: var(--muted); }
.num b { font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.num.over b { color: var(--danger); }

@media (max-width: 860px) {
  .menu { grid-template-columns: 1fr; padding: 16px; gap: 16px; align-content: start; }
  .card { min-height: 190px; padding: 24px; gap: 12px; }
  .card svg { width: 88px; height: 66px; }
  .view { min-height: 0; }
}
