/* 찬송 스튜디오 공통 스타일 — "컨트롤룸 HUD" (docs/superpowers/specs/2026-10-09-studio-redesign-design.md) */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  --bg: #080b10;
  --glass: rgba(22, 28, 38, .62);
  --glass-2: rgba(30, 38, 52, .7);
  --well: rgba(0, 0, 0, .22);
  --line: rgba(140, 170, 210, .14);
  --line-2: rgba(140, 170, 210, .26);
  --text: #e9eef6;
  --muted: #8a96a8;
  --dim: #566174;
  --accent: #54e0ff;
  --accent-2: #3b7bff;
  --ok: #4fe39a;
  --warn: #ffc25a;
  --bad: #ff6b7a;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 14px;
  /* 기존 페이지 CSS용 별칭 */
  --panel: var(--glass);
  --panel-2: var(--well);
  --accent-deep: var(--accent-2);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { color-scheme: dark; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(59,123,255,.16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(84,224,255,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: Pretendard, "Apple SD Gothic Neo", -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {   /* 옅은 컨트롤룸 그리드 */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,.55), transparent 75%);
  opacity: .35;
}
a { color: var(--accent); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* ── 셸: 사이드바 + 본문 ── */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
#shell {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; overflow-y: auto;
  border-right: 1px solid var(--line); background: rgba(10, 14, 20, .72); backdrop-filter: blur(14px);
  display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; text-decoration: none; color: inherit; }
.mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a; font-weight: 800; font-size: 16px; box-shadow: 0 0 24px rgba(84,224,255,.35);
}
.brand b { font-size: 14px; font-weight: 800; letter-spacing: .06em; display: block; }
img.mark { background: none; box-shadow: 0 0 22px rgba(84,224,255,.28); border-radius: 10px; }
.brand small { font-size: 11.5px; color: var(--muted); display: block; margin-top: 1px; }
.nav-h { font-size: 11px; color: var(--dim); letter-spacing: .08em; padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; position: relative;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav a.on { color: var(--text); background: rgba(84,224,255,.08); }
.nav a.on::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.nav a.on svg { color: var(--accent); }
.nav a .ext { margin-left: auto; font-size: 11px; color: var(--dim); }
.nav a .led { margin-left: auto; }
.shell-foot { margin-top: auto; padding: 14px 4px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.shell-foot .who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 0 8px; min-width: 0; }
.shell-foot .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-foot .who a { margin-left: auto; color: var(--muted); text-decoration: none; flex-shrink: 0; }
.shell-foot .who a:hover { color: var(--text); }
.haru-btn { width: 100%; }

main { padding: 26px clamp(16px, 3vw, 40px) 100px; min-width: 0; position: relative; z-index: 1; }
.top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.top .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.top .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.clock { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.clock b { color: var(--text); font-weight: 600; }

/* ── 부품 ── */
.panel, .card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(12px); }
.card { padding: 20px; }
.card h3 { font-size: 15px; display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.card h3 svg { color: var(--accent); }
.desc { color: var(--muted); font-size: 13px; line-height: 1.6; }
.card .desc { margin-bottom: 14px; }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex-shrink: 0; display: inline-block; }
.led.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.led.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); animation: pulse 1.6s ease-in-out infinite; }
.led.bad { background: var(--bad); box-shadow: 0 0 8px rgba(255,107,122,.6); }
@keyframes pulse { 50% { opacity: .35; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); text-decoration: none;
  transition: border-color .15s, background .15s, transform .1s, filter .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); background: rgba(84,224,255,.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary {
  border: 0; color: #03121a; font-weight: 700; font-size: 15px; padding: 13px 22px;
  background: linear-gradient(135deg, var(--accent), #6aa6ff);
  box-shadow: 0 0 0 1px rgba(84,224,255,.4), 0 8px 30px rgba(84,224,255,.22);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; }
.btn.danger { color: var(--bad); }
.btn.ghost-accent { color: var(--accent); border-color: rgba(84,224,255,.45); }
.btn-ghost { background: rgba(255,255,255,.03); }  /* 기존 클래스 호환 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type="text"], input[type="password"], input[type="date"], input:not([type]), select {
  font: inherit; font-size: 14px; color: var(--text); padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--line-2); background: rgba(0,0,0,.25); min-width: 0;
}
input::placeholder { color: var(--dim); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(84,224,255,.12); }
select { cursor: pointer; }
select option, select optgroup { background: #121822; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
  background: var(--well); border: 1px solid var(--line); color: var(--muted);
}
.chip b { font-weight: 600; color: var(--text); font-family: var(--mono); font-size: 12px; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex-shrink: 0; }
.chip.on::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chip.on b { color: var(--ok); }
.chip.off::before { background: var(--bad); }
.chip.off b { color: var(--bad); }

.log {
  display: none; margin-top: 14px; padding: 14px 16px; border-radius: 10px;
  background: rgba(0,0,0,.4); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-all;
  color: #c9d3e2; max-height: 300px; overflow-y: auto;
}
.log.show { display: block; }
.log.ok { border-color: rgba(79,227,154,.4); }
.log.bad { border-color: rgba(255,107,122,.45); }

.list { list-style: none; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.list li:last-child { border-bottom: 0; }
.list .when { color: var(--muted); font-size: 12px; flex-shrink: 0; font-family: var(--mono); }
.empty { color: var(--dim); font-size: 13px; padding: 10px 2px; }

.sec-h { display: flex; align-items: center; gap: 10px; margin: 6px 2px 12px; }
.sec-h h2 { font-size: 13px; font-weight: 600; color: var(--muted); }
.sec-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.help {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line-2); color: var(--muted); font-size: 11px; cursor: help; font-weight: 500;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 180px; min-width: 180px; }
.tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--warn); border: 1px solid rgba(255,194,90,.35); padding: 2px 7px; border-radius: 999px; font-weight: 500; }

/* 히어로: 화면의 주 행동 */
.hero { padding: 22px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-bottom: 14px; }
.hero h2 { font-size: 19px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero h2 > svg { color: var(--accent); width: 20px; height: 20px; }
.hero .chips { margin-top: 12px; }
.hero .act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.stack > * + * { margin-top: 14px; }

/* 인증 페이지(셸 없음) */
.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 360px; padding: 28px 24px; }
.auth-card .brand { padding: 0 0 22px; }
.auth-card label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.auth-card input { width: 100%; font-size: 15px; }
.auth-card .btn.primary { width: 100%; margin-top: 22px; }
.auth-card .err { color: var(--bad); font-size: 13px; margin-top: 14px; min-height: 1em; }
.auth-card .alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-card .alt a { text-decoration: none; }

.view { animation: in .25s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ── 모바일: 사이드바 → 하단 탭 ── */
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  #shell {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30; overflow: visible;
    flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
  }
  #shell .brand, .nav-h, .shell-foot, .nav a:not(.tab) { display: none; }
  .nav { display: contents; }
  .nav a.tab { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 6px 4px; flex: 1; text-align: center; }
  .nav a.tab .led, .nav a.tab .ext { display: none; }
  .nav a.on::before { left: 28%; right: 28%; top: -7px; bottom: auto; width: auto; height: 3px; }
  main { padding-bottom: 96px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero .act { justify-content: stretch; }
  .hero .act > * { flex: 1; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .clock { display: none; }
}
