/* LOML APP — toni tenui e caldi, pensato per iPhone, tema scuro automatico */

:root {
  --bg: #f3efe9;
  --card: #fbf9f6;
  --card-2: #efe9e1;
  --ink: #2e2a27;
  --ink-soft: #857c73;
  --line: #e2dbd1;

  --sage: #8c9c88;
  --sage-soft: #dfe5da;
  --dusk: #9aa9b4;
  --sand: #e6dac8;

  --red: #c0473b;
  --red-deep: #8a2f26;
  --red-hi: #d86a5c;

  --polaroid: #fdfbf7;
  --shadow: 0 8px 24px rgba(60, 45, 30, .10), 0 1px 3px rgba(60, 45, 30, .08);
  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --card: #262421;
    --card-2: #2f2c28;
    --ink: #eee8df;
    --ink-soft: #a39b90;
    --line: #38342f;
    --sage: #9fb09a;
    --sage-soft: #34392f;
    --dusk: #8d9da8;
    --sand: #3a342c;
    --red: #c4493c;
    --red-deep: #7a2920;
    --red-hi: #d9685a;
    --polaroid: #efe9df;
    --shadow: 0 8px 24px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 28px) calc(var(--safe-left) + 16px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
p { margin: 0; }

main { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
main > * { min-width: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* --- Intestazione ---------------------------------------------------- */
.top {
  max-width: 520px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hello { font-size: 28px; font-weight: 800; letter-spacing: -.4px; }
.today { margin-top: 2px; color: var(--ink-soft); font-size: 15px; font-weight: 600; }
.today::first-letter { text-transform: uppercase; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  border: 0; background: var(--card); color: var(--ink-soft);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.icon-btn:active { transform: scale(.94); }

/* --- Meteo ------------------------------------------------------------- */
.weather { padding: 12px 14px 8px; }
.w-now { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; column-gap: 10px; }
.w-icon { grid-row: 1; color: var(--ink); display: grid; }
.w-icon svg { width: 38px; height: 38px; }
.w-temp { font-size: 42px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.w-text { min-width: 0; }
.w-desc { font-weight: 700; font-size: 16px; }
.w-range { color: var(--ink-soft); font-size: 14px; font-weight: 600; margin-top: 2px; }
.w-place {
  align-self: start; justify-self: end;
  display: inline-flex; align-items: center; gap: 3px; min-height: 32px; padding: 0 2px;
  border: 0; background: none; color: var(--ink-soft); font-size: 13px; font-weight: 700;
}
.w-hours {
  list-style: none; margin: 8px -14px 0; padding: 8px 14px 2px;
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-top: 1px solid var(--line);
}
.w-hours::-webkit-scrollbar { display: none; }
.w-hours li { flex: 0 0 auto; min-width: 46px; display: grid; justify-items: center; gap: 3px; font-size: 13px; }
.w-hours .h { color: var(--ink-soft); font-weight: 700; }
.w-hours .t { font-weight: 800; }
.w-hours .p { color: var(--dusk); font-size: 11px; font-weight: 700; min-height: 13px; }

/* --- Polaroid ---------------------------------------------------------- */
.photo-card { display: grid; grid-template-columns: minmax(0, 1fr); padding: 4px 2px; }
.polaroid {
  margin: 0; background: var(--polaroid);
  padding: 12px 12px 0; border-radius: 4px;
  box-shadow: var(--shadow);
  transform: rotate(-.8deg);
}
.photo {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 2px;
  background: #e7e1d8;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .6s ease; }
.photo img.shown { opacity: 1; }
.photo-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 12px; padding: 24px; text-align: center; color: #6f665d;
}
.photo-empty p { font-weight: 700; font-size: 16px; max-width: 240px; }
.polaroid figcaption {
  min-height: 42px; display: grid; place-items: center; padding: 6px 8px 8px;
  color: #4a433d; font-size: 17px; font-weight: 700; text-align: center;
}

/* Menu ☰ sulla foto */
.photo-menu-btn {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; display: grid; place-items: center; color: #fff;
  background: rgba(30, 24, 20, .38); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.photo-menu-btn::before { content: ''; position: absolute; inset: -4px; } /* area di tocco 48px */
.photo-menu-btn:active { transform: scale(.92); }

.album-sheet {
  width: min(100% - 24px, 480px); margin: auto auto calc(var(--safe-bottom) + 12px);
  border: 0; border-radius: 24px; padding: 18px; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow);
}
.album-sheet::backdrop { background: rgba(20, 15, 10, .35); }
.album-sheet[open] { animation: slide-up .25s cubic-bezier(.2, .9, .3, 1); }
.album-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.album-head img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--card-2); }
.album-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.album-head .small { margin: 2px 0 0; }
.album-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.album-list button {
  width: 100%; min-height: 54px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg);
  font-weight: 700; font-size: 16px; text-align: left;
}
.album-list .box {
  width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--line); color: transparent; background: var(--card);
}
.album-list button[aria-checked="true"] { border-color: var(--sage); background: var(--sage-soft); }
.album-list button[aria-checked="true"] .box { background: var(--sage); border-color: var(--sage); color: #fff; }
.album-list .state { margin-left: auto; white-space: nowrap; font-size: 12px; font-weight: 700; color: var(--ink-soft); }

/* --- Spotify + UnCrank -------------------------------------------------- */
.play-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 12px; align-items: stretch; }
.spotify { padding: 12px; display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; gap: 10px 12px; min-width: 0; }
.sp-cover {
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  background: var(--card-2); color: var(--ink-soft); display: grid; place-items: center;
}
.sp-cover img { width: 100%; height: 100%; object-fit: cover; }
.sp-info { min-width: 0; align-self: center; }
.sp-label { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--sage); }
.sp-title, .sp-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-title { font-weight: 800; font-size: 15px; margin-top: 2px; }
.sp-artist { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.sp-controls { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.sp-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink);
  display: grid; place-items: center;
}
.sp-btn.main { background: var(--ink); color: var(--card); }
.sp-btn:disabled { opacity: .35; }
.sp-btn:not(:disabled):active { transform: scale(.92); }

/* Il bottone UnCrank: rosso, grosso, si schiaccia davvero */
.uncrank {
  position: relative; border: 0; border-radius: 28px; padding: 0;
  color: #fff8f2; font-weight: 900; font-size: 25px; line-height: 1; letter-spacing: -.3px;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .2);
  background:
    radial-gradient(120% 80% at 30% 15%, var(--red-hi), transparent 60%),
    var(--red);
  box-shadow:
    0 8px 0 var(--red-deep),
    0 14px 22px rgba(120, 30, 20, .35),
    inset 0 2px 0 rgba(255, 255, 255, .25),
    inset 0 -3px 0 rgba(0, 0, 0, .12);
  transform: translateY(-4px);
  transition: transform .09s ease, box-shadow .09s ease;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.uncrank span { display: block; }
.uncrank:active, .uncrank.pressed {
  transform: translateY(4px);
  box-shadow:
    0 0 0 var(--red-deep),
    0 3px 8px rgba(120, 30, 20, .35),
    inset 0 2px 0 rgba(255, 255, 255, .2),
    inset 0 -1px 0 rgba(0, 0, 0, .12);
}

/* --- Parti solo di Giulia o solo di Teo -------------------------------- */
body:not([data-role="giulia"]) [data-only="giulia"],
body:not([data-role="teo"]) [data-only="teo"] { display: none !important; }

/* Bottone CMD (Teo): stesso gesto di UnCrank, colori "mana" */
.uncrank.cmd {
  font-size: 30px; letter-spacing: 1px;
  background: radial-gradient(120% 80% at 30% 15%, #6d7fb0, transparent 60%), #3f4f80;
  box-shadow: 0 8px 0 #263157, 0 14px 22px rgba(30, 40, 80, .35), inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.uncrank.cmd:active { box-shadow: 0 0 0 #263157, 0 3px 8px rgba(30, 40, 80, .35); }

/* News of the Day */
.news { padding: 14px 16px 12px; }
.news .news-label { color: #3f4f80; }
@media (prefers-color-scheme: dark) { .news .news-label { color: #8d9fd6; } }
.news-main { display: grid; gap: 8px; margin-top: 10px; text-decoration: none; color: inherit; }
.news-main img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--card-2); }
.news-main h3 { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 800; }
.news-main p { color: var(--ink-soft); font-size: 14px; line-height: 1.35; }
.news-meta { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.news-more { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--line); }
.news-more a {
  display: grid; gap: 2px; padding: 10px 0; min-height: 44px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.3;
}
.news-more li:last-child a { border-bottom: 0; }

/* Scheda comandante */
.cmd-card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.cmd-card img { width: 120px; border-radius: 8px; box-shadow: var(--shadow); }
.cmd-card h3 { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.2; }
.cmd-card .small { margin-top: 4px; }
.cmd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cmd-chips span { padding: 4px 10px; border-radius: 999px; background: var(--card-2); font-size: 12px; font-weight: 700; }
.cmd-how { font-size: 16px; line-height: 1.45; }
.cmd-types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.cmd-types div { background: var(--bg); border-radius: 12px; padding: 8px 4px; }
.cmd-types b { display: block; font-size: 20px; }
.cmd-types span { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.cmd-list { list-style: none; margin: 0; padding: 0; }
.cmd-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 15px; }
.cmd-list li:last-child { border-bottom: 0; }
.cmd-list .pct { color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmd-oracle { white-space: pre-line; font-size: 14px; line-height: 1.45; color: var(--ink); }
.cmd-curve { display: flex; align-items: end; gap: 6px; height: 70px; margin-top: 6px; }
.cmd-curve div { flex: 1; background: #6d7fb0; border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.cmd-curve span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.cmd-loading { display: grid; place-items: center; min-height: 50dvh; color: var(--ink-soft); font-weight: 700; }

/* --- Request Cute / Spicy Pics ---------------------------------------- */
.req-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.req-btn {
  min-height: 64px; border: 0; border-radius: 18px; padding: 8px 10px;
  display: grid; place-content: center; gap: 2px; text-align: center;
  font-weight: 800; font-size: 15px; line-height: 1.15;
  transform: translateY(-3px); transition: transform .08s, box-shadow .08s;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.req-main { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.req-wait { font-size: 12px; font-weight: 700; opacity: .75; min-height: 14px; }
.req-wait:empty { display: none; }
.req-btn.cute { background: var(--sand); color: var(--ink); box-shadow: 0 5px 0 color-mix(in srgb, var(--sand) 70%, #6b5a44); }
.req-btn.spicy {
  color: #fff6ee; text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
  background: radial-gradient(120% 90% at 30% 10%, #ff8a3d, transparent 60%), linear-gradient(160deg, #ff4b1f, #d1201a 70%);
  box-shadow: 0 5px 0 #8f1410, 0 10px 18px rgba(209, 32, 26, .35);
}
.req-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.req-btn:disabled { filter: grayscale(.5) opacity(.55); transform: none; box-shadow: none; }

/* Richieste ricevute */
.requests { display: grid; gap: 10px; }
.requests:empty { display: none; }
.req-card { padding: 14px 16px; display: grid; gap: 10px; }
.req-card.spicy { box-shadow: inset 0 0 0 2px #e2401f, var(--shadow); }
.req-card .req-title { font-size: 18px; font-weight: 800; }
.req-card .req-sub { color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.req-card .row { margin: 0; flex-wrap: nowrap; }
.req-card .btn.fire { background: #d9301c; color: #fff; }

/* Avviso notifiche */
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink-soft); }
.notice p { flex: 1; font-size: 14px; font-weight: 700; color: var(--ink); }

/* Spicy pics ricevute: sfocate */
.spicy-box { padding: 12px 14px 14px; }
.spicy-label { color: #d9301c; }
.spicy-grid { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.spicy-grid button {
  position: relative; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: #2a1a18;
}
.spicy-grid img { width: 100%; height: 100%; object-fit: cover; filter: blur(18px) saturate(.8); transform: scale(1.2); }
.spicy-grid .tap {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

/* Visore a tutto schermo */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #000; color: #fff;
}
.viewer::backdrop { background: #000; }
.viewer img { width: 100%; height: 100%; object-fit: contain; }
.viewer-bar {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent);
}
.viewer-bar span { flex: 1; font-weight: 700; font-size: 14px; }
.viewer-bar .icon-btn { background: rgba(255, 255, 255, .15); color: #fff; box-shadow: none; }

/* Conferma invio */
.send-sheet { text-align: center; }
.send-sheet h2 { font-size: 19px; font-weight: 800; margin: 12px 0 0; }
.send-preview { width: 100%; max-height: 52dvh; object-fit: contain; border-radius: 14px; background: var(--card-2); }

/* --- Bottoni ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 16px; border: 0;
  background: var(--ink); color: var(--card); font-weight: 800; font-size: 16px;
  text-decoration: none; cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .08s;
}
.btn:active { transform: scale(.97); }
.btn.soft { background: var(--sand); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 14px; }
.btn.wide { width: 100%; min-height: 54px; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.row.tight { margin: 0; flex-wrap: nowrap; }
.row.tight input { flex: 1; min-width: 0; }

/* --- Citazione del giorno ---------------------------------------------- */
.quote { padding: 14px 18px 16px; }
.q-label {
  display: flex; align-items: center; gap: 6px; color: var(--red);
  font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
}
.quote blockquote {
  margin: 8px 0 0; font-family: ui-serif, "New York", Georgia, serif; font-style: italic;
  font-size: 19px; line-height: 1.35; color: var(--ink); text-wrap: pretty;
}
.q-source { margin-top: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.q-source:empty { display: none; }

/* --- Campi ------------------------------------------------------------- */
.field { display: grid; gap: 6px; font-weight: 700; font-size: 15px; margin: 10px 0; }
.field textarea { resize: vertical; line-height: 1.4; }
.field input, .field textarea, .field select {
  min-height: 46px; padding: 10px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); font-weight: 600; font-size: 16px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--sage); }
.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; }
.switch input { width: 22px; height: 22px; accent-color: var(--sage); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent; font-weight: 700;
}
.chip[aria-pressed="true"] { background: var(--sage-soft); border-color: var(--sage); }

.city-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.city-results button {
  width: 100%; min-height: 44px; text-align: left; padding: 8px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); font-weight: 700;
}
.city-results small { color: var(--ink-soft); font-weight: 600; }

.small { color: var(--ink-soft); font-size: 14px; margin: 6px 0; }
.strong { font-weight: 800; color: var(--ink); }
code { font-size: 13px; word-break: break-all; background: var(--card-2); padding: 2px 6px; border-radius: 6px; }

/* --- Pannello impostazioni ---------------------------------------------- */
.sheet {
  width: 100%; max-width: 560px; height: 100dvh; max-height: 100dvh; margin: 0 auto;
  border: 0; padding: 0; background: var(--bg); color: var(--ink);
}
.sheet::backdrop { background: rgba(20, 15, 10, .35); }
.sheet[open] { animation: slide-up .3s cubic-bezier(.2, .9, .3, 1); }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) calc(var(--safe-right) + 16px) 10px calc(var(--safe-left) + 16px);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.sheet-head h2 { margin: 0; font-size: 26px; font-weight: 800; }
.sheet-body { padding: 4px calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 40px) calc(var(--safe-left) + 16px); }
.set-group { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.set-group h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
details.set-group summary { min-height: 32px; display: flex; align-items: center; cursor: pointer; list-style: none; }
details.set-group summary h3 { margin: 0; }
details.set-group summary::after { content: '›'; margin-left: auto; font-size: 22px; color: var(--ink-soft); transition: transform .2s; }
details[open].set-group summary::after { transform: rotate(90deg); }

.import-box { background: var(--card-2); border-radius: 16px; padding: 12px 14px; margin: 8px 0; }
.import-box p { font-weight: 700; }

.thumbs { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.thumb { background: var(--bg); border-radius: 14px; overflow: hidden; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.thumb-bar { display: flex; gap: 4px; padding: 6px; align-items: center; }
.thumb-bar .tag {
  min-height: 36px; padding: 0 10px; border-radius: 10px; border: 1.5px solid var(--line);
  background: transparent; font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.thumb-bar .tag[aria-pressed="true"] { background: var(--sage-soft); border-color: var(--sage); color: var(--ink); }
.thumb-bar .del { margin-left: auto; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); display: grid; place-items: center; }
.thumb input {
  width: calc(100% - 12px); margin: 0 6px 8px; min-height: 36px; padding: 4px 10px;
  border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px;
}
.thumb .badge { font-size: 12px; color: var(--ink-soft); padding: 0 8px 8px; }

/* --- Spotify: bottone di collegamento ---------------------------------- */
.sp-connect { grid-column: 1 / -1; min-height: 44px; background: #1db954; color: #08210f; }
@media (prefers-color-scheme: dark) { .sp-connect { background: #1ed760; } }

/* --- Collegamento guidato ------------------------------------------------- */
.connect-sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.connect-intro { color: var(--ink-soft); font-weight: 600; margin-bottom: 10px; }
.connect-steps { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.connect-steps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; font-weight: 600; line-height: 1.35; }
.connect-steps li::before {
  content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sage-soft); color: var(--ink); font-weight: 800; font-size: 14px;
}
.connect-sheet .btn.wide { margin-top: 8px; }
.connect-paste { margin-top: 12px; }
.connect-paste summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--ink-soft); cursor: pointer; }
.connect-paste input { flex: 1; min-height: 46px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); }
.connect-error { color: var(--red); font-weight: 700; }
#link-code { font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; }
.link-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-weight: 800; }
.link-row .small { grid-column: 1; margin: 0; }
.link-row .btn { grid-column: 2; grid-row: 1 / span 2; }

/* --- Primo avvio ------------------------------------------------------ */
.pair {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background: var(--bg);
}
.pair-card { width: 100%; max-width: 380px; text-align: center; }
.pair-title { font-size: 34px; font-weight: 900; letter-spacing: -.6px; margin-bottom: 6px; }
.pair-card .field input { text-align: center; font-size: 20px; }
.pair-error { color: var(--red); min-height: 20px; font-weight: 700; }
body.locked .top, body.locked main { visibility: hidden; }

/* --- Toast --------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 24px);
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px;
  font-weight: 700; font-size: 15px; max-width: calc(100% - 40px); text-align: center;
  transition: transform .3s, opacity .3s; z-index: 100;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
