/* 스내피 월 대시보드. 휴대폰 화면을 먼저 맞추고 넓은 화면에서 넓힌다.
   색: 노랑 #ffe763 (강조), 차콜 #555. 글꼴: SUIT (같은 폴더의 파일, SIL OFL 1.1). */

@font-face {
  font-family: "SUIT";
  src: url("SUIT-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f5f5f2;
  --card: #ffffff;
  --ink: #232323;
  --sub: #6b6b66;
  --line: #e3e3dd;
  --accent: #ffe763;
  --accent-deep: #f4d73f;
  --charcoal: #555555;
  --ok: #17693f;
  --ok-bg: #e0f3e8;
  --wait: #6b5200;
  --wait-bg: #fff2b0;
  --bad: #a8261f;
  --bad-bg: #fce6e3;
  --mute: #66665f;
  --mute-bg: #ebebe5;
  --radius: 14px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "SUIT", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; }
h1, h2, p, dl, dd, ul { margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--charcoal); outline-offset: 2px; }

/* ---------- 위쪽 줄 ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
.top-in {
  max-width: 1120px; margin: 0 auto; min-height: 56px; display: flex; align-items: center; gap: 18px;
  padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px));
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; text-decoration: none; white-space: nowrap; }
.mark { width: 26px; height: 26px; background: url("mark.svg") center / contain no-repeat; flex: none; }
.nav { display: flex; gap: 4px; align-self: stretch; }
.nav a {
  display: flex; align-items: center; padding: 0 10px; text-decoration: none; font-weight: 600; color: var(--sub);
  border-bottom: 3px solid transparent; border-top: 3px solid transparent; white-space: nowrap;
}
.nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-name { color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.link { background: none; border: 0; padding: 8px 0; font: inherit; font-size: 13px; color: var(--sub); text-decoration: underline; cursor: pointer; white-space: nowrap; }

main { margin: 0 auto; padding: 22px max(var(--gutter), env(safe-area-inset-right, 0px)) 56px max(var(--gutter), env(safe-area-inset-left, 0px)); }
main.wide { max-width: 1120px; }
main.narrow { max-width: 420px; padding-top: 9vh; }
.foot { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter) 28px; color: var(--sub); font-size: 12px; }

h1.page { font-size: 22px; font-weight: 800; margin-bottom: 16px; }
.sub { color: var(--sub); font-size: 14px; }
.dim { color: var(--sub); }
.empty { padding: 44px 0; text-align: center; color: var(--sub); }
.flash { background: var(--mute-bg); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

/* ---------- 표시와 단추 ---------- */
.pill {
  display: inline-block; vertical-align: 2px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700;
  line-height: 1.5; white-space: nowrap; background: var(--mute-bg); color: var(--mute);
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.wait { background: var(--wait-bg); color: var(--wait); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.off { background: var(--charcoal); color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
  border: 1px solid #cfcfc8; border-radius: 11px; background: var(--card); color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--charcoal); }
.btn.go { background: var(--accent); border-color: var(--accent); }
.btn.go:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- 로그인처럼 가운데 놓이는 판 ---------- */
.auth { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px 22px; }
.auth h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.auth .lead { color: var(--sub); font-size: 14px; margin-bottom: 4px; }
.auth .code { color: var(--sub); font-weight: 700; font-size: 13px; }
.auth .alt { margin-top: 16px; font-size: 14px; color: var(--sub); }
.form { display: grid; gap: 14px; margin-top: 16px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; }
.field small { color: var(--sub); font-size: 12px; }
.field input {
  width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #cfcfc8; border-radius: 11px; background: #fff;
  font: inherit; font-size: 16px; color: var(--ink);
}
.field input[readonly] { background: var(--bg); color: var(--sub); }
.error { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 13px; font-size: 14px; font-weight: 600; }

/* ---------- 월 목록 ---------- */
.walls { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.wall { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; }
.wall:hover { border-color: var(--charcoal); }
.wall h2 { font-size: 18px; font-weight: 800; margin: 2px 0 8px; }
.wall .nums { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.wall .nums b { font-size: 18px; font-weight: 800; }
.wall .nums .dim { margin-left: auto; font-size: 13px; }
.wall .nums .hot { background: var(--accent); border-radius: 99px; padding: 1px 11px 1px 9px; }
.crumb { color: var(--sub); font-size: 13px; }
.crumb a { text-decoration: underline; }

/* ---------- 월 하나 ---------- */
.wall-head h1 { font-size: 22px; font-weight: 800; margin: 2px 0 12px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 9px 14px 8px; text-decoration: none; font-weight: 700; color: var(--sub); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--ink); font-size: 12px; text-align: center; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.block h2 { font-size: 13px; font-weight: 800; color: var(--sub); margin-bottom: 10px; }
.now { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.now::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--mute); }
.now.ok::before { background: #2aa364; }
.now.wait::before { background: #e0b400; }
.now.bad::before { background: #d6382f; }
.now.off::before { background: var(--charcoal); }
.tiles { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.tile { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.tile:hover { border-color: var(--charcoal); }
.tile b { font-size: 22px; font-weight: 800; line-height: 1.2; }
.tile span { font-size: 13px; color: var(--sub); }
.tile.hot { background: var(--accent); border-color: var(--accent); }
.tile.hot span { color: var(--ink); }
.facts { display: grid; gap: 0; }
.facts > div { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts > div:last-child { padding-bottom: 0; }
.facts dt { color: var(--sub); font-size: 13px; padding-top: 1px; }
.facts dd { min-width: 0; }

/* ---------- 콘텐츠 목록 ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(var(--gutter) * -1) 14px; padding: 2px var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14px; color: var(--sub);
}
.chips a b { font-weight: 800; color: var(--ink); }
.chips a.on { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.chips a.on b { color: var(--accent); }
.fresh { position: sticky; top: 64px; z-index: 10; display: flex; justify-content: center; margin-bottom: 12px; }
.fresh .btn { box-shadow: 0 6px 18px rgba(0, 0, 0, .16); }

.grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.thumb { position: relative; display: block; aspect-ratio: 3 / 4; background: #dcdcd6; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nothumb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center; color: var(--sub); font-size: 13px; }
.tag { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 7px; background: rgba(35, 35, 35, .82); color: #fff; font-size: 12px; font-weight: 700; }
.tag.r { left: auto; right: 8px; }
.card .body { display: flex; flex-direction: column; gap: 6px; padding: 10px 11px 11px; flex: 1; min-width: 0; }
.by { font-size: 13px; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.by b { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.by time { flex: none; color: var(--sub); font-size: 12px; white-space: nowrap; margin-left: auto; }
.ht { white-space: nowrap; }
.cap { font-size: 13px; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.st { font-size: 13px; }
.why { color: var(--sub); font-size: 12px; }
.act { display: flex; gap: 6px; margin-top: auto; }
.act .btn { flex: 1; padding: 0 8px; }
.card.s-hidden .thumb img, .card.s-expired .thumb img, .card.s-removed .thumb img { filter: grayscale(1); opacity: .45; }
.card.s-filtered .thumb img { opacity: .7; }
.more { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- 콘텐츠 하나 ---------- */
.backline { margin: -4px 0 12px; font-size: 14px; }
.detail { display: grid; gap: 14px; }
.stage { background: #1d1d1b; border-radius: var(--radius); overflow: hidden; display: grid; gap: 2px; }
.stage img, .stage video { width: 100%; max-height: 76vh; object-fit: contain; margin: 0 auto; }
.nofile { color: #d8d8d2; padding: 56px 18px; text-align: center; font-size: 14px; }
.side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.side .st { font-size: 14px; }
.caption { white-space: pre-wrap; font-size: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.caption:empty { display: none; }

/* ---------- 표 ---------- */
.scroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 14px 8px 0; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th { border-top: 0; color: var(--sub); font-weight: 700; padding-top: 0; }
td:last-child { white-space: normal; min-width: 160px; }
.alerts { list-style: none; display: grid; gap: 6px; font-size: 14px; }
.alerts time { color: var(--sub); margin-right: 6px; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px); background: #232323; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600;
}

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
}
@media (min-width: 860px) {
  .detail { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); align-items: start; }
  .facts > div { grid-template-columns: 132px minmax(0, 1fr); }
}
@media (max-width: 559px) {
  .who-name { display: none; }
  .top-in { gap: 10px; }
  .brand span + span, .brand > span:last-child { font-size: 15px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .wall, .tile { transition: border-color .12s, background-color .12s; }
}
