:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #e2e2e2;
  --line-strong: #c9c9c9;
  --bg: #fbfbfa;
  --panel: #ffffff;
  --accent: #2f6fdc;
  --accent-soft: #eef3fd;
  --deny: #b4302a;
  --deny-soft: #fdf0ef;
  --ok: #2b7a4b;
  --ok-soft: #eef7f1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* 한글은 낱말 안에서 줄이 끊기지 않게 둔다. '엽니 다.' 같은 모양을 막는다. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell { max-width: 940px; margin: 0 auto; padding: 48px 20px 80px; }
.shell--narrow { max-width: 520px; padding-top: 88px; }

.brand { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.brand__mark { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.brand__tag { font-size: 12.5px; color: var(--faint); }

.lede { color: var(--muted); font-size: 14px; margin: 0 0 32px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
}

/* ─── 로그인 ────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; font-size: 14.5px; font-family: inherit;
  border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.btn {
  width: 100%; padding: 11px 14px; font-size: 14.5px; font-weight: 600; font-family: inherit;
  border: 0; border-radius: 7px; background: var(--ink); color: #fff; cursor: pointer;
}
.btn:hover { background: #000; }

.alert {
  margin-bottom: 18px; padding: 11px 13px; border-radius: 7px; font-size: 13.5px;
  background: var(--deny-soft); border: 1px solid #f0cdca; color: var(--deny);
}

.demo { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.demo__title { font-size: 12.5px; color: var(--faint); margin-bottom: 12px; }
.demo__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 9px 12px; margin-bottom: 7px; text-align: left; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 7px;
  font-family: inherit; font-size: 13.5px; color: var(--ink);
}
.demo__row:hover { border-color: var(--accent); background: var(--accent-soft); }
.demo__who { font-weight: 600; }
.demo__has { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ─── 콘솔 ────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 30px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.who__name { font-weight: 650; }
.who__sub { font-size: 12.5px; color: var(--faint); }
.linkbtn {
  font-size: 13px; color: var(--muted); background: none; border: 0;
  cursor: pointer; font-family: inherit; padding: 0;
}
.linkbtn:hover { color: var(--ink); text-decoration: underline; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

.tile {
  display: block; padding: 18px 18px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: inherit;
}
.tile--open { cursor: pointer; }
.tile--open:hover { border-color: var(--accent); box-shadow: 0 1px 10px rgba(47, 111, 220, 0.10); text-decoration: none; }
.tile--shut { background: #f6f6f5; border-style: dashed; color: var(--faint); }

.tile__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile__name { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.tile--shut .tile__name { color: var(--faint); }
.tile__surface { margin: 5px 0 12px; font-size: 12.5px; color: var(--muted); }
.tile--shut .tile__surface { color: var(--faint); }
.tile__foot { font-size: 12px; color: var(--faint); }

.chip {
  flex: none; font-size: 11px; font-weight: 600; padding: 2.5px 8px; border-radius: 20px;
  letter-spacing: 0.01em;
}
.chip--open { background: var(--ok-soft); color: var(--ok); }
.chip--shut { background: #efefee; color: #8a8a8a; }

.note { margin-top: 30px; font-size: 12.5px; color: var(--faint); }

/* ─── 거절 · 발급 ────────────────────────────── */
.stop { max-width: 560px; margin: 96px auto; padding: 0 20px; }
.stop__mark { font-size: 12px; font-weight: 700; color: var(--deny); letter-spacing: 0.08em; }
.stop__title { font-size: 25px; font-weight: 700; margin: 10px 0 12px; letter-spacing: -0.02em; }
.stop__body { color: var(--muted); margin: 0 0 8px; }
.stop__meta {
  margin: 22px 0 26px; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--muted);
}
.stop__meta dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 14px; margin: 0; }
.stop__meta dt { color: var(--faint); }
.stop__meta dd { margin: 0; color: var(--ink); }

.kv { margin: 0 0 22px; }
.kv__label { font-size: 12.5px; color: var(--faint); margin-bottom: 6px; }
.kv__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  background: #f6f6f5; border: 1px solid var(--line); border-radius: 7px;
  padding: 11px 13px; word-break: break-all; color: var(--ink);
}
pre.kv__value { margin: 0; white-space: pre-wrap; line-height: 1.55; }

.backlink { display: inline-block; margin-top: 8px; font-size: 13.5px; }

@media (max-width: 520px) {
  .shell { padding: 32px 16px 60px; }
  .shell--narrow { padding-top: 48px; }
  .panel { padding: 22px 18px; }
}

/* ─── 타일 안에 두 갈래 길이 있는 제품 (관리 화면 · API) ────────────────────────────── */
.tile { position: relative; }
.tile__hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.tile__head, .tile__surface, .tile__foot { position: relative; pointer-events: none; }
.tile__more {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.tile__link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.tile__link:hover { text-decoration: underline; }
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ─── 권한 관리 표 ────────────────────────────── */
.topbar__acts { display: flex; align-items: center; gap: 14px; }

.matrix__scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.matrix { border-collapse: collapse; width: 100%; font-size: 13px; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); }
.matrix tbody tr:last-child th,
.matrix tbody tr:last-child td { border-bottom: none; }

.matrix__corner {
  text-align: left;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--faint);
  font-weight: 500;
  background: var(--panel);
  position: sticky;
  left: 0;
  z-index: 2;
}
.matrix__col { padding: 10px 8px; text-align: center; vertical-align: bottom; }
.matrix__row {
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  background: var(--panel);
  position: sticky;
  left: 0;
  z-index: 1;
}
.matrix__name { display: block; letter-spacing: -0.01em; }
.matrix__sub { display: block; margin-top: 2px; font-size: 11px; color: var(--faint); font-weight: 400; }
.matrix__cell { padding: 8px; text-align: center; }

.cell {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #f6f6f5;
  cursor: pointer;
  padding: 0;
  display: inline-block;
  transition: background 0.12s, border-color 0.12s;
}
.cell--off:hover { border-color: var(--accent); background: var(--accent-soft); }
.cell--on {
  background: var(--ok);
  border-color: var(--ok);
}
.cell--on:hover { background: var(--deny); border-color: var(--deny); }
.cell--busy { opacity: 0.45; cursor: progress; }
.cell--lock {
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 7px;
  border: 1px dashed var(--line-strong);
  background: #f2f2f1;
  color: #9a9a9a;
  display: inline-block;
  font-size: 12px;
  cursor: not-allowed;
}

.toast {
  margin-bottom: 14px;
  padding: 9px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  border: 1px solid var(--line);
}
.toast--ok { background: var(--ok-soft); border-color: #cfe6d8; color: var(--ok); }
.toast--bad { background: var(--deny-soft); border-color: #f1d2d0; color: var(--deny); }

.matrix code { font-size: 11.5px; background: #f2f2f1; padding: 1px 4px; border-radius: 4px; }
.matrix__dent { color: var(--faint); margin-right: 2px; }
