:root {
  --cream: #F7F3EC;
  --panel: #FFFDF9;
  --ink: #17140F;
  --ink-muted: #6B6459;
  --accent: #C17F2A;
  --accent-soft: #F3E6D2;
  --line: #E4DDD0;
  --font-serif: "Noto Serif KR", serif;
  --font-body: "Pretendard", "IBM Plex Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font-body); font-size: 14px; min-height: 100vh; }
body { animation: pageIn .4s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
body.anim-settled { animation: none; }
body.leaving { animation: pageOut .28s ease both; }
@keyframes pageOut { to { opacity: 0; transform: translateY(-8px); } }

.topbar { padding: 20px max(28px, calc((100% - 1180px) / 2 + 28px)); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.topbar .mark { font-family: 'Space Grotesk'; font-weight: 700; font-size: 15px; letter-spacing: normal; text-decoration: none; color: var(--ink); }
.nav-links { display: flex; gap: 30px; font-size: 12px; letter-spacing: 0.03em; color: var(--ink-muted); }
.nav-links span { cursor: pointer; }
.nav-links span:hover { color: var(--accent); }
.nav-links span.active { color: var(--accent); font-weight: 700; cursor: default; }

.stage { max-width: 560px; margin: 0 auto; padding: 20px 28px 90px; }

.masthead { text-align: center; margin-bottom: 40px; }
.masthead .kicker { font-size: 11px; letter-spacing: 0.22em; color: var(--accent); text-transform: uppercase; margin-bottom: 14px; }
.masthead h1 { font-family: var(--font-serif); font-weight: 700; font-size: 34px; letter-spacing: -0.01em; margin-bottom: 12px; }
.masthead .sub { font-family: var(--font-serif); font-style: italic; font-size: 14px; color: var(--ink-muted); }

.field { margin-bottom: 26px; }
.field label { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 8px; }
.field input[type="text"], .field input[type="number"], .field textarea, .field input[type="datetime-local"] {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
  font-family: var(--font-body); font-size: 14px; color: var(--ink); padding: 11px 13px; outline: none;
  transition: border-color .15s; box-sizing: border-box;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: none; min-height: 110px; line-height: 1.8; font-family: var(--font-serif); }
.char-count { text-align: right; font-size: 11px; color: var(--ink-muted); margin-top: 6px; }
.char-count.over { color: var(--accent); font-weight: 700; }
.field-hint { font-size: 11.5px; color: var(--ink-muted); margin-top: 6px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.preset-btn {
  border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 7px 14px;
  font-size: 12px; color: var(--ink); cursor: pointer;
}
.preset-btn.selected { border-color: var(--accent); background: var(--accent); color: #fff; }

.compose-paper {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 32px 28px 6px; margin-bottom: 26px;
}

.seal-btn {
  width: 100%; background: var(--ink); color: #fff; border: none; border-radius: 4px;
  padding: 16px; font-family: var(--font-serif); font-size: 16px; letter-spacing: 0.03em; cursor: pointer;
  transition: background .15s;
}
.seal-btn:hover { background: var(--accent); }
.seal-btn:disabled { background: var(--line); color: var(--ink-muted); cursor: not-allowed; }
.seal-btn:disabled:hover { background: var(--line); }
.ghost-btn { background: transparent; border: 1px solid var(--line); border-radius: 4px; padding: 12px 20px; font-size: 13px; color: var(--ink); cursor: pointer; }
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
.disclaimer { font-size: 11px; color: var(--ink-muted); text-align: center; margin-top: 16px; line-height: 1.7; }
.irrevocable-warning { font-size: 12px; color: #A0522D; background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; line-height: 1.5; }

.link-box { display: flex; gap: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin-bottom: 16px; align-items: center; }
.link-box input { flex: 1; border: none; background: transparent; font-size: 12px; color: var(--ink-muted); outline: none; }
.share-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.share-result { text-align: center; padding: 30px 0; }
.step-indicator { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 6px 14px; border-radius: 99px; margin-bottom: 18px; }
.share-result .env-icon { font-size: 40px; margin-bottom: 16px; }
.share-result h2 { font-family: var(--font-serif); font-size: 21px; margin-bottom: 10px; }
.share-result p { font-size: 13px; color: var(--ink-muted); margin-bottom: 24px; line-height: 1.7; }

/* ===== Room intro (no room param) ===== */
.intro-steps { margin: 30px 0; }
.intro-steps .step { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.intro-steps .num { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; }
.intro-steps p { font-size: 13px; color: var(--ink-muted); line-height: 1.6; margin: 0; }

/* ===== Dashboard: gauge ===== */
.room-title { font-family: var(--font-serif); font-size: 22px; text-align: center; margin-bottom: 6px; }
.room-dday { text-align: center; font-size: 12.5px; color: var(--ink-muted); margin-bottom: 28px; }
.gauge-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px 22px; margin-bottom: 22px; }
.gauge-count { font-family: var(--font-serif); font-size: 30px; text-align: center; margin-bottom: 4px; }
.gauge-count b { color: var(--accent); }
.gauge-remain { text-align: center; font-size: 12px; color: var(--ink-muted); margin-bottom: 16px; }
.gauge-bar-track { background: var(--accent-soft); border-radius: 20px; height: 14px; overflow: hidden; margin-bottom: 10px; }
.gauge-bar-fill { background: linear-gradient(90deg, #E0A857, var(--accent)); height: 100%; border-radius: 20px; transition: width .4s ease; }
.gauge-participants { text-align: center; font-size: 12.5px; color: var(--ink-muted); }

.inbox-add-row { display: flex; gap: 8px; margin-bottom: 20px; }
.inbox-add-row input { flex: 1; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 13px; color: var(--ink); padding: 12px 14px; outline: none; }
.inbox-add-row input:focus { border-color: var(--accent); }

.inbox-card { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 10px; }
.inbox-card-icon { font-size: 20px; flex-shrink: 0; }
.inbox-card-body { flex: 1; min-width: 0; }
.inbox-card-title { font-family: var(--font-serif); font-size: 14px; }
.inbox-card-len { font-size: 11.5px; color: var(--ink-muted); }
.inbox-empty { text-align: center; color: var(--ink-muted); font-size: 13px; padding: 40px 20px; border: 1px dashed var(--line); border-radius: 6px; line-height: 1.8; }
.inbox-card-remove { font-size: 11px; color: var(--ink-muted); text-decoration: underline; cursor: pointer; flex-shrink: 0; }
.inbox-card-remove:hover { color: var(--accent); }
.inbox-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.inbox-page-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 12.5px; cursor: pointer; }
.inbox-page-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 20px; font-size: 12.5px; z-index: 999; opacity: 0; transition: opacity .3s ease; }
.toast.show { opacity: 1; }

.bottom-nav { display: none; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  body { padding-bottom: 78px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: rgba(247,243,236,0.94); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--ink-muted); font-weight: 600; text-decoration: none; padding: 4px 0; cursor: pointer; }
  .bottom-nav a .bicon { font-size: 19px; line-height: 1; display: flex; align-items: center; justify-content: center; }
  .bottom-nav a .bicon svg { width: 20px; height: 20px; }
  .bottom-nav a.active { color: var(--accent); }
}

.inbox-fab {
  position: fixed; right: 22px; bottom: 26px; z-index: 55;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.55); color: var(--ink); text-decoration: none;
  border: 1px solid rgba(255,255,255,0.6);
  backdrop-filter: blur(14px) saturate(1.5); -webkit-backdrop-filter: blur(14px) saturate(1.5);
  padding: 12px 20px; border-radius: 999px; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 20px rgba(23,20,15,0.16); cursor: pointer; transition: background .15s, transform .15s;
}
.inbox-fab svg { width: 16px; height: 16px; flex-shrink: 0; }
.inbox-fab:hover { background: rgba(255,255,255,0.75); transform: translateY(-2px); }
@media (max-width: 760px) {
  .inbox-fab { bottom: 92px; right: 16px; padding: 10px 16px; font-size: 12px; }
}

.mylogs-howto { background: var(--accent-soft); border-radius: 8px; padding: 16px 18px; margin-top: 24px; text-align: left; }
.mylogs-howto-title { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.mylogs-howto-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.mylogs-howto p { font-size: 11.5px; color: var(--ink-muted); line-height: 1.6; margin: 0; }

.inline-link { color: inherit; font-size: inherit; font-weight: inherit; text-decoration: underline; cursor: pointer; }

.notify-status {
  font-size: 12px; color: var(--ink-muted); background: var(--accent-soft); border-radius: 6px;
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.notify-status .ghost-btn { padding: 7px 14px; font-size: 12px; flex-shrink: 0; }
@media (max-width: 600px) {
  .notify-status { flex-direction: column; align-items: flex-start; }
  .notify-status .ghost-btn { width: 100%; }
}
