/* Apple-style dark interface: black background, grouped cards, one accent colour.
   Green only says «online», blue is for actions and «Lavora», orange only for what needs you. */
:root {
  --bg: #000; --card: #1C1C1E; --card2: #2C2C2E; --card3: #3A3A3C;
  --ink: #FFFFFF; --sec: rgba(235, 235, 245, .66); --ter: rgba(235, 235, 245, .52);
  --sep: rgba(84, 84, 88, .55); --fill: rgba(118, 118, 128, .24); --bar: rgba(0, 0, 0, .72);
  --tint: #0A84FF; --green: #30D158; --orange: #FF9F0A; --grey: #8E8E93;
  --blue: var(--tint); --amber: var(--orange);
  --f: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --fm: ui-monospace, "SF Mono", Menlo, monospace;
  --r: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font: 17px/1.4 var(--f); -webkit-font-smoothing: antialiased; padding-bottom: env(safe-area-inset-bottom); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 10px; }
svg.i { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }
a { color: var(--tint); }
.blue { color: var(--tint); } .orange { color: var(--orange); } .green { color: var(--green); } .grey { color: var(--grey); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep);
}
.topbar-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sec); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); }
.live.ok .live-dot { background: var(--green); }
.live.err { color: var(--orange); }
.live.err .live-dot { background: var(--orange); }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--fill); color: var(--sec); display: grid; place-items: center; font-size: 16px; flex: none; }

/* ---------- page: one column ---------- */
.wrap { max-width: 640px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) 80px max(20px, env(safe-area-inset-left)); }
.hero { padding: 26px 0 18px; }
.hero h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.hero .sub { font-size: 17px; color: var(--sec); margin: 6px 0 0; }

/* ---------- lists of rows (iOS grouped) ---------- */
.list { background: var(--card); border-radius: 12px; overflow: hidden; }
.list:empty { display: none; }
.list > * + * .row, .list > .row + .row { border-top: .5px solid var(--sep); }
.row {
  width: 100%; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 11px 14px 11px 16px;
  border: 0; background: none; color: inherit; text-align: left;
}
button.row:active { background: var(--card3); }
.row > svg.i { color: var(--ter); font-size: 18px; }
.row.static { min-height: 54px; }
.row-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.row-title { font-size: 17px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 14px; color: var(--sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.static .row-title { font-weight: 400; }
.list.attn { margin-bottom: 18px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 45%, transparent); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--grey); }
.dot.green { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
.dot.orange { background: var(--orange); }

/* ---------- one card per Mac ---------- */
.macs { display: grid; gap: 16px; }
.mac { background: var(--card); border-radius: 20px; padding: 18px; display: grid; gap: 14px; min-width: 0; }
.mac .list { background: var(--card2); }
.mac-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; }
.mac-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mac-state { font-size: 15px; font-weight: 600; color: var(--sec); white-space: nowrap; }
.mac-acc { grid-column: 2 / 4; font-size: 15px; color: var(--sec); }
.mac-note { grid-column: 2 / 4; margin: 0; font-size: 15px; color: var(--sec); }
.mac-state.green { color: var(--green); }
.mac-note.blue { color: var(--tint); } .mac-note.orange { color: var(--orange); }
.mac.off .mac-name { color: var(--sec); }
.warn-t { color: var(--orange); }
.mac-label { font-size: 13px; font-weight: 600; color: var(--sec); text-transform: uppercase; letter-spacing: .04em; margin: 4px 4px -6px; }
.mac-label:empty, .mac-more:empty, .mac-foot:empty { display: none; }
.link { border: 0; background: none; color: var(--tint); font-size: 16px; padding: 0 4px; min-height: 44px; display: inline-flex; align-items: center; text-align: left; }

/* ---------- blocks below the Macs ---------- */
.area { display: grid; gap: 10px; margin-top: 30px; min-width: 0; }
.block-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 8px; }
.block-title .n { font-size: 13px; font-weight: 600; color: var(--sec); background: var(--fill); border-radius: 99px; padding: 1px 8px; }
.perche { margin: -2px 2px 0; font-size: 14px; color: var(--sec); }

/* «Dettagli tecnici» on the page and in the sheets */
.tech { margin-top: 36px; border-top: .5px solid var(--sep); }
.tech > summary, .fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  font-size: 17px; color: var(--sec); padding: 16px 2px;
}
.tech > summary::-webkit-details-marker, .fold > summary::-webkit-details-marker { display: none; }
.tech > summary::after, .fold > summary::after { content: "›"; font-size: 22px; color: var(--ter); transition: transform .15s; }
.tech[open] > summary::after, .fold[open] > summary::after { transform: rotate(90deg); }
.tech > .area:first-of-type { margin-top: 6px; }
.fold { border-top: .5px solid var(--sep); margin-top: 18px; }
.fold > summary { font-size: 16px; padding: 14px 2px; }
.fold[open] { display: grid; gap: 10px; padding-bottom: 6px; }
.tech-actions { margin-top: 6px; }

/* ---------- chat sheet ---------- */
.label { font-size: 13px; font-weight: 600; color: var(--sec); text-transform: uppercase; letter-spacing: .04em; margin: 18px 4px 8px; }
.label:first-child { margin-top: 4px; }
.bubble { background: var(--card); border-radius: 18px; padding: 14px 16px; font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.mine { background: color-mix(in srgb, var(--tint) 22%, var(--card)); }
.note { margin: 14px 4px 0; font-size: 15px; color: var(--sec); line-height: 1.45; }
.composer { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.composer textarea {
  font: 17px/1.4 var(--f); color: var(--ink); background: var(--card); border: 1px solid var(--sep); border-radius: 16px;
  padding: 12px 14px; width: 100%; min-height: 96px; resize: vertical;
}
.composer textarea:focus { outline: none; border-color: var(--tint); }

/* ---------- buttons, forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--fill); color: var(--tint);
  padding: 10px 16px; border-radius: 12px; font-size: 16px; font-weight: 600; min-height: 44px; text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { opacity: .7; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--tint); color: #fff; }
.btn.danger { background: var(--orange); color: #000; }
.btn.ghost-danger { color: var(--orange); }
.btn.block { width: 100%; min-height: 52px; font-size: 17px; border-radius: 14px; }
.btn.small { min-height: 40px; padding: 4px 12px; font-size: 14px; }

.actions { display: grid; gap: 10px; background: var(--card); border-radius: var(--r); padding: 14px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-note { font-size: 14px; color: var(--sec); }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; font-size: 14px; }
.field > span { color: var(--sec); font-weight: 600; margin-left: 4px; }
.field small { color: var(--ter); font-size: 13px; }
.field input, .field select, .field textarea, .actions textarea, .add-row select, .add-row textarea {
  font: 17px var(--f); color: var(--ink); background: var(--card); border: 1px solid var(--sep); border-radius: 12px; padding: 12px 14px; width: 100%; min-height: 50px;
}
.field textarea, .actions textarea, .add-row textarea { min-height: 110px; resize: vertical; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus, .actions textarea:focus, .add-row select:focus, .add-row textarea:focus { outline: none; border-color: var(--tint); }
.risk { font-size: 14px; color: var(--orange); }
.form-error { font-size: 14px; color: var(--orange); }
.add-row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.add-row textarea { grid-column: 1 / 3; }
.cmd { margin: 0; background: var(--fill); border-radius: 10px; padding: 10px 12px; font: 12px/1.5 var(--fm); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.mono { font-family: var(--fm); font-size: 13px; }
.empty { background: var(--card); border-radius: var(--r); padding: 22px 16px; color: var(--sec); font-size: 16px; display: grid; gap: 4px; }
.empty b { color: var(--ink); }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 20; animation: fade .18s ease; }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; top: max(12px, env(safe-area-inset-top)); margin: 0 auto; max-width: 640px;
  background: #0E0E10; border-radius: 14px 14px 0 0; display: flex; flex-direction: column;
  animation: rise .24s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
}
@media (min-width: 900px) {
  .sheet { top: 40px; bottom: 40px; border-radius: 18px; }
  .sheet-grip { display: none; }
}
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--card3); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 20px 14px; border-bottom: .5px solid var(--sep); }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.sheet-kicker { font-size: 15px; color: var(--sec); margin-top: 4px; }
.sheet-body { overflow-y: auto; padding: 16px 20px 32px; -webkit-overflow-scrolling: touch; display: grid; gap: 0; align-content: start; flex: 1; }
#sheet-reply, #sheet-actions, #project-body, #task-body { display: grid; gap: 0; }
.icon-btn { border: 0; background: var(--fill); color: var(--sec); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 15px; height: 15px; }
.sheet-section { font-size: 13px; font-weight: 600; color: var(--sec); text-transform: uppercase; letter-spacing: .04em; padding: 18px 4px 8px; }

.kv { margin: 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; font-size: 15px; position: relative; }
.kv > div + div::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: .5px solid var(--sep); }
.kv dt { color: var(--ink); flex: none; }
.kv dd { margin: 0; color: var(--sec); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.prompt-box { background: var(--card); border-radius: var(--r); padding: 12px 14px; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.timeline li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; font-size: 14px; padding: 10px 14px; position: relative; }
.timeline li + li::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; border-top: .5px solid var(--sep); }
.t-icon { width: 26px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--fill); color: var(--sec); }
.t-user .t-icon { background: color-mix(in srgb, var(--tint) 25%, transparent); color: var(--tint); }
.t-text { overflow-wrap: anywhere; }
.t-tool .t-text { font-family: var(--fm); font-size: 12px; color: var(--sec); }
.t-tool b { color: var(--ink); font-weight: 600; }
.t-time { display: block; font-size: 11px; color: var(--ter); margin-top: 2px; }
pre.logs { background: var(--card); border-radius: 10px; padding: 10px 12px; font-size: 12px; overflow-x: auto; white-space: pre-wrap; }

/* ---------- technical lists (unchanged functions, quieter look) ---------- */
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; flex: 1 1 240px; max-width: 360px; }
.segmented button { border: 0; background: none; border-radius: 7px; padding: 6px 10px; min-height: 40px; font-size: 14px; font-weight: 600; }
.segmented button[aria-selected="true"] { background: var(--card3); }
.chips { display: flex; gap: 6px; }
.chip { border: 0; background: var(--card); font: 600 14px var(--f); border-radius: 99px; padding: 6px 12px; min-height: 40px; }
.chip.on { background: var(--tint); color: #fff; }
.sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.session { width: 100%; text-align: left; border: 0; color: inherit; background: var(--card); border-radius: 12px; border-left: 3px solid var(--c, var(--card3)); padding: 12px 14px; display: grid; gap: 6px; min-width: 0; }
.session.is-ended .s-title { color: var(--sec); }
.st-working { --c: var(--tint); } .st-waiting { --c: var(--orange); } .st-failed { --c: var(--orange); }
.s-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.s-title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-time { font-size: 12px; color: var(--ter); white-space: nowrap; }
.s-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.s-where { font-size: 13px; color: var(--sec); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-activity { font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.s-activity .role { display: inline-block; font: 600 11px var(--f); color: var(--sec); background: var(--fill); border-radius: 5px; padding: 1px 5px; margin-right: 6px; }
.s-foot { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ter); }
.s-foot span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; color: var(--c, var(--sec)); background: color-mix(in srgb, var(--c, var(--grey)) 16%, transparent); white-space: nowrap; }
.badge .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.warn { --c: var(--orange); }
.badge.ok { --c: var(--green); }

.gruppo { background: var(--card); border-radius: 12px; overflow: hidden; }
.riga { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 14px; position: relative; align-items: start; width: 100%; border: 0; background: none; text-align: left; color: inherit; }
.riga + .riga::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; border-top: .5px solid var(--sep); }
.ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; color: var(--c, var(--sec)); background: color-mix(in srgb, var(--c, var(--grey)) 18%, transparent); grid-row: span 3; }
.ico.blue { --c: var(--tint); } .ico.amber { --c: var(--orange); }
.r-t { font-size: 16px; font-weight: 600; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.r-s { grid-column: 2 / 4; font-size: 14px; color: var(--sec); min-width: 0; overflow-wrap: anywhere; }
.r-s.q { color: var(--ter); font-size: 13px; }
.r-s.err { color: var(--orange); }
.r-end { align-self: center; display: flex; align-items: center; gap: 6px; color: var(--ter); }
.r-next { grid-column: 2 / 4; font-size: 15px; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.r-next span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.riga .actions-row { grid-column: 2 / 4; margin-top: 8px; }
.riga .form { grid-column: 1 / 4; }
.meter { grid-column: 2 / 4; height: 4px; border-radius: 4px; background: var(--fill); overflow: hidden; margin: 6px 0 2px; }
.meter > span { display: block; height: 100%; background: var(--grey); border-radius: 4px; }
.meter.warn > span, .meter.hot > span { background: var(--orange); }
.prio { font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 5px; background: var(--fill); color: var(--sec); text-transform: uppercase; letter-spacing: .03em; flex: none; }
.prio.alta { color: var(--orange); background: color-mix(in srgb, var(--orange) 16%, transparent); }
.hint { font-size: 15px; color: var(--sec); background: var(--card); border-radius: 12px; padding: 12px 14px; }
.tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--fill); color: var(--sec); }

.mem-list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 12px; overflow: hidden; }
.mem-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: 15px; padding: 11px 14px; position: relative; }
.mem-list li + li::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: .5px solid var(--sep); }
.mem-list .prio { margin-right: 6px; vertical-align: 1px; }
.mem-meta { display: block; font-size: 13px; color: var(--ter); margin-top: 2px; }
.mem-actions { display: flex; gap: 4px; align-items: center; }
.mem-actions select { font: 13px var(--f); background: var(--fill); color: var(--ink); border: 0; border-radius: 8px; padding: 4px 6px; }
.icon-x { border: 0; background: transparent; color: var(--ter); font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 8px; }
.mem-text { white-space: pre-wrap; font-size: 15px; background: var(--card); border-radius: 12px; padding: 12px 14px; overflow-wrap: anywhere; }
.empty-line { font-size: 15px; color: var(--ter); background: var(--card); border-radius: 12px; padding: 11px 14px; }
.brief-box { width: 100%; min-height: 50vh; font: 13px/1.45 var(--fm); color: var(--ink); background: var(--card); border: 0; border-radius: 12px; padding: 12px; }

/* ---------- confirm (iOS alert), toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 24px; animation: fade .15s ease; }
.modal { width: min(380px, 100%); background: #2A2A2C; border-radius: 18px; padding: 22px 20px 16px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); animation: pop .18s ease; }
.modal h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.modal p { margin: 0 0 12px; color: var(--sec); font-size: 15px; line-height: 1.45; }
.quote { margin: 0; text-align: left; background: rgba(0, 0, 0, .3); border-radius: 12px; padding: 10px 12px; font: 14px/1.45 var(--f); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30vh; overflow-y: auto; color: var(--ink); }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.modal-actions .btn { min-height: 48px; }
.toasts { position: fixed; z-index: 50; left: 16px; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; max-width: 480px; width: 100%; background: #2A2A2C; border-radius: 14px; padding: 13px 16px; font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); animation: rise .18s ease; }
.toast.error { background: var(--orange); color: #000; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes pop { from { transform: scale(1.06); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- login, public pages ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); background: var(--card); border-radius: 20px; padding: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 19px; margin-bottom: 4px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--tint); color: #fff; display: grid; place-items: center; font-size: 16px; }
.login-card .sub { margin: -6px 0 4px; font-size: 15px; color: var(--sec); }
.doc { max-width: 720px; margin: 0 auto; padding: 32px 20px 48px; line-height: 1.6; }
.doc h1 { font-size: 30px; letter-spacing: -.01em; margin: 0 0 12px; }
.doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc ul { padding-left: 20px; }
.doc code { font: 13px var(--fm); background: var(--fill); border-radius: 5px; padding: 0 4px; }
.doc .muted { color: var(--sec); font-size: 14px; }

/* ---------- search: one field under the title, results replace the home until «Annulla» ---------- */
.search { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--fill); border-radius: 12px; padding: 0 12px; min-height: 44px; color: var(--sec); }
.search-box svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: 17px var(--f); padding: 10px 0; outline: none; }
.search-box input::placeholder { color: var(--sec); }
.search-box:focus-within { box-shadow: 0 0 0 2px var(--tint); }
.search-cancel { border: 0; background: none; color: var(--tint); font: 17px var(--f); min-height: 44px; padding: 0 2px; }
#results { display: grid; gap: 12px; }
#results[hidden] { display: none; }
.filters { display: grid; gap: 10px; }
.filters .segmented { max-width: none; width: 100%; }
.filters .segmented button { min-height: 44px; font-size: 15px; }
.filter-row { display: flex; gap: 10px; }
.filter-row select { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; border: 0; background: var(--card); color: var(--ink); font: 16px var(--f); padding: 0 12px; }
.filter-row select[hidden] { display: none; }
.results-n { margin: 2px 4px 0; font-size: 15px; color: var(--sec); }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--tint); background: color-mix(in srgb, var(--tint) 18%, transparent); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }
.link-t { color: var(--tint); font-weight: 500; }
.more-row { justify-content: center; }
.row-title.multi, .row-sub.multi { white-space: normal; overflow-wrap: anywhere; }
.from { display: block; margin: 0 4px 6px; font-size: 15px; }
.dot.blue { background: var(--tint); }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } }
.sheet-back { align-self: flex-start; border: 0; background: none; color: var(--tint); font: 17px var(--f); min-height: 44px; padding: 4px 16px 0; }
.sheet-back[hidden] { display: none; }
.row-main { grid-template-columns: minmax(0, 1fr); }

/* a focus ring for keyboards and switch control, never for taps */
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.search-box input:focus-visible { outline: none; }
.bubble.md code { font: 14px var(--fm); background: var(--fill); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.bubble.md .md-h { display: block; font-size: 17px; margin-top: 4px; }
.filters .segmented button { white-space: nowrap; padding: 6px 4px; }
#confirm-text { white-space: pre-line; text-align: left; }
.sheet-body .btn.block { margin-top: 12px; }
.sheet-body .btn.block + .btn.block { margin-top: 10px; }
