@font-face {
    font-family: 'Jakarta';
    src: url('/fonts/plus-jakarta-sans-v8-latin-regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Jakarta';
    src: url('/fonts/plus-jakarta-sans-v8-latin-500.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Jakarta';
    src: url('/fonts/plus-jakarta-sans-v8-latin-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Jakarta';
    src: url('/fonts/plus-jakarta-sans-v8-latin-700.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Oswald';
    src: url('/fonts/Oswald-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}

:root {
    --tt-font-ui: 'Jakarta', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --tt-font-display: 'Oswald', 'Segoe UI', system-ui, sans-serif;

    --tt-green: #0f6b3f;
    --tt-green-dark: #0a4a2c;
    --tt-green-soft: #e7f1ea;
    --tt-green-line: #bcd9c7;
    --tt-green-hover: #0b5533;

    --tt-teal: #0e5563;
    --tt-teal-dark: #0a414c;
    --tt-teal-soft: #e1eff1;

    --tt-charcoal: #23201c;
    --tt-ink: #23201c;
    --tt-ink-soft: #4a453d;
    --tt-bg: #ffffff;
    --tt-ground: #fbfaf7;
    --tt-surface: #f4f2ec;
    --tt-card: #ffffff;
    --tt-border: #e7e2d9;
    --tt-border-strong: #d6cfc2;
    --tt-text: #23201c;
    --tt-muted: #6e6a61;
    --tt-muted-soft: #948e82;

    --tt-amber: #8a5a06;
    --tt-amber-soft: #fbf0dc;
    --tt-amber-line: #e3c78a;
    --tt-gold: #d4a017;
    --tt-brick: #9c3220;
    --tt-brick-soft: #fbe9e5;
    --tt-brick-line: #e8b7ac;
    --tt-indigo: #1f4e79;
    --tt-indigo-soft: #e7eef5;

    --tt-radius-sm: 8px;
    --tt-radius: 10px;
    --tt-radius-lg: 14px;
    --tt-shadow-card: 0 1px 2px rgba(35,32,28,.04), 0 8px 24px -12px rgba(35,32,28,.10);
    --tt-shadow-pop: 0 1px 2px rgba(35,32,28,.06), 0 18px 48px -12px rgba(35,32,28,.28);
    --tt-control-h: 38px;
    --tt-ease: 160ms cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: var(--tt-font-ui);
    background: var(--tt-bg);
    color: var(--tt-text);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

h1, h2 { font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
h3, h4 { font-weight: 600; line-height: 1.3; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--tt-green); outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important; animation-iteration-count: 1 !important;
        transition-duration: .01ms !important; scroll-behavior: auto !important;
    }
}

.btn, .btn-search, .row-btn, .page-btn, .btn-clear, .list-tabs .tab-btn { font-weight: 600; }
.row-btn, .page-btn { font-weight: 500; }

.t-tile-value, .cfg-total, .su-amount, .sb-amount, .pe-amount, .cj-total {
    font-family: var(--tt-font-display);
    font-weight: 500;
    letter-spacing: .01em;
    font-variant-numeric: tabular-nums;
}

td, .num, .money { font-variant-numeric: tabular-nums; }

a { color: inherit; text-decoration: none; }

.tt-nav {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 2rem;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--tt-border);
}
.tt-nav .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; color: var(--tt-charcoal); }
.tt-nav .brand img { height: 40px; width: auto; }
.tt-nav .links { display: flex; gap: 1.5rem; align-items: center; }
.tt-nav .links a { color: var(--tt-muted); font-weight: 600; }
.tt-nav .links a:hover { color: var(--tt-charcoal); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: var(--tt-control-h); padding: .5rem 1rem; border-radius: var(--tt-radius-sm);
    font-family: inherit; font-size: .875rem; font-weight: 600; line-height: 1.2;
    background: var(--tt-card); color: var(--tt-ink); border: 1px solid var(--tt-border-strong);
    cursor: pointer; white-space: nowrap;
    transition: background var(--tt-ease), border-color var(--tt-ease), color var(--tt-ease), box-shadow var(--tt-ease);
}
.btn:not(.btn-primary):not(.btn-accent):not(.btn-danger):hover { background: var(--tt-surface); border-color: var(--tt-muted-soft); }
.btn-primary, .btn-accent {
    background: var(--tt-green); color: #fff; border-color: var(--tt-green);
    box-shadow: 0 1px 2px rgba(10,74,44,.2);
}
.btn-primary:hover, .btn-accent:hover { background: var(--tt-green-hover); border-color: var(--tt-green-hover); }
.btn-ghost { background: transparent; border: 1px solid var(--tt-border-strong); color: var(--tt-ink); }
.btn-ghost:hover { background: var(--tt-surface); color: var(--tt-ink); }
.btn-danger { background: var(--tt-card); border: 1px solid var(--tt-brick-line); color: var(--tt-brick); }
.btn-danger:hover { background: var(--tt-brick-soft); border-color: var(--tt-brick); }
.btn-danger:disabled:hover { background: var(--tt-card); border-color: var(--tt-brick-line); }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn-primary:disabled:hover, .btn-accent:disabled:hover { background: var(--tt-green); border-color: var(--tt-green); }
.btn-ghost:disabled:hover { background: transparent; border-color: var(--tt-border-strong); color: var(--tt-ink); }

.hero {
    text-align: center; padding: 4rem 1.5rem 4rem;
    background: radial-gradient(900px 420px at 50% -10%, var(--tt-green-soft), transparent 70%);
}
.hero img.hero-logo { height: 130px; width: auto; margin-bottom: 1.2rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 0 0 1rem; line-height: 1.12; color: var(--tt-charcoal); }
.hero h1 .hl { color: var(--tt-green); }
.hero p { font-size: 1.15rem; color: var(--tt-muted); max-width: 620px; margin: 0 auto 2rem; }
.hero .cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.section { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem; }
.section h2 { font-size: 2rem; text-align: center; margin-bottom: .5rem; color: var(--tt-charcoal); }
.section .sub { text-align: center; color: var(--tt-muted); margin-bottom: 2.5rem; }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
a.feature { text-decoration: none; color: inherit; cursor: pointer; }
.feature {
    background: var(--tt-card); border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius-lg); padding: 1.15rem 1.2rem 1.25rem;
    transition: transform var(--tt-ease), border-color var(--tt-ease), box-shadow var(--tt-ease);
}
.feature:hover { transform: translateY(-1px); border-color: var(--tt-green-line); box-shadow: var(--tt-shadow-card); }
.feature .ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px; background: var(--tt-green-soft); font-size: 1.35rem;
}
.feature h3 { margin: .75rem 0 .25rem; font-size: 1rem; color: var(--tt-ink); }
.feature p { color: var(--tt-muted); margin: 0; font-size: .86rem; line-height: 1.45; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.plan {
    background: var(--tt-card); border: 1px solid var(--tt-border);
    border-radius: 1rem; padding: 2rem; display: flex; flex-direction: column;
    box-shadow: 0 2px 10px rgba(0,0,0,.03);
}
.plan.popular { border-color: var(--tt-green); box-shadow: 0 8px 28px rgba(15,107,63,.15); position: relative; }
.plan.popular::before {
    content: 'Más popular'; position: absolute; top: -.8rem; right: 1rem;
    background: var(--tt-green); color: #fff; font-size: .75rem; font-weight: 800;
    padding: .25rem .7rem; border-radius: 1rem;
}
.plan h3 { font-size: 1.5rem; margin: 0; color: var(--tt-charcoal); }
.plan .price { font-size: 2.6rem; font-weight: 800; margin: .5rem 0 0; color: var(--tt-charcoal); }
.plan .price small { font-size: .95rem; color: var(--tt-muted); font-weight: 500; }
.plan .desc { color: var(--tt-muted); min-height: 3rem; }
.plan ul { list-style: none; padding: 0; margin: 1.2rem 0; flex: 1; }
.plan li { padding: .4rem 0; color: var(--tt-text); display: flex; gap: .5rem; }
.plan li.off { color: #aab2ba; text-decoration: line-through; }
.plan li .ck { color: var(--tt-green); font-weight: 700; }

.quote { background: var(--tt-surface); border: 1px solid var(--tt-border); border-radius: 1rem; padding: 2rem; margin-top: 2rem; }
.quote h3 { color: var(--tt-charcoal); margin-top: 0; }
.quote .row { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: end; }
.quote label { display: block; color: var(--tt-muted); font-size: .9rem; margin-bottom: .3rem; }
.quote input, .quote select {
    background: #fff; border: 1px solid var(--tt-border); color: var(--tt-text);
    padding: .6rem .8rem; border-radius: .5rem; font-size: 1rem;
}
.quote input:focus, .quote select:focus { outline: 2px solid var(--tt-green); outline-offset: 1px; }
.quote .result { font-size: 1.6rem; font-weight: 800; color: var(--tt-green); }
.quote .result-plan { font-size: 1.25rem; font-weight: 700; color: var(--tt-charcoal); }

.plan-range {
    display: inline-block; margin-top: .5rem;
    background: var(--tt-green-soft); color: var(--tt-green-dark);
    font-size: .8rem; font-weight: 700;
    padding: .2rem .6rem; border-radius: 1rem;
}

.plan.free {
    border-color: var(--tt-teal);
    background: linear-gradient(180deg, var(--tt-teal-soft) 0%, #fff 45%);
    box-shadow: 0 8px 28px rgba(14,85,99,.14);
    position: relative;
}
.plan.free::before {
    content: 'Empieza gratis';
    position: absolute; top: -.8rem; right: 1rem;
    background: var(--tt-teal); color: #fff;
    font-size: .75rem; font-weight: 800;
    padding: .25rem .7rem; border-radius: 1rem;
}
.plan.free .price { color: var(--tt-teal); }
.plan.free .plan-range { background: var(--tt-teal-soft); color: var(--tt-teal-dark); }
.plan.free li .ck { color: var(--tt-teal); }
.plan.free .btn-primary { background: var(--tt-card); color: var(--tt-teal-dark); border-color: var(--tt-teal); }
.plan.free .btn-primary:hover { background: var(--tt-teal-soft); border-color: var(--tt-teal-dark); }

.footer { text-align: center; padding: 3rem 1.5rem; color: var(--tt-muted); border-top: 1px solid var(--tt-border); }

.loading { text-align: center; color: var(--tt-muted); padding: 2rem; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.form-grid input, .form-grid select {
    width: 100%; background: var(--tt-card); border: 1px solid var(--tt-border-strong);
    color: var(--tt-text); padding: .55rem .75rem; border-radius: var(--tt-radius-sm); font-size: .95rem; font-family: inherit;
}
.form-grid input:focus, .form-grid select:focus { outline: 2px solid var(--tt-green); outline-offset: 1px; }
.form-grid label { display: block; color: var(--tt-muted); font-size: .9rem; margin-bottom: .3rem; }

.alert-error {
    background: var(--tt-brick-soft); border: 1px solid var(--tt-brick-line); color: var(--tt-brick);
    border-radius: var(--tt-radius); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem;
}

.steps { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; }
.steps .step {
    font-size: .85rem; font-weight: 700; color: var(--tt-muted);
    background: var(--tt-surface); border: 1px solid var(--tt-border);
    padding: .35rem .9rem; border-radius: 1rem;
}
.steps .step.on { color: #fff; background: var(--tt-green); border-color: var(--tt-green); }

.inline-check {
    display: inline-flex; align-items: center; gap: .4rem;
    margin-left: .75rem; color: var(--tt-charcoal); font-weight: 600; cursor: pointer;
}
.inline-check input { width: auto; }

.map { height: 380px; border-radius: .75rem; border: 1px solid var(--tt-border); z-index: 0; }

.hint { color: var(--tt-muted); font-size: .82rem; line-height: 1.4; }
.hint.ok { color: var(--tt-green-dark); font-weight: 600; }

.actions { display: flex; gap: .8rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }

.code-input {
    width: 100%; text-align: center; letter-spacing: .6rem;
    font-size: 1.8rem; font-weight: 800; color: var(--tt-charcoal);
    padding: .7rem; border: 1px solid var(--tt-border); border-radius: .6rem;
}
.code-input:focus { outline: 2px solid var(--tt-green); outline-offset: 1px; }

.btn-paypal {
    background: #ffc439; color: #253b80;
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
}
.btn-paypal:hover { background: #f0b72c; }
.paypal-logo { height: 22px; width: auto; display: block; }

.success-badge {
    width: 72px; height: 72px; margin: 0 auto 1rem;
    border-radius: 50%; background: var(--tt-green-soft); color: var(--tt-green);
    font-size: 2.4rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
}

@font-face {
    font-family: 'Toc Toc Icons';
    src: url('/fonts/MaterialIcons-Regular.ttf') format('truetype');
    font-display: block;
}

.ico {
    font-family: 'Toc Toc Icons';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
    color: var(--tt-green);
}

.btn .ico, .btn-search .ico, .btn-clear .ico, .page-btn .ico { color: inherit; font-size: 1.1rem; }

body input[type="file"] {
    display: block; width: 100%; max-width: 100%;
    font: inherit; font-size: .86rem; color: var(--tt-muted);
    background: var(--tt-ground);
    border: 1px dashed var(--tt-border-strong); border-radius: 10px;
    padding: 9px 12px; cursor: pointer;
    transition: border-color .15s, background .15s;
}
body input[type="file"]:hover { border-color: var(--tt-green); background: var(--tt-green-soft); }
body input[type="file"]:focus-visible { outline: 2px solid var(--tt-green); outline-offset: 1px; }
body input[type="file"]::file-selector-button {
    font: inherit; font-weight: 600; font-size: .8rem;
    margin-right: 10px; border: 1px solid var(--tt-green-line); border-radius: 8px; padding: 6px 14px;
    background: var(--tt-card); color: var(--tt-green-dark); cursor: pointer;
    transition: background .15s, border-color .15s;
}
body input[type="file"]::file-selector-button:hover { background: var(--tt-green-soft); border-color: var(--tt-green); }
body input[type="file"]:disabled { opacity: .55; cursor: default; border-style: solid; background: var(--tt-surface); }
body input[type="file"]:disabled:hover { border-color: var(--tt-border-strong); background: var(--tt-surface); }
body input[type="file"]:disabled::file-selector-button { background: var(--tt-muted-soft); cursor: default; }

.tt-scroll { max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.tt-scroll > .tt-table { min-width: 640px; }
.tt-scroll-rows { max-height: 16rem; overflow-y: auto; }
.tt-scroll-rows > .tt-table thead th { position: sticky; top: 0; z-index: 1; }

.tt-table {
    width: 100%; border-collapse: collapse; background: var(--tt-card);
    border: 1px solid var(--tt-border); border-radius: var(--tt-radius); overflow: hidden;
}
.tt-table th {
    text-align: left; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--tt-muted); padding: 10px 14px; background: var(--tt-ground);
    border-bottom: 1px solid var(--tt-border); white-space: nowrap;
}
.tt-table td {
    padding: 11px 14px; border-top: 1px solid var(--tt-border);
    font-size: .86rem; color: var(--tt-ink); vertical-align: top; line-height: 1.4;
}
.tt-table tbody tr:first-child td { border-top: 0; }
.tt-table tbody tr:hover td { background: var(--tt-ground); }
.tt-table th, .tt-table td { overflow-wrap: break-word; }
.tt-table td .hh-name { white-space: nowrap; }
.hh-meta { color: var(--tt-muted); font-size: .82rem; margin-top: 2px; }
.hh-meta.hh-problem { color: var(--tt-brick); max-width: 34ch; white-space: normal; }
.tt-table td .meta { max-width: 52ch; }
.tt-table td.ledger-documents { white-space: nowrap; }
.tt-table td.ledger-documents .row-btn { display: flex; margin-bottom: 4px; }
.tt-table td.ledger-documents .row-btn:last-child { margin-bottom: 0; }
.tt-table td.num, .tt-table th.num { text-align: right; }

.tt-table tbody tr.ledger-move-opens td { padding-bottom: 3px; }
.tt-table tbody tr.ledger-same-move td { border-top: 0; padding-top: 0; padding-bottom: 3px; }
.tt-table tbody tr.ledger-move-closes td { padding-bottom: 11px; }
.tt-table tbody tr.ledger-same-move td:first-child {
    position: relative; padding-left: 32px;
    color: var(--tt-muted); font-size: .78rem;
}
.tt-table tbody tr.ledger-same-move td:first-child::before {
    content: ""; position: absolute; left: 16px; top: 0; bottom: 0;
    border-left: 1px solid var(--tt-border-strong);
}
.tt-table tbody tr.ledger-move-closes td:first-child::before {
    bottom: auto; height: 9px;
    border-bottom: 1px solid var(--tt-border-strong); border-bottom-left-radius: 4px; width: 7px;
}
.tt-table tbody tr.ledger-same-move:not(.ledger-move-closes) td:first-child::after {
    content: ""; position: absolute; left: 16px; top: 9px; width: 7px;
    border-top: 1px solid var(--tt-border-strong);
}
.tt-table td.actions { text-align: right; white-space: nowrap; }

.row-btn {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    border: 1px solid var(--tt-border-strong); border-radius: var(--tt-radius-sm); padding: 5px 10px; min-height: 30px;
    font-family: inherit; font-weight: 600; font-size: .78rem; line-height: 1.2; cursor: pointer;
    background: var(--tt-card); color: var(--tt-ink);
    transition: background var(--tt-ease), border-color var(--tt-ease), color var(--tt-ease);
}
.row-btn:hover { background: var(--tt-green-soft); border-color: var(--tt-green-line); color: var(--tt-green-dark); }
.row-btn:disabled { opacity: .5; cursor: default; }
.row-btn:disabled:hover { background: var(--tt-card); border-color: var(--tt-border); color: var(--tt-charcoal); }
.row-btn .ico { font-size: 1rem; color: inherit; }
.row-btn .ico.pdf, .row-btn:hover .ico.pdf { color: var(--tt-brick); }
.row-btn.danger { background: var(--tt-card); border-color: var(--tt-brick-line); color: var(--tt-brick); }
.row-btn.danger:hover { background: var(--tt-brick-soft); border-color: var(--tt-brick); color: var(--tt-brick); }
a.row-btn { text-decoration: none; }

.catalog-wait { font-size: .85rem; color: var(--tt-muted); margin: .6rem 0 0; }
.list-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 1rem 0 8px; }
.list-search input {
    flex: 1 1 12rem; min-width: min(12rem, 100%); min-height: var(--tt-control-h);
    border: 1px solid var(--tt-border-strong); border-radius: var(--tt-radius-sm); padding: 8px 12px;
    font-size: .9rem; font-family: inherit; color: var(--tt-ink); background: var(--tt-card);
    transition: border-color var(--tt-ease);
}
.list-search input:hover { border-color: var(--tt-muted-soft); }
.list-search input:focus { outline: 2px solid var(--tt-green); outline-offset: 1px; border-color: var(--tt-green); }
.btn-search, .btn-clear {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tt-control-h);
    border-radius: var(--tt-radius-sm); padding: 7px 16px; font-family: inherit; font-weight: 600; font-size: .875rem; line-height: 1.2;
    cursor: pointer; background: var(--tt-card); white-space: nowrap;
    transition: background var(--tt-ease), border-color var(--tt-ease), color var(--tt-ease);
}
.btn-search { border: 1px solid var(--tt-green-line); color: var(--tt-green-dark); }
.btn-search:hover { background: var(--tt-green-soft); border-color: var(--tt-green); }
.btn-clear { border: 1px solid var(--tt-border-strong); padding: 7px 13px; color: var(--tt-ink); }
.btn-clear:hover { background: var(--tt-surface); border-color: var(--tt-muted-soft); }
.btn-clear:disabled { opacity: .55; cursor: default; }
@media (max-width: 48rem) {
    .list-search > .btn { flex: 1 1 100%; }
}
.list-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 1rem; color: var(--tt-muted); font-size: .85rem; }
.list-filters input, .list-filters select {
    border: 1px solid var(--tt-border-strong); border-radius: var(--tt-radius-sm); padding: 6px 9px; min-height: 34px;
    font-size: .85rem; margin-left: 5px; color: var(--tt-ink); background: var(--tt-card); font-family: inherit;
}
.list-filters input:hover, .list-filters select:hover { border-color: var(--tt-muted-soft); }
.list-filters .grow { flex: 1; }

.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pager .info { color: var(--tt-muted); font-size: .85rem; }
.pager button:disabled, .page-btn:disabled { opacity: .45; cursor: default; }
.pager .pages { display: flex; align-items: center; gap: 6px; }
.page-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    min-width: 32px; min-height: 32px; border: 1px solid var(--tt-border-strong); border-radius: var(--tt-radius-sm); padding: 5px 11px;
    font-family: inherit; font-weight: 600; font-size: .8rem; line-height: 1.2; cursor: pointer;
    background: var(--tt-card); color: var(--tt-ink);
    transition: background var(--tt-ease), border-color var(--tt-ease);
}
.page-btn:hover { background: var(--tt-surface); border-color: var(--tt-muted-soft); }
.page-btn.current { background: var(--tt-green); border-color: var(--tt-green); color: #fff; }
.page-btn:disabled:hover { background: var(--tt-card); border-color: var(--tt-border-strong); }
.pager .dots { color: var(--tt-muted-soft); padding: 0 2px; }

.badge {
    display: inline-block; padding: .15rem .6rem; border-radius: 1rem;
    font-size: .74rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
    background: var(--tt-surface); color: var(--tt-muted);
}
.badge.b-on { background: var(--tt-green-soft); color: var(--tt-green-dark); }
.badge.b-off { background: var(--tt-brick-soft); color: var(--tt-brick); }
.badge.b-wait { background: var(--tt-amber-soft); color: var(--tt-amber); }
.badge.b-arranged { background: var(--tt-indigo-soft); color: var(--tt-indigo); }
.side-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; margin-left: auto; border-radius: 999px; background: var(--tt-brick); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; }
.btn .side-badge { margin-left: .5rem; }


.house-head { text-align: center; padding: .2rem 0 1.1rem; }
body .section .house-head h2 {
    margin: .1rem 0 0; font-family: var(--tt-font-display); font-size: 2.3rem;
    letter-spacing: .5px; color: var(--tt-ink); text-align: center;
}
.house-head-kind {
    display: inline-block; text-transform: uppercase; letter-spacing: .12em;
    font-size: .72rem; font-weight: 700; color: var(--tt-green);
}
.house-head-meta { color: var(--tt-muted); font-size: .95rem; margin: .25rem 0 0; }
.house-head-delivery { display: inline-flex; align-items: center; gap: .3rem; justify-content: center; font-size: .7rem; margin-top: .15rem; }
.house-head-delivery .house-head-delivery-edit { min-height: 18px; padding: 1px 4px; border-radius: 999px; }
.house-head-delivery .house-head-delivery-edit .ico { font-size: .75rem; }
.house-head-actions { display: flex; justify-content: flex-end; margin-bottom: .3rem; }
.house-summary { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: center; margin-top: .7rem; }
.house-tab { margin-top: 1.2rem; min-height: 30rem; }
.loading-rows { display: flex; flex-direction: column; gap: .55rem; margin-top: .9rem; }
.loading-row {
    display: block; height: 1.1rem; border-radius: .3rem;
    background: linear-gradient(90deg, var(--tt-surface) 0%, var(--tt-ground) 50%, var(--tt-surface) 100%);
    background-size: 200% 100%;
    animation: loading-sweep 1.2s ease-in-out infinite;
}
.loading-row:nth-child(odd) { width: 92%; }
.loading-row:nth-child(even) { width: 78%; }
@keyframes loading-sweep {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}
.house-figures {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
    gap: .8rem; margin-bottom: 1.2rem;
}
.house-figure {
    background: var(--tt-card); border: 1px solid var(--tt-border); text-align: center;
    border-radius: var(--tt-radius); padding: .8rem 1rem;
}
.house-figure-what { display: block; color: var(--tt-muted); font-size: .82rem; }
.house-figure-much { display: block; font-family: var(--tt-font-display); font-size: 1.35rem; color: var(--tt-ink); margin-top: .15rem; }
.house-person { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--tt-border); }
.house-person:last-child { border-bottom: 0; }
.house-person strong { margin-right: .4rem; }
.house-household { padding-left: 1rem; border-left: 2px solid var(--tt-border); margin-left: .3rem; }
.house-person-nested { padding-left: 1rem; }
.house-card {
    background: var(--tt-card); border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem;
    min-width: 0;
}
.house-card > h3 { margin: 0 0 .2rem; font-size: 1.02rem; }
.house-card > h4 { margin: 1.3rem 0 .5rem; font-size: .92rem; color: var(--tt-ink); }
.house-card-head + h4 { margin-top: .2rem; }
.house-card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.collect-together {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .8rem;
    flex-wrap: wrap;
    margin-top: .9rem;
    padding-top: .9rem;
    border-top: 1px solid var(--tt-border);
}
.collect-together .meta { margin: 0; }
.house-card-head + .tt-scroll .sd-table { margin-top: 0; }
.house-card-head + .loading-rows { margin-top: 0; }
.house-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.house-card-head h3 { margin: 0 0 .2rem; font-size: 1.02rem; }
details.house-card > summary { cursor: pointer; font-size: 1.02rem; font-weight: 600; color: var(--tt-ink); }
details.house-card[open] > summary { margin-bottom: .8rem; }
details.house-card > .house-card-actions { margin-bottom: .8rem; }
.house-photo { width: 100%; border-radius: 12px; border: 1px solid var(--tt-border); margin-top: .5rem; }
.house-toast { background: var(--tt-green-soft); color: var(--tt-green-dark); border-radius: var(--tt-radius); padding: .7rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.house-toast.problem { background: var(--tt-brick-soft); color: var(--tt-brick); }
.house-errorbox { background: var(--tt-brick-soft); color: var(--tt-brick); border-radius: var(--tt-radius); padding: .7rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.house-tabs { justify-content: safe center; }
.house-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(26rem, 100%), 1fr));
    gap: 1rem; align-items: start;
}
.house-grid > * { min-width: 0; }
.house-grid > .house-card { margin-bottom: 0; }
@media (min-width: 60rem) {
    .house-grid-wide-and-narrow { grid-template-columns: 2fr 1fr; }
}
.money-in { color: var(--tt-green); font-weight: 700; white-space: nowrap; }
.money-out { color: var(--tt-brick); font-weight: 700; white-space: nowrap; }

.sd-table { margin-top: .9rem; }
.sd-form { display: grid; gap: .8rem; margin-top: .8rem; }
.sd-field { display: flex; flex-direction: column; gap: .3rem; }
.sd-field label { font-size: .82rem; color: var(--tt-ink-soft); font-weight: 600; }
.sd-field input, .sd-field select, .sd-field textarea {
    padding: .5rem .65rem; border: 1px solid var(--tt-border);
    border-radius: .4rem; font-size: .92rem; font-family: inherit; color: var(--tt-ink);
}
.sd-field textarea { resize: vertical; min-height: 4.5rem; line-height: 1.4; }

.sd-field select, .field select {
    appearance: none; -webkit-appearance: none; background-color: var(--tt-card); cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23857b6c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 8l5 5 5-5'/></svg>");
    background-repeat: no-repeat; background-position: right .55rem center; background-size: 1.05rem;
    padding-right: 2.1rem;
}
.sd-field input:hover, .sd-field select:hover, .sd-field textarea:hover,
.field input:hover, .field select:hover { border-color: var(--tt-green-line); }
.sd-field input:focus, .sd-field select:focus, .sd-field textarea:focus,
.field input:focus, .field select:focus { outline: 2px solid var(--tt-green); outline-offset: 1px; border-color: var(--tt-green); }
.sd-field select:disabled, .field select:disabled { background-color: var(--tt-surface); color: var(--tt-muted); cursor: default; }
.phone-input { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; align-items: center; }
.phone-input input { min-width: 0; width: 100%; }
.lada-chosen {
    display: flex; align-items: center; gap: .35rem; white-space: nowrap;
    border: 1px solid var(--tt-border); border-radius: .4rem; background: var(--tt-card);
    padding: .5rem .55rem; font-family: inherit; font-size: .92rem; color: var(--tt-ink); cursor: pointer;
}
.lada-chosen:hover { border-color: var(--tt-green-line); }
.lada-chosen:disabled { opacity: .55; cursor: default; }
.lada-chosen .ico { font-size: 1.1rem; color: var(--tt-muted); }
.lada-flag { font-size: 1.05rem; line-height: 1; }
.lada-dial { color: var(--tt-ink); font-variant-numeric: tabular-nums; }
.lada-backdrop { position: fixed; inset: 0; z-index: 60; }
.lada-list {
    position: absolute; z-index: 61; top: calc(100% + .25rem); left: 0; right: 0; min-width: 12rem;
    background: var(--tt-card); border: 1px solid var(--tt-border); border-radius: var(--tt-radius);
    box-shadow: 0 10px 24px rgba(0,0,0,.14); padding: .4rem;
}
.lada-list > input {
    width: 100%; border: 1px solid var(--tt-border); border-radius: .4rem;
    padding: .4rem .55rem; font-family: inherit; font-size: .9rem; color: var(--tt-ink);
}
.lada-options { max-height: 13rem; overflow-y: auto; margin-top: .35rem; }
.lada-option {
    display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left;
    border: 0; border-bottom: 1px solid var(--tt-border); background: transparent;
    padding: .45rem .5rem; font-family: inherit; font-size: .9rem; color: var(--tt-ink); cursor: pointer;
}
.lada-option:last-child { border-bottom: 0; }
.lada-option:hover { background: var(--tt-surface); }
.lada-country { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lada-option .lada-dial { color: var(--tt-muted); font-size: .86rem; }
.sd-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .8rem; }
.sd-row > .sd-field { justify-content: space-between; }
.sd-folios { display: flex; flex-wrap: wrap; gap: .5rem; }
.sd-folios input { width: 9rem; }
.sd-piece { display: grid; gap: .6rem; border: 1px solid var(--tt-border); border-radius: .5rem; padding: .8rem .9rem; background: var(--tt-surface); }
.sd-piece-head { font-size: .82rem; font-weight: 700; color: var(--tt-ink-soft); text-transform: uppercase; letter-spacing: .03em; }
.sd-captured { display: flex; flex-wrap: wrap; gap: .35rem .8rem; margin-top: .2rem; }
.sd-captured span { font-size: .82rem; color: var(--tt-muted); }
.sd-captured strong { color: var(--tt-ink-soft); font-weight: 600; }
.sd-check { display: flex; flex-direction: row; align-items: center; gap: .5rem; cursor: pointer; font-size: .93rem; color: var(--tt-ink); }
.sd-check input { width: auto; }
.screens-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .4rem; }
.screen-pick { position: relative; display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; border: 1px solid var(--tt-border); border-radius: .5rem; background: var(--tt-bg); font-size: .9rem; cursor: pointer; transition: background .12s, border-color .12s; }
.screen-pick:hover { border-color: var(--tt-border-strong); }
.screen-pick.locked { opacity: .55; cursor: not-allowed; }
.screen-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.screen-pick .tick { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; border: 1.5px solid var(--tt-border-strong); border-radius: .3rem; background: var(--tt-bg); }
.screen-pick .tick .ico { font-size: 14px; line-height: 1; color: transparent; }
.screen-pick .screen-text { display: grid; gap: .1rem; min-width: 0; }
.screen-pick .screen-hint { font-size: .8rem; line-height: 1.3; color: var(--tt-muted); }
.screen-pick.on { background: var(--tt-green-soft); border-color: var(--tt-green-line); }
.screen-pick.on .tick { background: var(--tt-green); border-color: var(--tt-green); }
.screen-pick.on .tick .ico { color: #fff; }
.screen-pick.on .screen-name { color: var(--tt-green-dark); font-weight: 600; }
.screen-pick input:focus-visible + .tick { outline: 2px solid var(--tt-green); outline-offset: 2px; }
.sd-summary { background: var(--tt-surface); border-left: 3px solid var(--tt-green); border-radius: .4rem; padding: .7rem .9rem; font-size: .88rem; color: var(--tt-ink-soft); }
.modal-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }
.sd-summary strong { color: var(--tt-ink); }
.sd-error { color: var(--tt-brick); font-size: .88rem; }
.sd-folio { display: inline-flex; align-items: center; gap: .35rem; background: var(--tt-surface); color: var(--tt-ink-soft); border-radius: .4rem; padding: .1rem .5rem; margin: 0 .3rem .3rem 0; font-size: .82rem; }
.sd-folio.sd-down { background: var(--tt-ground); color: var(--tt-muted-soft); text-decoration: line-through; }
.sd-folio button { border: 0; background: transparent; color: var(--tt-brick); cursor: pointer; font-size: .9rem; line-height: 1; padding: 0; }

.house-picker { display: flex; flex-direction: column; gap: .4rem; }
.house-picker > label { font-size: .82rem; color: var(--tt-ink-soft); font-weight: 600; }
.house-picker-search { display: flex; gap: 8px; align-items: center; }
.house-picker-search input {
    flex: 1; min-width: 0;
    border: 1px solid var(--tt-border); border-radius: var(--tt-radius);
    padding: 8px 12px; font-size: .92rem; font-family: inherit; color: var(--tt-ink);
}
.house-picker-search input:focus { outline: none; border-color: var(--tt-green-line); }
.house-picker-hint { color: var(--tt-muted); font-size: .85rem; margin: 0; }
.house-picked {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    background: var(--tt-ground); border: 1px solid var(--tt-border);
    border-radius: var(--tt-radius); padding: .55rem .75rem; font-size: .92rem;
}
.house-picked-who { color: var(--tt-muted); margin-left: .4rem; }
.house-candidates {
    border: 1px solid var(--tt-border); border-radius: var(--tt-radius);
    max-height: 13rem; overflow-y: auto; background: var(--tt-card);
}
.house-candidate {
    display: flex; align-items: baseline; gap: .5rem;
    width: 100%; text-align: left; padding: .5rem .75rem;
    border: 0; border-bottom: 1px solid var(--tt-border); background: transparent;
    cursor: pointer; font-family: inherit; font-size: .92rem; color: var(--tt-ink);
}
.house-candidate:last-child { border-bottom: 0; }
.house-candidate:hover { background: var(--tt-surface); }
.house-candidate span { color: var(--tt-muted); font-size: .86rem; }

.list-tabs {
    display: flex; flex-wrap: wrap; gap: 4px; margin: 1rem 0 0;
    border-bottom: 1px solid var(--tt-border);
}
.list-tabs .tab-btn {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap;
    border: none; background: none; cursor: pointer;
    padding: 10px 12px; margin-bottom: -1px;
    font-family: inherit; font-weight: 600; font-size: .875rem;
    color: var(--tt-muted); border-bottom: 2px solid transparent;
    transition: color var(--tt-ease), border-color var(--tt-ease);
}
.list-tabs .tab-btn:hover { color: var(--tt-ink); }
.list-tabs .tab-btn.current { color: var(--tt-green); border-bottom-color: var(--tt-green); }
.list-tabs .tab-btn .ico { font-size: 1.05rem; color: inherit; }
.list-tabs.page-tabs { margin-bottom: 1.2rem; }

.modal-back {
    position: fixed; inset: 0; background: rgba(35,32,28,.45); z-index: 50;
    display: flex; align-items: flex-start; justify-content: center;
    overflow-y: auto; padding: 5vh 1rem;
}
.modal-back.confirm-back { z-index: 60; }
.modal-card {
    position: relative; background: var(--tt-card); color: var(--tt-ink);
    border: 1px solid var(--tt-border); border-radius: var(--tt-radius-lg); width: min(680px, 100%); padding: 1.5rem 1.6rem 1.6rem;
    box-shadow: var(--tt-shadow-pop);
}
.modal-card > h2, .modal-card > h3 { padding-right: 2.2rem; margin-top: 0; }
.modal-card > h2 { font-size: 1.2rem; }
.modal-card > h3 { font-size: 1.05rem; }
.modal-x {
    position: absolute; top: .55rem; right: .55rem; z-index: 5;
    display: inline-flex; align-items: center; justify-content: center;
    width: 2rem; height: 2rem; padding: 0;
    border: 0; border-radius: .5rem; background: transparent;
    color: var(--tt-muted); cursor: pointer;
}
.modal-x:hover { background: var(--tt-surface); color: var(--tt-ink); }
.modal-x .ico { font-size: 1.3rem; color: inherit; }

.section, .a-wrap, .c-wrap, .e-wrap, .i-wrap, .r-wrap, .t-wrap { position: relative; }
.tt-refresh--corner { position: absolute; top: 1.35rem; right: 1.5rem; z-index: 3; }
@media (max-width: 640px) { .tt-refresh--corner { top: .6rem; right: .6rem; } }

.app-audience { max-width: 560px; }
.app-audience .field { margin-top: 1rem; }
.module-rows { margin-top: 1rem; border: 1px solid var(--tt-border); border-radius: 12px; background: var(--tt-card); padding: 0 14px; }
.module-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--tt-border); cursor: pointer; font-size: .95rem; color: var(--tt-charcoal); }
.module-row:last-child { border-bottom: 0; }
.tt-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 44px; }
.tt-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tt-switch .knob { position: absolute; inset: 0; border-radius: 12px; background: var(--tt-border-strong); transition: background .15s; }
.tt-switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.tt-switch input:checked + .knob { background: var(--tt-green); }
.tt-switch input:checked + .knob::after { transform: translateX(20px); }
.tt-switch input:focus-visible + .knob { outline: 2px solid var(--tt-green); outline-offset: 2px; }

details.app-permissions > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .82rem; font-weight: 700; color: var(--tt-ink-soft); text-transform: uppercase; letter-spacing: .03em; }
details.app-permissions > summary::-webkit-details-marker { display: none; }
details.app-permissions > summary::after { content: "expand_more"; font-family: 'Toc Toc Icons'; font-size: 1.2rem; text-transform: none; letter-spacing: 0; color: var(--tt-muted); transition: transform .15s; }
details.app-permissions[open] > summary::after { transform: rotate(180deg); }
details.app-permissions .module-rows { margin-top: .4rem; }

.map-modal { display: grid; gap: .8rem; }
.map-modal .map-address { font-size: .95rem; color: var(--tt-ink); line-height: 1.4; }
.map-modal .map-coords { font-family: Consolas, monospace; font-size: .8rem; color: var(--tt-muted); }
.map-modal .map-frame { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--tt-border); border-radius: .6rem; overflow: hidden; background: var(--tt-surface); }
.map-modal .map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.gmaps-btn { display: inline-flex; align-items: center; gap: .6rem; padding: .65rem 1.1rem .65rem .8rem; border-radius: .7rem; background: #fff; border: 1px solid #dadce0; color: #3c4043; font-weight: 700; font-size: .92rem; text-decoration: none; box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); transition: box-shadow .15s, transform .1s; }
.gmaps-btn:hover { box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15); transform: translateY(-1px); color: #202124; }
.gmaps-btn svg { width: auto; height: 26px; flex: 0 0 auto; }
