@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/fonts/nunito-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #2A1E23;
  --body: #4A3A40;
  --muted: #6B5A60;
  --rose: #B0294F;
  --heart: #C2335A;
  --blush: #FBE4EB;
  --cream: #FFF6F4;
  --line: #EADBE0;
  --card: #FFFFFF;
  --pop-fg: #A3264A; --pop-bg: #FCE7EC;
  --todo-fg: #1C635F; --todo-bg: #E1F2F0;
  --obv-fg: #6E4700; --obv-bg: #FBEFD9;
  --due-fg: #7A4300; --due-bg: #FFF1E0;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--blush);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 20px; height: 20px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; }
.retry { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 800; }
#app { height: 100%; }
#app.loading::after { content: ''; display: block; width: 36px; height: 36px; margin: 40vh auto 0; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--rose); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-primary { min-height: 52px; border: none; border-radius: 16px; background: var(--rose); color: #fff; font-size: 17px; font-weight: 800; padding: 0 22px; }
.btn-primary:disabled { opacity: 0.6; }

/* ---------- prijava ---------- */
.login { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 8px; }
.login-heart { width: 56px; height: 56px; fill: var(--heart); }
.login h1 { margin: 0 0 16px; font-size: 40px; font-weight: 800; }
.login-form { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.login-form label { font-weight: 800; font-size: 14px; }
.login-form input { min-height: 54px; border-radius: 16px; border: 1px solid var(--line); background: #fff; padding: 0 18px; font-size: 22px; letter-spacing: 0.3em; text-align: center; }
.login-err { min-height: 22px; margin: 0; color: var(--pop-fg); font-weight: 700; text-align: center; }

/* ---------- Nastjin pogled ---------- */
.nview { max-width: 640px; margin: 0 auto; min-height: 100%; padding: calc(var(--safe-t) + 20px) 0 calc(var(--safe-b) + 28px); }
.nhead { padding: 8px 20px 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.nhead .from { font-size: 13px; font-weight: 800; color: #8C2E4D; letter-spacing: 0.06em; text-transform: uppercase; }
.nhead h1 { margin: 0; font-size: 34px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.nhead h1 svg { width: 28px; height: 28px; fill: var(--heart); }
.nhead .date { text-align: right; font-size: 13px; color: var(--muted); line-height: 1.35; }
.nhead .date b { display: block; color: var(--ink); font-weight: 800; }
.banner { margin: 0 20px 12px; padding: 12px 16px; border-radius: 18px; background: var(--rose); color: #fff; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.banner.calm { background: #fff; color: var(--body); }
.banner svg { width: 20px; height: 20px; }
.notice { margin: 0 20px 12px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1px dashed #D3B3BD; font-size: 14px; line-height: 1.45; color: var(--body); display: flex; flex-direction: column; gap: 10px; }
.notice button { align-self: flex-start; min-height: 44px; border-radius: 999px; border: none; background: var(--ink); color: #fff; font-weight: 800; padding: 0 18px; }
.filters { display: flex; gap: 8px; padding: 0 20px 12px; overflow-x: auto; scrollbar-width: none; }
.filters button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid #E6D3D9; background: #fff; font-size: 14px; font-weight: 800; white-space: nowrap; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.cards { list-style: none; margin: 0; padding: 4px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(80,20,40,0.06), 0 8px 20px rgba(80,20,40,0.06); display: flex; flex-direction: column; gap: 8px; }
.card-top { display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
/* Tipi: popoldne vijolična, todo modra, obvestilo rumena */
.chip.popoldne { color: #5E3596; background: #EDE3FA; }
.chip.todo { color: #1D5799; background: #DFEBFA; }
.chip.obvestilo { color: #6B4E00; background: #FFEFB0; }
.card.t-popoldne { background: #FBF8FF; border: 1px solid #E6DAF7; }
.card.t-todo { background: #F7FAFF; border: 1px solid #D7E5F7; }
.card.t-obvestilo { background: #FFFCF0; border: 1px solid #F3E4A8; }
.new { font-size: 12px; font-weight: 800; color: var(--rose); letter-spacing: 0.05em; }
.card-time { margin-left: auto; font-size: 13px; color: var(--muted); }
.card h2 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.3; }
.card p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--body); white-space: pre-line; }
.thumbs { display: flex; flex-direction: column; gap: 8px; }
.thumbs button { padding: 0; border: none; background: #F6ECEF; border-radius: 14px; overflow: hidden; display: block; width: 100%; }
.thumbs img { width: 100%; height: auto; display: block; }
.bubble .thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bubble .thumbs button { aspect-ratio: 4 / 3; }
.bubble .thumbs img { height: 100%; object-fit: cover; }
.links { display: flex; flex-direction: column; gap: 8px; }
.embed { width: 100%; border: 0; border-radius: 12px; display: block; }
.embed.spotify { height: 152px; }
.embed.youtube { aspect-ratio: 16 / 9; height: auto; }
.link { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; max-width: 100%; min-height: 44px; padding: 0 14px; border-radius: 999px; background: #F4EEF0; color: var(--rose); font-size: 14px; font-weight: 800; text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.link svg { width: 16px; height: 16px; flex: none; }
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.due { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--due-bg); color: var(--due-fg); font-size: 13px; font-weight: 800; }
.due svg { width: 14px; height: 14px; }
.seen-btn { margin-left: auto; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; border: none; font-size: 14px; font-weight: 800; background: #F4EEF0; color: var(--body); }
.seen-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--heart); stroke-width: 2; }
.seen-btn.on { background: var(--pop-bg); color: var(--pop-fg); }
.seen-btn.on svg { fill: var(--heart); }
.seen-btn:disabled { cursor: default; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 15px; }
.all-seen { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 20px auto 0; min-height: 48px; padding: 0 24px; border: none; border-radius: 999px; background: var(--rose); color: #fff; font-size: 15px; font-weight: 800; }
.all-seen svg { width: 20px; height: 20px; fill: #fff; }
.divider { display: flex; align-items: center; gap: 12px; margin: 28px 20px 12px; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #E3C9D1; }
.cards.older .card { box-shadow: none; border: 1px solid var(--line); }
.foot-note { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Robertov klepet ---------- */
.rview { height: 100%; display: flex; flex-direction: column; background: var(--cream); max-width: 900px; margin: 0 auto; }
.rhead { padding: calc(var(--safe-t) + 14px) 16px 10px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #F0E2E6; background: var(--cream); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--pop-bg); display: flex; align-items: center; justify-content: center; flex: none; }
.avatar svg { width: 22px; height: 22px; fill: var(--heart); }
.rhead h1 { margin: 0; font-size: 19px; font-weight: 800; }
.rhead .sub { font-size: 12px; color: var(--muted); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.rhead .tools { margin-left: auto; display: flex; gap: 8px; }
.chat { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 16px; }
.day { align-self: center; font-size: 12px; font-weight: 800; color: var(--muted); background: #F4EAED; padding: 4px 12px; border-radius: 999px; }
.msg { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bubble { max-width: min(82%, 560px); background: var(--rose); color: #fff; border-radius: 20px 20px 6px 20px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.bubble .text { font-size: 15px; line-height: 1.4; padding: 0 6px 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .thumbs button { background: #C9536F; }
.preview { width: min(82%, 560px); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 2px 12px 10px; display: flex; flex-direction: column; gap: 3px; }
.preview .ph { display: flex; align-items: center; gap: 6px; }
.preview .ph svg { width: 14px; height: 14px; color: var(--muted); }
.preview .lbl { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.preview .chip-btn { margin-left: auto; min-height: 44px; padding: 0; border: none; background: transparent; display: inline-flex; align-items: center; }
.preview .t { font-size: 15px; font-weight: 800; line-height: 1.3; }
.preview .b { font-size: 13px; line-height: 1.4; color: var(--body); }
.preview .st { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.preview .st svg { width: 13px; height: 13px; fill: none; stroke: var(--heart); stroke-width: 2; }
.preview .st.on { color: var(--pop-fg); }
.preview .st.on svg { fill: var(--heart); }
.meta { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.meta button { min-height: 36px; border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 999px; }
.meta button svg { width: 15px; height: 15px; }
.meta button.confirm { background: var(--pop-bg); color: var(--pop-fg); }
.thinking { align-self: flex-end; font-size: 13px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.thinking svg { width: 14px; height: 14px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.ai-warn { font-size: 12px; color: var(--due-fg); font-weight: 700; }

.pending { margin: 0 16px 6px; padding: 8px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: flex; gap: 8px; overflow-x: auto; }
.pending[hidden] { display: none; }
.pending .p { position: relative; width: 64px; height: 64px; flex: none; border-radius: 10px; overflow: hidden; background: #F6ECEF; }
.pending img { width: 100%; height: 100%; object-fit: cover; }
.pending .p button { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(42,30,35,0.75); color: #fff; display: flex; align-items: center; justify-content: center; }
.pending .p button svg { width: 14px; height: 14px; }
.composer { padding: 8px 12px calc(var(--safe-b) + 12px); display: flex; align-items: flex-end; gap: 8px; background: var(--cream); }
.composer textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 160px; resize: none; border-radius: 24px; border: 1px solid #E0CCD2; background: #fff; padding: 12px 16px; font-size: 16px; line-height: 1.4; }
.composer .icon-btn { width: 48px; height: 48px; }
.composer .send { border: none; background: var(--rose); color: #fff; }
.composer .send:disabled { opacity: 0.5; }
.chat.drag { outline: 3px dashed var(--heart); outline-offset: -8px; }

/* ---------- povečava slike ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(20,12,16,0.92); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lightbox button { position: absolute; top: calc(var(--safe-t) + 12px); right: 12px; width: 48px; height: 48px; border-radius: 50%; border: none; background: rgba(255,255,255,0.15); color: #fff; display: flex; align-items: center; justify-content: center; }
.lightbox button svg { width: 22px; height: 22px; }

/* ---------- osnutek ---------- */
.preview.draft { border: 2px dashed #D9C2CB; }
.preview .countdown { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--rose); padding: 14px 0; }
.type-pick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.type-pick button { min-height: 44px; padding: 0 16px; font-size: 14px; border: 2px solid transparent; }
.type-pick button.picked { border-color: currentColor; }

/* ---------- animacije ---------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.fx-heart { position: absolute; left: var(--x); bottom: -40px; width: 30px; height: 30px; fill: var(--heart); opacity: 0; animation: fx-rise var(--d) ease-out var(--delay) forwards; }
@keyframes fx-rise {
  0% { opacity: 0; transform: translateY(0) scale(var(--s)) rotate(0deg); }
  12% { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(-105vh) scale(var(--s)) rotate(var(--r)); }
}
.fx-burst { position: absolute; left: var(--x0); top: var(--y0); width: 16px; height: 16px; fill: var(--heart); animation: fx-burst 0.9s ease-out forwards; }
@keyframes fx-burst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); }
}
.seen-btn.pop svg { animation: fx-pop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes fx-pop { 0% { transform: scale(1); } 40% { transform: scale(1.7); } 100% { transform: scale(1); } }
.card.wiggle { animation: fx-wiggle 0.5s ease-in-out; }
@keyframes fx-wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-1.2deg); } 75% { transform: rotate(1.2deg); } }
.nhead h1 svg.beat { animation: fx-beat 1.4s ease-in-out 3; transform-origin: center; }
@keyframes fx-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(1); } 45% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) {
  .fx-layer { display: none; }
  .seen-btn.pop svg, .card.wiggle, .nhead h1 svg.beat { animation: none; }
}

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 90px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 80; max-width: 90vw; text-align: center; }
