/* ═══════════════════════════════════════════════════════════════════════════
   TotalShareware — Design System (restyling 2026)
   Archetipo: Soft Structuralism — chiaro, arioso, card flottanti,
   ombre morbidissime, tipografia geometrica grande.
   Font: stack di sistema locale, senza dipendenze CDN nel rendering iniziale
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Token ─────────────────────────────────────────────────────────────── */
:root {
    --bg:        #F5F6F8;
    --surface:   #FFFFFF;
    --surface-2: #EDF0F4;
    --ink:       #101820;
    --ink-2:     #4A5561;
    --ink-3:     #606C78;
    --line:      rgba(16, 24, 32, .08);
    --line-2:    rgba(16, 24, 32, .14);
    --brand:      #2A6F97;
    --brand-ink:  #1C5677;
    --brand-soft: #E4F0F7;
    --on-brand:   #FFFFFF;
    --accent:     #E8A33D;
    --ok:         #2E9E6B;
    --danger:     #B63D3D;
    --radius-s:  10px;
    --radius:    16px;
    --radius-l:  24px;
    --shadow-1:  0 1px 2px rgba(16,24,40,.05), 0 10px 28px -14px rgba(16,24,40,.14);
    --shadow-2:  0 2px 8px rgba(16,24,40,.06), 0 28px 56px -24px rgba(16,24,40,.22);
    --ease:      cubic-bezier(.32, .72, 0, 1);
    --font-head: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
    --header-h:  64px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:        #0C1117;
        --surface:   #131A22;
        --surface-2: #1B242E;
        --ink:       #E9EDF2;
        --ink-2:     #A7B1BC;
        --ink-3:     #9AA7B5;
        --line:      rgba(233, 237, 242, .09);
        --line-2:    rgba(233, 237, 242, .16);
        --brand:      #5FA8CE;
        --brand-ink:  #8FC4E2;
        --brand-soft: #14283A;
        --on-brand:   #0C1117;
        --danger:     #F08080;
        --shadow-1:  0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.5);
        --shadow-2:  0 2px 8px rgba(0,0,0,.45), 0 28px 56px -24px rgba(0,0,0,.6);
    }
}
:root[data-theme="dark"] {
    --bg:        #0C1117;
    --surface:   #131A22;
    --surface-2: #1B242E;
    --ink:       #E9EDF2;
    --ink-2:     #A7B1BC;
    --ink-3:     #9AA7B5;
    --line:      rgba(233, 237, 242, .09);
    --line-2:    rgba(233, 237, 242, .16);
    --brand:      #5FA8CE;
    --brand-ink:  #8FC4E2;
    --brand-soft: #14283A;
    --on-brand:   #0C1117;
    --danger:     #F08080;
    --shadow-1:  0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.5);
    --shadow-2:  0 2px 8px rgba(0,0,0,.45), 0 28px 56px -24px rgba(0,0,0,.6);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.6;
    text-align: left;
    overflow-x: clip; /* niente scroll orizzontale, mai */
    -webkit-font-smoothing: antialiased;
    transition: background-color .5s var(--ease), color .5s var(--ease);
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--ink);
}

h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }

a { color: var(--brand); text-decoration: none; transition: color .3s var(--ease); }
a:hover { color: var(--brand-ink); }

img { max-width: 100%; height: auto; }

::selection { background: var(--brand); color: var(--on-brand); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ── Eyebrow / badge ───────────────────────────────────────────────────── */
.ts-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .18em;
}

/* ── Card (double bezel) ───────────────────────────────────────────────── */
.ts-card {
    background: var(--surface);
    border-radius: var(--radius-l);
    padding: 6px;
    box-shadow: var(--shadow-1);
    transition: box-shadow .6s var(--ease), transform .6s var(--ease);
}
.ts-card-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius-l) - 6px);
    padding: 22px 24px;
    height: 100%;
}

/* ── Header flottante ──────────────────────────────────────────────────── */
.ts-header-wrap {
    position: sticky; top: 0; z-index: 100;
    padding: 12px 16px 4px;
}
.ts-header {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; gap: 14px;
    padding: 10px 12px 10px 20px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
}
.ts-brand {
    display: flex; align-items: baseline; gap: 2px;
    font-family: var(--font-head);
    font-size: 21px; font-weight: 700; letter-spacing: -.03em;
    color: var(--ink); white-space: nowrap;
}
.ts-brand em { font-style: normal; color: var(--brand); }
.ts-brand .ts-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: flex-start; margin-top: 4px; }

.ts-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.ts-nav a {
    padding: 8px 14px; border-radius: 999px;
    color: var(--ink-2); font-weight: 600; font-size: 14px;
    transition: background-color .35s var(--ease), color .35s var(--ease);
}
.ts-nav a:hover { background: var(--surface-2); color: var(--ink); }
.ts-nav a.ts-active { background: var(--brand-soft); color: var(--brand-ink); }

.ts-header-actions { display: flex; align-items: center; gap: 8px; }

.ts-searchbox { display: flex; align-items: center; gap: 6px; }
.ts-searchbox input {
    width: 180px; padding: 8px 16px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface-2); color: var(--ink);
    font-family: var(--font-body); font-size: 14px;
    transition: border-color .3s var(--ease), background-color .3s var(--ease), width .5s var(--ease);
}
.ts-searchbox input:focus { outline: none; border-color: var(--brand); background: var(--surface); width: 230px; }

/* Toggle tema */
.ts-theme-btn {
    width: 38px; height: 38px; flex: 0 0 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 50%;
    background: transparent; color: var(--ink-2);
    cursor: pointer; font-size: 16px;
    transition: transform .4s var(--ease), background-color .3s var(--ease), color .3s var(--ease);
}
.ts-theme-btn:hover { background: var(--surface-2); color: var(--ink); transform: rotate(20deg); }

/* Hamburger */
.ts-burger {
    display: none;
    width: 42px; height: 42px; flex: 0 0 42px;
    position: relative;
    border: 1px solid var(--line); border-radius: 50%;
    background: transparent; cursor: pointer;
}
.ts-burger span {
    position: absolute; left: 11px; right: 11px; height: 2px;
    background: var(--ink); border-radius: 2px;
    transition: transform .45s var(--ease), opacity .3s var(--ease);
}
.ts-burger span:nth-child(1) { top: 15px; }
.ts-burger span:nth-child(2) { top: 21px; }
.ts-burger span:nth-child(3) { top: 27px; }
.ts-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ts-burger.open span:nth-child(2) { opacity: 0; transform: scaleX(.4); }
.ts-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Overlay mobile */
.ts-overlay {
    position: fixed; inset: 0; z-index: 90;
    display: flex; flex-direction: column; justify-content: center;
    padding: 24px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0; pointer-events: none; visibility: hidden;
    transition: opacity .45s var(--ease), visibility .45s step-end;
}
.ts-overlay.open { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity .45s var(--ease), visibility 0s; }
.ts-overlay a {
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 6vw, 2.4rem); font-weight: 600;
    color: var(--ink); padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(28px);
    transition: opacity .6s var(--ease), transform .6s var(--ease), color .3s var(--ease);
}
.ts-overlay.open a { opacity: 1; transform: translateY(0); }
.ts-overlay.open a:nth-child(1) { transition-delay: .08s; }
.ts-overlay.open a:nth-child(2) { transition-delay: .14s; }
.ts-overlay.open a:nth-child(3) { transition-delay: .20s; }
.ts-overlay.open a:nth-child(4) { transition-delay: .26s; }
.ts-overlay.open a:nth-child(5) { transition-delay: .32s; }
.ts-overlay.open a:nth-child(6) { transition-delay: .38s; }
.ts-overlay a:hover { color: var(--brand); }

/* ── OSCat segmented control ───────────────────────────────────────────── */
.ts-oscat-row {
    max-width: 1200px; margin: 10px auto 0; padding: 0 16px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ts-oscat-row::-webkit-scrollbar { display: none; }
.ts-oscat {
    display: inline-flex; gap: 4px; padding: 4px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 999px; box-shadow: var(--shadow-1);
}
.ts-oscat a {
    padding: 7px 18px; border-radius: 999px;
    color: var(--ink-2); font-weight: 600; font-size: 13.5px;
    transition: background-color .35s var(--ease), color .35s var(--ease);
}
.ts-oscat a:hover { color: var(--ink); background: var(--surface-2); }
.ts-oscat a.ts-active { background: var(--brand); color: var(--on-brand); }
@media (max-width: 480px) {
    .ts-oscat { gap: 2px; padding: 3px; }
    .ts-oscat a { padding-inline: 9px; font-size: 13px; }
}
@media (max-width: 340px) {
    .ts-oscat-row { padding-inline: 12px; }
    .ts-oscat a { padding-inline: 6px; font-size: 12px; }
}

/* ── Layout contenuto ──────────────────────────────────────────────────── */
.ts-shell { max-width: 1200px; margin: 0 auto; padding: 26px 16px 60px; }
.ts-cols { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-areas: "sidebar main"; gap: 24px; align-items: start; }
.ts-cols > aside { grid-area: sidebar; }
.ts-cols > #main-content { grid-area: main; min-width: 0; }
@media (max-width: 991px) {
    .ts-cols { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "sidebar"; }
}

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.ts-breadcrumb {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    font-size: 13px; color: var(--ink-3); margin: 4px 0 18px;
}
.ts-breadcrumb a { color: var(--ink-3); }
.ts-breadcrumb a:hover { color: var(--brand); }
.ts-breadcrumb .sep { opacity: .5; }

/* ── Classi legacy mappate ─────────────────────────────────────────────── */
.PageTitle {
    display: block;
    font-family: var(--font-head);
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 600; letter-spacing: -.02em;
    color: var(--ink); text-align: center;
    margin: 8px 0 22px;
}
.TableHeader {
    background: var(--surface-2) !important;
    color: var(--ink) !important;
    font-family: var(--font-head); font-weight: 600;
}
.LinkButton, button, input[type="submit"], input[type="button"] {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 22px;
    border: 1px solid var(--line-2); border-radius: 999px;
    background: var(--surface); color: var(--ink);
    font-family: var(--font-body); font-weight: 600; font-size: 14px;
    cursor: pointer;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease),
                background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.LinkButton:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    border-color: var(--brand); color: var(--brand-ink);
    box-shadow: var(--shadow-1); transform: translateY(-1px);
}
.LinkButton:active, button:active, input[type="submit"]:active { transform: translateY(0) scale(.98); }

/* Pulsante primario */
.ts-btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 9px 22px; border: 1px solid var(--brand);
    border-radius: 999px; text-decoration: none; cursor: pointer;
    font-family: var(--font-body); font-size: 14px; font-weight: 600;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease),
                background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
    background: var(--brand); border-color: var(--brand); color: var(--on-brand);
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 60%, transparent);
}
.ts-btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: var(--on-brand); }

/* Input */
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], textarea, select {
    padding: 9px 14px;
    border: 1px solid var(--line-2); border-radius: var(--radius-s);
    background: var(--surface); color: var(--ink);
    font-family: var(--font-body); font-size: 14.5px;
    transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* ── Tabelle dati (liste programmi, dettagli) ──────────────────────────── */
table {
    border-collapse: separate; border-spacing: 0;
    background: var(--surface);
}
#main-content table, .ts-table-card table {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}
#main-content table th, #main-content table td { padding: 10px 14px; text-align: left; vertical-align: top; }
#main-content table th { background: var(--surface-2); font-family: var(--font-head); font-weight: 600; font-size: 13.5px; }
#main-content table tbody tr { transition: background-color .25s var(--ease); }
#main-content table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

/* Righe programma: tutta la riga evidenziata e cliccabile */
#main-content table tbody tr:has(a[href*="/Detail/"]) { cursor: pointer; }
#main-content table tbody tr:has(a[href*="/Detail/"]):hover > td {
    background: color-mix(in srgb, var(--brand) 16%, var(--surface));
}
#main-content table tbody tr:has(a[href*="/Detail/"]):hover > td:first-child {
    box-shadow: inset 3px 0 0 var(--brand);
}

/* ── Sidebar categorie ─────────────────────────────────────────────────── */
.ts-sidecard {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-1);
    overflow: hidden;
}
.ts-sidecard-head {
    padding: 12px 16px;
    font-family: var(--font-head); font-weight: 600; font-size: 14px;
    background: var(--surface-2); color: var(--ink);
}
.ts-sidecard ul { list-style: none; margin: 0; padding: 6px; max-height: 520px; overflow-y: auto; }
.ts-sidecard li { border-radius: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.ts-sidecard li > i { color: var(--brand); font-size: 13px; flex: 0 0 auto; }
.ts-sidecard li > a { flex: 1; min-width: 0; }
.ts-sidecard li > ul { flex-basis: 100%; }
.ts-sidecard a {
    display: block; padding: 6px 10px; border-radius: 8px;
    color: var(--ink-2); font-size: 13.5px;
    transition: background-color .25s var(--ease), color .25s var(--ease);
}
.ts-sidecard a:hover { background: var(--brand-soft); color: var(--brand-ink); }
.ts-sidecard .ts-cat-active > a { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.ts-caret {
    border: none; background: none; padding: 0 4px; cursor: pointer;
    min-width: 28px; min-height: 28px; flex: 0 0 28px;
    color: var(--ink-3); font-size: 10px;
    transition: transform .35s var(--ease);
}
.ts-caret.open { transform: rotate(90deg); }

/* ── Chip licenza a colori ─────────────────────────────────────────────── */
.ts-chip-free  { background: color-mix(in srgb, var(--ok) 14%, var(--surface));     color: var(--ok); }
.ts-chip-os    { background: color-mix(in srgb, #2E7DB2 14%, var(--surface));       color: #23689B; }
.ts-chip-trial { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: #A66F14; }

/* Sidebar sticky (liste lunghe: resta visibile scorrendo) */
.ts-cols > aside { position: sticky; top: 84px; align-self: start; }
@media (max-width: 991px) { .ts-cols > aside { position: static; } }

/* ── Card programma (liste/home) ───────────────────────────────────────── */
.ts-prog-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px;
}
.ts-prog-card {
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-1);
    display: flex; flex-direction: column; gap: 10px;
    transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.ts-prog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
    border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.ts-prog-card .ts-prog-icon { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; }
.ts-prog-card h3 { margin: 0; font-size: 1.02rem; overflow-wrap: anywhere; }
.ts-prog-card .ts-prog-name { margin: 0; font-size: 1.02rem; }
.ts-prog-card .ts-prog-desc {
    color: var(--ink-2); font-size: 13.5px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ts-prog-card .ts-prog-meta {
    display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto;
}
.ts-btn-secondary {
    display: inline-flex; justify-content: center; align-items: center; gap: 7px;
    min-height: 40px; padding: 8px 16px; border: 1px solid var(--line);
    border-radius: 999px; background: var(--surface); color: var(--ink);
    font-weight: 600; text-decoration: none; cursor: pointer;
}
.ts-btn-secondary:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }

/* Developer dashboard */
.ts-dev-center { width: min(100%, 1000px); margin: 0 auto; }
.ts-dev-center__header,
.ts-dev-center__section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.ts-dev-center__header { margin: 8px 0 22px; }
.ts-dev-center__header h1 { margin: 3px 0 8px; }
.ts-dev-center__header p { margin: 0; color: var(--ink-2); }
.ts-dev-center__username { color: var(--ink-3); font-size: .9em; }
.ts-dev-center__logout { margin-top: 10px; color: var(--danger); font-weight: 600; }
.ts-dev-center__section {
    margin: 16px 0; padding: clamp(16px, 2.5vw, 24px);
    border: 1px solid var(--line); border-radius: var(--radius-l);
    background: var(--surface); box-shadow: var(--shadow-1);
}
.ts-dev-center__section-header { align-items: center; margin-bottom: 18px; }
.ts-dev-center__section-header h2 { margin: 0 0 4px; font: 600 1.15rem var(--font-head); color: var(--ink); }
.ts-dev-center__section-header p { margin: 0; color: var(--ink-3); font-size: .9rem; }
.ts-dev-center__company { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.ts-dev-center__company > div { min-width: 0; }
.ts-dev-center__company dt { margin-bottom: 3px; color: var(--ink-3); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ts-dev-center__company dd { margin: 0; overflow-wrap: anywhere; }
.ts-dev-center__programs,
.ts-dev-center__orders { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ts-dev-center__programs li,
.ts-dev-center__orders li {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    min-width: 0; padding: 14px 16px; border: 1px solid var(--line);
    border-radius: var(--radius); background: var(--surface-2);
}
.ts-dev-center__programs h3 { margin: 0 0 4px; font-size: 1rem; }
.ts-dev-center__programs p,
.ts-dev-center__orders p { margin: 0; color: var(--ink-3); font-size: .85rem; }
.ts-dev-center__empty { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); }
.ts-dev-center__empty i { color: var(--brand); font-size: 24px; }
.ts-dev-center__empty p,
.ts-dev-center__no-orders { margin: 0; color: var(--ink-2); }
.ts-dev-center__order-price { min-width: 84px; text-align: right; }
.ts-dev-center__orders form { margin: 0; }
.ts-dev-center__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }
@media (max-width: 640px) {
    .ts-dev-center__header,
    .ts-dev-center__section-header { align-items: stretch; flex-direction: column; }
    .ts-dev-center__company { grid-template-columns: 1fr; }
    .ts-dev-center__programs li,
    .ts-dev-center__orders li { align-items: stretch; flex-direction: column; }
    .ts-dev-center__order-price { text-align: left; }
}
.ts-advertise-page { width: min(100%, 1000px); margin: 0 auto; }
.ts-advertise-page .ts-page-heading { max-width: none; margin-left: 0; }
.ts-advertise-notice { width: 100%; margin: 0 auto 20px; border-color: color-mix(in srgb, var(--brand) 24%, var(--line)); background: var(--brand-soft); color: var(--brand-ink); }
.ts-advertise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.ts-advertise-card,
.ts-advertise-detail-card {
    min-width: 0; padding: clamp(18px, 2.5vw, 26px); border: 1px solid var(--line);
    border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow-1);
}
.ts-advertise-card { display: flex; flex-direction: column; gap: 18px; }
.ts-advertise-card h2 { margin: 0 0 7px; font: 600 1.18rem var(--font-head); }
.ts-advertise-card header p { margin: 0; color: var(--ink-2); }
.ts-advertise-card dl,
.ts-advertise-detail-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.ts-advertise-card dl > div,
.ts-advertise-detail-card dl > div { display: grid; gap: 4px; }
.ts-advertise-card dt,
.ts-advertise-detail-card dt { color: var(--ink-3); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ts-advertise-card dd,
.ts-advertise-detail-card dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0; }
.ts-advertise-old-price { color: var(--ink-3); }
.ts-advertise-card__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.ts-advertise-detail-card { display: grid; grid-template-columns: minmax(160px, .42fr) 1fr; gap: clamp(20px, 4vw, 40px); align-items: start; }
.ts-advertise-detail-card > img { display: block; width: 100%; max-height: 260px; object-fit: contain; border-radius: var(--radius); }
.ts-advertise-detail-copy h2 { margin: 0 0 12px; font: 600 1.18rem var(--font-head); }
.ts-advertise-description { margin-bottom: 20px; color: var(--ink-2); overflow-wrap: anywhere; }
.ts-advertise-description img { max-width: 100%; height: auto; }
.ts-advertise-detail-copy dl { margin-bottom: 22px; }
.ts-buy-now-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ts-buy-now-grid h2 { margin: 0 0 4px; font: 600 1.18rem var(--font-head); }
.ts-buy-now-grid p { color: var(--ink-2); }
.ts-buy-now-sample { display: block; width: min(100%, 400px); height: auto; margin: 4px auto 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.ts-buy-now-steps { display: grid; gap: 12px; padding-left: 22px; color: var(--ink-2); }
@media (max-width: 640px) {
    .ts-advertise-detail-card { grid-template-columns: 1fr; }
    .ts-advertise-detail-card > img { max-width: 300px; margin: 0 auto; }
    .ts-advertise-card__actions { flex-direction: column; }
    .ts-advertise-card__actions > * { width: 100%; }
    .ts-buy-now-grid { grid-template-columns: 1fr; }
}
.ts-chip {
    padding: 3px 10px; border-radius: 999px;
    background: var(--surface-2); color: var(--ink-2);
    font-size: 11.5px; font-weight: 600;
}

/* ── Hero home ─────────────────────────────────────────────────────────── */
.ts-hero { text-align: center; padding: 44px 8px 36px; }
.ts-hero h1 { margin: 14px 0 10px; }
.ts-hero p { color: var(--ink-2); max-width: 560px; margin: 0 auto 22px; font-size: 16.5px; }
.ts-hero form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ts-hero input[type="text"] {
    width: min(430px, 90vw); padding: 13px 22px;
    border-radius: 999px; font-size: 15.5px;
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-1);
}
.ts-counter {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 18px; padding: 6px 16px;
    border-radius: 999px; background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--shadow-1);
    font-size: 13px; color: var(--ink-2); font-weight: 600;
}
.ts-counter strong { color: var(--brand-ink); font-family: var(--font-head); }

/* Griglia categorie home */
.ts-cat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 18px; margin-top: 26px;
}
.ts-category-heading__row { display: flex; align-items: center; gap: 14px; }
.ts-category-heading__row h1 { margin: 0 0 6px; }
.ts-ad-slot { width: 100%; margin: 28px auto 0; text-align: center; overflow: hidden; }
.ts-cat-card {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px;
    box-shadow: var(--shadow-1);
    transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.ts-cat-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-2);
    border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.ts-cat-card img { width: 44px; height: 44px; object-fit: contain; flex: 0 0 44px; }
.ts-cat-ico {
    flex: 0 0 46px; width: 46px; height: 46px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: var(--brand-soft);
    color: var(--brand-ink);
    font-size: 24px;
    transition: transform .5s var(--ease), background-color .4s var(--ease);
}
.ts-cat-card:hover .ts-cat-ico { transform: scale(1.08) rotate(-4deg); }
.ts-cat-card .ts-cat-name {
    font-family: var(--font-head); font-weight: 600; font-size: 15.5px;
    color: var(--ink); text-transform: none; letter-spacing: 0;
}
.ts-cat-card .ts-cat-desc {
    color: var(--ink-3); font-size: 12.5px; line-height: 1.45; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Scheda prodotto (Detail) ──────────────────────────────────────────── */
.ts-detail-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; overflow-wrap: anywhere; }
.ts-detail-head pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ts-detail-head table { display: block; max-width: 100%; overflow-x: auto; }
.ts-detail-head img { max-width: 100%; height: auto; }
.ts-card-inner a[href^="http"] { overflow-wrap: anywhere; }
.ts-download-status { max-width: 900px; margin: 10px auto 28px; }
.ts-download-status .ts-card-inner { padding: clamp(18px, 3vw, 30px); }
.ts-download-status h1 { margin: 0 0 12px; font-size: clamp(1.5rem, 3vw, 2rem); }
.ts-download-status p { color: var(--ink-2); }
.ts-download-status .ts-download-publisher { margin: 16px 0 0; font-size: 14px; }
.ts-download-unavailable {
    display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface-2); color: var(--ink-3); font-size: 13px; font-weight: 600;
}
.ts-download-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 13px 30px; border-radius: 999px;
    background: var(--brand); color: var(--on-brand) !important;
    font-weight: 700; font-size: 15.5px;
    box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--brand) 65%, transparent);
    transition: transform .4s var(--ease), box-shadow .4s var(--ease), background-color .3s var(--ease);
}
.ts-download-btn:hover { background: var(--brand-ink); transform: translateY(-2px); box-shadow: 0 16px 34px -12px color-mix(in srgb, var(--brand) 70%, transparent); }
.ts-download-btn:active { transform: scale(.98); }

/* ── Separatori e placeholder ──────────────────────────────────────────── */
.ts-sep { border: none; border-top: 1px solid var(--line); margin: 28px auto; width: 100%; }
.ts-noshot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 150px; height: 110px;
    border: 1px dashed var(--line-2); border-radius: 10px;
    background: var(--surface-2); color: var(--ink-3); font-size: 28px;
}
.ts-screenshot-placeholder {
    display: block; max-width: 100%; object-fit: contain;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface-2);
}

/* ── Barra ordinamento ─────────────────────────────────────────────────── */
.ts-sortbar {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
    margin: 4px 0 14px;
}
.ts-sortbar > span:first-child { margin-right: 4px; }
.ts-sortbar a {
    padding: 6px 14px; border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-2);
    font-weight: 600; font-size: 12.5px;
    transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.ts-sortbar a:hover { border-color: var(--brand); color: var(--brand-ink); }
.ts-sortbar a.ts-current { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ── Back to top ───────────────────────────────────────────────────────── */
.ts-totop {
    position: fixed; right: 22px; bottom: 22px; z-index: 80;
    width: 46px; height: 46px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface); border: 1px solid var(--line);
    color: var(--brand); font-size: 20px;
    box-shadow: var(--shadow-2);
    cursor: pointer; opacity: 0; pointer-events: none;
    transition: opacity .5s var(--ease), transform .5s var(--ease);
    transform: translateY(10px);
}
.ts-totop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.ts-totop:hover { transform: translateY(-3px); }

/* ── Pager ─────────────────────────────────────────────────────────────── */
.ts-pager-wrap {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    margin: 26px 0;
}
.ts-pager-info { color: var(--ink-2); font-size: 13.5px; }
.ts-pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; align-items: center; }
.ts-pager a, .ts-pager span {
    min-width: 38px; padding: 8px 13px; text-align: center;
    border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink-2);
    font-weight: 600; font-size: 13.5px;
    transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.ts-pager a:hover { border-color: var(--brand); color: var(--brand-ink); }
.ts-pager span.ts-current { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.ts-pager .ts-ellipsis { border: none; background: none; min-width: 20px; padding: 8px 2px; }

/* ── Statistics ────────────────────────────────────────────────────────── */
.ts-stats-page { max-width: 860px; margin: 0 auto; padding: 12px 0 36px; }
.ts-stats-intro {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
    margin: 8px 0 28px; padding: 0 2px 22px; border-bottom: 1px solid var(--line-2);
}
.ts-stats-intro h1 { margin: 0 0 8px; }
.ts-stats-intro > div > p, .ts-stats-section-head p { margin: 0; color: var(--ink-2); }
.ts-stats-total { display: flex; flex-direction: column; align-items: flex-end; margin: 0 0 2px; white-space: nowrap; }
.ts-stats-total strong { color: var(--brand-ink); font-family: var(--font-head); font-size: 1.65rem; line-height: 1.15; }
.ts-stats-total span, .ts-stats-range { color: var(--ink-2); font-size: 13px; }
.ts-stats-section { margin: 0 0 34px; }
.ts-stats-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 2px 12px; }
.ts-stats-section-head h2 { margin: 0 0 5px; font-size: 1.35rem; }
.ts-stats-range { padding-bottom: 3px; white-space: nowrap; }
.ts-stats-table-wrap { overflow-x: auto; border-radius: var(--radius); }
#main-content .ts-stats-table { width: 100%; margin: 0; }
#main-content .ts-stats-table th, #main-content .ts-stats-table td { padding: 9px 16px; }
#main-content .ts-stats-table th:last-child, #main-content .ts-stats-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
#main-content .ts-stats-table tbody tr:hover { background: var(--brand-soft); }
.ts-stats-pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 4px 0; color: var(--ink-2); font-size: 13.5px; }
.ts-stats-pager a { display: inline-flex; min-height: 38px; align-items: center; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-weight: 600; }
.ts-stats-pager a:hover { border-color: var(--brand); background: var(--brand-soft); }
.ts-stats-empty { margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 600px) {
    .ts-stats-page { padding-top: 4px; }
    .ts-stats-intro { align-items: flex-start; flex-direction: column; gap: 14px; }
    .ts-stats-total { align-items: flex-start; }
    .ts-stats-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
    .ts-stats-pager { flex-wrap: wrap; }
}
.ts-sidecard ul.ts-sub { padding: 0 0 4px 16px; max-height: none; }

/* ── Alert / messaggi ──────────────────────────────────────────────────── */
.ts-alert {
    padding: 12px 18px; border-radius: var(--radius-s);
    font-weight: 600; font-size: 14px; margin: 12px 0;
}
.ts-alert-ok   { background: color-mix(in srgb, var(--ok) 12%, var(--surface));     color: var(--ok); }
.ts-alert-err  { background: color-mix(in srgb, var(--danger) 10%, var(--surface));  color: var(--danger); }
.ts-alert-warn { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line)); }

/* ── Footer ────────────────────────────────────────────────────────────── */
.ts-footer {
    margin-top: 60px;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.ts-footer-inner {
    max-width: 1200px; margin: 0 auto; padding: 40px 16px 26px;
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px;
}
.ts-footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3); margin: 0 0 12px; }
.ts-footer a { display: block; padding: 4px 0; color: var(--ink-2); font-size: 14px; }
.ts-footer a:hover { color: var(--brand-ink); }
.ts-footer-brand { font-family: var(--font-head); font-size: 19px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.ts-footer-blurb { color: var(--ink-3); font-size: 13.5px; max-width: 320px; }
.ts-footer-legal {
    max-width: 1200px; margin: 0 auto; padding: 14px 16px 26px;
    border-top: 1px solid var(--line);
    color: var(--ink-3); font-size: 12.5px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
@media (max-width: 767px) { .ts-footer-inner { grid-template-columns: 1fr; gap: 22px; } }

/* ── Reveal on scroll ──────────────────────────────────────────────────── */
.ts-reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.ts-reveal.ts-in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .ts-reveal { opacity: 1; transform: none; transition: none; }
    * { animation: none !important; transition-duration: .01s !important; }
}

/* ── Responsive header ─────────────────────────────────────────────────── */
/* The full navigation needs more than 1024 CSS pixels once the search and
   theme controls are included. Switch to the compact menu before it clips. */
@media (max-width: 1100px) {
    .ts-nav, .ts-searchbox { display: none; }
    .ts-burger { display: block; margin-left: auto; }
    .ts-header { padding: 8px 10px 8px 18px; }
}
@media (min-width: 1101px) {
    .ts-burger { display: none; }
}
@media (max-width: 767px) {
    .ts-shell { padding: 18px 14px 40px; }
    .ts-detail-head { flex-direction: column; }
    .ts-detail-head > div { flex: auto !important; width: 100%; min-width: 0 !important; max-width: 100%; overflow-wrap: anywhere; }
}

/* ── Compatibilità pagine non ancora ritoccate ─────────────────────────── */
.DivTable { display: table; width: 100%; }
.DivRow { display: table-row; }
.DivCell { display: table-cell; }
.HomePageCategoryTitle { font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.HomePageCategorySubTitle { color: var(--ink-3); font-size: 13px; }
.TitleApplicationStats { font-size: 13px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); }
.validation-summary-errors { color: var(--danger); font-weight: 600; }
.validation-summary-valid { display: none; }
.field-validation-error { color: var(--danger); font-size: 12.5px; }
.input-validation-valid { display: none; }

/* ── Search, account and privacy pages ─────────────────────────────────── */
.ts-page-heading { max-width: 850px; margin: 8px auto 24px; }
.ts-page-heading h1 { margin: 0 0 8px; }
.ts-page-heading p { margin: 0; color: var(--ink-2); }
.ts-page-link { width: min(100%, 900px); margin: 0 auto; }
.ts-page-link-card {
    display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 24px;
    align-items: start; padding: clamp(18px, 3vw, 30px);
    border: 1px solid var(--line); border-radius: var(--radius-l);
    background: var(--surface); box-shadow: var(--shadow-1);
}
.ts-page-link-preview {
    display: block; width: 100%; max-width: 180px; overflow: hidden;
    border-radius: var(--radius); background: var(--surface-2);
}
.ts-page-link-preview img { display: block; width: 100%; height: auto; }
.ts-page-link-content { display: grid; gap: 8px; min-width: 0; }
.ts-page-link-content label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.ts-page-link-url { margin: 0 0 8px; overflow-wrap: anywhere; }
.ts-page-link-code { display: block; width: 100%; max-width: 100%; min-width: 0; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.ts-page-link-content .LinkButton { justify-self: start; margin-top: 10px; }
@media (max-width: 600px) {
    .ts-page-link-card { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .ts-page-link-preview { width: min(100%, 220px); max-width: 220px; margin: 0 auto; }
}
.ts-search-form, .ts-account-card {
    width: min(100%, 820px); margin: 0 auto 28px; padding: clamp(18px, 3vw, 30px);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    box-shadow: var(--shadow-1);
}
.ts-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.ts-form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ts-form-field label { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.ts-form-field label span { color: var(--danger); }
.ts-form-field input, .ts-form-field select, .ts-form-field textarea,
.ts-search-form input, .ts-search-form select { width: 100%; min-width: 0; }
.ts-form-field small { color: var(--ink-2); font-size: 12px; }
.ts-form-actions { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; }
.ts-form-actions .ts-btn-primary, .ts-account-card > .ts-btn-primary { min-height: 42px; }
.ts-account-page { width: min(100%, 820px); margin: 0 auto; }
.ts-account-page .ts-page-heading { margin-left: 0; }
.ts-account-card { display: flex; flex-direction: column; gap: 18px; }
.ts-account-card .ts-form-grid { width: 100%; }
.ts-account-switch { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.ts-form-message, .ts-validation-summary {
    width: min(100%, 820px); margin: 0 auto 16px; padding: 12px 16px;
    border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
}
.ts-form-message-error, .ts-validation-summary { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.ts-form-message-success { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.ts-validation-summary:empty { display: none; }
.ts-search-results { margin-top: 34px; }
.ts-results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ts-results-heading h2 { margin: 0; }
.ts-results-heading p { margin: 0; color: var(--ink-2); }
.ts-search-list { display: grid; gap: 12px; margin: 18px 0; min-width: 0; }
.ts-search-result {
    padding: 20px 22px; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-1); min-width: 0;
}
.ts-search-result h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
.ts-search-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 12px; color: var(--ink-2); font-size: 12.5px; }
.ts-search-description { color: var(--ink-2); overflow-wrap: anywhere; }
.ts-search-result__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.ts-search-result__actions .ts-download-btn { min-height: 38px; padding: 8px 16px; font-size: 13px; }
.ts-empty-state {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
    margin: 20px 0; padding: clamp(20px, 4vw, 34px);
    border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface);
}
.ts-empty-state > i { color: var(--brand); font-size: 28px; }
.ts-empty-state h2, .ts-empty-state h3, .ts-empty-state p { margin: 0; }
.ts-empty-state p { color: var(--ink-2); }
.ts-prog-icon-placeholder { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-ink); font-size: 24px; }
.ts-prog-actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.ts-privacy-page { max-width: 820px; margin: 0 auto; }
.ts-privacy-page section { padding: 20px 0; border-top: 1px solid var(--line); }
.ts-privacy-page h2 { margin: 0 0 10px; font-size: 1.25rem; }
.ts-privacy-page p, .ts-privacy-page li { color: var(--ink-2); }
.ts-privacy-page li + li { margin-top: 7px; }
.ts-inline-action { display: inline; border: 0; padding: 0; color: var(--brand-ink); background: none; font: inherit; text-decoration: underline; cursor: pointer; }

/* Consent banner and advertising placeholders */
.ts-consent-banner[hidden] { display: none; }
.ts-consent-banner {
    position: fixed; z-index: 250; left: 50%; bottom: 16px; transform: translateX(-50%);
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    width: min(calc(100% - 32px), 1000px); padding: 18px 22px;
    color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
    border-radius: var(--radius); box-shadow: var(--shadow-2);
}
.ts-consent-copy { max-width: 640px; }
.ts-consent-copy strong { font-family: var(--font-head); font-size: 16px; }
.ts-consent-copy p { margin: 4px 0; color: var(--ink-2); font-size: 13px; }
.ts-consent-copy a { font-size: 12.5px; }
.ts-consent-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.ts-consent-actions button { white-space: nowrap; }
.ts-footer-link { display: block; border: 0; padding: 4px 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ts-footer-link:hover { color: var(--brand-ink); }
html:not([data-optional-consent="accepted"]) .adsbygoogle { display: none !important; }

.ts-contact-form { width: min(100%, 820px); margin: 0 auto; }
.ts-contact-card, .ts-contact-info {
    padding: clamp(18px, 3vw, 28px); color: var(--ink); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.ts-contact-required { margin: 0 0 18px; color: var(--ink-3); font-size: .85rem; }
.ts-contact-required span, .ts-contact-field label span { color: var(--danger, #b42318); }
.ts-contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ts-contact-field { min-width: 0; }
.ts-contact-field--wide { grid-column: 1 / -1; }
.ts-contact-field label, .ts-contact-verification label {
    display: block; margin: 0 0 7px; color: var(--ink); font-size: .92rem; font-weight: 600;
}
.ts-contact-field input, .ts-contact-field textarea, .ts-contact-verification input[type="number"] {
    display: block; width: 100%; max-width: 100%;
}
.ts-contact-field textarea { min-height: 170px; resize: vertical; }
.ts-contact-field small { display: block; margin-top: 5px; color: var(--ink-3); font-size: .82rem; }
.ts-contact-verification { display: flex; align-items: end; gap: 14px; margin-top: 20px; }
.ts-contact-verification input[type="number"] { width: 105px; }
.ts-contact-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.ts-contact-info { width: min(100%, 820px); margin: 18px auto 0; }
.ts-contact-info h2 { margin: 0 0 8px; font: 600 1.05rem var(--font-head); }
.ts-contact-info address { color: var(--ink-2); font-style: normal; line-height: 1.65; }
.ts-contact-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ts-contact-form + .ts-alert { margin: 0 auto 16px; }
.ts-contact-form ~ .ts-alert ul { margin: 8px 0 0; padding-left: 20px; }
.ts-page-heading + .ts-alert { width: min(100%, 820px); margin: 0 auto 16px; }

@media (max-width: 700px) {
    .ts-form-grid { grid-template-columns: 1fr; }
    .ts-consent-banner { bottom: 8px; align-items: stretch; flex-direction: column; gap: 14px; padding: 16px; }
    .ts-consent-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .ts-consent-actions button { min-height: 42px; padding-inline: 10px; }
    .ts-contact-fields { grid-template-columns: 1fr; }
    .ts-contact-field--wide { grid-column: auto; }
    .ts-contact-verification { align-items: stretch; flex-direction: column; }
    .ts-contact-verification input[type="number"] { width: 100%; }
    .ts-contact-actions { justify-content: stretch; }
    .ts-contact-actions button { width: 100%; min-height: 44px; }
}

/* Inline prose links must remain identifiable without relying on color. */
main p a, .ts-privacy-page a { text-decoration: underline; text-underline-offset: .16em; }
