/* ================================================================ Scintille */
:root {
  --bg: #f7f3ec;
  --bg-2: #efe9df;
  --surface: #ffffff;
  --surface-2: #faf7f2;
  --line: #e7e0d4;
  --text: #1c1825;
  --muted: #6e6779;
  --faint: #a39cab;
  --brand: #6d4aff;
  --brand-2: #ff6a4a;
  --shadow-sm: 0 1px 2px rgba(28, 24, 37, .06), 0 2px 8px rgba(28, 24, 37, .05);
  --shadow: 0 10px 30px -12px rgba(28, 24, 37, .22), 0 2px 6px rgba(28, 24, 37, .06);
  --shadow-lg: 0 30px 60px -24px rgba(40, 20, 80, .45);
  --r: 18px;
  --r-lg: 28px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120f1a;
    --bg-2: #181424;
    --surface: #1d1828;
    --surface-2: #231d31;
    --line: #2f2840;
    --text: #f3eefa;
    --muted: #a69db6;
    --faint: #6f6780;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 14px 34px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 34px 70px -26px rgba(0, 0, 0, .85);
  }
}

/* colori dei temi */
.t-psicologia { --a1: #7b4dff; --a2: #c160ff; --ac: #6a3df0; --ac-d: #b79bff; }
.t-persuasione { --a1: #ff4f5a; --a2: #ff9442; --ac: #e8483a; --ac-d: #ff9a85; }
.t-neuroscienze { --a1: #08a6a0; --a2: #3a7cff; --ac: #0b8f8a; --ac-d: #5fe0d6; }
.t-filosofia { --a1: #d7801a; --a2: #b8402f; --ac: #b4630e; --ac-d: #ffc06b; }
.t-vuota { --a1: #8b8597; --a2: #b7b1c2; --ac: #6e6779; --ac-d: #a69db6; }
@media (prefers-color-scheme: dark) {
  [class*="t-"] { --acx: var(--ac-d); }
}
[class*="t-"] { --acx: var(--ac); }
@media (prefers-color-scheme: dark) { [class*="t-"] { --acx: var(--ac-d); } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
strong { font-weight: 700; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 8px; }

.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ================================================================ boot */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-spark { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.85) rotate(12deg); opacity: .6; } }

/* ================================================================ shell */
.shell { min-height: 100dvh; }
#view {
  padding: calc(18px + var(--safe-t)) 18px calc(var(--tabbar-h) + var(--safe-b) + 28px);
  max-width: 1240px;
  margin: 0 auto;
  outline: none;
}
#view.loading { opacity: .55; transition: opacity .2s .15s; }
#view.enter { animation: enter .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

.sidebar { display: none; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 6px 6px var(--safe-b);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--faint); border-radius: 14px;
  transition: color .2s;
}
.tabbar a .ic { width: 23px; height: 23px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.tabbar a.active { color: var(--text); }
.tabbar a.active .ic { transform: translateY(-1px) scale(1.08); color: var(--brand); }
.tabbar a.active::before {
  content: ""; position: absolute; top: 4px; width: 34px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  top: -6px;
}
.badge {
  position: absolute; top: 4px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand-2); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center;
  font-style: normal;
}
.badge:empty { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 272px 1fr; }
  .tabbar { display: none; }
  #view { padding: 44px 48px 64px; width: 100%; }
  .sidebar {
    display: flex; flex-direction: column; gap: 22px;
    position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 28px 20px 22px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg-2), var(--bg));
  }
  .brand { display: flex; align-items: center; gap: 10px; font: 700 24px/1 var(--serif); letter-spacing: -.01em; padding: 0 10px; }
  .brand-ic { width: 34px; height: 34px; padding: 6px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); stroke-width: 2; box-shadow: 0 8px 18px -8px var(--brand); }
  .side-nav { display: flex; flex-direction: column; gap: 3px; }
  .side-nav a {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 13px; font-weight: 600; color: var(--muted);
    transition: background .2s, color .2s;
  }
  .side-nav a:hover { background: var(--surface); color: var(--text); }
  .side-nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
  .side-nav a.active .ic { color: var(--brand); }
  .side-nav .badge { position: static; margin-left: auto; }
  .side-card { padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 14px; }
  .side-card:empty { display: none; }
  .streak { display: flex; align-items: center; gap: 12px; }
  .streak .ic { width: 38px; height: 38px; padding: 8px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #ff8a3d, #ff3d6e); fill: rgba(255,255,255,.25); }
  .streak strong { display: block; font: 700 22px/1 var(--serif); }
  .streak span { font-size: 12.5px; color: var(--muted); }
  .side-nums { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
  .side-nums strong { display: block; font: 700 18px/1.1 var(--serif); }
  .side-nums span { font-size: 11.5px; color: var(--muted); }
  .side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 700; margin: 0 12px 6px; }
  .side-theme { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 10px; font-size: 13.5px; color: var(--muted); }
  .side-theme:hover { background: var(--surface); color: var(--text); }
  .side-theme i { width: 10px; height: 10px; border-radius: 4px; background: linear-gradient(135deg, var(--a1), var(--a2)); }
  .side-logout { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; color: var(--faint); font-size: 14px; border-radius: 12px; }
  .side-logout:hover { color: var(--text); background: var(--surface); }
  .side-logout .ic { width: 19px; height: 19px; }
}

/* settimana */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week span {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px;
  font-size: 11px; font-weight: 700; color: var(--faint); background: var(--surface-2); border: 1px solid var(--line);
}
.week span.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, #ff8a3d, #ff3d6e); box-shadow: 0 6px 14px -8px #ff3d6e; }
.week.big { gap: 8px; }
.week.big span { font-size: 13px; border-radius: 12px; }

/* ================================================================ testate */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.eyebrow.link:hover { color: var(--text); }
.eyebrow .ic { width: 16px; height: 16px; }
.page-head h1 { font: 700 clamp(28px, 5.4vw, 44px)/1.08 var(--serif); letter-spacing: -.02em; max-width: 22ch; }
.hl { background: linear-gradient(100deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.head-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.pill .ic { width: 17px; height: 17px; }
.pill-flame .ic { color: #ff5a3d; fill: rgba(255, 90, 61, .2); }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin: -6px 0 20px;
  border-radius: 14px; background: var(--surface); border: 1px dashed var(--line); color: var(--muted); font-size: 14.5px;
}
.notice .ic { width: 19px; height: 19px; margin-top: 2px; }

/* ================================================================ bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: 15px; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(.97); }
.btn .ic { width: 19px; height: 19px; }
.btn-primary { border: 0; color: #fff; background: linear-gradient(120deg, var(--brand), #a24dff 55%, var(--brand-2)); background-size: 160% 100%; box-shadow: 0 10px 22px -10px var(--brand); }
.btn-primary:hover { background-position: 100% 0; }
.btn-light { border: 0; background: #fff; color: #1c1825; }
.btn-danger { color: #e5484d; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; pointer-events: none; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: transform .15s, background .2s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--faint); }
.icon-btn.sm:hover { color: #e5484d; background: var(--surface-2); }
.icon-btn.sm .ic { width: 18px; height: 18px; }

/* ================================================================ OGGI: mazzo di carte */
.deck {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(86vw, 420px); gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 18px;
  margin: 0 -18px; padding: 6px 18px 22px;
  scrollbar-width: none;
}
.deck::-webkit-scrollbar { display: none; }
.deck-dots { display: flex; justify-content: center; gap: 7px; margin: -8px 0 22px; }
.deck-dots i { width: 7px; height: 7px; border-radius: 9px; background: var(--line); transition: width .3s, background .3s; }
.deck-dots i.on { width: 24px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.spark {
  position: relative; isolation: isolate; overflow: hidden;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 14px;
  min-height: min(68dvh, 560px);
  padding: 22px 22px 20px; border-radius: var(--r-lg);
  color: #fff; cursor: pointer;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%),
    radial-gradient(90% 70% at 0% 100%, rgba(0, 0, 0, .22), transparent 60%),
    linear-gradient(150deg, var(--a1), var(--a2));
  box-shadow: var(--shadow-lg);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
}
.spark::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .16; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1.3px);
  background-size: 18px 18px;
  mask-image: linear-gradient(200deg, #000 10%, transparent 55%);
  -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 55%);
}
.spark:hover { transform: translateY(-4px) rotate(-.4deg); }
.spark-bg { position: absolute; z-index: -1; right: -40px; bottom: -30px; opacity: .17; }
.spark-glyph { width: 260px; height: 260px; stroke-width: 1.1; }
.spark-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.spark-theme {
  font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 99px; background: rgba(255, 255, 255, .2); backdrop-filter: blur(6px);
}
.spark-count { font: 700 14px/1 var(--serif); opacity: .8; }
.spark-title { font: 700 clamp(28px, 7.6vw, 36px)/1.06 var(--serif); letter-spacing: -.02em; margin-top: 8px; text-wrap: balance; }
.spark-hook { font-size: 18px; line-height: 1.4; font-weight: 600; opacity: .97; text-wrap: pretty; }
.spark-sum { font-size: 15.5px; line-height: 1.55; opacity: .86; text-wrap: pretty; }
.spark-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.spark-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; opacity: .9; white-space: nowrap; }
.spark-meta .ic { width: 16px; height: 16px; }
.spark-meta .done { display: inline-flex; align-items: center; gap: 3px; font-style: normal; margin-left: 6px; padding: 3px 8px 3px 5px; border-radius: 99px; background: rgba(255, 255, 255, .22); }
.spark-cta {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 99px;
  background: #fff; color: #1c1825; font-weight: 800; font-size: 14.5px;
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.5); transition: gap .2s;
}
.spark-cta .ic { width: 18px; height: 18px; color: var(--ac); }
.spark:hover .spark-cta { gap: 12px; }

@media (min-width: 760px) {
  .deck { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 4px 0 26px; }
  .deck-dots { display: none; }
  .spark { min-height: 520px; }
  .spark-title { font-size: clamp(26px, 2.5vw, 34px); }
  .spark:nth-child(2) { animation-delay: .06s; }
}
@media (min-width: 760px) and (max-width: 1100px) {
  .deck { grid-template-columns: 1fr 1fr; }
}
.deck .spark { animation: rise .6s cubic-bezier(.2, .8, .2, 1) backwards; }
.deck .spark:nth-child(2) { animation-delay: .08s; }
.deck .spark:nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.97); } }

/* tessere sotto */
.today-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .today-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.tile {
  padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.tile h3 { font: 700 19px/1.2 var(--serif); margin-bottom: 6px; }
.tile p { color: var(--muted); font-size: 14.5px; }
.tile-review { display: flex; align-items: center; gap: 16px; transition: transform .2s, box-shadow .2s; }
.tile-review:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; flex: none; background: var(--surface-2); color: var(--muted); }
.tile-review.has .tile-ic { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 20px -10px var(--brand); animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 85%, 100% { transform: rotate(0); } 90% { transform: rotate(-12deg); } 95% { transform: rotate(10deg); } }
.tile-go { margin-left: auto; color: var(--faint); }
.tile-week h3 { margin-bottom: 14px; }
.tile-nums { display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; text-align: center; }
.tile-nums strong { display: block; font: 700 30px/1 var(--serif); }
.tile-nums span { font-size: 12.5px; color: var(--muted); }

/* ================================================================ IDEA */
.idea { margin: calc(-18px - var(--safe-t)) -18px 0; }
.idea-hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  padding: calc(14px + var(--safe-t)) 18px 34px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%),
    linear-gradient(150deg, var(--a1), var(--a2));
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.hero-bg { position: absolute; z-index: -1; right: -60px; bottom: -70px; opacity: .15; }
.hero-glyph { width: 330px; height: 330px; stroke-width: 1; }
.hero-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 8px; }
.icon-btn.ghost { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .25); color: #fff; backdrop-filter: blur(8px); }
.icon-btn.ghost.on { background: #fff; color: var(--ac); }
.icon-btn.ghost.on .ic { fill: currentColor; }
.hero-theme { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .9; margin-bottom: 12px; }
.hero-text h1 { font: 700 clamp(32px, 8vw, 56px)/1.04 var(--serif); letter-spacing: -.025em; max-width: 18ch; text-wrap: balance; }
.hero-hook { margin-top: 14px; font-size: clamp(18px, 2.4vw, 22px); line-height: 1.4; font-weight: 600; max-width: 46ch; opacity: .97; }
.hero-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; font-weight: 600; opacity: .85; }
.hero-meta .ic { width: 16px; height: 16px; }

.idea-layout { display: grid; gap: 18px; padding: 22px 18px 0; }
.idea-main { display: grid; gap: 14px; min-width: 0; }
.block { padding: 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.block h3, .side-block h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--acx); margin-bottom: 14px;
}
.block h3::before { content: ""; width: 18px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.block p { font-size: 17px; line-height: 1.7; }
.block p + p { margin-top: 12px; }
.block.summary { background: color-mix(in srgb, var(--a1) 9%, var(--surface)); border-color: color-mix(in srgb, var(--a1) 24%, var(--line)); }
.block.summary p { font: 500 19px/1.6 var(--serif); }
.kq {
  position: relative; margin: 4px 0; padding: 8px 8px 8px 56px;
  font: italic 600 clamp(21px, 3vw, 26px)/1.4 var(--serif); color: var(--acx);
}
.kq .ic { position: absolute; left: 6px; top: 6px; width: 38px; height: 38px; opacity: .55; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 16px; }
.checks .ic { width: 20px; height: 20px; color: var(--acx); margin-top: 2px; }
.examples { display: grid; gap: 10px; }
.example { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); }
.example b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; flex: none; color: #fff; font-size: 14px; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.example p { font-size: 16px; line-height: 1.6; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; font-size: 16.5px; line-height: 1.6; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; border: 2px solid var(--acx); color: var(--acx); font-weight: 800; font-size: 14px; }
.evidence { background: var(--surface-2); border-style: dashed; }
.evidence p { font-size: 15.5px; color: var(--muted); }

.idea-side { display: grid; gap: 14px; align-content: start; }
.practice {
  position: relative; overflow: hidden; padding: 22px; border-radius: var(--r);
  background: linear-gradient(160deg, color-mix(in srgb, var(--a1) 16%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--a1) 30%, var(--line));
}
.practice-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.practice-head .ic { width: 36px; height: 36px; padding: 8px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.practice-head h3 { font: 700 20px/1.2 var(--serif); }
.practice > p { font-size: 16px; line-height: 1.6; margin-bottom: 14px; }
.practice form { display: grid; gap: 10px; }
textarea, .field input, .search input, .sheet-new input, .col-new input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
textarea:focus, .field input:focus, .search:focus-within, .sheet-new input:focus, .col-new input:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
.notes { display: grid; gap: 8px; margin-top: 12px; }
.notes:empty { display: none; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.note p { white-space: pre-wrap; font-size: 15px; }
.note small { color: var(--faint); font-size: 12px; }
.side-block { padding: 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sources a { display: grid; gap: 2px; padding: 10px 12px; margin: 0 -12px; border-radius: 12px; transition: background .2s; }
.sources a:hover { background: var(--surface-2); }
.sources span { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.sources small { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 12.5px; }
.sources small .ic { width: 13px; height: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags a { padding: 5px 11px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.tags a:hover { color: var(--text); }
.idea-pager { display: flex; justify-content: space-between; gap: 10px; }

@media (min-width: 960px) {
  .idea { margin: -44px -48px 0; }
  .idea-hero { padding: 26px 48px 52px; border-radius: 0 0 36px 36px; }
  .hero-glyph { width: 460px; height: 460px; }
  .hero-bg { right: 0; bottom: -110px; }
  .idea-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; padding: 28px 48px 0; align-items: start; }
  .idea-side { position: sticky; top: 24px; }
  .block { padding: 26px 28px; }
}

/* ================================================================ RIPASSO */
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin-bottom: 22px; }
.progress i { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.review-stage { max-width: 640px; margin: 0 auto; }
.flash { perspective: 1600px; }
.flash-inner { position: relative; display: grid; min-height: 380px; transition: transform .7s cubic-bezier(.3, 1.3, .5, 1); transform-style: preserve-3d; }
.flash.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  grid-area: 1 / 1; display: flex; flex-direction: column; gap: 18px;
  padding: 26px; border-radius: var(--r-lg); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow-lg);
}
.flash-face.front { color: #fff; background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,.22), transparent 55%), linear-gradient(150deg, var(--a1), var(--a2)); }
.flash-face.back { transform: rotateY(180deg); background: var(--surface); border: 1px solid var(--line); }
.flash-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flash-src { font-size: 13px; font-weight: 600; opacity: .8; }
.front .chip { background: rgba(255,255,255,.22); color: #fff; }
.flash-q { font: 700 clamp(24px, 4.6vw, 32px)/1.25 var(--serif); margin: auto 0; text-wrap: balance; }
.flash-qs { font-size: 15px; color: var(--muted); font-weight: 600; }
.flash-a { font: 500 clamp(19px, 3vw, 22px)/1.55 var(--serif); }
.front .btn-light { align-self: stretch; height: 52px; font-size: 16px; border-radius: 16px; box-shadow: 0 12px 26px -14px rgba(0,0,0,.6); }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; animation: enter .35s; }
.grades button {
  display: grid; gap: 2px; padding: 12px 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-sm); transition: transform .15s;
}
.grades button:active { transform: scale(.95); }
.grades b { font-size: 14px; }
.grades small { font-size: 11.5px; color: var(--muted); }
.grades .g0 b { color: #e5484d; } .grades .g1 b { color: #e58a1f; } .grades .g2 b { color: #1f9d6b; } .grades .g3 b { color: var(--brand); }
.review-done { text-align: center; padding: 40px 20px; display: grid; justify-items: center; gap: 12px; }
.review-done .done-ic { width: 76px; height: 76px; padding: 18px; border-radius: 26px; color: #fff; background: linear-gradient(135deg, #1fbf83, #0ea5a0); box-shadow: 0 16px 30px -14px #0ea5a0; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); stroke-width: 2.6; }
@keyframes pop { from { transform: scale(.3) rotate(-30deg); opacity: 0; } }
.review-done h2 { font: 700 30px/1.1 var(--serif); }
.review-done p { color: var(--muted); max-width: 40ch; }
.kbd-hint { display: none; text-align: center; margin-top: 18px; font-size: 13px; color: var(--faint); }
kbd { padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface); font: 600 12px var(--sans); }
@media (hover: hover) and (min-width: 960px) { .kbd-hint { display: block; } }

/* ================================================================ chip, card mini, griglie */
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--acx); background: color-mix(in srgb, var(--a1) 13%, transparent);
}
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.mini {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; height: 100%;
  padding: 18px 18px 18px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.mini::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--a1), var(--a2)); }
.mini:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mini-top { display: flex; align-items: center; gap: 8px; }
.mini-date { font-size: 12.5px; color: var(--faint); font-weight: 600; }
.mini-flag { margin-left: auto; color: var(--acx); }
.mini-flag .ic { width: 17px; height: 17px; fill: currentColor; }
.mini-new { margin-left: auto; font-size: 11px; font-weight: 800; color: #fff; padding: 3px 8px; border-radius: 99px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.mini-flag + .mini-new { margin-left: 0; }
.mini h3 { font: 700 21px/1.18 var(--serif); letter-spacing: -.01em; }
.mini p { color: var(--muted); font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mini-wrap { position: relative; }
.mini-remove { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--faint); }
.mini-remove:hover { color: #e5484d; }
.mini-remove .ic { width: 16px; height: 16px; }
.more { display: flex; justify-content: center; margin-top: 20px; }

/* archivio */
.toolbar { display: grid; gap: 12px; margin-bottom: 20px; }
.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.search .ic { color: var(--faint); }
.search input { border: 0; padding: 0; height: 100%; background: transparent; box-shadow: none !important; font-size: 16px; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 99px; flex: none;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--muted); transition: all .2s;
}
.filter i { width: 9px; height: 9px; border-radius: 3px; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.filter small { font-size: 12px; color: var(--faint); font-weight: 700; }
.filter.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--a1, #2a2435), var(--a2, #4a4258)); }
.filter.on:not([class*="t-"]) { background: var(--text); color: var(--bg); }
.filter.on small { color: inherit; opacity: .8; }
.filter.on i { background: #fff; }
@media (min-width: 960px) { .filters { margin: 0; padding: 2px 0; flex-wrap: wrap; } }

/* salvati / collezioni */
.segmented { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; margin-bottom: 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented a { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 700; font-size: 14.5px; color: var(--muted); }
.segmented a .ic { width: 18px; height: 18px; }
.segmented a small { color: var(--faint); }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.col-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.col-tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s; min-height: 190px; }
a.col-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.col-tile h3 { font: 700 21px/1.2 var(--serif); margin-top: auto; }
.col-tile p { color: var(--muted); font-size: 14px; }
.col-stack { position: relative; height: 84px; }
.col-stack i { position: absolute; top: 0; width: 64px; height: 80px; border-radius: 14px; background: linear-gradient(150deg, var(--a1), var(--a2)); box-shadow: 0 10px 20px -12px rgba(0,0,0,.5); border: 2px solid var(--surface); }
.col-stack i:nth-child(1) { left: 0; transform: rotate(-8deg); }
.col-stack i:nth-child(2) { left: 34px; transform: rotate(2deg); }
.col-stack i:nth-child(3) { left: 68px; transform: rotate(10deg); }
.col-new { justify-content: center; border-style: dashed; background: transparent; box-shadow: none; gap: 10px; }
.col-plus { width: 36px; height: 36px; padding: 7px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }

/* diario */
.timeline { display: grid; gap: 26px; max-width: 760px; }
.tl-day h3 { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.tl-day { display: grid; gap: 10px; }
.tl-entry { position: relative; padding: 18px 18px 10px 22px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; }
.tl-entry::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--a1, var(--line)), var(--a2, var(--line))); }
.tl-idea { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 14.5px; margin-bottom: 8px; }
.tl-idea:hover span { text-decoration: underline; }
.tl-entry p { white-space: pre-wrap; font: 500 17px/1.6 var(--serif); }
.tl-entry footer { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; color: var(--faint); }

/* ================================================================ vuoti, toast, sheet */
.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 48px 20px; }
.empty-art { position: relative; width: 96px; height: 96px; display: grid; place-items: center; border-radius: 30px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, var(--surface)), color-mix(in srgb, var(--brand-2) 18%, var(--surface))); }
.empty-ic { width: 44px; height: 44px; color: var(--brand); }
.empty h2 { font: 700 26px/1.15 var(--serif); }
.empty p { color: var(--muted); max-width: 44ch; }
.empty .btn { margin-top: 6px; }
.muted { color: var(--muted); }

#toast {
  position: fixed; left: 50%; z-index: 100; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14.5px;
  box-shadow: var(--shadow); transition: all .3s cubic-bezier(.2, .8, .2, 1); max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #e5484d; color: #fff; }
@media (min-width: 960px) { #toast { bottom: 28px; } }

.sheet-wrap { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 8, 16, 0); transition: background .25s; }
.sheet-wrap.open { background: rgba(10, 8, 16, .5); }
.sheet {
  width: 100%; max-width: 520px; max-height: 82dvh; overflow: auto;
  padding: 10px 20px calc(20px + var(--safe-b)); border-radius: 26px 26px 0 0; background: var(--surface);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.sheet-wrap.open .sheet { transform: none; }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 26px; transform: translateY(30px) scale(.97); opacity: 0; transition: all .25s; }
  .sheet-wrap.open .sheet { opacity: 1; }
}
.sheet-grip { width: 42px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 12px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head h2 { font: 700 22px/1.2 var(--serif); }
.sheet-list { display: grid; gap: 6px; margin-bottom: 16px; }
.sheet-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; }
.sheet-check { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); color: transparent; transition: all .2s; }
.sheet-check .ic { width: 16px; height: 16px; stroke-width: 3; }
.sheet-item.on .sheet-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.sheet-name { font-weight: 700; flex: 1; }
.sheet-item small { color: var(--faint); }
.sheet-new { display: flex; gap: 8px; }

/* ================================================================ login */
body.is-login { overflow: hidden; }
.login { position: relative; min-height: 100dvh; display: grid; place-items: center; padding: 24px; overflow: hidden; background: #120f1a; color: #f3eefa; }
.login-orbs i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .75; animation: float 14s ease-in-out infinite; }
.login-orbs .o1 { width: 420px; height: 420px; background: #7b4dff; top: -120px; left: -100px; }
.login-orbs .o2 { width: 360px; height: 360px; background: #ff4f5a; bottom: -120px; right: -80px; animation-delay: -4s; }
.login-orbs .o3 { width: 280px; height: 280px; background: #08a6a0; bottom: 10%; left: 8%; animation-delay: -8s; opacity: .5; }
.login-orbs .o4 { width: 240px; height: 240px; background: #d7801a; top: 12%; right: 10%; animation-delay: -2s; opacity: .45; }
@keyframes float { 50% { transform: translate(30px, -40px) scale(1.12); } }
.login-card {
  position: relative; width: 100%; max-width: 420px; display: grid; gap: 14px; padding: 34px 28px 28px; border-radius: 30px;
  background: rgba(29, 24, 40, .62); border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8);
  animation: rise .7s cubic-bezier(.2, .8, .2, 1);
}
.login-logo .ic { width: 58px; height: 58px; padding: 12px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #7b4dff, #ff6a4a); box-shadow: 0 14px 30px -12px #7b4dff; stroke-width: 2; }
.login-card h1 { font: 700 42px/1 var(--serif); letter-spacing: -.02em; }
.login-sub { color: #c7bfd6; font-size: 16.5px; }
.login-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.login-tags span { font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 99px; color: #fff; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 700; color: #c7bfd6; }
.login .field input { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #fff; height: 52px; font-size: 17px; }
.login-err { min-height: 20px; color: #ff8a8d; font-size: 14px; font-weight: 600; }
.login .btn-primary { height: 54px; font-size: 16.5px; border-radius: 16px; }

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

/* ================================================================ OGGI: parte bassa (Chiedi, Domani, tessere) */
.today-lower { display: grid; gap: 14px; }
.col-main { display: grid; gap: 14px; min-width: 0; }
.col-side { align-content: start; }
@media (min-width: 1100px) {
  .today-lower { grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
  .today-lower .today-grid { grid-template-columns: 1fr; position: sticky; top: 24px; }
}

.ask, .tomorrow {
  position: relative; overflow: hidden; padding: 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.ask::before {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 22%, transparent), transparent 65%); pointer-events: none;
}
.ask-head, .tm-head { position: relative; display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.ask-head h2, .tm-head h2 { font: 700 23px/1.15 var(--serif); letter-spacing: -.01em; margin-bottom: 4px; }
.ask-head p, .tm-head p { color: var(--muted); font-size: 14.5px; max-width: 60ch; }
.ask-ic { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 22px -10px var(--brand); }
.tm-ic { background: linear-gradient(135deg, #0fb5a6, #3a7cff); box-shadow: 0 10px 22px -10px #3a7cff; }
.ask-box {
  position: relative; display: grid; gap: 10px; padding: 12px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s;
}
.ask-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.ask-box textarea { border: 0; background: transparent; padding: 6px 6px 0; min-height: 56px; box-shadow: none !important; font-size: 16.5px; resize: none; }
.ask-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ask-attach { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 13px; cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; border: 1px dashed var(--line); transition: all .2s; }
.ask-attach:hover { color: var(--text); border-color: var(--muted); }
.ask-attach .ic { width: 20px; height: 20px; }
.ask-preview { position: relative; justify-self: start; }
.ask-preview img { display: block; max-height: 150px; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.ask-rm { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); }
.ask-rm .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.ask-list { display: grid; gap: 8px; margin-top: 12px; }
.ask-list:empty { display: none; }
.rq { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); animation: enter .35s; }
.rq-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.rq-main b { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.rq-main .ic { width: 18px; height: 18px; color: var(--muted); }
a.rq-main:hover b { text-decoration: underline; }
.rq-side { display: flex; align-items: center; gap: 2px; }
.rq-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.rq-status.s-in-corso { color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); }
.rq-status.s-pronta { color: #1f9d6b; background: color-mix(in srgb, #1f9d6b 13%, transparent); }
.rq-status.s-errore { color: #e5484d; background: color-mix(in srgb, #e5484d 12%, transparent); }
.spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tm-list { display: grid; gap: 10px; margin-bottom: 12px; }
.tm-list:empty { display: none; }
.tm {
  position: relative; display: flex; gap: 12px; align-items: center; padding: 14px 14px 14px 18px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface-2); overflow: hidden; transition: all .3s;
}
.tm::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--a1), var(--a2)); }
.tm.on { background: color-mix(in srgb, var(--a1) 10%, var(--surface)); border-color: color-mix(in srgb, var(--a1) 40%, var(--line)); }
.tm.gone { opacity: 0; transform: translateX(40px); }
.tm-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.tm-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-ok { font-size: 12px; font-weight: 800; color: #1f9d6b; }
.tm h3 { font: 700 18.5px/1.25 var(--serif); }
.tm p { font-size: 14px; color: var(--muted); }
.tm-actions { display: flex; gap: 6px; }
.tm-btn { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: all .2s; }
.tm-btn .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.tm-btn.yes:hover, .tm.on .tm-btn.yes { color: #fff; background: #1f9d6b; border-color: #1f9d6b; }
.tm-btn.no:hover { color: #fff; background: #e5484d; border-color: #e5484d; }
.tm-add { display: flex; gap: 8px; }
.tm-add input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 0 14px; height: 44px; outline: none; }
.tm-add input:focus { border-color: var(--brand); }
@media (max-width: 520px) { .tm-add .btn { padding: 0 12px; } .ask-attach span { display: none; } }

/* ================================================================ lingua */
.lang-switch { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.lang-switch button {
  min-width: 34px; height: 30px; padding: 0 6px; border: 0; border-radius: 9px; background: transparent;
  font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--muted); transition: all .2s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.on { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 14px -8px var(--brand); }
.lang-switch.dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.lang-switch.dark button { color: #c7bfd6; }
.lang-switch.dark button.on { color: #fff; }
.login-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.side-lang .side-label { display: flex; align-items: center; gap: 6px; }
.side-lang .side-label .ic { width: 14px; height: 14px; }
.side-lang .lang-switch { margin: 0 6px; display: grid; grid-template-columns: repeat(5, 1fr); }
.side-lang .lang-switch button { min-width: 0; }
.lang-fab {
  position: fixed; z-index: 35; top: calc(12px + var(--safe-t)); right: 14px;
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px; border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); border: 1px solid var(--line); color: var(--text);
  font-size: 12px; font-weight: 800; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-sm);
}
.lang-fab .ic { width: 16px; height: 16px; }
@media (min-width: 960px) { .lang-fab { display: none; } }
@media (max-width: 959px) { .page-head { padding-right: 70px; } .idea .hero-bar { padding-right: 64px; } }

/* ================================================================ banner installazione PWA */
.install-banner {
  position: fixed; z-index: 95; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: 0 24px 50px -20px rgba(40, 20, 80, .55);
  transform: translateY(140%); opacity: 0; transition: transform .45s cubic-bezier(.2, .9, .2, 1), opacity .3s;
}
.install-banner.show { transform: none; opacity: 1; }
.install-ic { width: 48px; height: 48px; border-radius: 14px; flex: none; box-shadow: 0 8px 18px -10px #7b4dff; }
.install-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.install-text b { font: 700 16.5px/1.2 var(--serif); }
.install-text span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.install-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.install-actions .btn { height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; }
.install-later { border: 0; background: none; color: var(--faint); font-weight: 700; font-size: 13px; padding: 8px; border-radius: 10px; display: grid; place-items: center; }
.install-later:hover { color: var(--text); }
.install-later .ic { width: 18px; height: 18px; }
body.is-login .install-banner { bottom: calc(16px + var(--safe-b)); background: rgba(29, 24, 40, .85); border-color: rgba(255,255,255,.12); color: #f3eefa; }
body.is-login .install-text span { color: #c7bfd6; }
@media (min-width: 960px) { .install-banner { left: auto; right: 24px; bottom: 24px; max-width: 460px; } }
@media (max-width: 380px) { .install-text span { display: none; } }
