/* Treno Copilot – interfaccia frontend. Tutto è confinato sotto .tcx per non toccare il tema. */

.tcx {
	--bg: #f5f3ee;
	--bg-2: #ffffff;
	--card: #ffffff;
	--card-2: #f0ede6;
	--ink: #14161b;
	--ink-2: #4a4f5a;
	--ink-3: #858b96;
	--line: rgba(20, 22, 27, .09);
	--line-2: rgba(20, 22, 27, .16);
	--accent: #b8792a;
	--accent-ink: #ffffff;
	--accent-soft: rgba(184, 121, 42, .12);
	--ok: #1f8a5b;
	--warn: #c27a00;
	--bad: #c2412d;
	--teal: #0f7c86;
	--shadow: 0 1px 2px rgba(20, 22, 27, .05), 0 12px 32px -12px rgba(20, 22, 27, .18);
	--glow: 0 0 0 0 transparent;
	--tab-on: #ffffff;
	--r: 20px;
	--r-sm: 12px;
	--font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
.tcx[data-t="dark"] {
	--bg: #0b0d12;
	--bg-2: #11141b;
	--card: #151922;
	--card-2: #1c212c;
	--ink: #f3efe7;
	--ink-2: #b9b5ad;
	--ink-3: #7d8290;
	--line: rgba(255, 255, 255, .07);
	--line-2: rgba(255, 255, 255, .14);
	--accent: #e8b86d;
	--accent-ink: #1a1307;
	--accent-soft: rgba(232, 184, 109, .13);
	--ok: #4cc38a;
	--warn: #f0b429;
	--bad: #ff7a66;
	--teal: #4fd1dc;
	--shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -20px rgba(0, 0, 0, .7);
	--glow: 0 0 60px -10px rgba(232, 184, 109, .45);
	--tab-on: #2a303d;
}

.tcx, .tcx * { box-sizing: border-box; }
.tcx {
	font-family: var(--font);
	color: var(--ink);
	background: var(--bg);
	border-radius: var(--r);
	line-height: 1.45;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	position: relative;
	overflow: hidden;
	isolation: isolate;
}
.tcx :where(button, input, select) { font: inherit; color: inherit; }
.tcx :where(button) { cursor: pointer; background: none; border: 0; padding: 0; }
.tcx :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.tcx .num { font-variant-numeric: tabular-nums; }
.tcx .muted { color: var(--ink-3); }
.tcx .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

body.tcx-standalone { margin: 0; background: #0b0d12; }
@media (prefers-color-scheme: light) { body.tcx-standalone { background: #f5f3ee; } }
body.tcx-standalone .tcx { border-radius: 0; min-height: 100vh; min-height: 100dvh; }

/* Sfondo atmosferico */
.tcx::before {
	content: ""; position: absolute; inset: -20% -10% auto; height: 520px; z-index: -1; pointer-events: none;
	background:
		radial-gradient(600px 300px at 20% 0%, var(--accent-soft), transparent 70%),
		radial-gradient(500px 260px at 90% 10%, rgba(79, 209, 220, .08), transparent 70%);
}

.tcx-boot { min-height: 240px; }
.tcx-wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 96px; }
body.tcx-standalone .tcx-wrap { padding-top: max(20px, env(safe-area-inset-top)); }

/* Barra superiore */
.tcx-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.tcx-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; font-size: 17px; }
.tcx-logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
.tcx-logo svg { width: 18px; height: 18px; }
.tcx-top .sp { flex: 1; }
.tcx-pill { font-size: 12px; font-weight: 600; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }
.tcx-pill.demo { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.tcx-icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line); background: var(--card); }
.tcx-icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.tcx-icon-btn svg { width: 18px; height: 18px; }

/* Schede */
.tcx-tabs { display: flex; gap: 4px; padding: 4px; background: var(--card-2); border-radius: 14px; margin-bottom: 24px; border: 1px solid var(--line); }
.tcx-tabs button { flex: 1; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s, color .2s; }
.tcx-tabs button svg { width: 16px; height: 16px; }
.tcx-tabs button[aria-selected="true"] { background: var(--tab-on); color: var(--ink); box-shadow: var(--shadow); }
@media (max-width: 560px) {
	body.tcx-standalone .tcx-tabs {
		position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20; margin: 0;
		backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: color-mix(in srgb, var(--card-2) 82%, transparent);
	}
}

/* Hero vocale */
.tcx-hero { text-align: center; padding: 18px 0 8px; }
.tcx-hero h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700; margin: 0 0 8px; }
.tcx-hero p { margin: 0 auto; color: var(--ink-2); max-width: 440px; }
.tcx-mic-wrap { position: relative; width: 132px; height: 132px; margin: 26px auto 6px; display: grid; place-items: center; }
.tcx-mic {
	position: relative; z-index: 2; width: 96px; height: 96px; border-radius: 50%;
	background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--accent) 70%, #fff) 0%, var(--accent) 55%, color-mix(in srgb, var(--accent) 70%, #000) 100%);
	color: var(--accent-ink); display: grid; place-items: center;
	box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--accent) 70%, transparent), var(--glow);
	transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.tcx-mic:hover { transform: scale(1.04); }
.tcx-mic:active { transform: scale(.97); }
.tcx-mic svg { width: 36px; height: 36px; }
.tcx-mic-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; }
.tcx.is-listening .tcx-mic-ring { animation: tcx-ring 1.8s cubic-bezier(.2, .6, .3, 1) infinite; }
.tcx.is-listening .tcx-mic-ring:nth-child(2) { animation-delay: .6s; }
.tcx.is-listening .tcx-mic-ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes tcx-ring { from { transform: scale(.72); opacity: .7; } to { transform: scale(1.35); opacity: 0; } }
.tcx-wave { display: flex; gap: 4px; justify-content: center; align-items: center; height: 28px; opacity: 0; transition: opacity .2s; }
.tcx.is-listening .tcx-wave { opacity: 1; }
.tcx-wave i { width: 4px; border-radius: 4px; background: var(--accent); height: 6px; animation: tcx-wave 1s ease-in-out infinite; }
.tcx-wave i:nth-child(2n) { animation-delay: -.3s; } .tcx-wave i:nth-child(3n) { animation-delay: -.6s; } .tcx-wave i:nth-child(5n) { animation-delay: -.15s; }
@keyframes tcx-wave { 0%, 100% { height: 6px; } 50% { height: 26px; } }
.tcx-transcript { min-height: 28px; font-size: 19px; letter-spacing: -.01em; color: var(--ink); max-width: 560px; margin: 6px auto 0; }
.tcx-transcript.interim { color: var(--ink-3); }
.tcx-hint { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

.tcx-ask { display: flex; gap: 8px; margin: 22px auto 0; max-width: 560px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.tcx-ask input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; outline: none; font-size: 16px; }
.tcx-ask input::placeholder { color: var(--ink-3); }
.tcx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 12px; font-weight: 650; font-size: 15px; background: var(--ink); color: var(--bg); transition: transform .15s, opacity .15s; white-space: nowrap; }
.tcx-btn:hover { opacity: .92; }
.tcx-btn:active { transform: scale(.98); }
.tcx-btn.accent { background: var(--accent); color: var(--accent-ink); }
.tcx-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.tcx-btn.block { width: 100%; padding: 15px; font-size: 16px; }
.tcx-btn[disabled] { opacity: .45; pointer-events: none; }
.tcx-btn svg { width: 18px; height: 18px; }
.tcx-examples { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.tcx-chip { font-size: 13px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); transition: border-color .15s, color .15s; }
.tcx-chip:hover { color: var(--ink); border-color: var(--line-2); }

/* Card */
.tcx-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.tcx-card + .tcx-card { margin-top: 14px; }
.tcx-section { margin-top: 26px; animation: tcx-in .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes tcx-in { from { opacity: 0; transform: translateY(10px); } }
.tcx-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.tcx-h .sp { flex: 1; }
.tcx-h button { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--accent); font-size: 13px; }

/* Parametri capiti */
.tcx-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.tcx-swap { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; margin-bottom: 4px; color: var(--ink-2); }
.tcx-swap svg { width: 16px; height: 16px; }
.tcx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tcx-field > span { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; }
.tcx-field input, .tcx-field select {
	width: 100%; border: 1px solid var(--line-2); background: var(--bg-2); border-radius: var(--r-sm); padding: 11px 12px; outline: none; min-height: 46px;
	transition: border-color .15s, box-shadow .15s;
}
.tcx-field input:focus, .tcx-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tcx-field.big input { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.tcx-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
@media (min-width: 620px) { .tcx-grid.g4 { grid-template-columns: 1.5fr 1.5fr 1fr 1fr; } }
.tcx-stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); min-height: 46px; }
.tcx-stepper button { width: 40px; height: 44px; font-size: 20px; color: var(--ink-2); }
.tcx-stepper output { flex: 1; text-align: center; font-weight: 650; }
.tcx-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.tcx-seg button { padding: 9px 13px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--ink-2); background: var(--bg-2); }
.tcx-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tcx-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.tcx-switch { width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.tcx-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.tcx-switch[aria-checked="true"] { background: var(--ok); }
.tcx-switch[aria-checked="true"]::after { transform: translateX(18px); }
.tcx-row { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.tcx-row .sp { flex: 1; }
details.tcx-more summary { cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 14px; display: inline-flex; gap: 6px; align-items: center; }
details.tcx-more summary::-webkit-details-marker { display: none; }
details.tcx-more summary::before { content: "+"; width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 14px; }
details.tcx-more[open] summary::before { content: "−"; }

/* Risultati */
.tcx-summary { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--ink-2); font-size: 14px; margin-bottom: 14px; }
.tcx-summary strong { color: var(--ink); }
.tcx-res { position: relative; padding: 0; overflow: hidden; transition: transform .2s, border-color .2s; }
.tcx-res + .tcx-res { margin-top: 12px; }
.tcx-res.top { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: var(--shadow), var(--glow); }
.tcx-res-main { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 18px 20px; width: 100%; text-align: left; }
.tcx-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tcx-badge { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 4px 9px; border-radius: 999px; background: var(--card-2); color: var(--ink-2); }
.tcx-badge.best { background: var(--accent); color: var(--accent-ink); }
.tcx-badge.fast { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }
.tcx-badge.cheap { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tcx-badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.tcx-times { display: flex; align-items: center; gap: 12px; }
.tcx-time { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.tcx-line { flex: 1; min-width: 40px; height: 2px; background: var(--line-2); position: relative; border-radius: 2px; }
.tcx-line i { position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink-3); transform: translate(-50%, -50%); }
.tcx-line::before, .tcx-line::after { content: ""; position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: translateY(-50%); }
.tcx-line::before { left: -2px; } .tcx-line::after { right: -2px; }
.tcx-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.tcx-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tcx-meta svg { width: 14px; height: 14px; opacity: .8; }
.tcx-price { text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.tcx-price b { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.tcx-price small { font-size: 12px; color: var(--ink-3); }
.tcx-score { width: 46px; height: 46px; position: relative; margin-top: 10px; }
.tcx-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tcx-score span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.tcx-why { padding: 0 20px 14px; font-size: 14px; color: var(--ink-2); }
.tcx-detail { border-top: 1px solid var(--line); padding: 18px 20px 20px; display: none; }
.tcx-res.open .tcx-detail { display: block; animation: tcx-in .3s both; }
.tcx-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.tcx-bar small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-bottom: 5px; }
.tcx-bar div { height: 6px; background: var(--card-2); border-radius: 6px; overflow: hidden; }
.tcx-bar div i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.tcx-tl { list-style: none; margin: 0 0 18px; padding: 0; position: relative; }
.tcx-tl li { position: relative; padding: 0 0 14px 26px; }
.tcx-tl li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -4px; width: 2px; background: var(--line-2); }
.tcx-tl li:last-child::before { display: none; }
.tcx-tl li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); }
.tcx-tl .tr { font-weight: 650; }
.tcx-tl .st { font-size: 14px; color: var(--ink-2); }
.tcx-tl .chg { padding-left: 26px; margin: -4px 0 14px; font-size: 13px; font-weight: 600; }
.tcx-classes { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-bottom: 16px; }
.tcx-class { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; text-align: left; background: var(--bg-2); }
.tcx-class b { display: block; font-size: 17px; margin-top: 2px; }
.tcx-class small { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.tcx-class[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.tcx-empty { text-align: center; padding: 34px 20px; color: var(--ink-2); }
.tcx-empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* Caricamento */
.tcx-skel { height: 118px; border-radius: var(--r); background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: tcx-sh 1.2s linear infinite; border: 1px solid var(--line); }
.tcx-skel + .tcx-skel { margin-top: 12px; }
@keyframes tcx-sh { to { background-position: -200% 0; } }

/* Foglio di prenotazione */
.tcx-sheet-bg { position: fixed; inset: 0; background: rgba(5, 6, 9, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 99998; animation: tcx-fade .2s both; }
@keyframes tcx-fade { from { opacity: 0; } }
.tcx-sheet {
	position: fixed; z-index: 99999; left: 50%; bottom: 0; transform: translateX(-50%); width: min(560px, 100%);
	max-height: 92vh; overflow: auto; background: var(--bg); color: var(--ink); border-radius: 24px 24px 0 0; padding: 10px 20px max(22px, env(safe-area-inset-bottom));
	box-shadow: 0 -20px 60px rgba(0, 0, 0, .35); animation: tcx-up .32s cubic-bezier(.2, .8, .2, 1) both; font-family: var(--font);
}
@media (min-width: 640px) { .tcx-sheet { bottom: 50%; transform: translate(-50%, 50%); border-radius: 24px; animation: tcx-pop .28s both; } }
@keyframes tcx-up { from { transform: translate(-50%, 100%); } }
@keyframes tcx-pop { from { opacity: 0; transform: translate(-50%, 52%) scale(.97); } }
.tcx-grab { width: 40px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 0 auto 14px; }
.tcx-sheet h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 4px; }
.tcx-form { display: grid; gap: 12px; margin: 18px 0; }
.tcx-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tcx-err { color: var(--bad); font-size: 14px; font-weight: 600; margin: 8px 0 0; }
.tcx-note { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }

/* Biglietto */
.tcx-ticket { position: relative; border-radius: 24px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow), var(--glow); }
.tcx-ticket-head { padding: 20px 22px; background: var(--ink); color: var(--bg); display: flex; align-items: center; gap: 10px; }
.tcx-ticket-head .sp { flex: 1; }
.tcx-ticket-head small { opacity: .7; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.tcx-ticket-head b { font-family: var(--mono); font-size: 20px; letter-spacing: .12em; }
.tcx-ticket-body { padding: 22px; }
.tcx-codes { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.tcx-codes .c { font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.tcx-codes .c + small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.tcx-codes .r { text-align: right; }
.tcx-codes svg { width: 22px; height: 22px; color: var(--accent); }
.tcx-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.tcx-kv small { display: block; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.tcx-kv b { font-size: 16px; }
.tcx-perf { position: relative; height: 26px; }
.tcx-perf::before { content: ""; position: absolute; left: 20px; right: 20px; top: 50%; border-top: 2px dashed var(--line-2); }
.tcx-perf i { position: absolute; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.tcx-perf i:first-child { left: -14px; } .tcx-perf i:last-child { right: -14px; }
.tcx-qr { display: grid; place-items: center; padding: 6px 22px 24px; }
.tcx-qr .box { background: #fff; padding: 14px; border-radius: 16px; }
.tcx-qr canvas, .tcx-qr img { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.tcx-qr code { margin-top: 10px; font-size: 11px; color: var(--ink-3); word-break: break-all; text-align: center; }
.tcx-demo-mark { position: absolute; top: 118px; right: -44px; transform: rotate(35deg); background: var(--warn); color: #1a1307; font-size: 11px; font-weight: 800; letter-spacing: .14em; padding: 5px 50px; }
.tcx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tcx-actions .tcx-btn { flex: 1; }
.tcx-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.tcx-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tcx-status.ok { color: var(--ok); } .tcx-status.wait { color: var(--warn); } .tcx-status.ko { color: var(--bad); }

/* Elenchi */
.tcx-list { display: grid; gap: 10px; }
.tcx-item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; width: 100%; text-align: left; }
.tcx-item .sp { flex: 1; min-width: 0; }
.tcx-item b { display: block; font-size: 16px; }
.tcx-item small { color: var(--ink-2); }
.tcx-slider { margin-top: 14px; }
.tcx-slider label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.tcx-slider input[type=range] { width: 100%; accent-color: var(--accent); }
.tcx-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--ink); margin-top: 10px; }
.tcx-alert.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); }

/* Toast */
.tcx-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 100000; background: #14161b; color: #f3efe7; padding: 12px 18px; border-radius: 12px; font: 600 14px/1.3 var(--font); box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: tcx-in .25s both; max-width: calc(100% - 32px); }

/* [tc_stazioni] */
.tcx-stazioni { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(var(--col, 3), minmax(0, 1fr)); gap: 8px; font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif; }
.tcx-stazioni li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid rgba(0,0,0,.1); border-radius: 12px; }
.tcx-stazioni code { opacity: .6; }
@media (max-width: 640px) { .tcx-stazioni { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
	.tcx *, .tcx-sheet { animation: none !important; transition: none !important; }
}
@media (max-width: 480px) {
	.tcx-time { font-size: 24px; }
	.tcx-price b { font-size: 22px; }
	.tcx-kv { grid-template-columns: 1fr 1fr; }
	.tcx-bars { grid-template-columns: 1fr 1fr; }
}

/* Contenitore dei fogli modali (fuori dal flusso della pagina) */
.tcx.tcx-portal { background: none; overflow: visible; border-radius: 0; position: static; }
.tcx.tcx-portal::before { display: none; }
.tcx-compact .tcx-hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; text-align: left; align-items: center; padding: 0; }
.tcx-compact .tcx-hero h1, .tcx-compact .tcx-hero > p, .tcx-compact .tcx-examples { display: none; }
.tcx-compact .tcx-mic-wrap { width: 64px; height: 64px; margin: 0; grid-row: span 2; }
.tcx-compact .tcx-mic { width: 56px; height: 56px; }
.tcx-compact .tcx-mic svg { width: 24px; height: 24px; }
.tcx-compact .tcx-transcript { margin: 0; font-size: 16px; }
.tcx-compact .tcx-wave { justify-content: flex-start; height: 16px; }
.tcx-compact .tcx-ask { margin-top: 14px; }
.tcx-compact .tcx-hint { display: none; }

/* Meteo partenza / arrivo */
.tcx-meteo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.tcx-meteo-i { border: 1px solid var(--line); background: var(--bg-2); border-radius: 14px; padding: 12px 14px; }
.tcx-meteo-i small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.tcx-meteo-v { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcx-meteo-v b { font-size: 22px; letter-spacing: -.02em; }
.tcx-meteo-v span { font-size: 14px; color: var(--ink-2); }
.tcx-meteo-v .ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.tcx-meteo-v .ic svg { width: 18px; height: 18px; }
.tcx-meteo-i.pioggia .ic, .tcx-meteo-i.temporale .ic { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal); }
.tcx-meteo-i em { display: block; font-style: normal; font-size: 13px; font-weight: 600; margin-top: 6px; color: var(--warn); }
.tcx-ticket + .tcx-meteo { margin-top: 14px; }
@media (max-width: 480px) { .tcx-meteo { grid-template-columns: 1fr; } }
