/* design/README.md의 공통 디자인 값 */
:root {
  --text: #1A1F2B; --text-2: #3C4452; --text-3: #5B6472;
  --accent: #1F4FD8; --accent-hover: #163A9E;
  --danger: #A11D1D;
  --line: #E3E6EB; --line-input: #C5CAD3;
  --bg: #F4F6F9; --bg-2: #EEF1F6; --card: #FFFFFF;
  --nav: #141A26;
  --ok-bg: #E3F4EA; --ok: #14613A;
  --warn-bg: #FFF0DC; --warn: #8A4B00;
  --bad-bg: #FCE4E4; --bad: #A11D1D;
  --info-bg: #E6EDFD; --info: #163A9E;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 15px; line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1 { margin: 0; font-size: 24px; }
h2 { margin: 0; font-size: 17px; }
p { margin: 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg-2); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }

/* 틀: 왼쪽 메뉴 + 본문. 좁은 화면에서는 메뉴가 위로 올라간다 */
.shell { display: flex; min-height: 100vh; }
.nav { width: 232px; flex: none; background: var(--nav); color: #C9D1DE; padding: 24px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav .brand { color: #FFFFFF; font-weight: 700; font-size: 18px; padding: 0 12px 16px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: #C9D1DE; }
.nav a:hover { background: #1F2838; color: #FFFFFF; }
.nav a.active { background: var(--accent); color: #FFFFFF; font-weight: 700; }
.nav .soon { font-size: 11px; color: #8D97A8; border: 1px solid #3A4558; border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.nav a.active .soon { color: #FFFFFF; border-color: #FFFFFF; }
.nav .sep { height: 1px; background: #2A3345; margin: 12px; }
.nav .who { margin-top: auto; padding: 16px 12px 0; font-size: 13px; overflow-wrap: anywhere; }
.main { flex: 1; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sub { color: var(--text-3); font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv span:first-child { color: var(--text-3); }
.kv span:last-child { text-align: right; overflow-wrap: anywhere; }

.badge { display: inline-block; border-radius: 999px; padding: 2px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.neutral { background: var(--bg-2); color: var(--text-2); }

.notice { border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.info { background: var(--info-bg); color: var(--info); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--text-3); font-weight: 500; border-top: 0; white-space: nowrap; }
td.nowrap { white-space: nowrap; }

/* 폼 */
form.stack { display: flex; flex-direction: column; gap: 16px; }
label { font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
label small { font-weight: 400; color: var(--text-3); }
input[type=email], input[type=password], input[type=text] {
  height: 48px; padding: 0 12px; border: 1px solid var(--line-input); border-radius: 8px; font: inherit; width: 100%; background: #FFFFFF; color: var(--text);
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #9DB6F5; outline-offset: 2px; }
button, .button {
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--accent); color: #FFFFFF;
  font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
button:hover, .button:hover { background: var(--accent-hover); color: #FFFFFF; }
button.plain { background: #FFFFFF; color: var(--text-2); border: 1px solid var(--line-input); }
button.plain:hover { background: var(--bg-2); color: var(--text); }
button.link { background: none; color: #C9D1DE; padding: 0; min-height: 44px; font-weight: 400; }
button.link:hover { background: none; color: #FFFFFF; text-decoration: underline; }

/* 로그인·설정 화면 */
.center { max-width: 480px; margin: 0 auto; padding: 56px 16px; display: flex; flex-direction: column; gap: 24px; }
.center.wide { max-width: 640px; }
.center .title { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.center .title strong { font-size: 26px; }
.step { font-size: 13px; font-weight: 700; color: var(--accent); }
.qr { align-self: center; width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 8px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; margin: 0; padding: 0; }
.codes li { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg-2); border-radius: 8px; padding: 8px 12px; text-align: center; }
ul.plain { margin: 0; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .nav { width: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .nav .brand { width: 100%; padding: 4px 12px 8px; }
  .nav .sep { display: none; }
  .nav .who { margin: 0; padding: 0 12px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .main { padding: 16px; }
}

/* 화면 추가분 */
.grid.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.stat { gap: 4px; }
.stat span { color: var(--text-3); font-size: 14px; }
.stat strong { font-size: 30px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { color: var(--text-3); }
.row.start { justify-content: flex-start; align-items: flex-end; gap: 8px 12px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice + .notice { margin-top: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; color: var(--text-3); border-bottom: 3px solid transparent; font-weight: 500; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.formgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.formgrid .wide { grid-column: 1 / -1; }
.formgrid button { justify-self: start; }
select, textarea, input[type=number], input[type=time] { min-height: 48px; padding: 0 12px; border: 1px solid var(--line-input); border-radius: 8px; font: inherit; background: #FFFFFF; color: var(--text); max-width: 100%; }
textarea { padding: 12px; width: 100%; line-height: 1.6; }
.formgrid select, .formgrid input[type=number], .formgrid input[type=time] { width: 100%; }
.row.start input[type=text] { width: auto; min-width: 180px; flex: 1 1 180px; max-width: 420px; }
input.code { width: 120px; min-width: 0; flex: none; letter-spacing: 2px; }
label.inline { flex-direction: row; align-items: center; gap: 12px; }
label.check, .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; min-height: 44px; display: flex; }
input[type=checkbox] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
button.danger { background: var(--danger); }
button.danger:hover { background: #7E1414; }
button.danger-text, .danger-text { color: var(--danger); }
button.small { min-height: 36px; padding: 0 10px; font-weight: 500; }
.button.plain { background: #FFFFFF; color: var(--text-2); border: 1px solid var(--line-input); }
td form { display: inline-block; margin: 2px 4px 2px 0; }
td small, .sub small { font-size: 13px; }
code.detail { display: block; max-width: 520px; max-height: 120px; overflow: auto; font-size: 12px; white-space: pre-wrap; }
.pre { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 12px 16px; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; }
.step-chip { background: var(--bg-2); border-radius: 8px; padding: 6px 12px; font-size: 13px; max-width: 360px; }
.step-chip small { color: var(--text-3); }
.preview { border: 1px solid var(--line); border-radius: 8px; padding: 8px 24px 24px; max-width: 760px; }
.preview h2 { margin: 28px 0 8px; font-size: 20px; }
.preview h3 { margin: 20px 0 4px; font-size: 16px; }
.preview p, .preview ul { margin: 8px 0; }
.preview table { margin: 8px 0; }
.preview td, .preview th { border: 1px solid var(--line); }
.preview sup { color: var(--accent); font-size: 11px; }
h2 + h2, section.card > h2:not(:first-child) { margin-top: 8px; }

.shot { margin: 0; }
.shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; display: block; }
.preview img { max-width: 100%; height: auto; border-radius: 8px; }
