:root {
  --paper: #fdf7e9;
  --paper-deep: #f3e8d0;
  --ink: #33281f;
  --ink-soft: #6f6053;
  --line: #e4d6ba;
  --coin: #f0bd4a;
  --coin-deep: #a87416;
  --danger: #ad4136;
  --glass: rgb(24 28 44 / 0.5);
  --glass-line: rgb(255 255 255 / 0.14);
  --on-glass: #fbf6ea;
  --shadow: 0 18px 50px rgb(20 16 12 / 0.35);
  --ui: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --note: 'Gowun Batang', 'AppleMyungjo', 'Batang', serif;
  --safe-b: max(14px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #1a2238;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; }

svg .i { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg .dot { fill: currentColor; }

#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#world:active { cursor: grabbing; }

/* ---- 입장 ---- */

.entry {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--on-glass);
  background: radial-gradient(ellipse at center, rgb(14 16 32 / 0.5) 0%, rgb(14 16 32 / 0.2) 62%, rgb(14 16 32 / 0.05) 100%);
  transition: opacity 0.9s ease;
}
.entry.leaving { opacity: 0; pointer-events: none; }
.entry-inner { max-width: 440px; text-shadow: 0 2px 22px rgb(10 10 25 / 0.75); }
.entry-eyebrow { margin: 0 0 8px; font-size: 15px; letter-spacing: 0.08em; color: #ffe2a0; }
.entry-title {
  margin: 0;
  font-family: var(--note);
  font-weight: 700;
  font-size: clamp(44px, 10vw, 68px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.entry-lede { margin: 14px 0 26px; font-size: 18px; line-height: 1.6; }
.entry-stat { min-height: 24px; margin: 18px 0 2px; font-size: 15px; color: #ffe2a0; }
.entry-note { margin: 0; font-size: 14px; opacity: 0.86; }
.legal-links { margin: 12px 0 0; font-size: 13px; color: var(--ink-soft); }
.legal-links a, .care-note a, .help-list a, .login-agree a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.entry-legal { color: inherit; opacity: 0.82; }
.care-note { margin-top: -8px; }
.login-agree { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 2px; font-size: 14px; cursor: pointer; }
.login-agree input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); }
body:not(.before-entry) .site-notice { top: 62px; }
.site-notice {
  pointer-events: none;
  position: fixed;
  z-index: 40;
  top: 10px;
  left: 50%;
  width: min(560px, calc(100vw - 32px));
  margin: 0;
  padding: 9px 16px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
  box-shadow: 0 6px 22px rgb(0 0 0 / 0.3);
}

/* ---- 공통 버튼 ---- */

.pill {
  min-height: 50px;
  padding: 11px 30px;
  font-size: 17px;
  border: 0;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.15s ease;
}
.pill:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.pill:active:not(:disabled) { transform: translateY(1px); }
.pill:disabled { opacity: 0.7; }
.pill-light { background: var(--paper); color: var(--ink); box-shadow: 0 8px 30px rgb(0 0 0 / 0.35); }
.pill-coin {
  color: #4a3106;
  background: linear-gradient(180deg, #ffd978 0%, var(--coin) 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55), inset 0 -2px 0 rgb(168 116 22 / 0.5), 0 8px 24px rgb(20 16 12 / 0.3);
}
.pill-coin.done { color: var(--on-glass); background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); backdrop-filter: blur(10px); }
.pill-ink { background: var(--ink); color: var(--paper); }
.pill-plain { background: var(--paper-deep); color: var(--ink); }
.pill-small { min-height: 40px; padding: 6px 16px; font-size: 15px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--on-glass);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  transition: background 0.15s ease;
}
.icon-btn:hover { background: rgb(24 28 44 / 0.68); }
.icon-btn svg { width: 23px; height: 23px; }
.icon-big { width: 50px; height: 50px; }
.icon-big[aria-expanded='true'] { background: var(--paper); color: var(--ink); }
.icon-plain { width: 40px; height: 40px; font-size: 22px; color: var(--ink); background: var(--paper-deep); border: 0; backdrop-filter: none; }
.icon-plain:hover { background: var(--line); }
.icon-plain:disabled { opacity: 0.35; }

/* ---- HUD ---- */

.hud { position: fixed; left: 14px; right: 14px; pointer-events: none; transition: opacity 0.8s ease 0.6s; }
.hud button, .hud input, .hud .presence { pointer-events: auto; }
.before-entry .hud, .before-entry .bank-tag { opacity: 0; visibility: hidden; }

.hud-top {
  z-index: 5;
  top: max(14px, env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 10px;
}
.presence {
  justify-self: start;
  display: flex;
  flex-direction: column;
  padding: 7px 15px 8px;
  color: var(--on-glass);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  font-size: 13.5px;
  line-height: 1.35;
}
.brand { font-family: var(--note); font-size: 16px; }
.ritual {
  padding: 7px 15px;
  font-size: 14px;
  color: #ffe9b4;
  white-space: nowrap;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  font-variant-numeric: tabular-nums;
}
.ritual.now { color: #4a3106; background: var(--coin); border-color: transparent; }
.ritual { grid-column: 2; grid-row: 1; }
.tools { grid-column: -2; grid-row: 1; justify-self: end; display: flex; gap: 8px; align-items: flex-start; }

.sound-wrap { position: relative; }
#sound-toggle .wave-off { display: none; }
#sound-toggle.silent .wave-on { display: none; }
#sound-toggle.silent .wave-off { display: initial; }
#sound-toggle[aria-expanded='true'] { color: var(--ink); background: var(--paper); }

.sound-panel {
  position: absolute;
  top: 52px;
  right: -52px;
  z-index: 6;
  width: min(290px, calc(100vw - 28px));
  padding: 14px 16px 8px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: pop 0.18s ease-out;
}
.sound-rows { transition: opacity 0.2s; }
.sound-panel.muted .sound-rows { opacity: 0.4; }
.sound-row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; margin-bottom: 8px; font-size: 14.5px; }
.sound-row:first-child { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); font-weight: 700; }
.sound-row output { font-size: 13px; font-weight: 400; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.sound-row input {
  grid-column: 1 / -1;
  width: 100%;
  height: 30px;
  margin: 0;
  accent-color: var(--coin-deep);
  cursor: pointer;
}
.sound-foot { display: flex; justify-content: space-between; gap: 6px; }
.sound-action {
  min-height: 38px;
  padding: 5px 8px;
  font-size: 14px;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 8px;
}
.sound-action:hover { color: var(--ink); background: var(--paper-deep); }

.hud-bottom { bottom: var(--safe-b); display: flex; flex-direction: column; gap: 8px; }
.bottom-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.zoom {
  flex: none;
  display: flex;
  flex-direction: column;
  width: 50px;
  overflow: hidden;
  color: var(--on-glass);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 25px;
  backdrop-filter: blur(10px);
}
.zoom button {
  display: grid;
  place-items: center;
  height: 48px;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
}
.zoom button + button { border-top: 1px solid var(--glass-line); }
.zoom button:hover:not(:disabled) { background: rgb(255 255 255 / 0.14); }
.zoom button:disabled { opacity: 0.35; }
.zoom button:focus-visible { outline-offset: -3px; }
.zoom svg { width: 22px; height: 22px; }
.center-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.today-line { margin: 0 0 3px; font-size: 14.5px; color: var(--on-glass); text-shadow: 0 1px 8px rgb(10 10 25 / 0.8); text-align: center; }
.today-line b { color: #ffe08f; font-weight: 400; }
.links { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.link-btn {
  min-height: 34px;
  padding: 4px 10px;
  font-size: 14px;
  color: var(--on-glass);
  background: none;
  border: 0;
  border-radius: 8px;
  text-shadow: 0 1px 8px rgb(10 10 25 / 0.9);
  white-space: nowrap;
}
.link-btn:hover { background: rgb(24 28 44 / 0.4); }

.gestures {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  backdrop-filter: blur(12px);
}
.gesture {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding: 6px 4px 5px;
  font-size: 12.5px;
  color: var(--on-glass);
  background: none;
  border: 0;
  border-radius: 12px;
}
.gesture:hover, .gesture[aria-expanded='true'] { background: rgb(255 255 255 / 0.13); }
.g-ico { display: grid; place-items: center; height: 26px; }
.g-ico svg { width: 24px; height: 24px; }

.dress {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(330px, 100%);
  padding: 10px 11px 11px;
  color: var(--on-glass);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  backdrop-filter: blur(12px);
}
.dress-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; font-size: 14.5px; }
.dress-done {
  min-height: 32px;
  padding: 2px 12px;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 9px;
}
.dress-tabs { display: flex; gap: 3px; }
.dress-tab {
  flex: 1;
  min-height: 34px;
  padding: 3px 4px;
  font-size: 14px;
  color: var(--on-glass);
  background: none;
  border: 0;
  border-bottom: 2px solid rgb(255 255 255 / 0.18);
}
.dress-tab[aria-selected='true'] { border-bottom-color: var(--coin); color: #ffe6a8; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 31px;
  height: 31px;
  padding: 0;
  background: var(--c, #fff);
  border: 2px solid rgb(255 255 255 / 0.3);
  border-radius: 50%;
}
.swatch[aria-pressed='true'] { border-color: #fff; box-shadow: 0 0 0 2px var(--coin); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  min-height: 36px;
  padding: 4px 11px;
  font-size: 14px;
  color: var(--on-glass);
  background: rgb(255 255 255 / 0.1);
  border: 0;
  border-radius: 10px;
}
.chip[aria-pressed='true'] { color: var(--ink); background: var(--paper); }
.swatch.locked, .chip.locked { opacity: 0.38; cursor: not-allowed; }

.right-col { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.home-btn { width: 50px; height: 46px; border-radius: 16px; }

.mine-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.mine-actions .pill { flex: 1 1 150px; min-height: 44px; padding: 8px 12px; font-size: 15px; }

.confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.confirm-actions .pill { flex: 1 1 130px; }
.pill-danger { color: #fff; background: var(--danger); }

.bank-tag {
  position: fixed;
  top: 0;
  left: 0;
  padding: 3px 12px 4px;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 999px;
  box-shadow: 0 3px 12px rgb(20 16 12 / 0.3);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  will-change: transform;
}
.bank-tag.show { opacity: 1; }

.hint {
  position: fixed;
  left: 50%;
  top: 80px;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 8px 16px;
  transform: translateX(-50%);
  font-size: 14.5px;
  text-align: center;
  color: var(--on-glass);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: opacity 0.6s;
}
.hint.gone { opacity: 0; }

.walking-elsewhere {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 80px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 8px 10px 8px 16px;
  transform: translateX(-50%);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  max-width: calc(100vw - 32px);
  width: max-content;
  padding: 9px 18px;
  transform: translate(-50%, -8px);
  font-size: 15px;
  text-align: center;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- 행복 쪽지 ---- */

.slip {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 124px);
  width: min(430px, calc(100vw - 28px));
  max-height: calc(100dvh - 240px);
  overflow-y: auto;
  padding: 18px 20px 8px;
  transform: translateX(-50%);
  background:
    linear-gradient(transparent 0, transparent 100%),
    var(--paper);
  border-radius: 6px 6px 18px 18px;
  box-shadow: var(--shadow);
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.slip::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--coin) 0 12px, transparent 12px 20px);
  opacity: 0.8;
}
@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 16px) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.slip-close {
  position: absolute;
  top: 9px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 50%;
}
.slip-close svg { width: 20px; height: 20px; }
.slip-close:hover { background: var(--paper-deep); }

.slip-owner { margin: 0 34px 0 0; font-size: 15px; font-weight: 700; }
.slip-count { margin-left: 8px; font-weight: 400; font-size: 14px; color: var(--ink-soft); }
.slip-date { margin: 0 0 9px; font-size: 14px; color: var(--ink-soft); }
.slip-text {
  margin: 0 0 15px;
  font-family: var(--note);
  font-size: 20px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.slip-action { width: 100%; min-height: 46px; margin: 0 0 12px; font-size: 16px; }

.emotions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.emotion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 76px;
  padding: 6px 1px 4px;
  background: none;
  border: 0;
  border-radius: 12px;
  transition: background 0.15s ease;
}
.emotion canvas { width: 36px; height: 36px; transition: transform 0.2s cubic-bezier(0.3, 1.8, 0.5, 1); }
.emotion:hover:not(:disabled) { background: var(--paper-deep); }
.emotion:hover:not(:disabled) canvas { transform: translateY(-3px) rotate(-6deg); }
.emotion[aria-pressed='true'] { background: #fdeabb; box-shadow: inset 0 0 0 1.5px var(--coin); }
.emotion[aria-pressed='true'] canvas { transform: scale(1.1); }
.emotion .l { font-size: 12.5px; line-height: 1.25; }
.emotion .n { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.slip-foot { display: flex; gap: 2px; margin-top: 4px; }
.text-btn {
  min-height: 38px;
  padding: 5px 8px;
  font-size: 14px;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 8px;
}
.text-btn:hover:not(:disabled) { color: var(--ink); background: var(--paper-deep); }
.text-btn:disabled { opacity: 0.35; }
.slip-report { margin-left: auto; }

/* ---- 대화상자 ---- */

dialog.sheet {
  width: min(480px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 26px 24px 22px;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
dialog.sheet[open] { animation: pop 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
dialog.sheet::backdrop { background: rgb(14 14 26 / 0.46); backdrop-filter: blur(2px); }
dialog.sheet h2 { margin: 2px 0 14px; font-family: var(--note); font-size: 25px; line-height: 1.35; }
dialog.tall { height: min(760px, calc(100dvh - 28px)); }

.eyebrow { margin: 0; font-size: 14px; color: var(--coin-deep); }
.note { margin: 8px 0 16px; font-size: 14px; color: var(--ink-soft); }

.paper {
  position: relative;
  background:
    repeating-linear-gradient(transparent 0 33px, var(--line) 33px 34px) 0 10px,
    #fffdf6;
  border: 1px solid var(--line);
  border-radius: 12px;
}
textarea {
  display: block;
  width: 100%;
  padding: 10px 14px 30px;
  font-family: var(--note);
  font-size: 19px;
  line-height: 34px;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 12px;
  resize: none;
}
.counter { position: absolute; right: 12px; bottom: 7px; font-size: 13.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.field-error { margin: 6px 0 0; color: var(--danger); font-size: 14px; }
.field-error:empty { display: none; }

.switch-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; padding: 4px; background: var(--paper-deep); border-radius: 12px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: block; padding: 8px; font-size: 15px; text-align: center; border-radius: 9px; color: var(--ink-soft); }
.choice input:checked + span { color: var(--ink); background: var(--paper); box-shadow: 0 1px 4px rgb(60 40 20 / 0.2); }
.choice input:focus-visible + span { outline: 3px solid var(--coin-deep); }

.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-actions .pill { flex: 1 1 170px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; }
.stats div { padding: 10px 14px; background: var(--paper-deep); border-radius: 13px; }
.stats dt { font-size: 14px; color: var(--ink-soft); }
.stats dd { margin: 0; font-family: var(--note); font-size: 28px; font-weight: 700; line-height: 1.25; }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 18px; }
.cal-dow { font-size: 13px; text-align: center; color: var(--ink-soft); }
.cal-day {
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(100%, 36px);
  height: 36px;
  padding: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
}
.cal-day.has {
  font-weight: 700;
  color: #5e3f07;
  background: radial-gradient(circle at 35% 30%, #ffe29a, var(--coin));
  box-shadow: inset 0 0 0 2px #cf9a2c;
}
.cal-day.today:not(.has) { box-shadow: inset 0 0 0 2px var(--line); }
button.cal-day:hover { filter: brightness(1.06); }

.my-notes, .feed { margin: 0 0 18px; padding: 0; list-style: none; }
.my-notes li { padding: 11px 0; border-top: 1px solid var(--line); }
.my-notes li.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: #fde9b8; } to { background: transparent; } }
.my-notes .empty, .feed .empty { color: var(--ink-soft); border: 0; text-align: center; padding: 8px 0; }
.note-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.badge { margin-left: 6px; padding: 1px 7px; font-size: 12.5px; background: var(--paper-deep); border-radius: 6px; }
.note-body { margin: 2px 0 6px; font-family: var(--note); font-size: 18px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-reactions { display: flex; flex-wrap: wrap; gap: 9px; font-size: 14px; color: var(--ink-soft); }
.note-reactions span { display: inline-flex; align-items: center; gap: 3px; }
.note-reactions canvas { width: 19px; height: 19px; }
.note-hidden { margin: 0 0 4px; font-size: 14px; color: var(--danger); }

.feed li { padding: 14px 0 8px; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed-owner { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink-soft); }
.feed-dot { width: 13px; height: 13px; background: var(--c, #fff); border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(60 40 20 / 0.15); }
.feed-walk { margin-left: auto; }
.feed-more { display: block; width: 100%; }
.feed .emotions { margin-top: 2px; }
.feed .emotion { min-height: 70px; }

.rank-heading { margin: 22px 0 10px; font-family: var(--note); font-size: 18px; }
.rank-tabs { grid-template-columns: repeat(3, 1fr); margin-top: 0; }
.rank-tabs .choice span { padding-inline: 2px; }
.rank-heading:first-child { margin-top: 16px; }
.rank-badge { margin: 0 0 3px; font-size: 14px; font-weight: 700; color: var(--coin-deep); }

.givers { margin: 10px 0 8px; padding: 0; list-style: none; }
.givers li { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 2px 4px 2px 8px; border-top: 1px solid var(--line); }
.givers li:first-child { border-top: 0; }
.givers li.me { background: #fdeabb; border-radius: 10px; }
.givers .empty { justify-content: center; color: var(--ink-soft); }
.giver-rank { width: 22px; flex: none; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.giver-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.giver-count { flex: none; font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
#rank-mine { margin: 0 0 4px; }

.reward-summary { margin: 0 0 8px; font-size: 15px; }
.reward-bar { height: 10px; margin-bottom: 10px; overflow: hidden; background: var(--paper-deep); border-radius: 999px; }
.reward-bar span { display: block; height: 100%; background: linear-gradient(90deg, #ffd978, var(--coin)); border-radius: 999px; transition: width 0.4s ease; }
.rewards { margin: 0 0 6px; padding: 0; list-style: none; }
.rewards li { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--ink-soft); border-top: 1px solid var(--line); }
.rewards li.open { color: var(--ink); }
.reward-at { width: 44px; flex: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.reward-state { margin-left: auto; font-size: 13.5px; }
.rewards li.open .reward-state { color: var(--coin-deep); font-weight: 700; }

.account-box { padding-top: 12px; border-top: 1px solid var(--line); }
.account-box summary { min-height: 32px; font-weight: 700; cursor: pointer; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.account-delete { color: var(--danger); }

.profile-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 15px 0 11px;
  font-size: 14px;
  color: var(--on-glass);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  transition: background 0.15s ease;
}
.profile-btn:hover { background: rgb(24 28 44 / 0.68); }
.profile-btn svg { flex: none; width: 22px; height: 22px; }
.profile-btn span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-btn.signed-in svg { color: var(--c, var(--on-glass)); }

.login-skip { width: 100%; }
.login-options { display: grid; gap: 10px; margin-bottom: 14px; }
.login-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 18px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.login-option svg { flex: none; width: 20px; height: 20px; }
.login-option:hover { filter: brightness(0.97); }
.login-kakao { color: rgb(0 0 0 / 0.85); background: #fee500; border-color: #fee500; }
.login-google { color: #1f1f1f; background: #fff; border-color: #747775; }

.help-list { margin: 0 0 8px; padding: 0; list-style: none; }
.help-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.help-list li:first-child { border-top: 0; }
.help-list b { display: block; font-family: var(--note); }

.fatal {
  position: fixed;
  inset: auto 16px 50% 16px;
  max-width: 420px;
  margin: 0 auto;
  padding: 16px 20px;
  text-align: center;
  background: var(--paper);
  border-radius: 16px;
}

@media (max-width: 640px) {
  .presence { font-size: 12.5px; padding: 6px 12px 7px; }
  .brand { font-size: 15px; }
  .hud-top { grid-template-columns: 1fr auto; }
  .profile-btn.signed-in { width: 44px; padding: 0; justify-content: center; }
  .profile-btn.signed-in span { display: none; }
  .ritual { grid-row: 2; grid-column: 1 / -1; justify-self: center; font-size: 13px; }
  .pill-coin { padding-inline: 24px; }
  .slip { bottom: calc(var(--safe-b) + 162px); padding: 16px 16px 6px; max-height: calc(100dvh - 250px); }
  /* 쪽지가 열리면 공간이 좁으니 오늘의 개수 문구는 잠시 숨긴다. */
  body:has(#card:not([hidden])) .today-line { display: none; }
  .slip-text { font-size: 18px; }
  .emotion canvas { width: 32px; height: 32px; }
  .link-btn { padding: 4px 7px; font-size: 13.5px; }
  .bottom-row { align-items: flex-end; }
  .pill-coin { padding-inline: 14px; font-size: 16px; }
  .center-actions .pill-coin { max-width: 100%; }
  .center-actions { flex: 1; }
  .gesture { min-width: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
