/* 궁궐의 시간 공통 스타일
   배치: 메인은 방(타이머) 자체가 첫 화면, 그 아래로 책장처럼 공간·이야기·이벤트가 이어진다. */
:root {
  --bg: #F7F2E3;          /* 밝은 아이보리 */
  --surface: #FFFCF2;
  --ink: #221E15;
  --muted: #6A6252;
  --line: #DED4BB;
  --accent: #3F574A;      /* 포인트 — 색 빠진 딥그린 */
  --accent-ink: #FFFCF2;
  --brass: #7A6008;       /* 어두운 개나리 — 글자용 */
  --gold: #C9A227;        /* 어두운 개나리 — 칠하는 용 */
  --indigo: #3F574A;
  --chip: #EFE7D2;
  /* 타이머 무대는 낮밤 설정과 관계없이 항상 밤의 방 */
  --st-bg: #0E1218;
  --st-panel: rgba(18, 15, 14, 0.82);
  --st-ink: #FFFFFF;
  --st-soft: #EFE7D6;
  --st-gold: #D4AA2E;     /* 무대 안의 일반 색 — 어두운 개나리 */
  --st-line: #8C7E6A;
  --st-paper: #F6EFDF;
  --st-dark: #1E1510;
  --st-red: #3F574A;      /* 무대 안의 포인트도 같은 딥그린 */
  /* 큰 제목만 — 명조체 */
  --font-display: 'Nanum Myeongjo', 'AppleMyungjo', 'Batang', serif;
  /* 그 밖의 모든 글자 — 담백한 고딕 (프리텐다드, 없으면 기기 기본 고딕) */
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130D; --surface: #211E16; --ink: #F2EDDE; --muted: #A9A18C; --line: #3A352A;
    --accent: #8FB09C; --accent-ink: #15130D; --brass: #E0BD46; --gold: #E0BD46; --indigo: #8FB09C; --chip: #2A2619;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130D; --surface: #211E16; --ink: #F2EDDE; --muted: #A9A18C; --line: #3A352A;
  --accent: #8FB09C; --accent-ink: #15130D; --brass: #E0BD46; --gold: #E0BD46; --indigo: #8FB09C; --chip: #2A2619;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
}
img { max-width: 100%; }
a { color: var(--indigo); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; line-height: 1.3; margin: 0; }
p { margin: 0; }

.wrap {
  max-width: 1080px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* 머리말 */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand strong { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.04em; }
.brand span { font-size: 13px; color: var(--muted); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { min-height: 44px; padding: 0 14px; display: flex; align-items: center; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--chip); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.auth { display: flex; align-items: center; gap: 8px; }
.btn { min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--chip); color: var(--ink); }
.btn-fill { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-fill:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; }
.user-chip { min-height: 44px; padding: 0 12px 0 6px; border-radius: 22px; background: var(--chip); display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.user-chip i { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-style: normal; font-family: var(--font-display); font-weight: 700; }

/* 본문 구역 */
.band { padding-block: 44px; }
.band + .band { border-top: 1px solid var(--line); }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.band-head h2 { font-size: 26px; }
.band-head p { color: var(--muted); font-size: 15px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--brass); }

/* 공간(테마) 고르기 */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.theme { text-align: left; padding: 0; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); overflow: hidden; display: flex; flex-direction: column; }
.theme:hover:not(:disabled) { border-color: var(--indigo); }
.theme[aria-pressed="true"] { border-color: var(--accent); }
.theme-thumb { aspect-ratio: 16 / 9; width: 100%; background-color: var(--st-bg); background-size: cover; background-position: 62% 60%; position: relative; }
.thumb-seogo { background-image: url(seogo-night.webp); }
.thumb-pav { background-image: url(pavilion-day.webp); background-position: 58% 52%; }
.thumb-forest { background-image: url(spring-walk.webp); background-position: 40% 50%; }
.thumb-mook { background-image: url(mook-night.webp); background-position: 60% 40%; }
.thumb-plain { background-image: radial-gradient(circle at 50% 46%, rgba(226,194,122,0.22) 0 23%, rgba(226,194,122,0) 24%), radial-gradient(circle at 50% 120%, #2A3540 0%, #0E1218 70%); }
.thumb-soon { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 22px), repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 22px), linear-gradient(160deg, #26323A, #131A20); }
.theme-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.theme-body strong { font-family: var(--font-display); font-size: 18px; }
.theme-body span { font-size: 14px; color: var(--muted); line-height: 1.5; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink); }
.theme[aria-pressed="true"] .tag-now { background: var(--accent); color: var(--accent-ink); }
.theme:disabled { opacity: 0.75; }

/* 이야기 카드 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0; }
a.card:hover { border-color: var(--indigo); color: var(--ink); }
.card h3 { font-size: 20px; }
.card p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.card .meta { font-size: 13px; color: var(--brass); font-weight: 700; }
.card.soon { background: transparent; border-style: dashed; }

/* 글 본문 */
.article { max-width: 44rem; margin-inline: auto; }
.article header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.article h1 { font-size: clamp(28px, 5vw, 38px); }
.article h2 { font-size: 22px; margin-top: 36px; margin-bottom: 10px; }
.article p + p { margin-top: 14px; }
.article ul { margin: 10px 0 0; padding-left: 22px; }
.article li + li { margin-top: 6px; }
.article .lead { font-size: 18px; color: var(--muted); }
.note { margin-top: 18px; padding: 14px 16px; border-radius: 8px; background: var(--chip); font-size: 15px; }
.sources { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.sources h2 { font-size: 16px; margin: 0 0 8px; color: var(--ink); }
.cta { margin-top: 36px; padding: 22px; border-radius: 10px; background: var(--st-bg); color: var(--st-soft); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cta p { font-family: var(--font-display); font-size: 19px; }
.cta a { background: var(--st-paper); color: var(--st-dark); border-color: var(--st-paper); font-weight: 700; }
.cta a:hover { background: var(--st-gold); color: var(--st-dark); }

/* 꼬리말 */
.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-foot .wrap { padding-block: 24px; display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; }
.site-foot a { color: var(--muted); }
.site-foot .grow { margin-right: auto; }

/* 로그인·이름 창 */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(8, 10, 14, 0.62); display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.modal { width: min(420px, 100%); max-height: 100%; overflow-y: auto; background: var(--surface); color: var(--ink); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); }
.modal h2 { font-size: 22px; }
.modal p { font-size: 15px; color: var(--muted); line-height: 1.6; }
.modal .note { margin: 0; color: var(--ink); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.field input { height: 48px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--muted); background: var(--bg); color: var(--ink); font-size: 16px; }
.field small { font-size: 13px; color: var(--accent); min-height: 1.2em; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  /* 무대 그림 속 장식(촛불·참새·올빼미)은 짧은 장면이라 그대로 둔다 */
  *:not(.scene-inner, .scene-inner *) { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* 공지 / 광고 자리 / 알림 띠 */
.notice { background: var(--brass); color: #FFFFFF; }
.notice .wrap { padding-block: 10px; }
.notice p { margin: 0; font-size: 15px; font-weight: 500; }
.ad-slot { border-block: 1px dashed var(--line); background: var(--chip); }
.ad-slot .wrap { padding-block: 22px; text-align: center; }
.ad-slot p { margin: 0; font-size: 14px; color: var(--muted); }
.alert-bar { background: var(--accent); color: var(--accent-ink); }
.alert-bar .wrap { padding-block: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.alert-bar p { margin-right: auto; font-weight: 700; }
.alert-bar .btn { border-color: var(--accent-ink); color: var(--accent-ink); }
.alert-bar .btn-fill { background: var(--accent-ink); color: var(--accent); }
.muted { color: var(--muted); }

/* 관리자 */
.admin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h1 { font-size: clamp(26px, 5vw, 34px); }
.gate-box { max-width: 36rem; display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.acard { padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.acard h2 { font-size: 20px; }
.ahint { font-size: 14px; color: var(--muted); line-height: 1.6; }
.afield { display: flex; flex-direction: column; gap: 4px; }
.afield label { font-size: 13px; font-weight: 700; color: var(--muted); }
.afield small { font-size: 12px; color: var(--muted); }
.acard input[type="text"], .acard input[type="number"], .acard textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--muted);
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 15px; line-height: 1.5;
}
.acard input[type="number"] { max-width: 120px; }
.acard select { width: 100%; max-width: 280px; min-height: 44px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--muted); background: var(--bg); color: var(--ink); font-family: inherit; font-size: 15px; }
.acard textarea { resize: vertical; }
.acheck { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 44px; }
.acheck input { width: 20px; height: 20px; accent-color: var(--accent); }
.arow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.astates { display: flex; gap: 6px; flex-wrap: wrap; }
.acard .ghost { min-height: 40px; padding: 0 12px; border-radius: 8px; border: 2px solid var(--line); background: transparent; color: var(--ink); font-size: 14px; }
.acard .ghost[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.acard .ghost.danger, .btn.danger { border-color: var(--accent); color: var(--accent); }
.alist { display: flex; flex-direction: column; gap: 12px; }
.aitem { padding: 14px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 10px; }
.aitem.small { flex-direction: row; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.aitem-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.aitem-head b { margin-right: auto; font-size: 16px; }
.save-bar { position: sticky; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); }
.save-bar .wrap { padding-block: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.save-bar p { margin-right: auto; font-size: 14px; color: var(--muted); }
.save-bar.on p { color: var(--accent); font-weight: 700; }

/* ── 관리자: 칸 전환 ── */
.adm-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.adm-tab { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: none; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.adm-tab:hover { color: var(--ink); }
.adm-tab[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
#adminBody:focus { outline: none; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.two-col .acard { margin-bottom: 0; }
.sample-note { margin: 0 0 16px; padding: 12px 14px; border-radius: 8px; background: var(--chip); font-size: 14px; color: var(--ink); }

/* ── 관리자: 숫자 카드 ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-k { font-size: 13px; color: var(--muted); }
.kpi-v { font-family: var(--font-display); font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: 12px; color: var(--muted); }

/* ── 관리자: 차트 ── */
.chart-scroll { overflow-x: auto; padding-block: 4px; }
.chart { width: 100%; min-width: 520px; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: #A8392A; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-family: var(--font-body); }
.chart .bar-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; z-index: 40; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: 13px; white-space: nowrap; pointer-events: none; }
.barlist { display: flex; flex-direction: column; gap: 8px; }
.barlist-row { display: grid; grid-template-columns: minmax(84px, 9rem) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-track { height: 12px; border-radius: 6px; background: var(--chip); overflow: hidden; }
.bl-fill { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.bl-val { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-view { margin-top: 12px; }
.table-view summary { cursor: pointer; font-size: 14px; color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.table-wrap { overflow-x: auto; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: 14px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap th { color: var(--muted); font-size: 13px; }
.table-wrap td { font-variant-numeric: tabular-nums; }

/* ── 관리자: 운영 점검·활동 ── */
.ops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ops li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
.ops li:last-child { border-bottom: none; }
.ops .dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.ops .ok .dot, .ops li.ok .dot { background: #2F6E5E; }
.ops li.todo .dot { background: var(--brass); }
.ops-t { margin-right: auto; }
.logs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.logs li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.logs li:last-child { border-bottom: none; }
.log-k { flex: 0 0 auto; min-width: 48px; padding: 2px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; font-weight: 700; text-align: center; }
.log-m { margin-right: auto; min-width: 0; }
.log-t { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ── 관리자: 목록 편집 ── */
.aitem { padding: 0; }
.aitem summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; min-height: 48px; flex-wrap: wrap; }
.aitem summary::-webkit-details-marker { display: none; }
.aitem summary::marker { content: ''; }
.aitem summary b { font-size: 16px; }
.aitem summary::after { content: '＋'; margin-left: auto; color: var(--muted); font-size: 17px; }
.aitem[open] summary::after { content: '－'; }
.sum-sub { font-size: 13px; color: var(--muted); }
.chip { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--chip); color: var(--muted); }
.chip-on, .chip-open { background: #2F6E5E; color: #FFFFFF; }
.chip-soon { background: var(--brass); color: #FFFFFF; }
.aitem-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.aitem-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.acard .ghost:disabled { opacity: .4; }

/* 공간 소개 */
.theme-intro { margin-top: 20px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.theme-intro :first-child { margin-top: 0; }
.theme-intro h3 { font-family: var(--font-display); font-size: 20px; margin: 0 0 8px; }
.theme-intro p { margin: 0 0 10px; }
.theme-intro ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.theme-intro li + li { margin-top: 4px; }

/* 게시판 */
.board { border-collapse: collapse; width: 100%; font-size: 15px; }
.board th, .board td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.board thead th { font-size: 13px; color: var(--muted); border-bottom: 2px solid var(--line); }
.board .no { width: 56px; color: var(--muted); font-variant-numeric: tabular-nums; }
.board .cat { width: 130px; }
.board .dt { width: 110px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board .ttl { min-width: 220px; }
.board .ttl a { color: var(--ink); text-decoration: none; font-weight: 500; }
.board .ttl a:hover { color: var(--accent); text-decoration: underline; }
.board .ttl .chip { margin-left: 8px; }
.board tbody tr:hover { background: var(--chip); }
.story-body h2 { font-size: 22px; margin-top: 36px; margin-bottom: 10px; }
.story-body p + p, .story-body ul { margin-top: 14px; }
.story-body ul { padding-left: 22px; }
.story-body li + li { margin-top: 6px; }
.story-body .lead { font-size: 18px; color: var(--muted); }

/* 굿즈샵 */

/* 관리자: 편집 도움 */
.acard textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.acard input[type="date"], .acard input[type="file"] { width: 100%; max-width: 280px; min-height: 44px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--muted); background: var(--bg); color: var(--ink); font-family: inherit; font-size: 15px; }
.arow2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.asep { border: none; border-top: 1px solid var(--line); margin: 4px 0; }
.prow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prow-n { min-width: 72px; font-size: 14px; color: var(--muted); }
.sound-pane { display: flex; flex-direction: column; gap: 8px; }
.warn-txt { color: var(--accent); }
.admin-board .acts { width: 1%; white-space: nowrap; }
.admin-board .acts button { margin-left: 4px; }
.admin-board td { vertical-align: middle; }
.admin-board tr.row-on { background: var(--chip); }
.linkbtn { border: none; background: none; padding: 0; color: var(--ink); font-size: 15px; font-weight: 500; text-align: left; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.linkbtn:hover { color: var(--accent); }

/* 관리자 — 배경 그림 미리 보기 */
.bg-prev { display: block; width: min(100%, 320px); aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 4px; background: #0E1218; }

/* ---------- 이야기 카드 목록 ---------- */
.list-count { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post, a.post { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
a.post:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; background-size: cover; background-position: center; background-color: var(--chip); }
.post-thumb.no-img { display: grid; place-items: center; background-image: linear-gradient(135deg, #3F574A 0%, #5A6B4E 52%, #C9A227 100%); }
.post-thumb.no-img span { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: rgba(255, 252, 246, 0.9); }
.post-body { display: block; padding: 16px 18px 20px; }
.post-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-meta .tag { font-size: 12px; font-weight: 700; color: var(--accent); }
.post-meta time { font-size: 12px; color: var(--muted); }
.post h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.38; letter-spacing: -0.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post p { margin: 0; font-size: 14px; line-height: 1.62; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post.soon { opacity: 0.62; }
.post.soon .post-meta time { color: var(--muted); }

/* 글 맨 위 큰 그림 */
.story-hero { width: 100%; aspect-ratio: 16 / 7; border-radius: 14px; margin-bottom: 26px; background-size: cover; background-position: center; background-color: var(--chip); }
.story-hero.no-img { display: none; }
.story-body img { max-width: 100%; height: auto; border-radius: 10px; margin: 18px 0; display: block; }

@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } .post h3 { font-size: 18px; } }

/* ---------- 글쓰기 편집기 ---------- */
.ed { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--chip); }
.ed-btn { border: 1px solid transparent; background: none; color: var(--ink); font-size: 13px; font-weight: 600; padding: 6px 9px; border-radius: 7px; line-height: 1.2; }
.ed-btn:hover { background: var(--surface); border-color: var(--line); }
.ed-btn.on { background: var(--ink); color: var(--surface); }
.ed-btn.ed-b { font-weight: 800; }
.ed-btn.ed-i { font-style: italic; }
.ed-btn.ed-u { text-decoration: underline; }
.ed-btn.ed-right { margin-left: auto; }
.ed-sep { width: 1px; height: 18px; background: var(--line); margin: 0 5px; }
.ed-row { display: flex; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ed-url { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 13px; background: var(--surface); color: var(--ink); }
.ed-area { min-height: 320px; max-height: 560px; overflow-y: auto; padding: 16px 18px; font-size: 15px; line-height: 1.75; outline: none; }
.ed-area:focus { box-shadow: inset 0 0 0 2px rgba(168, 57, 42, 0.18); }
.ed-area > *:first-child { margin-top: 0; }
.ed-area h2 { font-size: 20px; margin: 22px 0 8px; }
.ed-area h3 { font-size: 17px; margin: 18px 0 6px; }
.ed-area p { margin: 0 0 12px; }
.ed-area ul, .ed-area ol { margin: 0 0 12px; padding-left: 22px; }
.ed-area blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.ed-area img { max-width: 100%; max-height: 340px; width: auto; height: auto; border-radius: 8px; display: block; margin: 12px 0; }
.ed-area:empty::before { content: '여기에 글을 쓰세요.'; color: var(--muted); }
.ed-code { width: 100%; min-height: 320px; border: none; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.65; background: var(--surface); color: var(--ink); resize: vertical; outline: none; }
.ed-msg { margin: 0; padding: 8px 12px; font-size: 12px; color: var(--accent); border-top: 1px solid var(--line); }

/* 대표 그림 고르기 */
.cover-prev { width: min(100%, 320px); aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; background-size: cover; background-position: center; background-color: var(--chip); display: grid; place-items: center; }
.cover-prev span { font-size: 12px; color: var(--muted); }

/* 파일 고르기 단추를 한글로 */
.filebtn { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--surface); cursor: pointer; }
.filebtn:hover { border-color: var(--accent); }
.afield input[type="file"].hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }


/* ---------- 모든 모서리를 각지게 ---------- */
*, *::before, *::after,
img, input, select, textarea, button, a, .btn, .card, .post, .post-thumb,
.cover-prev, .bg-prev, .theme-thumb, .story-hero, .chip, .tag {
  border-radius: 0 !important;
}


/* ---------- 글자 다듬기: 더 작고 담백하게 ---------- */
/* 명조는 큰 제목(브랜드·페이지 제목·구역 제목)에만 쓰고, 나머지는 모두 고딕입니다. */
body { font-size: 15px; line-height: 1.6; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-body); font-weight: 600; letter-spacing: -0.02em; line-height: 1.35; }
h1, .band-head h2, .brand strong { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }

.brand strong { font-size: 22px; }
.brand span { font-size: 12px; }
.nav a { font-size: 14px; min-height: 40px; padding: 0 12px; }
.btn { font-size: 14px; min-height: 40px; padding: 0 16px; }
.btn-fill { font-weight: 600; }
.band-head h1 { font-size: clamp(24px, 4vw, 30px); }
.band-head h2 { font-size: 22px; }
.band-head p { font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.article h1 { font-size: clamp(24px, 4vw, 30px); }
.admin-head h1 { font-size: clamp(22px, 4vw, 28px); }
.article h2, .story-body h2 { font-size: 18px; margin-top: 30px; }
.article .lead, .story-body .lead { font-size: 16px; }
.theme-body strong { font-family: var(--font-body); font-size: 15px; font-weight: 600; }
.theme-body span { font-size: 13px; }
.card h3 { font-size: 16px; }
.cta p { font-family: var(--font-body); font-size: 16px; font-weight: 600; }
.modal h2 { font-size: 18px; }
.acard h2 { font-size: 16px; }
.kpi-v { font-family: var(--font-body); font-size: 24px; font-weight: 600; line-height: 1.3; }
.theme-intro h3 { font-family: var(--font-body); font-size: 17px; }
.post h3 { font-size: 16px; line-height: 1.45; letter-spacing: -0.02em; padding-bottom: 1px; }
.post p { font-size: 13px; line-height: 1.6; }
.post-body { padding: 14px 16px 18px; }
.site-foot { font-size: 13px; }
.ed-area { font-size: 14px; }
.ed-area h2 { font-size: 18px; }
.ed-area h3 { font-size: 16px; }
@media (max-width: 560px) { .post h3 { font-size: 16px; } }

/* 관리자 미리 보기 띠 */
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 22px; background: var(--chip); border: 1px solid var(--gold); font-size: 13px; font-weight: 600; color: var(--brass); }

/* ---------- 스케줄 타이머 (schedule.html, 비공개 시안) ---------- */
.sched-head { margin-bottom: 24px; }
.sched-head h1 { margin: 6px 0 8px; }
.small { font-size: 13px; }
.btn-quiet { border-color: var(--line); color: var(--muted); }
.sched-nowcard { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.sched-nowcard h2 { margin: 4px 0; font-size: 20px; }
.sched-nowcard p { margin: 0; }
.sched-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sched-barwrap { margin: 28px 0 8px; }
.sched-bar { position: relative; height: 46px; background: var(--chip); border: 1px solid var(--line); }
.sched-seg { position: absolute; top: 0; bottom: 0; overflow: hidden; border-right: 2px solid var(--bg); display: flex; align-items: center; padding: 0 8px; opacity: .78; }
.sched-seg.is-now { opacity: 1; box-shadow: inset 0 -4px 0 rgba(255,255,255,.55); }
.sched-seg span { color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.sched-now { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--ink); }
.sched-now span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.sched-ticks { position: relative; height: 20px; margin-top: 4px; }
.sched-ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.sched-ticks span:first-child { transform: none; }
.sched-ticks span:last-child { transform: translateX(-100%); }
.sched-rows { display: grid; gap: 8px; margin-top: 16px; }
.sched-row { display: grid; grid-template-columns: 8px 1fr 1.25fr 1fr 1.25fr 1.35fr 1.1fr .7fr auto; gap: 10px; align-items: end; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); }
.sched-chip { align-self: stretch; }
.sched-row label, .sched-row .f-end { display: grid; gap: 4px; min-width: 0; }
.sched-row label > span, .sched-row .f-end > span { font-size: 12px; color: var(--muted); }
.sched-row .f-end b { font-size: 13px; font-weight: 600; min-height: 38px; display: flex; align-items: center; }
.sched-row input, .sched-row select { width: 100%; min-width: 0; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; }
.sched-row input:disabled { opacity: .45; }
.sched-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.sched-foot { margin-top: 24px; }
@media (max-width: 860px) {
  .sched-row { grid-template-columns: 8px 1fr 1fr; }
  .sched-chip { grid-row: span 5; }
  .sched-row .f-name { grid-column: 2 / 4; }
  .sched-row .f-theme, .sched-row .f-sound { grid-column: 2 / 4; }
  .sched-row .f-del { grid-column: 2 / 4; justify-self: start; }
  .sched-seg span { font-size: 10px; }
  .sched-seg { padding: 0 3px; }
}
.sched-pass { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: -8px 0 16px; }
.sched-pass a { color: var(--ink); }
.sched-pass-tag { padding: 2px 8px; font-size: 12px; font-weight: 600; background: var(--chip); color: var(--muted); }
.sched-pass-tag.is-on { background: var(--accent); color: #fff; }

/* ---------- 포인트 (points.html, 비공개 시안) ---------- */
.pt-banner { padding: 10px 14px; background: var(--chip); border-left: 4px solid var(--gold); font-size: 13px; color: var(--ink); }
.pt-msg { min-height: 20px; margin: 8px 0; font-size: 14px; font-weight: 600; color: var(--accent); }
.pt-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pt-stat { display: grid; gap: 4px; padding: 18px; background: var(--surface); border: 1px solid var(--line); }
.pt-stat > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.pt-stat strong { font-size: 24px; font-weight: 700; }
.pt-stat small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.pt-stat.is-on { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.pt-h { font-size: 18px; margin: 32px 0 12px; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.pt-card { display: grid; gap: 6px; align-content: start; padding: 16px; background: var(--surface); border: 1px solid var(--line); }
.pt-card h3 { font-size: 14px; font-weight: 600; margin: 0; }
.pt-card p { margin: 0; }
.pt-card .btn { margin-top: 6px; }
.pt-big { font-size: 22px; font-weight: 700; color: var(--accent); }
.pt-log { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border: 1px solid var(--line); }
.pt-log th, .pt-log td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.pt-log th { font-size: 12px; color: var(--muted); font-weight: 600; }
.pt-log td:last-child, .pt-log th:last-child { text-align: right; white-space: nowrap; }
.pt-log .plus { color: var(--accent); font-weight: 600; }
.pt-log .minus { color: var(--brass); font-weight: 600; }
.pt-rules { display: grid; gap: 6px; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.pt-tools { margin-top: 24px; }
.pt-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.pt-dl dt { color: var(--muted); }
.pt-dl dd { margin: 0; font-weight: 600; }
.pt-agree { font-size: 14px; }
.modal .warn { color: var(--accent); min-height: 16px; }
.ad-box { display: grid; gap: 10px; }
.ad-tag { font-size: 12px !important; font-weight: 600; color: var(--brass) !important; margin: 0; }
.ad-screen { position: relative; aspect-ratio: 16 / 9; background: repeating-linear-gradient(45deg, var(--chip), var(--chip) 12px, var(--bg) 12px, var(--bg) 24px); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.ad-screen span { font-size: 13px; color: var(--muted); }
.ad-count { position: absolute; right: 10px; top: 8px; font-size: 14px; background: var(--ink); color: #fff; padding: 2px 8px; }
.ad-bar { height: 4px; background: var(--chip); }
.ad-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
@media (max-width: 860px) { .pt-stats { grid-template-columns: 1fr; } .pt-grid { grid-template-columns: repeat(2, 1fr); } }
.pt-arow { display: grid; gap: 10px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pt-arow-pack { grid-template-columns: 1fr 1fr auto; }
.pt-arow-pass { grid-template-columns: 2fr 1fr 1fr auto; }
.pt-arow .afield { margin: 0; }
@media (max-width: 600px) { .pt-arow-pass { grid-template-columns: 1fr 1fr; } .pt-arow-pass .afield:first-child { grid-column: 1 / -1; } }
.pt-asub { font-size: 14px; margin: 12px 0 0; }

/* 한 줄 소개가 길어져서, 좁은 화면에서는 이름 아래 줄로 내린다 (2026-11-25) */
@media (max-width: 700px) {
  .brand { flex-wrap: wrap; row-gap: 0; column-gap: 8px; }
  .brand span { flex-basis: 100%; font-size: 11.5px; line-height: 1.4; }
}
