/* Our Little Universe — design system */
:root {
  --ivory: #fbf6ee;
  --paper: #fffdf9;
  --beige: #f1e6d6;
  --sand: #e6d6bf;
  --rose: #b87480;
  --rose-deep: #9c5a67;
  --blush: #ebcfcc;
  --blush-soft: #f6e7e4;
  --gold: #c19a52;
  --gold-soft: #ead9b4;
  --ink: #3a2e2d;
  --ink-soft: #7b6a66;
  --line: #e9dccb;
  --ok: #6f8f72;
  --warn: #b98a3e;
  --bad: #b5645d;
  --shadow-sm: 0 1px 2px rgba(80, 50, 40, .06), 0 2px 8px rgba(80, 50, 40, .05);
  --shadow: 0 6px 24px rgba(80, 50, 40, .10);
  --radius: 18px;
  --radius-sm: 12px;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] {
  --ivory: #1f1918; --paper: #2a2221; --beige: #342a28; --sand: #483a36; --rose: #d6959f; --rose-deep: #e3a9b2;
  --blush: #4a3335; --blush-soft: #3a2b2c; --gold: #d8b673; --gold-soft: #4b4023; --ink: #f3e9e2; --ink-soft: #b9a8a1; --line: #433633;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 8px 28px rgba(0,0,0,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ivory: #1f1918; --paper: #2a2221; --beige: #342a28; --sand: #483a36; --rose: #d6959f; --rose-deep: #e3a9b2;
    --blush: #4a3335; --blush-soft: #3a2b2c; --gold: #d8b673; --gold-soft: #4b4023; --ink: #f3e9e2; --ink-soft: #b9a8a1; --line: #433633;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 8px 28px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6;
  background-image: radial-gradient(circle at 12% -10%, var(--blush-soft), transparent 40%), radial-gradient(circle at 100% 0%, var(--gold-soft), transparent 30%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; color: var(--ink); letter-spacing: .005em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--rose-deep); text-decoration-color: color-mix(in srgb, var(--rose) 40%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--rose); }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.section { margin: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.eyebrow { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.script { font-family: var(--serif); font-style: italic; }

/* Navigation */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--ivory) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.brand { font-family: var(--serif); font-size: 1.55rem; font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand i { color: var(--rose); font-size: 1.1rem; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a { padding: 8px 12px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-size: .93rem; font-weight: 500; }
.nav-links a:hover { background: var(--blush-soft); color: var(--ink); }
.nav-links a.active { background: var(--blush); color: var(--rose-deep); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 12px; width: 44px; height: 44px; color: var(--ink); font-size: 1.1rem; cursor: pointer; }
@media (max-width: 920px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
}

/* Buttons & forms */
.btn { --b: var(--rose); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--b); background: var(--b); color: #fff; padding: 10px 20px; border-radius: 999px; font: 500 .95rem var(--sans); cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; min-height: 42px; }
.btn:hover { background: var(--rose-deep); border-color: var(--rose-deep); color: #fff; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--rose-deep); }
.btn.ghost:hover { background: var(--blush-soft); color: var(--rose-deep); }
.btn.gold { --b: var(--gold); }
.btn.gold:hover { background: #a9843f; border-color: #a9843f; }
.btn.danger { --b: var(--bad); }
.btn.danger.ghost { color: var(--bad); }
.btn.sm { padding: 6px 14px; font-size: .85rem; min-height: 34px; }
.btn.block { width: 100%; }
label { display: block; font-size: .85rem; font-weight: 500; color: var(--ink-soft); margin-bottom: 6px; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font: inherit; min-height: 44px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.field { margin-bottom: 16px; }
.row { display: grid; gap: 16px; }
.row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.row.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .row.cols-2, .row.cols-3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--rose); }

/* Cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* Hero */
.hero { padding: 56px 0 24px; text-align: center; }
.hero h1 { margin-bottom: 8px; }
.hero .sub { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--rose-deep); margin-bottom: 8px; }
.hero .date { color: var(--ink-soft); font-size: .92rem; letter-spacing: .04em; }
.avatars { display: flex; justify-content: center; align-items: center; gap: 0; margin-bottom: 20px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 600 1.6rem var(--serif); color: #fff; border: 3px solid var(--ivory); box-shadow: var(--shadow-sm); }
.avatar.a { background: linear-gradient(135deg, var(--rose), var(--rose-deep)); }
.avatar.b { background: linear-gradient(135deg, var(--gold), #a9843f); margin-left: -14px; }
.avatars .heart { margin: 0 -4px; z-index: 2; color: var(--rose); font-size: 1.1rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; text-align: center; box-shadow: var(--shadow-sm); }
.stat .n { font: 600 2.4rem/1 var(--serif); color: var(--rose-deep); }
.stat .l { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-top: 8px; }

/* Memory cards */
.memory-card { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: inherit; width: 100%; }
.memory-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.memory-card.milestone { border-color: var(--gold); background: linear-gradient(180deg, var(--paper), var(--gold-soft)); }
.memory-card .cover { margin: -20px -20px 4px; height: 170px; border-radius: var(--radius) var(--radius) 0 0; background-size: cover; background-position: center; }
.mc-date { font-family: var(--serif); color: var(--rose-deep); font-size: 1.05rem; font-weight: 600; letter-spacing: .02em; }
.mc-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.2; margin: 0; }
.mc-desc { color: var(--ink-soft); font-size: .95rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--blush-soft); color: var(--rose-deep); font-size: .78rem; font-weight: 500; border: 1px solid transparent; text-decoration: none; }
a.chip:hover, button.chip:hover { border-color: var(--rose); }
button.chip { cursor: pointer; font-family: inherit; }
.chip.gold { background: var(--gold-soft); color: #7a5d22; }
.chip.ok { background: #e2eee3; color: #3f6a43; }
.chip.warn { background: #f5e9cf; color: #805c14; }
.chip.bad { background: #f3dcd9; color: #8a3b34; }
.chip.active { background: var(--rose); color: #fff; }
:root[data-theme="dark"] .chip.ok { background: #2c3d2e; color: #a9d2ac; }
.big-date { display: grid; place-items: center; text-align: center; min-width: 78px; padding: 10px 6px; border-radius: 14px; background: var(--blush-soft); color: var(--rose-deep); font-family: var(--serif); line-height: 1; }
.big-date b { font-size: 2.1rem; display: block; }
.big-date span { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }

/* Memory of the day */
.motd { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; background: linear-gradient(135deg, var(--blush-soft), var(--paper) 60%); }
.motd .ribbon { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
@media (max-width: 560px) { .motd { grid-template-columns: 1fr; } }

/* Ask band */
.ask { background: linear-gradient(135deg, var(--rose), var(--rose-deep)); color: #fff; border-radius: 28px; padding: 40px; text-align: center; box-shadow: var(--shadow); }
.ask h2 { color: #fff; }
.ask p { color: #fbe9e9; }
.ask form { display: flex; gap: 10px; max-width: 620px; margin: 18px auto 0; flex-wrap: wrap; }
.ask input { flex: 1 1 260px; border: none; border-radius: 999px; padding: 14px 20px; }
.ask .btn { background: var(--gold); border-color: var(--gold); }
.ask .chips { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ask .chip { background: rgba(255,255,255,.18); color: #fff; }
.ask .chip:hover { border-color: #fff; }

/* Horizontal journey */
.hscroll { display: flex; gap: 18px; overflow-x: auto; padding: 8px 4px 20px; scroll-snap-type: x proximity; }
.hscroll > * { flex: 0 0 min(300px, 80vw); scroll-snap-align: start; }
.journey-line { position: relative; }
.journey-line::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; height: 2px; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, transparent 8px 16px); }
.j-item { position: relative; padding-top: 40px; }
.j-item::before { content: ""; position: absolute; top: 10px; left: 20px; width: 18px; height: 18px; border-radius: 50%; background: var(--rose); border: 4px solid var(--ivory); box-shadow: 0 0 0 2px var(--rose); }

/* Year strip */
.years { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.year-card { flex: 0 0 200px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); }
.year-card:hover { border-color: var(--rose); }
.year-card .y { font: 600 2.2rem/1 var(--serif); color: var(--rose-deep); }
.year-card ul { margin: 8px 0 0; padding-left: 16px; color: var(--ink-soft); font-size: .85rem; }

/* Special dates */
.sd { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.sd:last-child { border: none; }
.sd .when { margin-left: auto; text-align: right; font-size: .85rem; color: var(--ink-soft); }

/* Category tiles */
.tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--rose); background: var(--blush-soft); }
.tile i { color: var(--rose); width: 20px; text-align: center; }
.tile .count { margin-left: auto; color: var(--ink-soft); font-size: .85rem; }

/* Empty state */
.empty { text-align: center; padding: 48px 24px; border: 2px dashed var(--sand); border-radius: var(--radius); background: color-mix(in srgb, var(--paper) 60%, transparent); color: var(--ink-soft); }
.empty i { font-size: 2rem; color: var(--rose); margin-bottom: 12px; display: block; }
.empty h3 { color: var(--ink); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 24px; }
.filters > * { flex: 1 1 160px; }
.filters .grow { flex: 2 1 240px; }
.year-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

/* Timeline */
.timeline { position: relative; margin: 20px 0; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--blush), var(--gold-soft)); transform: translateX(-50%); }
.tl-year { position: relative; text-align: center; margin: 44px 0 20px; z-index: 1; }
.tl-year span { display: inline-block; background: var(--rose); color: #fff; font: 600 1.8rem var(--serif); padding: 4px 26px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.tl-month { position: relative; text-align: center; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 14px 0; z-index: 1; }
.tl-month span { background: var(--ivory); padding: 0 12px; }
.tl-item { position: relative; width: 50%; padding: 0 36px 22px 0; }
.tl-item:nth-child(even of .tl-item) { margin-left: 50%; padding: 0 0 22px 36px; }
.tl-item::after { content: ""; position: absolute; top: 28px; right: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 3px solid var(--rose); }
.tl-item:nth-child(even of .tl-item)::after { right: auto; left: -7px; }
.tl-item.milestone::after { background: var(--gold); border-color: var(--gold); width: 20px; height: 20px; right: -10px; top: 24px; }
.tl-item.milestone:nth-child(even of .tl-item)::after { left: -10px; right: auto; }
@media (max-width: 760px) {
  .timeline::before { left: 14px; }
  .tl-year, .tl-month { text-align: left; padding-left: 36px; }
  .tl-item, .tl-item:nth-child(even of .tl-item) { width: 100%; margin-left: 0; padding: 0 0 20px 40px; }
  .tl-item::after, .tl-item:nth-child(even of .tl-item)::after { left: 7px; right: auto; }
  .tl-item.milestone::after, .tl-item.milestone:nth-child(even of .tl-item)::after { left: 4px; right: auto; }
}
.milestone-hero { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.milestone-hero .memory-card { border-color: var(--gold); background: linear-gradient(160deg, var(--paper) 40%, var(--gold-soft)); }
.ml-label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: #8a6a28; font-weight: 700; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(40, 25, 22, .55); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--paper); border-radius: 24px; width: min(760px, 100%); max-height: 92vh; overflow-y: auto; padding: 32px; position: relative; box-shadow: var(--shadow); animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal.wide { width: min(980px, 100%); }
.modal .close { position: absolute; top: 14px; right: 14px; border: none; background: var(--blush-soft); color: var(--rose-deep); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; }
.quote { border-left: 3px solid var(--gold); padding: 6px 0 6px 16px; margin: 12px 0; font-family: var(--serif); font-size: 1.15rem; font-style: italic; }
.quote small { display: block; font-family: var(--sans); font-style: normal; font-size: .78rem; color: var(--ink-soft); }
.label-tag { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin: 18px 0 6px; }
.src-msg { padding: 6px 10px; border-radius: 10px; font-size: .88rem; margin: 3px 0; background: var(--beige); }
.src-msg.support { background: var(--blush); border-left: 3px solid var(--rose); }
.src-msg b { font-weight: 600; }

/* Toast */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: var(--ivory); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow); animation: pop .2s ease; max-width: 340px; }
.toast.err { background: var(--bad); color: #fff; }

/* Chat */
.chat-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 20px; min-height: 68vh; }
@media (max-width: 860px) { .chat-wrap { grid-template-columns: 1fr; } .chat-side { display: none; } .chat-side.open { display: block; } }
.chat-side { padding: 16px; max-height: 76vh; overflow-y: auto; }
.chat-side button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); font: inherit; font-size: .9rem; }
.chat-side button:hover, .chat-side button.active { background: var(--blush-soft); }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.chat-head .dot { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--rose), var(--gold)); display: grid; place-items: center; color: #fff; }
.chat-log { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-height: 360px; max-height: 62vh; }
.bubble { max-width: 86%; padding: 14px 18px; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.user { align-self: flex-end; background: var(--rose); color: #fff; border-bottom-right-radius: 6px; }
.bubble.bot { align-self: flex-start; background: var(--blush-soft); border-bottom-left-radius: 6px; }
.bubble .mref { display: inline-block; font-size: .72rem; background: var(--gold-soft); color: #6d5120; border-radius: 6px; padding: 0 6px; cursor: pointer; border: none; }
.refs { align-self: flex-start; display: grid; gap: 10px; width: min(560px, 100%); }
.ref-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.ref-card .t { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.ref-card .q { font-style: italic; font-family: var(--serif); border-left: 3px solid var(--gold); padding-left: 10px; margin: 8px 0 4px; }
.ref-card .q small { display: block; font-family: var(--sans); font-style: normal; color: var(--ink-soft); font-size: .74rem; }
.chat-form { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.chat-form input { flex: 1; border-radius: 999px; }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--rose); animation: blink 1.2s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 24px 14px; }

/* Gallery */
.masonry { columns: 4 220px; column-gap: 16px; }
.masonry .tile-m { break-inside: avoid; margin-bottom: 16px; border-radius: var(--radius-sm); overflow: hidden; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer; position: relative; display: block; width: 100%; padding: 0; text-align: left; font: inherit; color: inherit; }
.masonry img { width: 100%; display: block; }
.masonry .cap { padding: 10px 12px; font-size: .85rem; color: var(--ink-soft); }
.media-icon { display: grid; place-items: center; aspect-ratio: 4/3; background: var(--beige); color: var(--rose); font-size: 2.2rem; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 66vh; border-radius: 12px; display: block; margin: 0 auto; }
.dropzone { border: 2px dashed var(--sand); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--ink-soft); background: color-mix(in srgb, var(--paper) 70%, transparent); cursor: pointer; }
.dropzone.drag { border-color: var(--rose); background: var(--blush-soft); }

/* Wiki */
.wiki-body { font-size: 1.05rem; }
.wiki-body h3 { margin-top: 1.4em; color: var(--rose-deep); }
.wiki-body ul { padding-left: 20px; }
.wiki-body li { margin-bottom: 10px; }
.wiki-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .wiki-layout { grid-template-columns: 1fr; } }
.infobox { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 84px; }
.infobox h4 { font-size: 1.05rem; margin: 14px 0 6px; }
.editor-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.editor { min-height: 260px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--paper); }

/* Charts */
.chart-card { padding: 20px; }
.chart-card h3 { font-size: 1.2rem; margin-bottom: 4px; }
.chart-box { position: relative; height: 300px; margin-top: 12px; }
.chart-box.tall { height: 380px; }
.cal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .cal-grid { grid-template-columns: repeat(2, 1fr); } }
.cal-m { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; background: var(--paper); }
.cal-m h4 { font-size: 1rem; margin-bottom: 6px; color: var(--rose-deep); }
.cal-m ul { margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.cal-m li { padding: 2px 0; }

/* Admin */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab { padding: 10px 16px; border: none; background: none; color: var(--ink-soft); font: 500 .95rem var(--sans); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--rose-deep); border-bottom-color: var(--rose); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--beige); color: var(--ink-soft); }
.pill.pending_review, .pill.parsed, .pill.review_required, .pill.uploaded { background: #f5e9cf; color: #805c14; }
.pill.approved, .pill.completed, .pill.done { background: #e2eee3; color: #3f6a43; }
.pill.rejected, .pill.failed { background: #f3dcd9; color: #8a3b34; }
.pill.parsing, .pill.ai_processing, .pill.processing { background: #e0e9f3; color: #365a80; }
.pill.duplicate, .pill.low_confidence, .pill.skipped { background: var(--beige); color: var(--ink-soft); }
.progress { height: 10px; background: var(--beige); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--rose), var(--gold)); transition: width .4s; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.tbl th, table.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.tbl th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; }
.review-item { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: 14px; }
.review-item .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.conf { font-weight: 700; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: .9rem; }
.notice { border-radius: var(--radius-sm); padding: 12px 16px; background: var(--gold-soft); color: #6d5120; font-size: .92rem; margin-bottom: 16px; }
.notice.err { background: #f3dcd9; color: #7a2f29; }
.notice.ok { background: #e2eee3; color: #35603a; }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); text-align: center; padding: 40px 32px; }
.auth-card .heart { font-size: 2rem; color: var(--rose); margin-bottom: 8px; }

footer.site { padding: 40px 0 60px; text-align: center; color: var(--ink-soft); font-size: .88rem; }
footer.site .script { font-size: 1.2rem; color: var(--rose-deep); }

.fade-in { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.skeleton { background: linear-gradient(90deg, var(--beige), var(--paper), var(--beige)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); min-height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }
