/* ─────────────────────────────────────────────────────────
   НеСлил · Лютый цинизм — iPhone PWA
   ───────────────────────────────────────────────────────── */
:root {
  --bg:        #0a0608;
  --bg-2:      #0f0a0c;
  --bg-3:      #150a0c;
  --red:       #ff5147;
  --red-dark:  #c01710;
  --text:      #e8d6cf;
  --muted:     #9d8a85;
  --muted-2:   #5a4a47;
  --border:    #2a1f22;
  --mint:      #7af0a3;
  --mint-dim:  rgba(122,240,163,0.12);
  --mint-line: rgba(122,240,163,0.35);
  --safe-top:  env(safe-area-inset-top, 0px);
  --safe-bot:  env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, 'Geist Mono', monospace;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
html, body { width: 100%; height: 100%; height: 100dvh; }

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  padding-top: calc(var(--safe-top) + 12px);
  padding-bottom: var(--safe-bot);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Backdrops */
.scan {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(255,81,71,0.04) 0px, rgba(255,81,71,0.04) 1px, transparent 1px, transparent 3px);
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(255,0,0,0.18) 100%);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .55 } 50% { opacity: 1 } }

/* ─────── topbar ─────── */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 22px 0;
}
.rec {
  font-size: 9px; letter-spacing: 0.3em; color: var(--red); font-weight: 700;
}
.rec #day-status.closed {
  color: var(--mint);
}
.icon-btn {
  appearance: none; background: transparent; cursor: pointer;
  border: 1px solid var(--red); color: var(--red);
  font-family: inherit; font-size: 16px; font-weight: 700;
  width: 28px; height: 28px; border-radius: 4px;
  display: grid; place-items: center; line-height: 1;
  padding: 0;
}
.icon-btn:active { background: var(--red); color: var(--bg); }

.top-actions { display: flex; gap: 6px; }

/* Sync indicator dot inside the topbar button. Color encodes status:
   gray=off, mint=in sync, yellow=pending, red=error. */
.sync-btn { position: relative; }
.sync-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-2);
  transition: background .2s;
}
.sync-dot.synced  { background: var(--mint); box-shadow: 0 0 6px var(--mint); }
.sync-dot.pending { background: #ffd24a; animation: syncPulse 1.2s ease-in-out infinite; }
.sync-dot.error   { background: var(--red); }
@keyframes syncPulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* Sync modal extras */
.sync-blurb {
  font-size: 11px; color: var(--muted); line-height: 1.5;
  margin: 0 0 14px;
}
.sync-status {
  margin: 8px 0 4px;
  font-size: 10px; letter-spacing: 0.14em; color: var(--muted-2);
  text-transform: lowercase;
}
.sync-status.ok    { color: var(--mint); }
.sync-status.err   { color: var(--red); }
.sync-status.warn  { color: #ffd24a; }

/* ─────── hero ─────── */
/* The hero block uses a fixed min-height so rotating quips (1–3 lines) and
   mode-flips between TITLES_OK / TITLES_SLIP don't push the stat strip below
   up and down on every tick. */
.hero {
  position: relative; z-index: 2;
  padding: 18px 22px 22px;
  min-height: 200px;
  display: flex; flex-direction: column;
}
.hero-title {
  margin: 0; font-size: 42px; line-height: 0.95; letter-spacing: -0.04em;
  font-family: 'Instrument Serif', serif; font-style: italic; color: #fff;
  min-height: 80px;   /* always reserves space for 2 lines */
  /* Hard on/off makes the glitch read as intentional. The previous .05s
     transition was producing a brief horizontal smear that looked like a
     layout shift rather than a glitch beat. */
}
.hero-title.glitch { text-shadow: 2px 0 var(--red), -2px 0 #69b8ff; }
.hero-badge {
  position: absolute; top: 14px; right: 22px;
  font-size: 10px; color: var(--red); font-weight: 700;
  border: 1px solid var(--red); padding: 3px 7px; border-radius: 4px;
  animation: blink 1.4s steps(2) infinite;
}
@keyframes blink { 0%,49% { opacity: 1 } 50%,100% { opacity: .2 } }

.quip {
  margin: 18px 0 0;
  font-size: 12px; color: var(--muted); line-height: 1.4;
  /* Fixed (not min-) height: the typewriter animation expands max-width
     from 0 → 100%, which makes the text wrap to more lines mid-animation
     than it does at rest. Locking height + overflow keeps the stat strip
     below from being pushed around on every quip rotation. */
  height: 54px;
  overflow: hidden;
}
.quip.anim { animation: typeIn .6s steps(40); max-width: 100%; }
@keyframes typeIn { from { max-width: 0 } to { max-width: 100% } }

/* ─────── stats ─────── */
.stats {
  position: relative; z-index: 2;
  display: flex; gap: 8px; padding: 0 22px; margin: 8px 0 18px;
}
.stat {
  flex: 1; padding: 12px 10px; background: var(--bg-3);
  border: 1px solid rgba(157,138,133,0.2);
}
.stat[data-tone="red"] { border-color: rgba(255,81,71,0.27); }
.stat .n {
  font-size: 26px; font-weight: 700; letter-spacing: -0.04em; color: var(--muted);
}
.stat[data-tone="red"] .n { color: var(--red); }
.stat .l {
  font-size: 9px; color: var(--muted-2); letter-spacing: 0.15em; margin-top: 3px;
}

/* ─────── section heads (reused by habits + money) ─────── */
.habits-section, .money {
  position: relative; z-index: 2;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 22px 8px;
}
.section-title {
  font-size: 9px; letter-spacing: 0.22em; color: var(--muted); font-weight: 700;
}

/* ─────── habits ─────── */
.habits {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 22px;
}
.habit {
  position: relative;
  padding: 12px 14px; border: 1px solid var(--border); background: var(--bg-2);
  display: flex; align-items: center; gap: 10px;
  overflow: hidden;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.habit.angry {
  border-color: rgba(255,81,71,0.27);
  background: rgba(255,81,71,0.05);
}
.habit.angry.shake-a { animation: shakeA 8s ease-in-out infinite; }
.habit.angry.shake-b { animation: shakeB 8s ease-in-out infinite; }
@keyframes shakeA { 0%,92%,100% { transform: translateX(0) } 94% { transform: translateX(-2px) } 96% { transform: translateX(2px) } 98% { transform: translateX(-1px) } }
@keyframes shakeB { 0%,88%,100% { transform: translateX(0) } 90% { transform: translateX(2px) } 92% { transform: translateX(-2px) } 94% { transform: translateX(1px) } }

.habit.slipping { transform: scale(.97); background: rgba(255,81,71,0.12); border-color: var(--red); }
.habit.deleting { transform: translateX(-110%); opacity: 0; transition: transform .25s ease, opacity .25s ease; }

.habit-emoji { font-size: 18px; }
.habit.angry .habit-emoji { filter: grayscale(.5); }
.habit-body { flex: 1; min-width: 0; }
.habit-name {
  font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: -0.01em;
}
.habit-meta {
  font-size: 10px; color: var(--muted-2); margin-top: 3px; letter-spacing: 0.04em;
}
.habit.angry .habit-meta { color: var(--red); }

.habit-bar {
  width: 64px; height: 14px; background: #1a0d0f;
  border: 1px solid var(--border); position: relative;
}
.habit-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--muted);
  transition: width .35s ease;
}
.habit.angry .habit-bar-fill {
  background: repeating-linear-gradient(45deg, var(--red) 0 4px, var(--red-dark) 4px 8px);
  animation: stripe 2s linear infinite;
}
@keyframes stripe { from { background-position: 0 0 } to { background-position: 16px 0 } }

.habit-count {
  font-size: 11px; font-weight: 700; min-width: 32px; text-align: right;
  color: var(--muted);
}
.habit.angry .habit-count { color: var(--red); }

.habit-actions {
  display: flex; flex-direction: column; gap: 4px; margin-left: 6px;
  min-width: 56px;
}
.habit-sub-actions {
  display: flex; gap: 3px;
}
.habit-btn {
  appearance: none; cursor: pointer;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-family: inherit;
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  padding: 5px 7px; min-width: 38px;
  line-height: 1;
}
.habit-sub-actions .habit-btn {
  flex: 1; min-width: 0; padding: 5px 0;
  font-size: 11px; letter-spacing: 0;
}
.habit-btn.slip { color: var(--red); border-color: rgba(255,81,71,0.5); }
.habit-btn.slip:active { background: var(--red); color: var(--bg); }
.habit-btn.undo:active { background: var(--muted); color: var(--bg); }
.habit-btn.delete { color: var(--muted-2); }
.habit-btn.delete:active {
  background: var(--red); color: var(--bg); border-color: var(--red);
}
.habit-btn:disabled { opacity: .25; cursor: not-allowed; }

.empty {
  padding: 28px 12px; text-align: center;
  color: var(--muted-2); font-size: 11px; letter-spacing: 0.06em;
  border: 1px dashed var(--border);
}
.empty b { color: var(--red); font-weight: 700; }

/* ─────── money slips ─────── */
.money { margin-top: 18px; }

.money-btn { border-color: var(--red); color: var(--red); }
.ghost-btn { border-color: var(--border); color: var(--muted); }
.ghost-btn:active { background: var(--bg-3); color: var(--red); }

.money-summary {
  margin: 0 22px;
  padding: 14px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex; align-items: flex-end; gap: 14px;
}
.money-summary.angry { border-color: rgba(255,81,71,0.4); }
.money-amount {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 44px; line-height: 0.9; letter-spacing: -0.04em;
  color: #fff;
  font-weight: 400;
}
.money-summary.angry .money-amount { color: var(--red); }
.money-side { flex: 1; padding-bottom: 4px; }
.money-label {
  font-size: 9px; letter-spacing: 0.18em; color: var(--muted-2); font-weight: 700;
}
.money-hint {
  margin-top: 6px;
  font-size: 11px; color: var(--muted); line-height: 1.35;
}

.money-cats {
  margin: 10px 22px 0;
  display: flex; flex-direction: column; gap: 4px;
}
.money-cat {
  padding: 8px 12px; background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  font-size: 11px;
}
.money-cat-emoji { font-size: 14px; }
.money-cat-name { flex: 1; color: var(--text); letter-spacing: -0.01em; }
.money-cat-bar {
  flex: 0 0 50px; height: 6px; background: #1a0d0f;
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.money-cat-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg, var(--red) 0 4px, var(--red-dark) 4px 8px);
  animation: stripe 2s linear infinite;
}
.money-cat-amount {
  font-weight: 700; color: var(--red); min-width: 56px; text-align: right;
  font-size: 11px; letter-spacing: -0.01em;
}

.money-recent-head {
  margin: 14px 22px 6px;
  font-size: 9px; letter-spacing: 0.22em; color: var(--muted); font-weight: 700;
}
.money-recent {
  margin: 0 22px; display: flex; flex-direction: column; gap: 4px;
}
.money-row {
  padding: 9px 12px; background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.money-row-emoji { font-size: 14px; }
.money-row-body { flex: 1; min-width: 0; }
.money-row-amount {
  font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -0.02em;
}
.money-row-note {
  font-size: 10px; color: var(--muted-2); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.money-row-time {
  font-size: 9px; color: var(--muted-2); letter-spacing: 0.08em;
}
.money-row .habit-btn { margin-left: 4px; }

/* Money modal extras */
.modal-title .accent {
  color: var(--red); font-style: italic;
}
.amount-field { margin-bottom: 18px; }
.amount-row {
  display: flex; align-items: baseline; gap: 6px;
  border-bottom: 1px solid var(--border);
  padding: 4px 0 6px;
}
.amount-row:focus-within { border-color: var(--red); }
.amount-sign {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 36px; color: var(--muted-2);
}
.amount-row input {
  flex: 1; width: 100%;
  appearance: none; background: transparent; border: 0; outline: none;
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 44px; line-height: 1; letter-spacing: -0.03em;
  color: #fff;
  padding: 0;
}
.amount-row input::placeholder { color: var(--muted-2); }

.cat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.cat-btn {
  appearance: none; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 9px; letter-spacing: 0.04em; line-height: 1.2;
  min-height: 60px;
  text-align: center;
}
.cat-btn .e { font-size: 20px; line-height: 1; }
.cat-btn.sel { border-color: var(--red); background: rgba(255,81,71,0.08); color: var(--red); }
.cat-btn.cat-add { border-style: dashed; color: var(--muted); }
.cat-btn.cat-add:active,
.cat-btn.cat-add.active {
  border-color: var(--red); color: var(--red); background: rgba(255,81,71,0.05);
}

/* ─────── New-category inline form (inside money modal) ─────── */
.new-cat {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--red);
  background: rgba(255,81,71,0.04);
}
.new-cat-label {
  font-size: 9px; letter-spacing: 0.22em; color: var(--red); font-weight: 700;
  margin-bottom: 8px;
}
.new-cat-row {
  display: flex; gap: 6px; align-items: stretch;
}
.new-cat-row input {
  appearance: none; border-radius: 0;
  padding: 10px 10px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none;
  min-width: 0;
}
.new-cat-row input:focus { border-color: var(--red); }
.new-cat-emoji {
  width: 56px; flex: 0 0 56px;
  text-align: center; font-size: 18px !important;
}
.new-cat-name { flex: 1; }
.btn-mini {
  appearance: none; cursor: pointer;
  padding: 0 12px; min-width: 36px;
  border: 1px solid var(--border);
  font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  background: transparent; color: var(--muted);
}
.btn-mini.primary { background: var(--red); color: var(--bg); border-color: var(--red); }
.btn-mini.primary:disabled { opacity: .35; cursor: not-allowed; }
.btn-mini.ghost:active { background: var(--bg-3); color: var(--red); }
.new-cat-hint {
  margin-top: 6px;
  font-size: 9px; letter-spacing: 0.12em; color: var(--muted-2);
}

/* ─────── Custom emoji input (habit modal) ─────── */
.custom-emoji-input {
  width: 100%; margin-top: 8px;
  appearance: none; border-radius: 0;
  padding: 10px 12px;
  border: 1px dashed var(--border); background: var(--bg);
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none;
}
.custom-emoji-input:focus { border-color: var(--red); border-style: solid; }
.custom-emoji-input::placeholder { color: var(--muted-2); font-size: 11px; }

/* ─────── victories ─────── */
.victories { margin-top: 18px; }

.vic-head-actions { display: flex; gap: 6px; }
.vic-btn { border-color: var(--mint-line); color: var(--mint); }
.vic-btn:active { background: var(--mint); color: var(--bg); }

.vic-nudge {
  margin: 0 22px 10px;
  padding: 16px 18px;
  background: var(--mint-dim);
  border: 1px solid var(--mint-line);
  position: relative;
  overflow: hidden;
}
.vic-nudge::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at top right, rgba(122,240,163,0.18), transparent 60%);
}
.vic-nudge-meta {
  font-size: 9px; letter-spacing: 0.22em; color: var(--mint); font-weight: 700;
}
.vic-nudge-title {
  margin-top: 8px;
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 26px; line-height: 1; color: #fff;
  letter-spacing: -0.02em;
}
.vic-nudge-hint {
  margin-top: 8px;
  font-size: 10px; color: var(--muted); letter-spacing: 0.04em;
}
.vic-nudge-btn {
  appearance: none; cursor: pointer;
  margin-top: 14px; padding: 10px 14px;
  background: var(--mint); color: var(--bg); border: 0;
  font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  position: relative;
}
.vic-nudge-btn:active { background: #5cd784; }

.vic-summary {
  margin: 0 22px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex; align-items: flex-end; gap: 14px;
}
.vic-summary-num {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 40px; line-height: 0.9; letter-spacing: -0.04em;
  color: var(--mint);
}
.vic-summary-side { flex: 1; padding-bottom: 4px; }
.vic-summary-label {
  font-size: 9px; letter-spacing: 0.18em; color: var(--muted-2); font-weight: 700;
}
.vic-summary-streak {
  margin-top: 4px; font-size: 11px; color: var(--muted);
}
.vic-summary-streak span { color: var(--mint); font-weight: 700; }

.vic-recent {
  margin: 8px 22px 0; display: flex; flex-direction: column; gap: 4px;
}
.vic-row {
  padding: 10px 12px; background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: border-color .15s, background .15s;
}
.vic-row:hover { border-color: var(--mint-line); background: rgba(122,240,163,0.04); }
.vic-row:hover .vic-row-edit { opacity: 1; }
.vic-row-date {
  font-size: 9px; letter-spacing: 0.14em; color: var(--mint); font-weight: 700;
  min-width: 56px; align-self: flex-start; padding-top: 2px;
}
.vic-row-body { flex: 1; min-width: 0; }
.vic-row-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vic-row-snippet {
  font-size: 10px; color: var(--muted-2); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vic-row-edit {
  flex-shrink: 0;
  font-size: 11px; letter-spacing: 0.1em; color: var(--mint);
  font-weight: 700; opacity: .5; padding: 0 4px;
  transition: opacity .15s;
}

.vic-empty {
  margin: 8px 22px 0;
  padding: 20px 12px; text-align: center;
  color: var(--muted-2); font-size: 11px; letter-spacing: 0.06em;
  border: 1px dashed var(--border);
}

/* Victory modal — notepad feel */
.modal-title .vic-accent { color: var(--mint); }
.btn.primary.vic-save { background: var(--mint); color: var(--bg); }
.btn.primary.vic-save:disabled { opacity: .35; background: var(--mint); }
.btn.ghost.danger { color: var(--red); border-color: rgba(255,81,71,0.4); }
.btn.ghost.danger:active { background: var(--red); color: var(--bg); }

.vic-card textarea {
  width: 100%; appearance: none; border-radius: 0;
  padding: 12px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-family: inherit; font-size: 13px; line-height: 1.5;
  outline: none; resize: vertical;
  min-height: 100px;
}
.vic-card textarea:focus { border-color: var(--mint); }

/* Archive — full-height slide-up */
.modal-full { align-items: stretch; }
.modal-full .archive-card {
  max-height: 100vh;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--mint);
}
.archive-list {
  flex: 1; overflow-y: auto;
  margin: 8px 0 14px;
  display: flex; flex-direction: column; gap: 16px;
  -webkit-overflow-scrolling: touch;
}
.archive-day {
  display: flex; flex-direction: column; gap: 4px;
}
.archive-day-head {
  font-size: 10px; letter-spacing: 0.2em; color: var(--mint); font-weight: 700;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--mint-line);
  margin-bottom: 4px;
}
.archive-empty {
  padding: 32px 12px; text-align: center;
  color: var(--muted-2); font-size: 12px; letter-spacing: 0.06em;
}

/* ─────── roast ─────── */
.roast {
  position: relative; z-index: 2;
  margin: 18px 22px 22px;
  padding: 14px 16px;
  border: 1px dashed var(--red); background: rgba(255,81,71,0.06);
}
.roast-tag { font-size: 9px; color: var(--red); letter-spacing: 0.18em; font-weight: 700; }
.roast-text {
  margin-top: 6px; font-size: 14px;
  font-family: 'Instrument Serif', serif; font-style: italic; color: #fff;
  letter-spacing: -0.01em; line-height: 1.3;
}
.roast-stamp {
  position: absolute; bottom: -1px; right: -1px; padding: 2px 6px;
  background: var(--red); color: var(--bg);
  font-size: 8px; font-weight: 700; letter-spacing: 0.1em;
}

/* ─────── toast ─────── */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bot) + 28px);
  transform: translate(-50%, 80px);
  z-index: 50;
  padding: 10px 14px;
  background: var(--red); color: var(--bg);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  border-radius: 4px;
  max-width: 86vw; text-align: center;
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ─────── modal ─────── */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.75);
  display: none; align-items: flex-end;
  padding: 0;
}
.modal.open { display: flex; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  width: 100%;
  background: var(--bg-2);
  border-top: 1px solid var(--red);
  padding: 20px 22px calc(20px + var(--safe-bot));
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(60px) } to { transform: translateY(0) } }
.modal-meta {
  font-size: 9px; letter-spacing: 0.3em; color: var(--red); font-weight: 700;
}
.modal-title {
  margin: 8px 0 18px; font-size: 30px; line-height: 0.95; letter-spacing: -0.03em;
  font-family: 'Instrument Serif', serif; font-style: italic; color: #fff;
}
.field { display: block; margin-bottom: 14px; }
.field-label {
  font-size: 9px; letter-spacing: 0.18em; color: var(--muted-2); font-weight: 700;
  display: block; margin-bottom: 6px;
}
.field input {
  width: 100%; appearance: none; border-radius: 0;
  padding: 12px 12px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-family: inherit; font-size: 13px;
  outline: none;
}
.field input:focus { border-color: var(--red); }

.emoji-row {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.emoji-row button {
  appearance: none; cursor: pointer;
  padding: 10px 0; font-size: 22px; line-height: 1;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-family: inherit;
}
.emoji-row button.sel { border-color: var(--red); background: rgba(255,81,71,0.08); }

.modal-actions {
  display: flex; gap: 8px; margin-top: 14px;
}
.btn {
  flex: 1; appearance: none; cursor: pointer;
  padding: 14px; border: 0;
  font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
}
.btn.primary { background: var(--red); color: var(--bg); }
.btn.primary:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn.ghost:active { background: var(--bg-3); }
