/* Secondbrain inbox: the "taccuino da campo" design system of alessiosetaro.it (blue and azure), phone first. */
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces-variabile-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-variabile-latin.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --bg: #E9EFF7; --bg-alt: #DCE5F1; --surface: #FFFFFF; --ink: #0E1B2E; --muted: #4E5F78;
  --line: #C8D4E4; --dot: #B4C5DC; --chip: #D7E2F0; --blue: #1F4FD1; --azure: #08669A;
  --ok: #1D7A46; --err: #B3261E; --rec: #C62828; --rec-ink: #FFFFFF; --voce: #047857; --voce-ink: #FFFFFF; --invio: #0F2766;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08101E; --bg-alt: #0E1A30; --surface: #13213A; --ink: #E6EEF8; --muted: #9FB2CB;
    --line: #1E2D47; --dot: #1A2840; --chip: #172640; --blue: #86A8FF; --azure: #5CC6F2;
    --ok: #5FD08F; --err: #FF8A80; --rec: #FF6B6B; --rec-ink: #08101E; --voce: #047857; --voce-ink: #FFFFFF; --invio: #0F2766; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08101E; --bg-alt: #0E1A30; --surface: #13213A; --ink: #E6EEF8; --muted: #9FB2CB;
  --line: #1E2D47; --dot: #1A2840; --chip: #172640; --blue: #86A8FF; --azure: #5CC6F2;
  --ok: #5FD08F; --err: #FF8A80; --rec: #FF6B6B; --rec-ink: #08101E; --voce: #047857; --voce-ink: #FFFFFF; --invio: #0F2766; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 22px 22px;
  font-family: var(--font-body); font-size: 17px; line-height: 1.5;
}
.wrap {
  max-width: 640px; margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 0 14px;
}
.marchio { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; letter-spacing: -0.01em; margin: 0; }
.marchio span { color: var(--azure); font-weight: 400; }
.eyebrow { font-family: var(--font-mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 12px; padding: 16px; }
.card + .card, .card + section, section + section { margin-top: 16px; }
label.campo { display: grid; gap: 6px; }
input[type="text"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; outline: none;
}
input[type="text"]:focus-visible, textarea:focus-visible { border-color: var(--azure); box-shadow: 0 0 0 2px color-mix(in srgb, var(--azure) 35%, transparent); }
textarea { min-height: 7.5em; resize: vertical; }
.modulo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.modulo > *, .azioni > * { min-width: 0; }
.azioni { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button, .bottone {
  font: 600 1rem/1.2 var(--font-body); min-height: 48px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-alt); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
button:focus-visible, .bottone:focus-visible { outline: 2px solid var(--azure); outline-offset: 2px; }
button:disabled { opacity: 0.55; cursor: default; }
/* Send: navy, the same in both themes (Alessio's choice, 30/10/2026); white text 14:1. */
button.primario, .bottone.primario { background: var(--invio); border-color: var(--invio); color: #fff; font-size: 1.05rem; min-height: 54px; }
/* Record: full width above the photo buttons, as tall as "Metti nell'inbox", in emerald green (same in both themes, white text) to tell it from the blue send button. */
button.registra {
  width: 100%; min-height: 54px; font-size: 1.05rem; gap: 10px;
  background: var(--voce); border-color: var(--voce); color: var(--voce-ink);
}
button.registra .icona { width: 22px; height: 22px; }
button.registra[aria-pressed="true"] { background: var(--rec); border-color: var(--rec); color: var(--rec-ink); }
button.piccolo { min-height: 36px; padding: 6px 10px; font-size: 0.9rem; font-weight: 500; }
button.link { background: none; border: 0; color: var(--blue); text-decoration: underline; min-height: 0; padding: 4px; font-weight: 500; }
.icona { width: 20px; height: 20px; flex: none; }
.allegati { display: flex; flex-wrap: wrap; gap: 10px; }
.allegati:empty { display: none; }
.miniatura { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.miniatura button { position: absolute; top: 4px; right: 4px; min-height: 28px; width: 28px; padding: 0; border-radius: 999px; background: rgba(8, 16, 30, 0.75); color: #fff; border: 0; font-size: 1rem; }
.clip { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.clip audio { flex: 1; min-width: 0; height: 36px; }
.avviso { border-top-color: var(--azure); display: grid; gap: 10px; }
.avviso.errore { border-top-color: var(--err); }
.avviso p { margin: 0; }
.stato-rete { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.stato-rete::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.stato-rete.offline::before { background: var(--err); }
h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; margin: 24px 0 10px; }
ul.elenco { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.elemento { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.elemento[data-stato="consegnata"] { border-left-color: var(--ok); }
.elemento[data-stato="in-coda"], .elemento[data-stato="invio"] { border-left-color: var(--azure); }
.elemento[data-stato="errore"] { border-left-color: var(--err); }
.elemento .titolo { font-weight: 600; overflow-wrap: anywhere; }
.elemento .meta { font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.elemento .errore { font-size: 0.85rem; color: var(--err); overflow-wrap: anywhere; }
.vuoto { color: var(--muted); font-size: 0.95rem; }
.elenco-azioni { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.elenco-azioni:has(> :not([hidden])) { min-height: 36px; }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 0.95rem;
  max-width: calc(100vw - 32px); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25); z-index: 10;
}
.toast[hidden] { display: none; }
.piede { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 0.85rem; }
.piede form { margin: 0; }
/* Theme selector: three segments, the chosen one filled. */
.tema { display: inline-flex; width: 100%; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tema button { flex: 1; min-height: 40px; border: 0; border-radius: 0; background: var(--surface); color: var(--muted); font-weight: 500; font-size: 0.9rem; padding: 6px 8px; }
.tema button + button { border-left: 1px solid var(--line); }
.tema button[aria-pressed="true"] { background: var(--azure); color: var(--bg); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.accesso { min-height: 100dvh; display: grid; place-items: center; }
.accesso .card { max-width: 420px; display: grid; gap: 14px; }
.accesso h1 { font-family: var(--font-display); font-weight: 600; font-size: 2rem; margin: 0; line-height: 1.1; }
.accesso h1 span { color: var(--azure); font-weight: 400; }
.accesso p { margin: 0; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  button.registra[aria-pressed="true"] .icona { animation: pulsa 1.2s ease-in-out infinite; }
  @keyframes pulsa { 50% { opacity: 0.35; } }
}
