/* Netto — interfaccia
   Carta fredda, inchiostro blu notte, scontrino come unico elemento espressivo. */

@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #EDF0F3;
  --surface: #FFFFFF;
  --ink: #15233B;
  --slate: #586880;
  --line: #D3DAE3;
  --line-soft: #E4E9EF;
  --signal: #2A50D8;
  --signal-ink: #1B3AAE;
  --up: #0B7F57;
  --up-bg: #E3F4EC;
  --down: #BD3731;
  --down-bg: #FBE9E7;
  --thermal: #FDFDFB;
  --thermal-ink: #23262B;
  --r-s: 5px;
  --r-m: 8px;
  --display: "Bricolage", "Plex", system-ui, sans-serif;
  --text: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "PlexMono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.55 var(--text); font-feature-settings: "tnum" 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
img { max-width: 100%; }
a { color: var(--signal-ink); text-underline-offset: 2px; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.01em; }
p { margin: 0 0 .8em; }
small, .small { font-size: 13px; }
.muted { color: var(--slate); }
.up { color: var(--up); }
.down { color: var(--down); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Barra superiore ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 700 21px/1 var(--display); letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { stroke: #fff; stroke-width: 2.6; }
.mainnav { display: flex; gap: 4px; }
.mainnav a { color: var(--slate); text-decoration: none; padding: 7px 11px; border-radius: var(--r-s); font-weight: 500; }
.mainnav a:hover { color: var(--ink); background: var(--paper); }
.mainnav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.search { position: relative; margin-left: auto; width: min(320px, 32vw); }
.search input, .picker input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--paper); font: inherit; color: var(--ink);
}
.search input:focus, .picker input:focus { background: var(--surface); border-color: var(--signal); outline: none; box-shadow: 0 0 0 3px rgba(42, 80, 216, .15); }
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: 0 12px 32px -12px rgba(21, 35, 59, .35); z-index: 30; max-height: 420px; overflow: auto;
}
.search-results li a, .search-results li button {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 10px; align-items: center; width: 100%;
  padding: 8px; border-radius: var(--r-s); color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
}
.search-results li[aria-selected="true"] > *, .search-results li > *:hover { background: var(--paper); }
.search-results img, .search-results .ph { width: 22px; height: 22px; border-radius: 50%; grid-row: span 2; background: var(--line-soft); }
.search-results .sr-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .sr-sym { color: var(--slate); font-size: 12px; }
.search-results .sr-price { text-align: right; font-size: 13px; grid-row: span 2; }
.search-results .sr-empty { padding: 10px; color: var(--slate); }
.account { display: flex; align-items: center; gap: 12px; }
.bell { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink); }
.bell:hover { background: var(--paper); }
.bell svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--down); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 600; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 6px; box-shadow: 0 12px 32px -12px rgba(21, 35, 59, .35); }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: var(--r-s); color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--paper); }
.menu-who { padding: 8px 10px; margin: 0 0 4px; border-bottom: 1px solid var(--line-soft); }

/* ---------- Struttura ---------- */
.page { flex: 1; width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 28px 20px 64px; }
.page-head { margin-bottom: 20px; }
.page-title { font-size: 30px; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: flex-start; }
.crumb { margin: 0 0 4px; font-size: 13px; }
.section { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.sub { font-size: 18px; margin: 28px 0 12px; }
.panel .sub:first-child, .section-head .sub { margin-top: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 20px; }
.split { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 24px; align-items: start; }
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-in { max-width: var(--wrap); margin: 0 auto; padding: 20px; font-size: 13px; color: var(--slate); }
.footer-in p { margin: 0 0 4px; }

/* ---------- Pulsanti e moduli ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 500 15px/1 var(--text); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--slate); color: var(--ink); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn.primary:hover { background: var(--signal-ink); border-color: var(--signal-ink); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--down); border-color: var(--down); color: #fff; }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--signal-ink); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--down); }
.form { display: grid; gap: 14px; }
.form.tight { gap: 10px; }
.form label, .ticket label { display: grid; gap: 5px; font-weight: 500; font-size: 14px; }
.form input:not([type="checkbox"]):not([type="radio"]), .form select, .form textarea, .ticket input:not([type="radio"]), .ticket select, .ticket textarea, .inline-search input {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r-s);
  background: var(--surface); color: var(--ink); font: 400 15px/1.4 var(--text);
}
.form textarea, .ticket textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .ticket input:focus, .ticket select:focus, .ticket textarea:focus {
  outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(42, 80, 216, .15);
}
.form input:disabled { background: var(--paper); color: var(--slate); }
.form label.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; }
.form label.check input { margin-top: 4px; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; display: grid; gap: 12px; margin: 0; background: var(--surface); }
.form legend { font-weight: 600; padding: 0 6px; }
.form h3 { font-size: 15px; margin: 8px 0 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 13px; color: var(--slate); margin: 0; }
.warn { background: #FFF6E0; border-left: 3px solid #C98A00; padding: 8px 12px; border-radius: 0 var(--r-s) var(--r-s) 0; font-size: 14px; }
.inline-search { display: flex; gap: 8px; }
.inline-search input { width: 240px; }

.flash { padding: 11px 14px; border-radius: var(--r-s); margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: var(--up-bg); border-color: #A9DCC4; color: #064D35; }
.flash.error { background: var(--down-bg); border-color: #EFBAB5; color: #7D1F1A; }
.flash.info { background: #E8EEFC; border-color: #BCCBF4; color: #1B2F78; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-m); padding: 32px; text-align: center; }
.empty.small { padding: 20px; }
.empty p { color: var(--slate); }
.big-empty { max-width: 560px; margin: 40px auto; }

/* ---------- Tabelle mercato ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow-x: auto; }
.mkt { width: 100%; border-collapse: collapse; }
.mkt th, .mkt td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.mkt tbody tr:last-child td { border-bottom: 0; }
.mkt th { font-size: 13px; font-weight: 500; color: var(--slate); text-align: left; background: #F7F9FB; white-space: nowrap; position: sticky; top: 0; }
.mkt th.num { text-align: right; }
.mkt th a { color: inherit; text-decoration: none; }
.mkt th a:hover { color: var(--ink); }
.mkt th[aria-sort="ascending"], .mkt th[aria-sort="descending"] { color: var(--ink); }
.mkt th span[aria-hidden] { font-size: 9px; }
.mkt tbody tr:hover { background: #F7F9FB; }
.mkt.compact td { padding: 9px 12px; }
.mkt tr.is-off td { color: var(--slate); }
.coin { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 500; min-width: 0; }
.coin img { border-radius: 50%; flex: none; }
.coin small { color: var(--slate); font-weight: 400; }
a.coin:hover span { text-decoration: underline; }
.star-col { width: 36px; padding-right: 0 !important; }
.star { display: grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; cursor: pointer; color: #A4AFBD; border-radius: 50%; padding: 0; }
.star svg, .star-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.star:hover { color: var(--ink); background: var(--paper); }
.star[aria-pressed="true"], .star-btn[aria-pressed="true"] { color: #C98A00; }
.star[aria-pressed="true"] svg, .star-btn[aria-pressed="true"] svg { fill: #F2B92B; stroke: #C98A00; }
.spark { display: block; }
.spark path { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.spark.up path { stroke: var(--up); }
.spark.down path { stroke: var(--down); }
.spark-empty { display: block; width: 120px; height: 1px; background: var(--line); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form { display: inline-flex; gap: 12px; margin-left: 12px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--slate); text-decoration: none; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 18px; }

/* ---------- Lo scontrino ---------- */
.receipt {
  --tear: 9px;
  position: relative; background: var(--thermal); color: var(--thermal-ink);
  font: 400 13.5px/1.5 var(--mono); padding: 22px 22px calc(18px + var(--tear));
  filter: drop-shadow(0 1px 0 rgba(21, 35, 59, .08)) drop-shadow(0 10px 18px rgba(21, 35, 59, .12));
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tear)) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--tear) * 2) var(--tear) repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - var(--tear)) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--tear) * 2) var(--tear) repeat-x;
}
.r-head { font-weight: 500; font-size: 15px; text-align: center; margin: 0; }
.r-sub { text-align: center; color: #6B6F76; font-size: 12.5px; margin: 2px 0 0; }
.r-lines { margin: 16px 0 0; padding: 12px 0 0; border-top: 1px dashed #9BA0A8; }
.r-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.r-lines dt { color: #3F444B; }
.r-lines dd { margin: 0; text-align: right; white-space: nowrap; }
.r-lines > div.r-rule { border-top: 1px dashed #C4C8CE; margin-top: 6px; padding-top: 9px; }
.r-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 12px 0 0; padding-top: 12px; border-top: 2px solid var(--thermal-ink); }
.r-total strong { font-size: 19px; font-weight: 500; }
.r-foot { font-size: 12px; color: #6B6F76; margin: 12px 0 0; text-align: center; }
.r-foot.up { color: var(--up); }
.r-foot.down { color: var(--down); }
.r-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.r-inputs label { display: grid; gap: 4px; font-size: 12px; color: #4D5259; }
.r-field { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--thermal-ink); }
.r-field input { width: 100%; border: 0; background: transparent; font: 500 20px/1.3 var(--mono); color: var(--thermal-ink); padding: 2px 0; -moz-appearance: textfield; }
.r-field input::-webkit-outer-spin-button, .r-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.r-field input:focus { outline: none; }
.r-field:focus-within { border-bottom-width: 2px; border-color: var(--signal); }
.r-total strong.is-bad { color: var(--down); }
.r-total strong.is-ok { color: var(--up); }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: center; padding: 28px 0 48px; }
.hero h1 { font-size: clamp(36px, 5vw, 58px); line-height: 1.02; letter-spacing: -0.03em; max-width: 13ch; margin-bottom: 20px; }
.lead { font-size: 18px; line-height: 1.55; color: #33435C; max-width: 46ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 12px; }
.hero-actions .btn { height: 46px; padding: 0 20px; font-size: 16px; }
.fineprint { font-size: 13px; color: var(--slate); }
.receipt-hero { max-width: 420px; justify-self: center; width: 100%; transform: rotate(1.2deg); animation: print .9s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes print { from { opacity: 0; transform: translateY(-18px) rotate(0deg); } to { opacity: 1; transform: rotate(1.2deg); } }
.steps-band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 32px 0; }
.steps-band h2 { font-size: 22px; margin-bottom: 20px; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.steps li { counter-increment: s; display: grid; gap: 6px; align-content: start; }
.steps li::before { content: counter(s); font: 700 15px/1 var(--display); width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; margin-bottom: 6px; }
.steps strong { font-size: 16px; }
.steps span { color: var(--slate); font-size: 14.5px; }

/* ---------- Scheda moneta ---------- */
.coin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.coin-id { display: flex; gap: 14px; align-items: center; }
.coin-id img { border-radius: 50%; }
.coin-id h1 { font-size: 28px; margin: 0; }
.coin-id h1 small { font: 500 16px var(--text); color: var(--slate); }
.coin-id p { margin: 2px 0 0; font-size: 13px; }
.coin-grid { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.price-line { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.price-big { font: 700 40px/1 var(--display); letter-spacing: -0.02em; margin: 0; }
.chg { font-size: 17px; font-weight: 500; margin: 0; }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 12px 8px; }
.chart-bar { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.chart-bar button { border: 0; background: none; padding: 6px 10px; border-radius: var(--r-s); font: 500 13px var(--text); color: var(--slate); cursor: pointer; }
.chart-bar button:hover { color: var(--ink); background: var(--paper); }
.chart-bar button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chart-delta { margin-left: auto; font-size: 13px; font-weight: 500; }
.chart-box { position: relative; height: 340px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--slate); margin: 0; pointer-events: none; }
.chart-tip { position: absolute; top: 6px; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 9px; border-radius: var(--r-s); font-size: 12.5px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.stats > div { padding: 12px 14px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stats > div:nth-child(3n) { border-right: 0; }
.stats > div:nth-last-child(-n+3) { border-bottom: 0; }
.stats dt { font-size: 13px; color: var(--slate); }
.stats dd { margin: 2px 0 0; font-weight: 500; font-size: 16px; }
.range24 { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; margin-top: 16px; font-size: 13px; }
.range24 small { grid-column: 1 / -1; text-align: center; }
.range-track { position: relative; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--down), #D9DEE5 50%, var(--up)); }
.range-track i { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--ink); transform: translate(-50%, -50%); }
.coin-side { display: grid; gap: 16px; position: sticky; top: 76px; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; display: grid; gap: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: var(--r-s); padding: 3px; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 8px; border-radius: 4px; cursor: pointer; font-weight: 500; color: var(--slate); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(21, 35, 59, .15); }
.seg input[value="buy"]:checked + span { color: var(--up); }
.seg input[value="sell"]:checked + span { color: var(--down); }
.seg input:focus-visible + span { outline: 2px solid var(--signal); }
.quick { display: flex; gap: 6px; margin-top: 6px; }
.quick button { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-s); padding: 5px; font: 500 13px var(--text); cursor: pointer; color: var(--slate); }
.quick button:hover { color: var(--ink); border-color: var(--slate); }
.receipt-ticket { padding: 16px 16px calc(14px + var(--tear)); font-size: 12.5px; margin: 4px -4px 4px; }
.receipt-ticket .r-lines { margin-top: 10px; padding-top: 8px; }
.mini-trades { list-style: none; margin: 0; padding: 0; }
.mini-trades li a { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; font-size: 14px; }
.mini-trades li a:hover { background: #F7F9FB; }
.side { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.side.buy { background: var(--up-bg); color: var(--up); }
.side.sell { background: var(--down-bg); color: var(--down); }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.plain li:last-child { border-bottom: 0; }

/* ---------- Situazione ---------- */
.ports { display: grid; gap: 16px; }
.port { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.port-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.port-head h2 { font-size: 19px; margin: 0; }
.port-head h2 a { color: var(--ink); text-decoration: none; }
.port-head h2 a:hover { text-decoration: underline; }
.port-head p { margin: 0; font-size: 13px; }
.port-body { display: grid; grid-template-columns: 1fr 1.3fr 1.1fr; gap: 28px; padding: 16px 20px 18px; align-items: start; }
.label-s { font-size: 13px; color: var(--slate); margin: 0 0 4px; }
.big { font: 700 32px/1.05 var(--display); letter-spacing: -0.02em; margin: 0 0 4px; }
.port-net p:last-child { font-weight: 500; margin: 0; }
.port-lines { margin: 0; }
.port-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dotted var(--line); font-size: 14px; }
.port-lines dt { color: var(--slate); }
.port-lines dd { margin: 0; font-weight: 500; }
.port-target p { margin: 0 0 8px; font-size: 14px; }
.port-target strong { font-size: 18px; }
.meter { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.port-foot { display: flex; justify-content: space-between; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--line-soft); font-size: 14px; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.coin-list { list-style: none; margin: 0; padding: 0; }
.coin-list a { display: grid; grid-template-columns: 1fr auto 76px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); font-size: 14px; }
.coin-list li:last-child a { border-bottom: 0; }
.coin-list a:hover .coin span { text-decoration: underline; }
.dash-grid .hint { margin-top: 10px; }
.pop-form { position: relative; }
.pop-form summary { list-style: none; }
.pop-form summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; box-shadow: 0 12px 32px -12px rgba(21, 35, 59, .35); z-index: 10; }

/* ---------- Portafoglio ---------- */
.port-detail { display: grid; grid-template-columns: 380px 1fr; gap: 28px; align-items: start; }
.port-detail .sub:first-child { margin-top: 0; }
.receipt-summary { position: sticky; top: 76px; }

/* ---------- Diario ---------- */
.journal { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.j-item details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.j-item.is-focus details { border-color: var(--ink); }
.j-item summary { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 12px 16px; cursor: pointer; list-style: none; }
.j-item summary::-webkit-details-marker { display: none; }
.j-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.j-title img { border-radius: 50%; }
.j-meta { font-size: 13px; }
.j-body { display: grid; grid-template-columns: 340px 1fr; gap: 28px; padding: 8px 16px 20px; }
.j-notes h3 { font-size: 14px; font-family: var(--text); font-weight: 600; margin: 14px 0 4px; }
.j-notes h3:first-child { margin-top: 4px; }
.receipt-trade { font-size: 12.5px; }

/* ---------- Varie ---------- */
.auth { max-width: 420px; margin: 24px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 28px; }
.auth-links { display: flex; justify-content: space-between; margin: 16px 0 0; font-size: 14px; }
.notes { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.notes li { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.notes li:last-child { border-bottom: 0; }
.notes li.unread { box-shadow: inset 3px 0 0 var(--signal); }
.notes p { margin: 0 0 2px; }
.n-title { font-weight: 600; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.danger-zone { border-color: #EFBAB5; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.kpis > div { padding: 16px 18px; border-right: 1px solid var(--line-soft); }
.kpis > div:last-child { border-right: 0; }
.kpis dt { font-size: 13px; color: var(--slate); }
.kpis dd { margin: 4px 0; font: 700 26px/1 var(--display); }
.kpis small { color: var(--slate); display: block; margin-bottom: 8px; }
.code { background: var(--ink); color: #E6ECF5; padding: 10px 12px; border-radius: var(--r-s); font: 13px/1.5 var(--mono); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.plain-dl { margin: 12px 0 0; }
.plain-dl > div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dotted var(--line); font-size: 14px; }
.plain-dl dd { margin: 0; }
.prose { max-width: 68ch; }
.prose h2 { font-size: 19px; margin-top: 28px; }
.narrow { max-width: 640px; margin: 0 auto; padding: 32px 20px; }
.checks { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-bottom: 20px; }
.picker { position: relative; display: grid; gap: 5px; }
.picker label { font-weight: 500; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .mainnav a { padding: 7px 8px; }
  .hide-m { display: none; }
  .port-body { grid-template-columns: 1fr 1fr; }
  .port-target { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .topbar-in { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px 16px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; }
  .search { order: 4; width: 100%; margin-left: 0; }
  .account { margin-left: auto; }
  .hero, .coin-grid, .port-detail, .split, .settings, .j-body { grid-template-columns: 1fr; }
  .hero { gap: 36px; }
  .coin-side, .receipt-summary { position: static; }
  .steps { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis > div:nth-child(2) { border-right: 0; }
  .kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}
@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .page { padding: 20px 14px 48px; }
  .hide-s { display: none; }
  .page-title { font-size: 25px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div { border-right: 1px solid var(--line-soft) !important; border-bottom: 1px solid var(--line-soft) !important; }
  .stats > div:nth-child(2n) { border-right: 0 !important; }
  .port-body { grid-template-columns: 1fr; gap: 18px; }
  .steps { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .chart-box { height: 260px; }
  .price-big { font-size: 32px; }
  .j-item summary { grid-template-columns: auto 1fr auto; }
  .j-meta { display: none; }
  .mini-trades li a { grid-template-columns: auto 1fr auto; }
  .mini-trades li a .muted { display: none; }
  .receipt-hero { transform: none; animation: none; }
  .pop-body { right: auto; left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
