﻿:root {
    --th-red: #AA3930;
    --th-red-deep: #7A2822;
    --th-gold: #AA3930;
    --th-ivory: #F6F3F0;
    --th-cream: #F6F3F0;
    --th-surface: #FFFCFA;
    --th-ink: #1A1A1A;
    --th-muted: #6B6B6B;
    --th-line: #E7E0DA;
    --th-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
    --th-photo: #ffffff;
    --th-bg: #F8F5F2;
    --th-serif: "IBM Plex Sans Condensed", "IBM Plex Sans", "Segoe UI", sans-serif;
    --th-sans: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --th-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
    --th-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --th-glow: rgba(170, 57, 48, 0.28);
    --th-appbar-height: 4.6rem;
    --th-cat-rail-h: 3.1rem;
    --th-grid-size: 3.2rem;
    --th-grid:
        linear-gradient(color-mix(in srgb, var(--th-red) 14%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--th-red) 14%, transparent) 1px, transparent 1px);
    --th-grid-soft:
        linear-gradient(color-mix(in srgb, var(--th-red) 8%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--th-red) 8%, transparent) 1px, transparent 1px);
    --color-sf-primary: 170, 57, 48;
    --color-sf-primary-text-color: 255, 255, 255;
}

html.th-dark {
    --th-red: #E07A72;
    --th-red-deep: #C45B52;
    --th-gold: #E07A72;
    --th-ivory: #12141A;
    --th-cream: #12141A;
    --th-surface: #1C1F28;
    --th-ink: #F3F4F6;
    --th-muted: #A3AAB8;
    --th-line: #2E3440;
    --th-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --th-photo: #ffffff;
    --th-bg: #161922;
    --th-glow: rgba(224, 122, 114, 0.32);
    --color-sf-primary: 224, 122, 114;
    --color-sf-primary-text-color: 255, 255, 255;
}

html {
    scroll-padding-top: calc(var(--th-appbar-height, 4rem) + var(--th-cat-rail-h, 3.65rem) + 0.75rem);
    scroll-behavior: smooth;
}

html.th-scroll-instant {
    scroll-behavior: auto !important;
}

html, body {
    font-family: var(--th-sans);
    color: var(--th-ink);
    background-color: var(--th-ivory);
    background-image: var(--th-grid-soft);
    background-size: var(--th-grid-size) var(--th-grid-size);
    background-position: center top;
    letter-spacing: 0.01em;
}

h1, h2, h3, h4, .th-serif {
    font-family: var(--th-serif);
    font-weight: 600;
    letter-spacing: 0.02em;
}

a, .btn-link {
    color: var(--th-red);
}

.btn-primary {
    color: #fff;
    background-color: var(--th-red);
    border-color: var(--th-red-deep);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--th-red) !important;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 300, "GRAD" -25, "opsz" 24;
    font-weight: 300;
    line-height: 1;
}

.mud-icon-root {
    opacity: 0.92;
}

.mud-button .mud-button-icon-start .mud-icon-root,
.mud-button-filled .mud-icon-root {
    opacity: 1;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--th-red);
}

.validation-message {
    color: var(--th-red);
    font-size: 0.8rem;
}

#blazor-error-ui {
    background: var(--th-surface);
    color: var(--th-ink);
    border-top: 3px solid var(--th-red);
    bottom: 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem 0.85rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload {
    margin-left: 0.45rem;
    font-weight: 700;
    color: var(--th-red);
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.status-bar-safe-area {
    display: none;
}

@supports (-webkit-touch-callout: none) {
    .status-bar-safe-area {
        display: flex;
        position: sticky;
        top: 0;
        height: env(safe-area-inset-top);
        background-color: var(--th-ivory);
        width: 100%;
        z-index: 1;
    }

    .flex-column, .navbar-brand {
        padding-left: env(safe-area-inset-left);
    }
}

.e-tab-text {
    color: var(--th-red) !important;
    font-family: var(--th-sans) !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
}

.e-indicator {
    background-color: var(--th-red) !important;
}

/* Layout */
.th-shell {
    min-height: 100vh;
    background: var(--th-ivory);
}

.th-skip {
    position: absolute;
    left: 0.75rem;
    top: -4rem;
    z-index: 80;
    padding: 0.45rem 0.8rem;
    background: var(--th-red);
    color: #fff;
}

.th-skip:focus {
    top: 0.75rem;
}

html.th-scroll-lock,
html.th-scroll-lock body {
    overflow: hidden;
}

.th-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1100;
    padding: max(0.55rem, env(safe-area-inset-top, 0px)) 0 0.55rem;
    background: var(--th-surface);
    border-bottom: 3px solid var(--th-red);
    color: var(--th-ink);
}

body:has(.th-cat-rail) .th-header {
    border-bottom-color: var(--th-surface);
}

.th-header__inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    width: 100%;
    padding: 0 max(0.85rem, env(safe-area-inset-right)) 0 max(0.85rem, env(safe-area-inset-left));
}

.th-header__end {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.th-header__search {
    display: none;
    width: min(18rem, 28vw);
    min-width: 12rem;
}

.th-cart-wrap {
    flex: 0 0 auto;
    position: relative;
    z-index: 20;
    margin-left: 0.35rem;
}

.th-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem 0.3rem 0.55rem;
    border: none;
    border-radius: 2px;
    background: var(--th-red);
    color: #fff;
    cursor: pointer;
    min-height: 38px;
    overflow: visible;
}

.th-cart-btn:hover {
    background: var(--th-red-deep);
}

.th-cart-btn:focus-visible,
.th-icon-btn:focus-visible,
.th-menu-toggle:focus-visible,
.th-signin-chip:focus-visible,
.th-brand:focus-visible,
.th-login-submit:focus-visible,
.th-login-link:focus-visible,
.th-login-eye:focus-visible,
.th-contact-cta:focus-visible,
.th-branch-trigger:focus-visible {
    outline: 2px solid var(--th-red);
    outline-offset: 2px;
}

.th-signin-chip,
.th-signin-chip:link,
.th-signin-chip:visited,
.th-signin-chip:hover,
.th-signin-chip:active,
.th-signin-chip:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.35rem 0.95rem;
    margin-right: 0.35rem;
    border: none;
    border-radius: 999px;
    background: var(--th-red);
    color: #fff !important;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.th-signin-chip:hover,
.th-signin-chip:active {
    background: var(--th-red-deep);
    color: #fff !important;
}

.th-price-lock {
    color: var(--th-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    min-width: 0;
}

.th-cart-btn.is-pulse {
    animation: th-cart-pulse 0.6s ease;
}

.th-cart-btn.is-pulse .th-cart-count {
    transform: scale(1.15);
}

@keyframes th-cart-pulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.14); }
    100% { transform: scale(1); }
}

.th-cart-btn .mud-icon-root {
    color: #fff !important;
    font-size: 1.2rem !important;
    opacity: 1;
}

.th-cart-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.th-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    height: 1.55rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #fff;
    color: var(--th-red);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.th-cart-count.is-empty {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.th-logo {
    height: 34px;
    width: auto;
    flex-shrink: 0;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 5px 6px;
    box-sizing: content-box;
}

.th-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    color: inherit;
    text-decoration: none;
}

.th-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    flex: 0 0 auto;
    min-width: 0;
}

.th-brand-name {
    font-family: var(--th-sans);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--th-ink);
    white-space: nowrap;
}

.th-brand-branch {
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--th-red);
    margin-left: 0.35em;
}

.th-brand-loc {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--th-muted);
}

.th-brand-motto {
    font-family: var(--th-serif);
    font-style: italic;
    color: var(--th-red);
}

.th-brand-current {
    display: none;
    margin-top: 0.08rem;
    font-family: var(--th-sans);
    font-size: 0.62rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--th-ink);
    line-height: 1.2;
}

.th-shell.is-branch-fixed .th-brand-current {
    display: block;
}

.th-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.6rem;
    margin: 0;
    padding: 0.35rem 0.1rem 0.35rem 0.4rem;
    border: 0;
    background: none;
    color: var(--th-ink);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.th-menu-toggle__bars {
    position: relative;
    display: block;
    width: 18px;
    height: 12px;
}

.th-menu-toggle__bars i {
    position: absolute;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--th-red);
    transition: transform 0.35s var(--th-ease), top 0.35s var(--th-ease);
}

.th-menu-toggle__bars i:first-child { top: 2px; }
.th-menu-toggle__bars i:last-child { top: 8px; }

.th-menu-toggle.is-open .th-menu-toggle__bars i:first-child {
    top: 5px;
    transform: rotate(40deg);
}

.th-menu-toggle.is-open .th-menu-toggle__bars i:last-child {
    top: 5px;
    transform: rotate(-40deg);
}

.th-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    margin: 0 0.15rem;
    padding: 0;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
    color: var(--th-ink);
    cursor: pointer;
}

.th-icon-btn .mud-icon-root {
    font-size: 1.2rem !important;
    color: var(--th-ink) !important;
}

.th-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.4rem;
    margin-right: 0.35rem;
    padding: 0 0.7rem 0 0.55rem;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
    color: var(--th-ink);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.th-account-btn .mud-icon-root {
    color: var(--th-red) !important;
    font-size: 1.15rem !important;
}

.th-nav {
    display: none;
    align-items: center;
    gap: 1.45rem;
    min-width: 0;
}

.th-nav a {
    position: relative;
    color: var(--th-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
}

.th-nav a:hover,
.th-nav a.active {
    color: var(--th-ink);
}

.th-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.35rem;
    height: 2px;
    background: var(--th-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--th-ease);
}

.th-nav a.active::after,
.th-nav a:hover::after {
    transform: scaleX(1);
}

.th-search-toggle {
    display: inline-flex;
    margin: 0;
    border-color: var(--th-line);
}

.th-search-toggle.is-open {
    color: var(--th-red);
    border-color: color-mix(in srgb, var(--th-red) 45%, var(--th-line));
    background: color-mix(in srgb, var(--th-red) 8%, var(--th-surface));
}

.th-search-toggle.is-open .mud-icon-root {
    color: var(--th-red) !important;
}

.th-mobile-search-dock {
    --th-mobile-gutter: 1.25rem;
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--th-appbar-height, calc(4rem + 3px)) - 1px);
    z-index: 1095;
    box-sizing: border-box;
    display: none;
    align-items: stretch;
    padding:
        0.4rem
        max(var(--th-mobile-gutter), env(safe-area-inset-right))
        0.65rem
        max(var(--th-mobile-gutter), env(safe-area-inset-left));
    background: var(--th-surface);
    border-bottom: 1px solid var(--th-line);
}

.th-mobile-search-dock.is-open {
    display: flex;
}

.th-mobile-search-dock .th-search-host {
    z-index: 1;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: none;
}

.th-branch-host {
    position: relative;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    z-index: 30;
}

.th-branch-host.is-open {
    z-index: 1205;
}

.th-branch-host.th-branch--appbar {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    margin-right: 0.15rem;
}

.th-branch-host.th-branch--drawer {
    flex: none;
    width: 100%;
    max-width: none;
}

.th-drawer-branch {
    width: 100%;
}

.th-branch-scrim {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: transparent;
}

.th-branch-trigger {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.45rem;
    max-width: 100%;
    padding: 0.28rem 0.5rem 0.28rem 0.6rem;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
    color: var(--th-ink);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: border-color 0.15s var(--th-ease), box-shadow 0.15s var(--th-ease);
}

.th-branch-trigger:hover,
.th-branch-host.is-open .th-branch-trigger {
    border-color: color-mix(in srgb, var(--th-red) 50%, var(--th-line));
}

.th-branch-host.is-open .th-branch-trigger {
    box-shadow: 0 0 0 1px var(--th-red);
}

.th-branch-trigger.is-locked {
    cursor: default;
}

.th-branch-trigger.is-locked:hover {
    border-color: var(--th-line);
}

.th-branch-trigger > .mud-icon-root:first-child {
    flex: 0 0 auto;
    color: var(--th-red) !important;
    font-size: 1.15rem !important;
}

.th-branch-trigger__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.02rem;
    min-width: 0;
}

.th-branch-trigger__kicker {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--th-muted);
    line-height: 1;
}

.th-branch-trigger__name {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
}

.th-branch-trigger__chevron {
    flex: 0 0 auto;
    margin-left: 0.1rem;
    color: var(--th-muted) !important;
    font-size: 1.2rem !important;
    transition: transform 0.18s var(--th-ease);
}

.th-branch-trigger__chevron.is-open {
    transform: rotate(180deg);
    color: var(--th-red) !important;
}

.th-branch-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 2;
    min-width: max(100%, 17rem);
    padding: 0.35rem;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
    box-shadow: var(--th-shadow);
}

.th-branch--drawer .th-branch-trigger {
    width: 100%;
}

.th-branch--drawer .th-branch-menu {
    min-width: 100%;
    width: 100%;
}

.th-branch-option {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.12rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 0;
    background: transparent;
    color: var(--th-ink);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.th-branch-option:hover {
    background: var(--th-ivory);
}

.th-branch-option.is-active {
    background: color-mix(in srgb, var(--th-red) 9%, var(--th-surface));
}

.th-branch-option.is-inactive {
    opacity: 0.55;
}

.th-branch-option__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.th-branch-option__name {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.th-branch-option__check {
    color: var(--th-red) !important;
    font-size: 1.05rem !important;
}

.th-branch-option__meta {
    font-size: 0.72rem;
    color: var(--th-muted);
    line-height: 1.3;
}

.th-admin-scope {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0 0 0.7rem;
    padding: 0.5rem 0.8rem 0.55rem;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
}

.th-admin-scope__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--th-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.th-admin-scope__head .mud-icon-root {
    color: var(--th-red) !important;
    font-size: 1.05rem !important;
}

.th-admin-scope__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.th-admin-scope__chip {
    appearance: none;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    padding: 0.28rem 0.65rem;
    border: 1px solid var(--th-line);
    background: var(--th-ivory);
    color: var(--th-ink);
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s var(--th-ease), background 0.15s var(--th-ease), box-shadow 0.15s var(--th-ease);
}

.th-admin-scope__chip:hover {
    border-color: color-mix(in srgb, var(--th-red) 45%, var(--th-line));
}

.th-admin-scope__chip.is-active {
    border-color: var(--th-red);
    background: color-mix(in srgb, var(--th-red) 8%, var(--th-surface));
    box-shadow: inset 0 0 0 1px var(--th-red);
}

.th-admin-scope__chip.is-inactive:not(.is-active) {
    opacity: 0.7;
}

.th-admin-scope__chip-name {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.th-admin-scope__chip-meta {
    font-size: 0.68rem;
    color: var(--th-muted);
    line-height: 1.2;
}

.th-admin-scope__chip-flag {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-admin-scope__chip.is-active .th-admin-scope__chip-flag {
    color: var(--th-red);
}

.th-admin-scope__hint,
.th-admin-note,
.th-admin-branch-hint,
.th-admin-field-hint {
    color: var(--th-muted);
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0;
}

.th-admin-scope__hint strong {
    color: var(--th-ink);
    font-weight: 600;
}

.th-admin-note,
.th-admin-branch-hint {
    margin: 0 0 0.85rem;
}

.th-admin-field-hint {
    font-size: 0.72rem;
    margin-top: 0.3rem;
}

.th-admin-tabs > .e-content {
    padding-top: 0.85rem !important;
}

.th-admin-tabs.e-tab > .e-tab-header {
    overflow: hidden;
}

.th-admin-tabs .e-toolbar-items {
    min-height: 2.6rem;
}

.th-admin-subtabs .e-tab-header {
    background: transparent !important;
}

.th-admin-panel {
    max-width: 40rem;
    margin: 0.35rem 0 1.25rem;
    padding: 1.15rem 1.2rem 1.3rem;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
}

.th-admin-panel__title {
    margin: 0 0 0.35rem;
    font-family: var(--th-serif);
    font-size: 1.15rem;
    font-weight: 600;
}

.th-admin-panel__lead {
    margin: 0 0 1rem;
    color: var(--th-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.th-admin-steps {
    margin: 0 0 1.1rem;
    padding-left: 1.15rem;
    color: var(--th-ink);
    font-size: 0.88rem;
    line-height: 1.55;
}

.th-admin-steps li + li {
    margin-top: 0.25rem;
}

.th-admin-panel__field + .th-admin-panel__field {
    margin-top: 1rem;
}

.th-admin-download {
    display: inline-flex;
    align-items: center;
    margin: 0 0 1rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--th-line);
    background: var(--th-ivory);
    color: var(--th-ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.th-admin-download:hover,
.th-admin-download:active,
.th-admin-download:focus {
    border-color: var(--th-red);
    color: var(--th-ink);
}

.th-admin-sample {
    margin: 0 0 1rem;
    padding: 0.75rem 0.85rem;
    overflow-x: auto;
    background: var(--th-ivory);
    border: 1px solid var(--th-line);
    color: var(--th-ink);
    font-family: var(--th-mono);
    font-size: 0.72rem;
    line-height: 1.5;
    white-space: pre;
}

.th-admin-alt {
    margin-top: 0.9rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--th-red);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.th-admin-result {
    margin-top: 0.85rem;
}

.th-admin-result p + p {
    margin-top: 0.35rem;
}

.th-admin-empty {
    margin: 0.35rem 0 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px dashed var(--th-line);
    background: var(--th-ivory);
    color: var(--th-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.th-admin-dialog {
    min-width: min(520px, 92vw);
}

.th-user-edit__perms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 1rem;
    margin-top: 0.85rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--th-line);
    background: var(--th-ivory);
}

.th-user-edit__perm {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.th-user-edit__perm-note {
    font-size: 0.72rem;
    color: var(--th-muted);
    line-height: 1.35;
    padding-left: 1.65rem;
}

.th-user-edit__perm--wide {
    grid-column: 1 / -1;
    padding-top: 0.35rem;
    border-top: 1px solid var(--th-line);
}

.th-muted-cell {
    color: var(--th-muted);
}

.th-status-pill {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.th-status-pill.is-on {
    color: var(--th-red);
    background: color-mix(in srgb, var(--th-red) 12%, transparent);
}

.th-status-pill.is-off {
    color: var(--th-muted);
    background: var(--th-ivory);
}

.th-admin-grid-shell > .th-office-panel {
    margin: 0.9rem 1.05rem 1rem;
}

.th-admin-grid-shell {
    margin-top: 0.45rem;
    border: 1px solid var(--th-line);
    border-radius: 16px;
    background: var(--th-surface);
    box-shadow: var(--th-shadow);
    overflow: hidden;
}

.th-admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.75rem;
    padding: 0.85rem 1rem 0.8rem;
    border-bottom: 1px solid var(--th-line);
    background: var(--th-surface);
    position: relative;
    z-index: 5;
}

.th-admin-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 16rem;
    min-width: 12rem;
    max-width: 24rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--th-line);
    border-radius: 12px;
    background: var(--th-ivory);
    color: var(--th-muted);
}

.th-admin-search .mud-icon-root {
    font-size: 1.15rem !important;
    color: var(--th-muted) !important;
}

.th-admin-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--th-ink);
    font: inherit;
    font-size: 0.9rem;
    outline: none;
}

.th-admin-search:focus-within {
    border-color: color-mix(in srgb, var(--th-red) 45%, var(--th-line));
    background: var(--th-surface);
}

.th-admin-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex: 1 1 100%;
    position: relative;
    z-index: 6;
    pointer-events: auto;
}

.th-admin-filter {
    appearance: none;
    border: 1px solid var(--th-line);
    background: var(--th-ivory);
    color: var(--th-muted);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    z-index: 6;
    pointer-events: auto;
}

.th-admin-filter.is-active {
    background: rgba(170, 57, 48, 0.12);
    border-color: rgba(170, 57, 48, 0.28);
    color: var(--th-red);
}

.th-admin-toolbar__count {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--th-muted);
    white-space: nowrap;
}

.th-admin-add {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.4rem;
    min-width: 6.5rem;
    padding: 0.5rem 0.9rem;
    border: 0;
    border-radius: 12px;
    background: var(--th-red);
    color: #fff;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.th-admin-add:hover {
    background: var(--th-red-deep);
}

.th-admin-add .mud-icon-root {
    font-size: 1.1rem !important;
    color: inherit !important;
}

.th-admin-grid.e-grid {
    border: none !important;
    border-radius: 0 !important;
    position: relative;
    z-index: 1;
}

.th-admin-grid .e-gridheader {
    background: var(--th-ivory) !important;
    border-bottom: 1px solid var(--th-line) !important;
}

.th-admin-grid .e-headercell {
    background: var(--th-ivory) !important;
    padding: 0.9rem 1.35rem !important;
    height: auto !important;
}

.th-admin-grid .e-headercelldiv,
.th-admin-grid .e-headertext {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: var(--th-muted) !important;
    padding: 0 !important;
}

.th-admin-grid .e-rowcell {
    padding: 1.15rem 1.35rem !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
    border-bottom: 1px solid var(--th-line) !important;
    border-right: none !important;
}

.th-admin-grid .e-altrow,
.th-admin-grid .e-altrow .e-rowcell {
    background: transparent !important;
}

.th-admin-grid .e-row:hover .e-rowcell {
    background: color-mix(in srgb, var(--th-red) 6%, var(--th-surface)) !important;
}

.th-admin-grid .e-selectionbackground,
.th-admin-grid .e-active .e-rowcell {
    background: color-mix(in srgb, var(--th-red) 10%, var(--th-surface)) !important;
}

.th-admin-grid .e-toolbar,
.th-admin-grid .e-groupdroparea {
    display: none !important;
}

.th-admin-grid .e-filtermenudiv,
.th-admin-grid .e-filtered {
    display: none !important;
}

.th-admin-grid .e-sortfilterdiv {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.th-admin-grid .e-headercell:hover .e-sortfilterdiv,
.th-admin-grid .e-headercell.e-mousepointer .e-sortfilterdiv {
    opacity: 1;
}

.th-admin-empty-inline {
    padding: 2.4rem 1rem;
    text-align: center;
    color: var(--th-muted);
    font-size: 0.9rem;
}

.th-admin-grid .e-emptyrow td,
.th-admin-grid .e-emptyrecord {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    height: auto !important;
}

.th-admin-grid td.e-unboundcell,
.th-admin-grid .e-unboundcelldiv {
    overflow: visible !important;
}

.th-admin-grid td.e-unboundcell {
    padding: 0.55rem 0.7rem !important;
}

.th-admin-grid .e-unboundcelldiv {
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    gap: 0.1rem;
    position: relative;
    z-index: 2;
}

.th-grid-cmd.e-btn,
.th-admin-grid .e-unboundcelldiv .e-btn,
.th-admin-grid .e-unboundcelldiv .e-flat {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--th-muted) !important;
    width: 2.1rem !important;
    height: 2.1rem !important;
    min-width: 2.1rem !important;
    border-radius: 10px !important;
    padding: 0 !important;
    position: relative;
    z-index: 2;
}

.th-admin-grid .e-unboundcelldiv .e-btn:hover,
.th-grid-cmd.e-btn:hover {
    background: var(--th-ivory) !important;
    color: var(--th-red) !important;
}

.th-grid-cmd--danger.e-btn:hover,
.th-admin-grid .e-unboundcelldiv .e-delete:hover {
    color: var(--th-red) !important;
    background: color-mix(in srgb, var(--th-red) 12%, transparent) !important;
}

.th-admin-grid .e-rowcell[title],
.th-admin-grid .e-unboundcell[title] {
    pointer-events: auto;
}

.th-admin-grid-shell .e-tooltip-wrap,
.th-admin-grid .e-tooltip-wrap,
.e-tooltip-wrap.e-grid-tooltip {
    display: none !important;
}

.th-admin-grid .e-gridpager {
    padding: 0.65rem 0.9rem !important;
    border-top: 1px solid var(--th-line) !important;
    background: var(--th-ivory) !important;
}

.th-admin-grid .e-pager .e-numericitem,
.th-admin-grid .e-pager .e-currentitem {
    border-radius: 8px !important;
    min-width: 1.85rem;
    border: none !important;
}

.th-admin-grid .e-pager .e-currentitem {
    background: var(--th-red) !important;
    color: #fff !important;
}

.th-admin-grid .e-pager .e-parentmsgbar {
    color: var(--th-muted) !important;
    font-size: 0.78rem !important;
}

.th-admin-grid .e-groupcaption,
.th-admin-grid .e-recordplusexpand,
.th-admin-grid .e-recordpluscollapse {
    font-weight: 600 !important;
    color: var(--th-ink) !important;
}

.th-user-store {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--th-serif);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--th-ink);
}

.th-user-store .mud-icon-root {
    font-size: 1.05rem !important;
    color: var(--th-red) !important;
}

.th-user-store__count {
    font-family: var(--th-sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-admin-grid .e-groupcaptionrow .e-recordplusexpand,
.th-admin-grid .e-groupcaptionrow td,
.th-admin-grid .e-groupcaptionrow .e-groupcaption {
    background: var(--th-ivory) !important;
    padding-top: 0.7rem !important;
    padding-bottom: 0.7rem !important;
}

.th-admin-grid .e-checkbox-wrapper .e-icons,
.th-admin-grid .e-css.e-checkbox-wrapper .e-icons {
    font-size: 14px;
}

.th-admin-grid--nested {
    border: 1px solid var(--th-line) !important;
    border-radius: 12px !important;
    overflow: hidden;
}

.th-admin-grid--nested .e-headercell {
    padding: 0.55rem 0.9rem !important;
}

.th-admin-grid--nested .e-rowcell {
    padding: 0.65rem 0.9rem !important;
}

.th-grid-person {
    display: flex;
    align-items: center;
    gap: 0.95rem;
    min-width: 0;
}

.th-grid-person__text {
    min-width: 0;
}

.th-grid-avatar {
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--th-red);
    background: color-mix(in srgb, var(--th-red) 12%, var(--th-ivory));
}

.th-grid-thumb {
    flex: 0 0 auto;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0.28rem;
    border-radius: 12px;
    object-fit: contain;
    background: var(--th-photo);
    border: 1px solid var(--th-line);
    box-shadow: 0 1px 2px rgba(44, 38, 34, 0.05);
}

.th-grid-name {
    display: block;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--th-ink);
}

.th-grid-sub {
    display: block;
    margin-top: 0.32rem;
    font-size: 0.75rem;
    color: var(--th-muted);
    line-height: 1.35;
}

.th-grid-money {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.th-grid-money span {
    margin-right: 0.15rem;
    font-weight: 500;
    color: var(--th-muted);
}

.th-grid-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
}

.th-grid-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
    background: var(--th-ivory);
    color: var(--th-muted);
}

.th-grid-pill.is-on,
.th-grid-pill.is-hire,
.th-grid-pill.is-admin {
    color: var(--th-red);
    background: color-mix(in srgb, var(--th-red) 12%, transparent);
}

.th-grid-pill.is-month {
    color: #6b5348;
    background: color-mix(in srgb, #8c6b62 16%, transparent);
}

.th-grid-pill.is-super {
    color: #2e7d4f;
    background: rgba(46, 125, 79, 0.12);
}

html.th-dark .th-admin-grid .e-row:hover .e-rowcell,
html.th-dark .th-admin-grid .e-active .e-rowcell {
    background: color-mix(in srgb, var(--th-red) 14%, var(--th-surface)) !important;
}

html.th-dark .th-grid-pill.is-month {
    color: #d4b8ae;
}

html.th-dark .th-grid-pill.is-super {
    color: #6bcb77;
}

@media (max-width: 640px) {
    .th-admin-scope__chip {
        min-width: calc(50% - 0.3rem);
    }

    .th-user-edit__perms {
        grid-template-columns: 1fr;
    }

    .th-admin-toolbar {
        padding: 0.75rem;
    }

    .th-admin-search {
        max-width: none;
        flex-basis: 100%;
    }

    .th-admin-toolbar__count {
        margin-left: 0;
        width: 100%;
    }

    .th-admin-add {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 1023px) {
    .th-header .th-branch--appbar {
        display: none;
    }

    .th-brand-current {
        display: block;
    }
}

.th-header__search .th-search-host {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
}

.th-search-host {
    position: relative;
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 22rem;
    z-index: 40;
}

.th-search-host.th-search-mobile {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
}

.th-search-field {
    width: 100%;
    margin: 0 !important;
}

.th-search-field.mud-input-control-margin-dense {
    margin: 0 !important;
}

.th-search-field .mud-input-control-helper-container,
.th-search-field .mud-input-helper-text {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.th-search .mud-input-outlined-border,
.th-search-field .mud-input-outlined-border {
    border-color: var(--th-line) !important;
}

.th-search-host.is-busy .mud-input-adornment-end .mud-icon-button:last-child {
    visibility: hidden;
}

.th-search-spin {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.th-search-host:not(.is-busy) .mud-input-adornment-end .mud-icon-button:last-child {
    visibility: visible;
}

.th-search-spin .mud-progress-circular {
    width: 18px !important;
    height: 18px !important;
}

.th-search-drop {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: -1px;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-top: none;
    box-shadow: var(--th-shadow);
    z-index: 50;
    max-height: 360px;
    overflow: auto;
    text-align: left;
}

.th-main {
    min-height: 100vh;
    background-color: var(--th-ivory);
    background-image: var(--th-grid-soft);
    background-size: var(--th-grid-size) var(--th-grid-size);
    background-position: center top;
    padding-top: var(--th-mobile-chrome-height, var(--th-appbar-height, 4.6rem));
    overflow: visible;
}

.th-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.75rem 1.5rem 2.5rem;
    overflow: visible;
    animation: th-page-in 0.45s var(--th-ease) both;
}

.th-panel {
    position: fixed;
    inset: 0;
    z-index: 1098;
    display: grid;
    background: color-mix(in srgb, var(--th-ivory) 92%, var(--th-surface));
    color: var(--th-ink);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: opacity 0.45s var(--th-ease), visibility 0.45s;
}

.th-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: var(--th-grid-soft);
    background-size: var(--th-grid-size) var(--th-grid-size);
    mask-image: radial-gradient(ellipse at 50% 38%, black 28%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 38%, black 28%, transparent 78%);
    opacity: 0.85;
}

.th-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.th-panel__inner {
    position: relative;
    z-index: 1;
    width: min(72rem, calc(100% - 2.4rem));
    margin: calc(var(--th-appbar-height, 4.6rem) + 1.6rem) auto 2rem;
    display: grid;
    gap: 2rem;
}

.th-panel__head {
    display: grid;
    gap: 0.4rem;
    max-width: 24rem;
}

.th-panel__title {
    margin: 0;
    font-family: var(--th-serif);
    font-weight: 700;
    font-size: clamp(1.7rem, 4.4vw, 2.5rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
}

.th-panel__tag {
    margin: 0;
    color: var(--th-muted);
    font-size: 1.05rem;
}

.th-panel nav {
    display: grid;
    gap: 0.2rem;
    counter-reset: th-nav;
}

.th-panel nav a {
    display: flex;
    align-items: baseline;
    gap: 1.2rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--th-line);
    color: var(--th-ink) !important;
    text-decoration: none;
    font-family: var(--th-serif);
    font-size: clamp(2.1rem, 7vw, 4.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    transform: translateY(12px);
    opacity: 0;
}

.th-panel.is-open nav a {
    animation: th-rise 0.7s var(--th-ease) both;
}

.th-panel nav a:nth-child(1) { animation-delay: 0.05s; }
.th-panel nav a:nth-child(2) { animation-delay: 0.12s; }
.th-panel nav a:nth-child(3) { animation-delay: 0.19s; }
.th-panel nav a:nth-child(4) { animation-delay: 0.26s; }
.th-panel nav a:nth-child(5) { animation-delay: 0.33s; }
.th-panel nav a:nth-child(6) { animation-delay: 0.4s; }

.th-panel nav a small {
    font-family: var(--th-mono);
    font-size: 0.8rem;
    color: var(--th-red);
    letter-spacing: 0.12em;
    min-width: 1.6rem;
}

.th-panel nav a small::before {
    counter-increment: th-nav;
    content: counter(th-nav, decimal-leading-zero);
}

.th-panel nav a:hover,
.th-panel nav a.active {
    color: var(--th-red) !important;
}

.th-panel__foot {
    display: grid;
    gap: 0.4rem;
    color: var(--th-muted);
    max-width: 22rem;
}

.th-panel__foot a {
    color: var(--th-ink);
    text-decoration: none;
}

.th-panel__foot a:hover {
    color: var(--th-red);
}

.th-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.55rem;
}

.th-panel__action,
.th-panel__who {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0 0.85rem 0 0.6rem;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
    color: var(--th-ink) !important;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.th-panel__who {
    cursor: default;
    color: var(--th-muted) !important;
}

.th-panel__action .mud-icon-root,
.th-panel__who .mud-icon-root {
    color: var(--th-red) !important;
    font-size: 1.15rem !important;
}

.th-panel__cta,
.th-panel__cta:link,
.th-panel__cta:visited,
.th-panel__cta:hover,
.th-panel__cta:active,
.th-panel__cta:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    min-height: 2.5rem;
    background: var(--th-red);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.th-panel__cta:hover,
.th-panel__cta:active {
    background: var(--th-red-deep);
    color: #fff !important;
}

.th-panel__ornament {
    position: absolute;
    right: 6vw;
    bottom: 4vh;
    font-family: var(--th-serif);
    font-size: min(28vw, 14rem);
    font-weight: 700;
    line-height: 0.8;
    color: color-mix(in srgb, var(--th-red) 12%, transparent);
    pointer-events: none;
}

@keyframes th-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

@media (min-width: 1024px) {
    .th-header__search { display: block; }
    .th-search-toggle { display: none; }
    .th-mobile-search-dock { display: none !important; }
    .th-main {
        padding-top: var(--th-appbar-height, 4.6rem);
    }
    .th-panel__inner {
        margin-top: calc(var(--th-appbar-height, 4.6rem) + 2.4rem);
        gap: 2.4rem;
    }
}

.th-shell.is-menu-open .th-mobile-search-dock {
    visibility: hidden;
    pointer-events: none;
}

.th-account-pop {
    min-width: 14rem;
}

.th-account-pop__head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.9rem 0.65rem;
    border-bottom: 1px solid var(--th-line);
    margin-bottom: 0.25rem;
}

.th-account-pop__head strong {
    font-size: 0.88rem;
    color: var(--th-ink);
}

.th-account-pop__head span {
    font-size: 0.75rem;
    color: var(--th-muted);
}

.th-page-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0 0 0.7rem;
    padding: 0;
    border: none;
    min-height: 0;
}

.th-page-header__card {
    width: 100%;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 12px;
    box-shadow: var(--th-shadow);
    padding: 0.5rem 0.8rem;
}

html.th-dark .th-page-header__lead {
    background: rgba(170, 57, 48, 0.18);
}

.th-page-header .th-kicker {
    display: none;
}

.th-page-header__row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
}

.th-page-header__lead {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    border-radius: 8px;
    background: rgba(170, 57, 48, 0.1);
}

.th-page-header__lead .th-back {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border-radius: 8px;
}

.th-page-header__text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.th-page-header__icon {
    color: var(--th-red);
    font-size: 1.15rem;
    line-height: 1;
    font-variation-settings: "FILL" 0, "wght" 300, "GRAD" -25, "opsz" 24;
}

.th-page-header h1,
.th-page-header__title {
    font-family: var(--th-serif);
    font-size: 1.12rem;
    font-weight: 600;
    margin: 0;
    color: var(--th-ink);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.th-page-header__subtitle {
    margin: 0;
    color: var(--th-muted);
    font-size: 0.78rem;
    max-width: 46rem;
    line-height: 1.3;
}

.th-back {
    cursor: pointer;
    color: var(--th-red);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
}

/* Admin product edit dialog */
.th-product-edit-dialog.e-dialog {
    width: min(960px, 94vw) !important;
    max-width: 94vw !important;
    max-height: calc(100dvh - 5.5rem) !important;
    border: 1px solid var(--th-line) !important;
    box-shadow: var(--th-shadow) !important;
    z-index: 1400 !important;
}

.e-dlg-container:has(.th-product-edit-dialog) {
    z-index: 1400 !important;
}

.e-dlg-container:has(.th-product-edit-dialog) .e-dlg-overlay,
.e-dlg-overlay:has(+ .th-product-edit-dialog.e-dialog) {
    z-index: 1399 !important;
}

.th-product-edit-dialog .e-dlg-header-content,
.th-product-edit-dialog .e-footer-content {
    background: var(--th-surface);
    border-color: var(--th-line) !important;
    padding: 0.85rem 1.15rem !important;
}

.th-product-edit-dialog .e-dlg-content {
    background: var(--th-ivory);
    padding: 1rem 1.15rem 1.25rem !important;
    overflow-y: auto;
    max-height: calc(100dvh - 11rem);
}

.th-product-edit__body {
    width: 100%;
    min-width: min(720px, 88vw);
}

.th-product-edit__body .form-row {
    margin-bottom: 0.15rem;
}

.th-product-edit__tabs .e-content {
    padding-top: 0.75rem !important;
}

.th-product-edit__pricing {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.35rem;
}

@media (min-width: 720px) {
    .th-product-edit__pricing {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .th-product-edit__pricing .form-row {
        margin-bottom: 0;
    }
}

@media (max-width: 719px) {
    .th-product-edit-dialog.e-dialog {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: calc(100dvh - 5.5rem) !important;
    }

    .th-product-edit__body {
        min-width: 0;
    }
}

/* Admin product image */
.th-product-image-edit {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.th-product-image-edit__label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-product-image-edit__preview,
.th-product-image-edit__grid-thumb {
    object-fit: contain;
    background: var(--th-photo);
    border: 1px solid var(--th-line);
}

.th-product-image-edit__preview {
    width: 140px;
    height: 140px;
    padding: 0.35rem;
}

.th-product-image-edit__grid-thumb {
    width: 44px;
    height: 44px;
    padding: 0.2rem;
    border-radius: 10px;
}

.th-product-image-edit__clear {
    appearance: none;
    align-self: flex-start;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--th-red);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.th-product-image-edit__clear:hover {
    text-decoration: underline;
}

/* Equipment catalog */
.th-equipment {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}

.th-equipment__section {
    margin-bottom: 2.5rem;
    scroll-margin-top: calc(var(--th-appbar-height, 4rem) + var(--th-cat-rail-h, 3.65rem) + 0.85rem);
}

.th-equipment__section:last-child {
    margin-bottom: 0;
}

.th-equipment__section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.85rem;
    margin: 0 0 0.95rem;
    padding: 0 0 0.55rem;
    border-bottom: 1px solid var(--th-line);
}

.th-equipment__section-head h2::before {
    content: "";
    display: inline-block;
    width: 0.2rem;
    height: 0.78em;
    margin-right: 0.55rem;
    margin-bottom: -0.04em;
    background: var(--th-red);
    border-radius: 1px;
    vertical-align: baseline;
}

.th-equipment__section-head h2 {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    font-family: var(--th-serif);
    font-size: 1.22rem;
    font-weight: 600;
    color: var(--th-ink);
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.th-equipment__section-head span {
    flex: 0 0 auto;
    color: var(--th-muted);
    font-family: var(--th-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    background: none;
    border-radius: 0;
    padding: 0;
}

/* Category tiles */
.th-loader-host {
    display: block;
    width: 100%;
}

.th-loader {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.85rem;
    width: 100%;
    min-height: 240px;
    padding: 2.5rem 1rem;
    text-align: center;
}

.th-loader__mark {
    position: relative;
    width: 3.4rem;
    height: 3.4rem;
}

.th-loader__track,
.th-loader__arc,
.th-loader__core {
    position: absolute;
    border-radius: 50%;
}

.th-loader__track {
    inset: 0;
    border: 1.5px solid color-mix(in srgb, var(--th-red) 18%, var(--th-line));
}

.th-loader__arc {
    inset: 0;
    border: 1.5px solid transparent;
    border-top-color: var(--th-red);
    border-right-color: color-mix(in srgb, var(--th-red) 55%, transparent);
    animation: th-loader-spin 0.95s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.th-loader__core {
    inset: 1.15rem;
    background: var(--th-red);
    opacity: 0.7;
    animation: th-loader-breathe 2.4s ease-in-out infinite;
}

.th-loader__text {
    margin: 0;
    font-family: var(--th-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--th-muted);
}

@keyframes th-loader-spin {
    to { transform: rotate(360deg); }
}

@keyframes th-loader-breathe {
    0%, 100% { opacity: 0.35; transform: scale(0.86); }
    50% { opacity: 0.9; transform: scale(1); }
}

.th-category-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.25rem;
}

.th-category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 300px;
    cursor: pointer;
    background: var(--th-surface);
    box-shadow: var(--th-shadow);
    border: 1px solid var(--th-line);
    border-top: 3px solid var(--th-gold);
    transition: transform 280ms var(--th-ease), box-shadow 280ms var(--th-ease), border-color 280ms var(--th-ease);
}

.th-category-card:hover {
    transform: translateY(-5px);
    border-color: var(--th-gold);
    box-shadow: 0 18px 40px rgba(170, 57, 48, 0.14);
}

.th-category-card img {
    flex: 1;
    width: 100%;
    min-height: 0;
    object-fit: contain;
    object-position: center;
    padding: 1.25rem 1.25rem 0.5rem;
    background: var(--th-photo);
    transition: transform 0.55s var(--th-ease);
}

.th-category-card:hover img {
    transform: scale(1.06);
}

.th-category-card__count {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: #dc3545;
    border: 1px solid #dc3545;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #fff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
    position: static;
}

.th-category-card__overlay {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1.1rem 1rem;
    background: var(--th-surface);
    color: var(--th-ink);
    border-top: 1px solid var(--th-line);
}

.th-category-card__overlay h3 {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 1.5rem;
    color: var(--th-ink);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Product cards */
.th-product-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.25rem;
}

.th-product-card-wrap {
    min-width: 0;
    height: 100%;
    display: flex;
    overflow-anchor: none;
}

html.th-motion .th-product-card-wrap.th-reveal,
html.th-motion .th-product-card-wrap.th-reveal.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
}

.th-product-card-wrap > .th-product-card {
    flex: 1 1 auto;
    width: 100%;
    min-height: 100%;
}

@property --th-tron {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.th-product-card {
    --th-card-radius: 18px;
    position: relative;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: var(--th-card-radius);
    box-shadow: 0 10px 24px rgba(26, 26, 26, 0.045);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
    transition: transform 280ms var(--th-ease), box-shadow 280ms var(--th-ease), border-color 280ms var(--th-ease);
}

.th-product-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--th-red) 45%, var(--th-line));
    box-shadow: 0 18px 36px rgba(170, 57, 48, 0.1);
}

.th-product-card.is-added {
    z-index: 2;
    border-color: color-mix(in srgb, var(--th-red) 65%, var(--th-line));
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--th-red) 30%, transparent),
        0 0 20px color-mix(in srgb, var(--th-red) 22%, transparent);
}

.th-product-card.is-added:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--th-red) 65%, var(--th-line));
}

.th-product-card.is-added::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 6;
    background: conic-gradient(
        from var(--th-tron),
        transparent 0deg,
        transparent 248deg,
        color-mix(in srgb, var(--th-red) 40%, transparent) 286deg,
        var(--th-red) 318deg,
        #fff 336deg,
        var(--th-red) 350deg,
        transparent 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: th-tron-spin 1.45s linear infinite;
}

@keyframes th-tron-spin {
    to { --th-tron: 360deg; }
}

.th-product-card__media {
    position: relative;
    height: 220px;
    background:
        radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--th-red) 6%, transparent), transparent 62%),
        var(--th-photo);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.th-product-card__media img {
    max-width: 82%;
    max-height: 82%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: transparent;
    transition: transform 0.55s var(--th-ease);
}

.th-product-card:hover .th-product-card__media img {
    transform: scale(1.06);
}

.th-product-card__body {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.th-product-card__body h3 {
    font-size: 1.18rem;
    line-height: 1.28;
    margin: 0 0 0.4rem;
}

.th-product-card__desc,
.th-desc-toggle {
    display: none;
}

.th-product-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--th-line);
}

.th-product-card__footer .th-add-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.th-price-tag {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.12rem;
    min-width: 0;
    background: none;
    color: var(--th-ink);
    padding: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
    line-height: 1.1;
}

.th-price-tag--discount {
    align-items: flex-start;
}

.th-price-tag::before {
    display: none;
}

.th-price-tag__stack {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 0;
}

.th-price-tag__amount {
    font-family: var(--th-serif);
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--th-red);
    letter-spacing: 0.01em;
}

.th-price-tag__was {
    font-size: 0.68rem;
    color: var(--th-muted);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
}

.th-price-tag__label {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--th-muted);
    line-height: 1.25;
}

.th-price-tag__off {
    color: var(--th-red);
    font-weight: 700;
}

.th-price-tag__period,
.th-price-tag__vat {
    color: var(--th-muted);
    white-space: nowrap;
}

.th-discount-banner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(170, 57, 48, 0.22);
    border-left: 3px solid var(--th-red);
    background: linear-gradient(90deg, rgba(170, 57, 48, 0.08), transparent 70%);
    border-radius: 10px;
}

.th-discount-banner__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: var(--th-red);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.th-discount-banner__text {
    color: var(--th-ink);
    font-size: 0.88rem;
    line-height: 1.35;
}

.th-price {
    font-family: var(--th-serif);
    color: var(--th-red);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.th-price__was {
    display: block;
    margin-top: 0.2rem;
    font-family: var(--th-sans);
    font-size: 0.78rem;
    color: var(--th-muted);
    text-decoration: line-through;
}

.th-price small,
.th-price__note {
    display: block;
    margin-top: 0.15rem;
    font-family: var(--th-sans);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--th-gold);
}

.th-add-btn.mud-button-filled {
    font-weight: 700 !important;
    letter-spacing: 0.02em;
    min-height: 2.4rem;
    flex-shrink: 0;
    min-width: 7.75rem;
    border-radius: 999px !important;
    padding-left: 0.95rem !important;
    padding-right: 1.05rem !important;
    white-space: nowrap;
}

.th-add-btn.is-added.mud-button-filled {
    background: color-mix(in srgb, var(--th-red) 10%, var(--th-surface)) !important;
    color: var(--th-red) !important;
    box-shadow: inset 0 0 0 1.5px var(--th-red) !important;
    min-width: 6.5rem;
}

.th-add-btn.is-added.mud-button-filled .mud-icon-root {
    color: var(--th-red) !important;
    opacity: 1;
}

.th-add-btn .mud-button-label {
    white-space: nowrap;
}

.th-empty {
    color: var(--th-muted);
    padding: 2.4rem 0;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.th-empty-panel {
    max-width: 32rem;
    padding: 2.2rem 0 3.2rem;
}

.th-empty-panel h1,
.th-empty-panel h2 {
    margin: 0.35rem 0 0.7rem;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    color: var(--th-ink);
}

.th-empty-panel > p {
    color: var(--th-muted);
    margin: 0 0 1.1rem;
    line-height: 1.5;
}

.th-empty-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.1rem;
}

.th-empty-panel .th-contact-cta,
.th-hire-empty .th-contact-cta,
.th-contact-actions .th-contact-cta {
    margin-top: 0;
}

.th-empty-panel__id {
    margin-top: 1.25rem !important;
    font-size: 0.78rem;
    color: var(--th-muted);
}

.th-empty-panel__id code {
    font-family: var(--th-mono);
    font-size: 0.76rem;
}

/* Login */
.th-login-page {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1.15rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    background-color: var(--th-ivory);
    background-image: var(--th-grid-soft);
    background-size: var(--th-grid-size) var(--th-grid-size);
    background-position: center top;
    border-top: 3px solid var(--th-red);
}

.th-login-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    align-self: flex-start;
    flex: 0 0 auto;
    margin: 0;
    color: var(--th-red);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
}

.th-login-back:hover {
    color: var(--th-red-deep);
}

.th-login {
    width: min(24rem, 100%);
    margin: auto;
    padding: 1.6rem 1.35rem 1.35rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(26, 26, 26, 0.08);
}

.th-login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 0 1.65rem;
}

.th-login-mark {
    display: grid;
    place-items: center;
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 0 0.85rem;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--th-line);
    border-radius: 18px;
    box-sizing: border-box;
}

.th-login-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.th-login-brand h1 {
    margin: 0;
    color: var(--th-ink);
    font-family: var(--th-serif);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.th-login-place {
    margin: 0.3rem 0 0;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--th-red);
}

.th-login-title {
    margin: 0 0 0.95rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--th-ink);
}

.th-login-form input:-webkit-autofill,
.th-login-form input:-webkit-autofill:hover,
.th-login-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 32px var(--th-surface) inset;
    -webkit-text-fill-color: var(--th-ink);
    caret-color: var(--th-ink);
}

.th-contact-motto {
    font-family: var(--th-serif);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--th-red);
    margin: 0 0 1rem;
    line-height: 1.35;
}

.th-contact-name {
    font-size: 1.65rem;
    margin: 0 0 0.15rem;
}

.th-contact-branch {
    margin: 0 0 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: var(--th-red);
    font-weight: 600;
}

.th-contact-region {
    margin-top: 1.5rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.72rem;
    color: var(--th-red);
}

.th-login-form {
    display: flex;
    flex-direction: column;
    position: relative;
}

.th-login-form.is-busy .th-login-form__fields {
    pointer-events: none;
    opacity: 0.4;
}

.th-login-form:not(.is-busy) .th-login-form__busy {
    display: none;
}

.th-login-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0 0 0.85rem;
}

.th-login-field > span:first-child {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--th-muted);
}

.th-login-field__control {
    position: relative;
    display: block;
}

.th-login-field input {
    width: 100%;
    min-height: 2.7rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--th-line);
    border-radius: 10px;
    background: var(--th-surface);
    color: var(--th-ink);
    font: inherit;
    font-size: 1rem;
}

.th-login-field__control input {
    padding-right: 2.6rem;
}

.th-login-field input:focus {
    outline: none;
    border-color: var(--th-red);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--th-red) 16%, transparent);
}

.th-login-eye {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--th-muted);
    cursor: pointer;
    touch-action: manipulation;
}

.th-login-form__busy {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--th-surface) 72%, transparent);
    border-radius: 12px;
}

.th-login-form--gate {
    min-height: 12rem;
}

.th-login-form--gate .th-login-form__busy {
    position: relative;
    inset: auto;
    min-height: 12rem;
    background: transparent;
}

.th-login-help {
    margin: 0.5rem 0 1.25rem;
    font-size: 0.82rem;
    color: var(--th-muted);
}

.th-login-link {
    border: none;
    background: none;
    padding: 0;
    color: var(--th-red);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: opacity 0.15s;
}

.th-login-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.th-login-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.35rem;
    min-height: 46px;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 10px;
    background: var(--th-red);
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(170, 57, 48, 0.25);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.th-login-submit:hover {
    background: var(--th-red-deep);
    box-shadow: 0 4px 14px rgba(170, 57, 48, 0.35);
}

.th-login-submit:disabled {
    opacity: 0.85;
    cursor: default;
}

.th-login-submit__spin {
    display: none;
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    border: 2px solid color-mix(in srgb, #fff 35%, transparent);
    border-top-color: #fff;
    border-radius: 50%;
    animation: th-login-spin 0.7s linear infinite;
    flex: 0 0 auto;
}

.th-login-submit__busy {
    display: none;
}

.th-login-form.is-busy .th-login-submit__spin,
.th-login-submit[aria-busy="true"] .th-login-submit__spin,
html.th-login-busy .th-login-submit__spin {
    display: inline-block;
}

.th-login-form.is-busy .th-login-submit__busy,
.th-login-submit[aria-busy="true"] .th-login-submit__busy,
html.th-login-busy .th-login-submit__busy {
    display: inline;
}

.th-login-form.is-busy .th-login-submit__idle,
.th-login-submit[aria-busy="true"] .th-login-submit__idle,
html.th-login-busy .th-login-submit__idle {
    display: none;
}


@keyframes th-login-spin {
    to { transform: rotate(360deg); }
}

.th-login-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.th-login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.th-login-form .mud-input-outlined .mud-input-outlined-border {
    border-color: var(--th-line) !important;
    border-radius: 10px !important;
    transition: border-color 0.2s ease !important;
}

.th-login-form .mud-input:focus-within .mud-input-outlined-border {
    border-color: var(--th-red) !important;
    border-width: 2px !important;
}

.th-login-form .mud-input-label {
    font-size: 0.85rem !important;
}

.th-login-form .mud-input-label-outlined {
    transform: translate(14px, -6px) scale(0.75) !important;
    background: var(--th-surface);
    padding: 0 4px;
}

.th-login-switch,
.th-login-hint,
.th-login-contact {
    text-align: center;
    margin: 1.05rem 0 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--th-muted);
}

.th-login-hint {
    margin-top: 1.6rem;
    font-size: 0.8rem;
}

.th-login-contact {
    margin-top: 0.55rem;
    font-size: 0.78rem;
}

.th-login-contact a {
    color: var(--th-red);
    font-weight: 700;
    text-decoration: none;
}

.th-login-contact span {
    margin: 0 0.35rem;
    color: var(--th-line);
}

.th-verify-section {
    text-align: center;
    padding: 0.5rem 0;
}

.th-verify-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--th-ink);
    margin: 0 0 0.5rem;
}

.th-verify-description {
    font-size: 0.85rem;
    color: var(--th-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.th-status-layer {
    position: fixed;
    inset: 0;
    z-index: 12050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    animation: th-status-fade 0.2s var(--th-ease);
}

.th-status-layer__scrim {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(28, 25, 23, 0.45);
    cursor: pointer;
}

.th-status-dialog {
    position: relative;
    z-index: 1;
    background: var(--th-surface);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
    width: min(420px, 100%);
    max-height: min(88dvh, 720px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--th-line);
    animation: th-status-rise 0.28s var(--th-ease);
}

.th-status-dialog.is-return {
    width: min(520px, 100%);
}

.th-status-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1rem 0.7rem 1.15rem;
}

.th-status-dialog__id h3 {
    margin: 0;
    font-family: var(--th-serif);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--th-ink);
}

.th-status-dialog__id p {
    margin: 0.2rem 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.4rem;
    font-size: 0.78rem;
    color: var(--th-muted);
}

.th-status-dialog__x {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: -0.15rem -0.2rem 0 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--th-muted);
    cursor: pointer;
}

.th-status-dialog__x:hover {
    background: var(--th-ivory);
    color: var(--th-ink);
}

.th-status-pips {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.15rem;
    list-style: none;
    margin: 0;
    padding: 0 1rem 0.75rem;
}

.th-status-pip {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    position: relative;
}

.th-status-pip:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 8px;
    left: calc(50% + 10px);
    right: calc(-50% + 10px);
    height: 1px;
    background: var(--th-line);
}

.th-status-pip.is-done:not(:last-child)::after,
.th-status-pip.is-current:not(:last-child)::after {
    background: color-mix(in srgb, var(--th-red) 55%, var(--th-line));
}

.th-status-pip__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--th-line);
    background: var(--th-surface);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.th-status-pip__dot .mud-icon-root {
    font-size: 0.7rem !important;
}

.th-status-pip.is-done .th-status-pip__dot {
    background: var(--th-red);
    border-color: var(--th-red);
}

.th-status-pip.is-current .th-status-pip__dot {
    border-color: var(--th-red);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--th-red) 16%, transparent);
}

.th-status-pip__name {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--th-muted);
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-status-pip.is-done .th-status-pip__name,
.th-status-pip.is-current .th-status-pip__name {
    color: var(--th-ink);
}

.th-status-pip.is-current .th-status-pip__name {
    color: var(--th-red);
    font-weight: 700;
}

.th-status-dialog__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.15rem 1.15rem 1rem;
}

.th-status-lead {
    margin: 0 0 0.85rem;
    font-size: 0.84rem;
    color: var(--th-muted);
    line-height: 1.45;
}

.th-status-dialog__foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem 0.95rem;
    border-top: 1px solid var(--th-line);
    background: var(--th-ivory);
}

.th-status-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.35rem;
    padding: 0.45rem 0.95rem;
    border-radius: 10px;
    border: 0;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.th-status-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.th-status-btn:focus,
.th-status-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--th-red) 22%, transparent);
}

.th-status-btn--primary {
    background: var(--th-red);
    color: #fff;
}

.th-status-btn--primary .mud-icon-root {
    color: #fff !important;
}

.th-status-btn--primary:hover:not(:disabled) {
    background: var(--th-red-deep);
}

.th-status-btn--ghost {
    background: transparent;
    color: var(--th-muted);
}

.th-status-btn--ghost:hover {
    background: var(--th-surface);
    color: var(--th-ink);
}

.th-status-btn--danger {
    background: transparent;
    color: var(--th-red);
    margin-right: auto;
}

.th-status-btn--danger:hover {
    background: color-mix(in srgb, var(--th-red) 10%, transparent);
}

.th-return-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.th-return-onceoff {
    margin-top: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: var(--th-ivory);
    border: 1px dashed var(--th-line);
}

.th-return-onceoff__title {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-return-onceoff__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--th-line);
}

.th-return-onceoff__item:first-of-type {
    border-top: none;
    padding-top: 0;
}

.th-return-onceoff__name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--th-ink);
}

.th-return-onceoff__meta {
    font-size: 0.72rem;
    color: var(--th-muted);
}

.th-dispatch {
    display: grid;
    gap: 0.65rem;
    margin: 0.15rem 0 0.2rem;
}

.th-dispatch__kicker {
    margin: 0;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--th-red);
}

.th-dispatch-item {
    padding: 0.75rem 0.8rem 0.8rem;
    border: 1px solid var(--th-line);
    border-radius: 12px;
    background: var(--th-ivory);
}

.th-dispatch-item__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0 0 0.55rem;
}

.th-dispatch-item__name {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--th-ink);
}

.th-dispatch-item__meta {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--th-muted);
}

.th-dispatch-item__ready {
    flex: 0 0 auto;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--th-red) 10%, #fff);
    color: var(--th-red);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.th-dispatch-item__empty {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--th-muted);
}

.th-dispatch-slot {
    display: grid;
    grid-template-columns: 1.55rem minmax(0, 1fr);
    gap: 0.5rem;
    align-items: center;
}

.th-dispatch-slot + .th-dispatch-slot {
    margin-top: 0.4rem;
}

.th-dispatch-slot__n {
    display: grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border: 1px solid var(--th-line);
    border-radius: 8px;
    background: #fff;
    color: var(--th-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.th-dispatch-slot.is-set .th-dispatch-slot__n {
    border-color: color-mix(in srgb, var(--th-red) 32%, var(--th-line));
    background: color-mix(in srgb, var(--th-red) 10%, #fff);
    color: var(--th-red);
}

.th-dispatch-select {
    appearance: none;
    width: 100%;
    margin: 0;
    padding: 0.52rem 2rem 0.52rem 0.75rem;
    border: 1px solid var(--th-line);
    border-radius: 10px;
    background-color: #fff;
    background-image: linear-gradient(45deg, transparent 50%, var(--th-muted) 50%), linear-gradient(135deg, var(--th-muted) 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    color: var(--th-ink);
    font: inherit;
    font-size: 0.86rem;
    line-height: 1.3;
}

.th-dispatch-select:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--th-red) 55%, var(--th-line));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--th-red) 12%, transparent);
}

.th-return-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-radius: 12px;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    overflow: hidden;
}

.th-return-item.is-expanded {
    border-color: rgba(170, 57, 48, 0.28);
}

.th-return-item__main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
}

.th-return-item.is-returned {
    opacity: 0.72;
    background: var(--th-bg);
}

.th-return-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.th-return-item__name {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--th-ink);
    line-height: 1.3;
}

.th-return-item__type {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--th-line);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--th-muted);
    background: var(--th-ivory);
}

.th-return-item__type.is-daily {
    color: var(--th-red);
    border-color: rgba(170, 57, 48, 0.28);
    background: rgba(170, 57, 48, 0.08);
}

.th-return-item__type.is-monthly {
    color: #8C6B62;
    border-color: rgba(140, 107, 98, 0.35);
    background: rgba(184, 149, 107, 0.16);
}

.th-return-item__meta {
    font-size: 0.76rem;
    color: var(--th-muted);
    font-weight: 500;
}

.th-return-item__qtyselect {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border-radius: 10px;
    background: var(--th-bg);
    border: 1px solid var(--th-line);
}

.th-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--th-ink);
    cursor: pointer;
}

.th-qty-btn:hover:not(:disabled) {
    background: rgba(170, 57, 48, 0.08);
    color: var(--th-red);
}

.th-qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.th-qty-btn__value {
    min-width: 1.75rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--th-ink);
}

.th-return-item__hire {
    padding: 0.7rem 0.8rem 0.85rem;
    background: var(--th-bg);
    border-top: 1px solid var(--th-line);
}

.th-return-item__hire-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.th-return-item__hire-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--th-line);
}

.th-return-item__hire-duration {
    width: 100%;
    min-width: 0;
}

.th-return-item__hire-duration .e-float-input,
.th-return-item__hire-duration .e-control-wrapper {
    width: 100%;
}

.th-return-item__hire-note {
    font-size: 0.78rem;
    color: var(--th-muted);
    font-weight: 600;
    line-height: 1.4;
}

@media (max-width: 640px) {
    .th-status-layer {
        padding: 0;
        align-items: flex-end;
        justify-content: stretch;
    }

    .th-status-dialog,
    .th-status-dialog.is-return {
        width: 100%;
        max-width: none;
        max-height: 88dvh;
        height: auto;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.16);
        border: 1px solid var(--th-line);
        border-bottom: 0;
        animation: th-status-sheet 0.32s var(--th-ease);
    }

    .th-status-dialog.is-return,
    .th-status-dialog.is-dispatch {
        max-height: 96dvh;
        min-height: 72dvh;
    }

    .th-status-dialog::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        margin: 0.5rem auto 0;
        border-radius: 99px;
        background: var(--th-line);
        flex: 0 0 auto;
    }

    .th-status-pip__name {
        font-size: 0.52rem;
    }

    .th-status-dialog__foot {
        padding-bottom: max(0.95rem, env(safe-area-inset-bottom));
    }

    .th-status-btn {
        flex: 1 1 auto;
    }

    .th-status-btn--danger {
        margin-right: 0;
    }

    .th-return-item__hire-grid {
        grid-template-columns: 1fr;
    }
}

/* Legacy status stepper — kept for reference, superseded by rail */
.th-status-stepper {
    display: none;
}

.th-status-dialog__prompt {
    font-size: 0.9rem;
    color: var(--th-ink);
    margin: 0 0 1rem;
    text-align: center;
    line-height: 1.5;
}

.th-status-advance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin: 0.15rem 0 0.85rem;
    padding: 0.85rem 0.75rem;
    border-radius: 12px;
    background: var(--th-ivory);
    border: 1px solid var(--th-line);
}

.th-status-advance__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 4.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-status-advance__step.is-next {
    color: var(--th-red);
}

.th-status-advance__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 10px;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    color: var(--th-muted);
}

.th-status-advance__step.is-next .th-status-advance__icon {
    background: color-mix(in srgb, var(--th-red) 12%, var(--th-surface));
    border-color: color-mix(in srgb, var(--th-red) 28%, var(--th-line));
    color: var(--th-red);
}

.th-status-advance__arrow {
    color: var(--th-muted) !important;
    opacity: 0.7;
}

.th-orders {
    margin-top: 0.45rem;
    border: 1px solid var(--th-line);
    border-radius: 16px;
    background: var(--th-surface);
    box-shadow: var(--th-shadow);
    overflow: hidden;
}

.th-orders-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.75rem;
    padding: 0.85rem 1rem 0.8rem;
    border-bottom: 1px solid var(--th-line);
}

.th-orders-scope {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--th-ivory);
    border: 1px solid var(--th-line);
}

.th-orders-scope button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--th-muted);
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.th-orders-scope button.is-active {
    background: var(--th-surface);
    color: var(--th-ink);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.th-orders-empty {
    margin: 0;
    padding: 2.4rem 1.2rem;
    text-align: center;
    color: var(--th-muted);
    font-size: 0.92rem;
}

.th-orders-empty p {
    margin: 0;
}

.th-orders-empty .th-contact-link {
    display: inline-block;
    margin-top: 0.7rem;
}

.th-orders-list {
    display: flex;
    flex-direction: column;
}

.th-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid var(--th-line);
    transition: background 0.25s var(--th-ease);
}

.th-order-row:last-child {
    border-bottom: 0;
}

.th-order-row:hover {
    background: color-mix(in srgb, var(--th-red) 5%, var(--th-surface));
}

.th-order-row.is-closed {
    opacity: 0.72;
}

.th-order-row.is-flash {
    animation: th-order-flash 1.1s var(--th-ease);
}

.th-order-row__main {
    appearance: none;
    display: grid;
    grid-template-columns: 5.6rem minmax(0, 1fr) 5.6rem;
    align-items: center;
    gap: 0.75rem 1rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.th-order-row__ref {
    font-family: var(--th-serif);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--th-ink);
}

.th-order-row__who {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.th-order-row__who strong {
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--th-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.th-order-row__who small {
    font-size: 0.75rem;
    color: var(--th-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.th-order-track {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 5.6rem;
}

.th-order-track span {
    flex: 1 1 0;
    height: 3px;
    border-radius: 99px;
    background: var(--th-line);
}

.th-order-track span.is-done,
.th-order-track span.is-current {
    background: var(--th-red);
}

.th-order-track span.is-current {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--th-red) 18%, transparent);
}

.th-order-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.58rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
    background: var(--th-ivory);
    color: var(--th-muted);
}

.th-order-chip.is-wait {
    color: #8a5a12;
    background: rgba(196, 140, 48, 0.14);
}

.th-order-chip.is-ok {
    color: #2c5f8a;
    background: rgba(44, 95, 138, 0.12);
}

.th-order-chip.is-out {
    color: #0f6e86;
    background: rgba(15, 110, 134, 0.12);
}

.th-order-chip.is-hire {
    color: var(--th-red);
    background: color-mix(in srgb, var(--th-red) 12%, transparent);
}

.th-order-chip.is-back {
    color: #6b5348;
    background: color-mix(in srgb, #8c6b62 16%, transparent);
}

.th-order-chip.is-done {
    color: #2e7d4f;
    background: rgba(46, 125, 79, 0.12);
}

.th-order-chip.is-cancel {
    color: var(--th-red);
    background: color-mix(in srgb, var(--th-red) 10%, transparent);
}

.th-order-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: center;
}

.th-order-row__link {
    appearance: none;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
    color: var(--th-muted);
    border-radius: 999px;
    padding: 0.32rem 0.65rem;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
}

.th-order-row__link:hover {
    color: var(--th-ink);
    border-color: color-mix(in srgb, var(--th-red) 35%, var(--th-line));
}

.th-order-row__go {
    appearance: none;
    border: 0;
    background: var(--th-red);
    color: #fff;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
}

.th-order-row__go:hover {
    background: var(--th-red-deep);
}

.th-order-due {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.th-order-due.is-overdue,
.th-order-row.is-due-overdue {
    --th-due-tint: color-mix(in srgb, var(--th-red) 12%, transparent);
}

.th-order-due.is-overdue {
    color: var(--th-red);
    background: var(--th-due-tint);
}

.th-order-due.is-today {
    color: #8a5a00;
    background: color-mix(in srgb, #e6a800 18%, transparent);
}

.th-order-due.is-soon {
    color: var(--th-muted);
    background: color-mix(in srgb, var(--th-line) 55%, transparent);
}

.th-order-row.is-due-overdue {
    background: linear-gradient(90deg, var(--th-due-tint), transparent 42%);
}

.th-admin-filter.is-hot {
    border-color: color-mix(in srgb, var(--th-red) 45%, var(--th-line));
    color: var(--th-red);
}

.th-admin-filter__n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    margin-left: 0.25rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--th-red) 14%, transparent);
    font-size: 0.68rem;
    font-weight: 700;
}

.th-return-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0.65rem;
}

.th-orders-more {
    appearance: none;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--th-line);
    background: var(--th-ivory);
    color: var(--th-muted);
    padding: 0.8rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.th-orders-more:hover {
    color: var(--th-ink);
    background: color-mix(in srgb, var(--th-red) 6%, var(--th-ivory));
}

.th-hire-title__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.th-hire-status-go {
    appearance: none;
    flex: 0 0 auto;
    border: 0;
    background: var(--th-red);
    color: #fff;
    border-radius: 999px;
    padding: 0.32rem 0.8rem;
    font: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
}

.th-hire-status-go:hover {
    background: var(--th-red-deep);
}

@keyframes th-status-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes th-status-rise {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes th-status-sheet {
    from { transform: translateY(18%); }
    to { transform: none; }
}

@keyframes th-order-flash {
    0% { background: color-mix(in srgb, var(--th-red) 16%, var(--th-surface)); }
    100% { background: transparent; }
}

html.th-dark .th-order-chip.is-wait {
    color: #e0b36a;
}

html.th-dark .th-order-chip.is-ok {
    color: #8cb8dc;
}

html.th-dark .th-order-chip.is-out {
    color: #7ec8d8;
}

html.th-dark .th-order-chip.is-done {
    color: #6bcb77;
}

@media (max-width: 720px) {
    .th-order-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "main chip"
            "actions actions";
        gap: 0.55rem 0.7rem;
        padding: 0.85rem 0.9rem;
    }

    .th-order-row__main {
        grid-area: main;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.22rem;
    }

    .th-order-row__who,
    .th-order-row__who strong,
    .th-order-row__who small {
        white-space: normal;
    }

    .th-order-track {
        width: 100%;
        max-width: 9rem;
        margin-top: 0.2rem;
    }

    .th-order-chip {
        grid-area: chip;
        align-self: start;
    }

    .th-order-row__actions {
        grid-area: actions;
    }

    .th-order-row__go {
        width: 100%;
        min-height: 2.4rem;
    }

    .th-orders-toolbar {
        padding: 0.75rem;
    }

    .th-hire-title__row {
        flex-wrap: wrap;
        align-items: flex-start;
    }
}

.th-hire-auto-dates {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--th-bg);
    border: 1px solid var(--th-line);
    font-size: 0.82rem;
    color: var(--th-muted);
    line-height: 1.5;
}

.th-hire-auto-dates strong {
    color: var(--th-ink);
}

.th-history-timeline {
    position: relative;
    padding-left: 20px;
    margin-bottom: 1rem;
}

.th-history-timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--th-line);
}

.th-history-entry {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    position: relative;
}

.th-history-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
    margin-left: -20px;
    z-index: 1;
}

.th-history-content {
    flex: 1;
    min-width: 0;
}

.th-history-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--th-ink);
}

.th-history-note {
    font-size: 0.75rem;
    color: var(--th-muted);
    margin-top: 2px;
    white-space: pre-line;
}

.th-history-date {
    font-size: 0.7rem;
    color: var(--th-muted);
    margin-top: 2px;
}

.th-history-timeline--wide {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0;
    margin: 0;
}

.th-history-timeline--wide::before {
    display: none;
}

.th-history-timeline--wide .th-history-entry {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 0.75rem 0.85rem;
    align-items: start;
    padding: 0.9rem 1rem;
    margin: 0;
    border: 1px solid var(--th-line);
    border-left: 3px solid var(--th-history-accent, var(--th-red));
    border-radius: 10px;
    background: var(--th-surface);
}

.th-history-timeline--wide .th-history-dot {
    width: 10px;
    height: 10px;
    margin: 0.35rem 0 0;
}

.th-history-timeline--wide .th-history-content {
    min-width: 0;
}

.th-history-entry__top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
}

.th-history-timeline--wide .th-history-label {
    font-size: 0.86rem;
}

.th-history-timeline--wide .th-history-date {
    margin-top: 0;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.th-history-timeline--wide .th-history-note {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--th-ink);
    white-space: pre-line;
}

.th-contact {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    padding: 2.5rem 2rem;
    box-shadow: var(--th-shadow);
    max-width: 640px;
}

.th-contact-branches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0 0 1.35rem;
}

.th-contact p {
    color: var(--th-muted);
    margin-bottom: 0.5rem;
}

.th-contact-block {
    margin: 1.15rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--th-line);
}

.th-contact-label {
    display: block;
    margin-bottom: 0.35rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--th-red);
}

.th-contact-value {
    margin: 0 !important;
    color: var(--th-ink) !important;
    line-height: 1.45;
}

.th-contact-link {
    color: var(--th-red);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.th-contact-link:hover {
    border-bottom-color: var(--th-red);
    color: var(--th-red-deep);
}

.th-contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    margin-top: 0.55rem;
}

.th-contact-sep {
    color: var(--th-line);
}

.th-contact-hours {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--th-ink);
    line-height: 1.55;
}

.th-contact-lead {
    margin-top: 1.35rem !important;
}

.th-customer-edit {
    min-width: min(560px, 92vw);
}

.th-customer-edit__hint {
    font-size: 0.72rem;
    color: var(--th-muted);
    margin-top: 0.35rem;
    line-height: 1.35;
}

.th-customer-edit__field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--th-muted);
}

.th-customer-edit__categories {
    margin-top: 1rem;
    border: 1px solid var(--th-line);
    border-radius: 10px;
    background: var(--th-ivory);
    overflow: hidden;
}

.th-customer-edit__categories-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--th-line);
    background: var(--th-surface);
}

.th-customer-edit__categories-head > span:first-child {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--th-red);
}

.th-customer-edit__categories-note {
    font-size: 0.72rem;
    color: var(--th-muted);
}

.th-customer-edit__categories-list {
    max-height: 280px;
    overflow: auto;
    padding: 0.35rem 0.55rem 0.55rem;
}

.th-customer-edit__category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 0.65rem;
    align-items: center;
    padding: 0.35rem 0.3rem;
    border-bottom: 1px solid var(--th-line);
}

.th-customer-edit__category-row:last-child {
    border-bottom: none;
}

.th-customer-edit__category-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--th-ink);
}

.th-customer-edit__category-toggle input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--th-red);
    flex-shrink: 0;
}

.th-customer-edit__category-toggle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-customer-edit__discount-input {
    width: 110px;
    height: 2.15rem;
    border: 1px solid var(--th-line);
    border-radius: 8px;
    background: var(--th-surface);
    color: var(--th-ink);
    padding: 0 0.55rem;
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

.th-customer-edit__discount-input--wide {
    width: 100%;
    max-width: 12rem;
}

.th-customer-edit__discount-input:focus {
    outline: none;
    border-color: var(--th-red);
    box-shadow: 0 0 0 2px rgba(170, 57, 48, 0.18);
}

/* Unlock/lock without waiting for Blazor to re-render Syncfusion's edit dialog */
.th-customer-edit__category-row:not(:has(input[type="checkbox"]:checked)) .th-customer-edit__discount-input {
    opacity: 0.45;
    pointer-events: none;
    background: #ececec;
    color: var(--th-muted);
}

.e-dlg-header,
.e-dlg-header-content {
    font-family: var(--th-serif) !important;
    color: var(--th-ink) !important;
    letter-spacing: 0.04em;
}

.e-footer-content {
    border-top: 1px solid var(--th-line);
}

.th-search-mobile {
    width: 100%;
}

.th-boot {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--th-ivory);
    background-image: var(--th-grid-soft);
    background-size: var(--th-grid-size) var(--th-grid-size);
    background-position: center top;
}

.th-search-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-bottom: 1px solid var(--th-line);
    background: var(--th-surface);
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.th-search-item:last-child {
    border-bottom: none;
}

.th-search-item:hover {
    background: var(--th-ivory);
}

.th-search-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: var(--th-photo);
    border: 1px solid var(--th-line);
    flex-shrink: 0;
}

.th-search-item__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
    text-align: left;
}

.th-search-item__name {
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.th-search-item__price {
    font-size: 0.75rem;
    color: var(--th-red);
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.th-search-item__off {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: var(--th-red);
    border-radius: 999px;
    padding: 0.12rem 0.4rem;
}

.th-search-empty {
    padding: 0.5rem 0.75rem;
    color: var(--th-muted);
    font-size: 0.85rem;
}

.th-hire-dialog.e-dialog {
    border: 1px solid var(--th-line) !important;
    border-radius: 18px !important;
    box-shadow: 0 28px 64px rgba(26, 26, 26, 0.18) !important;
    max-width: 100vw;
    overflow: hidden;
    background: var(--th-surface) !important;
}

.th-hire-dialog .e-dlg-header-content,
.th-hire-dialog .e-footer-content {
    background: var(--th-surface) !important;
    border-color: var(--th-line) !important;
}

.th-hire-dialog .e-dlg-header-content {
    border-bottom: 3px solid var(--th-red) !important;
    padding: 0.95rem 1.2rem 0.85rem !important;
}

.th-hire-dialog .e-dlg-closeicon-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 2.1rem !important;
    height: 2.1rem !important;
    min-width: 2.1rem !important;
    min-height: 2.1rem !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    border-radius: 999px !important;
    background: var(--th-ivory) !important;
    color: var(--th-ink) !important;
}

.th-hire-dialog .e-dlg-closeicon-btn .e-btn-icon,
.th-hire-dialog .e-dlg-closeicon-btn .e-icon-dlg-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 1em !important;
    height: 1em !important;
    line-height: 1 !important;
    font-size: 1rem !important;
}

.th-hire-dialog .e-footer-content {
    padding: 0.85rem 1.15rem !important;
}

.th-hire-dialog .e-dlg-content {
    background: var(--th-bg) !important;
    padding: 1rem 1.15rem 1.25rem !important;
}

.th-hire-dialog .e-dlg-content > * {
    width: 100%;
    max-width: none;
}

.e-dlg-container:has(.th-hire-dialog) {
    z-index: 1400 !important;
}

@media (max-width: 768px) {
    .e-dlg-container:has(.th-hire-dialog) {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .e-dlg-container:has(.th-hire-dialog) .e-dlg-overlay {
        background: var(--th-surface) !important;
    }

    .th-hire-dialog.e-dialog,
    .th-hire-dialog.e-dialog.e-dlg-fullscreen {
        position: fixed !important;
        inset: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        width: 100vw !important;
        max-width: none !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .th-hire-dialog .e-dlg-header-content {
        padding: 0.8rem 0.9rem !important;
        padding-top: calc(0.7rem + env(safe-area-inset-top, 0px)) !important;
        flex-shrink: 0;
    }

    .th-hire-dialog .e-dlg-content {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0.8rem 0.85rem 1rem !important;
    }

    .th-hire-dialog .e-footer-content {
        flex-shrink: 0;
        padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
        box-shadow: 0 -10px 24px rgba(26, 26, 26, 0.06);
        border-top: 1px solid var(--th-line) !important;
    }
}

.th-add-dialog.e-dialog {
    overflow: hidden;
}

.th-add-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.15rem;
    overscroll-behavior: contain;
    animation: th-add-overlay-in 0.2s var(--th-ease);
}

.th-add-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.42);
    touch-action: none;
}

.th-add-sheet {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(480px, 100%);
    max-height: min(90dvh, 760px);
    overflow: hidden;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 18px;
    box-shadow: 0 28px 64px rgba(26, 26, 26, 0.18);
    animation: th-add-sheet-in 0.28s var(--th-ease);
}

.th-add-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: 0.95rem 1.1rem 0.85rem;
    border-bottom: 3px solid var(--th-red);
    background: var(--th-surface);
}

.th-add-sheet__head .th-hire-title {
    padding-right: 0;
}

.th-add-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    background: var(--th-ivory);
    color: var(--th-ink);
    cursor: pointer;
}

.th-add-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.15rem 1.25rem;
    background: var(--th-bg);
}

.th-add-sheet__foot {
    flex-shrink: 0;
    padding: 0.85rem 1rem;
    background: var(--th-surface);
    border-top: 1px solid var(--th-line);
}

.th-add-sheet .th-add__submit {
    width: 100%;
    min-height: 2.7rem;
    border-radius: 999px !important;
    font-weight: 700 !important;
}

@keyframes th-add-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes th-add-sheet-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
    .th-add-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .th-add-overlay__backdrop {
        background: var(--th-surface);
    }

    .th-add-sheet {
        width: 100%;
        max-height: none;
        height: 100%;
        height: 100dvh;
        border: none;
        border-radius: 0;
        box-shadow: none;
        animation: th-add-sheet-up 0.28s var(--th-ease);
    }

    .th-add-sheet__head {
        padding: 0.8rem 0.9rem;
        padding-top: calc(0.7rem + env(safe-area-inset-top, 0px));
    }

    .th-add-sheet__body {
        padding: 0.8rem 0.85rem 1rem;
    }

    .th-add-sheet__foot {
        padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -10px 24px rgba(26, 26, 26, 0.06);
    }

    .th-add-sheet .th-add__media {
        width: 92px;
        height: 92px;
        border-radius: 14px;
    }

    .th-add-sheet .th-add__intro h2 {
        font-size: 1.12rem;
        margin-bottom: 0.3rem;
    }
}

@keyframes th-add-sheet-up {
    from { transform: translateY(10%); }
    to { transform: none; }
}

.th-add {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.th-add__hero {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.th-add__media {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--th-photo);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    overflow: hidden;
}

.th-add__media img {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
}

.th-add__intro h2 {
    margin: 0 0 0.4rem;
    font-size: 1.28rem;
    line-height: 1.25;
}

.th-add__price .th-price {
    font-size: 1.35rem;
}

.th-add__price .th-price__was {
    margin-top: 0;
    margin-bottom: 0.12rem;
}

.th-add__price .th-price__note {
    letter-spacing: 0.08em;
}

.th-add__label {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--th-muted);
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.th-add__desc {
    padding: 0.8rem 0.9rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
}

.th-add__desc p {
    margin: 0;
    color: var(--th-ink);
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.th-add__qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.9rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
}

.th-add__qty-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--th-ink);
}

.th-stepper {
    display: inline-flex;
    align-items: center;
    height: 2.4rem;
    border: 1px solid var(--th-line);
    border-radius: 999px;
    background: var(--th-ivory);
    overflow: hidden;
}

.th-stepper--sm {
    height: 2.1rem;
}

.th-stepper__btn {
    width: 2.35rem;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--th-red);
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.th-stepper__btn:hover:not(:disabled) {
    background: color-mix(in srgb, var(--th-red) 8%, transparent);
}

.th-stepper--sm .th-stepper__btn {
    width: 2.05rem;
}

.th-stepper__btn:disabled {
    color: var(--th-muted);
    cursor: default;
    opacity: 0.45;
}

.th-stepper__value {
    min-width: 1.6rem;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--th-ink);
}

.th-add__related {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.th-add-acc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
}

.th-add-acc__info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.th-add-acc__info strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--th-ink);
    line-height: 1.3;
}

.th-add-acc__info span {
    font-size: 0.75rem;
    color: var(--th-muted);
}

.th-add__note {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--th-muted);
}

.th-add__footer {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
}

.th-add__actions {
    display: flex;
    justify-content: flex-end;
}

.th-add-dialog .e-footer-content {
    padding: 0.85rem 1rem !important;
}

.th-add__submit.mud-button-filled,
.th-add-dialog .th-add__submit {
    width: 100%;
    min-height: 2.7rem;
    border-radius: 999px !important;
    font-weight: 700 !important;
}

.th-hire-title {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding-right: 2.2rem;
}

.th-hire-title__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.th-hire-title__top .th-order-chip {
    flex: 0 0 auto;
}

.th-hire-steps {
    display: flex;
    align-items: center;
    gap: 0.32rem;
}

.th-hire-steps span {
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 999px;
    background: var(--th-line);
}

.th-hire-steps span.is-active {
    width: 1.05rem;
    background: var(--th-red);
}

.th-hire-steps span.is-done {
    background: color-mix(in srgb, var(--th-red) 55%, var(--th-line));
}

.th-hire-title--completed {
    gap: 0.55rem;
    padding-bottom: 0.15rem;
}

.th-hire-title__contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
    padding-top: 0.15rem;
}

.th-hire-title__contact-item {
    font-size: 0.78rem;
    color: var(--th-muted);
    line-height: 1.4;
    word-break: break-word;
}

.th-hire-title__contact-item:first-child {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--th-ink);
}

.th-hire-title__contact-item--period {
    font-variant-numeric: tabular-nums;
}

.th-hire-dialog .e-dlg-header-content:has(.th-hire-title--completed) {
    padding-bottom: 0.85rem !important;
}

.th-hire-kicker {
    font-size: 0.65rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--th-gold);
}

.th-hire-kicker--motto {
    font-family: var(--th-serif);
    font-size: 1.15rem;
    font-style: italic;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--th-red);
    line-height: 1.3;
}

.th-hire-title .th-serif {
    font-family: var(--th-serif);
    font-size: 1.42rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--th-ink);
}

.th-hire-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.th-hire-layout--wizard {
    gap: 0;
    width: 100%;
    grid-template-columns: 1fr !important;
}

.th-hire-layout--completed {
    gap: 1rem;
    width: 100%;
    grid-template-columns: 1fr;
}

.th-hire-layout--completed .th-hire-pane--cart,
.th-hire-layout--completed .th-hire-pane--history {
    grid-column: 1 / -1;
}

.th-hire-pane--history {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 12px;
    padding: 1rem 1.05rem;
    width: 100%;
}

.th-hire-pane--full {
    width: 100%;
    max-width: none;
}

.th-hire-layout--wizard .th-hire-pane--form.th-hire-pane--full {
    max-width: none;
    margin: 0;
    width: 100%;
}

.th-hire-pane {
    background: transparent;
    border: none;
    padding: 0;
}

.th-hire-pane--form {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    padding: 1.05rem 1.1rem;
}

.th-hire-pane__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.th-hire-pane__head h2 {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-hire-pane__head span {
    font-size: 0.8rem;
    color: var(--th-muted);
}

.th-hire-table {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.th-hire-period {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    padding: 0.95rem 1rem;
    margin-bottom: 0.95rem;
}

.th-hire-period--summary {
    margin-top: 0.85rem;
    margin-bottom: 0;
    background: var(--th-ivory);
}

.th-hire-period .th-hire-pane__head {
    margin-bottom: 0.5rem;
}

.th-hire-period__pickers {
    margin-bottom: 0.35rem;
}

.th-hire-period__hint,
.th-hire-period__note {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    color: var(--th-muted);
    line-height: 1.45;
}

.th-hire-period__note strong {
    color: var(--th-ink);
    font-weight: 600;
}

.th-hire-period__custom {
    margin-top: 0.55rem;
}

.th-hire-period__custom-toggle {
    margin: 0;
}

.th-hire-period__custom-toggle .mud-typography-body1 {
    font-size: 0.82rem;
    font-weight: 600;
}

.th-hire-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(26, 26, 26, 0.04);
}

.th-hire-group + .th-hire-group {
    margin-top: 0;
}

.th-hire-group__head {
    padding: 0.55rem 0.85rem;
    background: var(--th-ivory);
    border-bottom: 1px solid var(--th-line);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--th-red);
}

.th-hire-line {
    border-bottom: 1px solid var(--th-line);
}

.th-hire-line:last-child {
    border-bottom: none;
}

.th-hire-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    grid-template-rows: auto auto;
    gap: 0.5rem 0.75rem;
    align-items: start;
    padding: 0.8rem 0.9rem;
}

.th-hire-row img {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: var(--th-photo);
    border: 1px solid var(--th-line);
    border-radius: 12px;
}

.th-hire-row__main {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.th-hire-row__bar {
    display: contents;
}

.th-hire-row__bar .th-hire-qtybox {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: end;
}

.th-hire-row__toggle {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    flex-shrink: 1;
    min-width: 0;
}

.th-hire-row__toggle .mud-switch {
    margin: 0;
    padding: 0;
}

.th-hire-row__main strong {
    font-family: var(--th-serif);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
}

.th-hire-row__price {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--th-red);
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.th-hire-row__off {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    background: var(--th-red);
    border-radius: 999px;
    padding: 0.12rem 0.4rem;
    white-space: nowrap;
}

.th-hire-row__was {
    font-size: 0.7rem;
    color: var(--th-muted);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.th-hire-row__bill {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--th-muted);
    line-height: 1.35;
    margin-top: 0.1rem;
}

.th-hire-row__toggle .mud-typography-body1 {
    font-size: 0.72rem;
    line-height: 1.2;
    white-space: nowrap;
}

.th-hire-row__dates-label {
    font-size: 0.72rem;
    color: var(--th-muted);
    line-height: 1.35;
}

.th-hire-row__dates-slot {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s ease;
    overflow: hidden;
    overflow-anchor: none;
}

.th-hire-row__dates-slot > .th-hire-row__dates {
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, padding 0.22s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.th-hire-row__dates-slot.is-open {
    grid-template-rows: 1fr;
}

.th-hire-row__dates-slot.is-open > .th-hire-row__dates {
    opacity: 1;
    pointer-events: auto;
    padding-top: 0;
    padding-bottom: 0.65rem;
}

.th-hire-line {
    overflow-anchor: none;
}

.th-hire-row__dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.65rem;
    padding-left: calc(0.9rem + 52px + 0.75rem);
    padding-right: 0.85rem;
}

.th-hire-qtybox {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 6.6rem;
    min-width: 6.6rem;
    height: 2.15rem;
    flex-shrink: 0;
    border: 1px solid var(--th-line);
    border-radius: 999px;
    background: var(--th-ivory);
}

.th-hire-qtybox span {
    width: 1.75rem;
    min-width: 1.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.th-hire-row__remove {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    align-self: start;
}

.th-hire-days {
    padding: 0 0.9rem 0.65rem calc(0.9rem + 52px + 0.75rem);
    max-width: 16rem;
}

.th-bill-page {
    display: grid;
    gap: 1rem;
}

.th-bill-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    padding: 0.15rem 0.1rem 0.35rem;
}

.th-bill-meta div {
    min-width: 0;
}

.th-bill-meta dt {
    margin: 0;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--th-muted);
    font-weight: 700;
}

.th-bill-meta dd {
    margin: 0.18rem 0 0;
    color: var(--th-ink);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.th-bill-meta dd span {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--th-muted);
}

.th-bill {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
    overflow: hidden;
}

.th-bill__cols,
.th-bill-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 4.2rem 5.2rem 6.4rem 7.2rem;
    gap: 0.55rem 0.7rem;
    align-items: center;
}

.th-bill__cols {
    padding: 0.55rem 1rem;
    background: var(--th-ivory);
    color: var(--th-muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.th-bill__cols span:nth-child(n + 2),
.th-bill-row > .th-bill-input,
.th-bill-row > .th-bill-static,
.th-bill-row__amount {
    text-align: right;
}

.th-bill-row {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--th-line);
}

.th-bill-row__item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.th-bill-row__item img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--th-ivory);
    flex-shrink: 0;
}

.th-bill-row__item strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.3;
}

.th-bill-row__item span {
    display: block;
    color: var(--th-muted);
    font-size: 0.74rem;
    margin-top: 0.12rem;
}

.th-bill-input {
    width: 100%;
    height: 2.15rem;
    border: 1px solid var(--th-line);
    border-radius: 8px;
    background: #fff;
    color: var(--th-ink);
    font: inherit;
    font-variant-numeric: tabular-nums;
    text-align: right;
    padding: 0 0.5rem;
}

.th-bill-input:focus {
    outline: 2px solid color-mix(in srgb, var(--th-red) 35%, transparent);
    border-color: var(--th-red);
}

.th-bill-input--wide {
    text-align: left;
}

.th-bill-static {
    font-variant-numeric: tabular-nums;
    color: var(--th-ink);
}

.th-bill-row__amount {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.th-bill-x {
    border: 0;
    background: none;
    color: var(--th-muted);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
}

.th-bill-x:hover {
    color: var(--th-red);
}

.th-bill-off {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.7rem;
    padding-left: calc(44px + 0.7rem);
}

.th-bill-off__edit {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    align-items: end;
    width: 100%;
}

.th-bill-off__edit label {
    display: grid;
    gap: 0.22rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-bill-off__reason {
    flex: 1;
    min-width: 12rem;
}

.th-bill-chip,
.th-bill-link,
.th-bill-add__btn {
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.th-bill-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--th-gold) 16%, var(--th-ivory));
    color: var(--th-ink);
    font-size: 0.76rem;
    font-weight: 650;
}

.th-bill-link,
.th-bill-add__btn {
    color: var(--th-red);
    font-size: 0.8rem;
    font-weight: 650;
    padding: 0;
}

.th-bill-add {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--th-line);
}

.th-bill-select {
    flex: 1;
    min-width: 0;
    height: 2.25rem;
    border: 1px solid var(--th-line);
    border-radius: 8px;
    background: #fff;
    padding: 0 0.65rem;
    font: inherit;
}

.th-bill-totals {
    display: grid;
    justify-items: end;
    gap: 0.28rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid var(--th-line);
    background: var(--th-ivory);
}

.th-bill-totals div {
    display: grid;
    grid-template-columns: auto 8.5rem;
    gap: 1.25rem;
    align-items: baseline;
    min-width: 16rem;
}

.th-bill-totals span {
    color: var(--th-muted);
    font-size: 0.78rem;
}

.th-bill-totals strong {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.th-bill-totals .is-total {
    margin-top: 0.2rem;
    padding-top: 0.35rem;
    border-top: 1px solid var(--th-line);
}

.th-bill-totals .is-total span,
.th-bill-totals .is-total strong {
    color: var(--th-ink);
    font-size: 0.98rem;
}

.th-hire-footer--bill {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.th-hire-footer--bill .th-hire-footer__actions {
    margin-left: auto;
}

.th-office-issue-bill {
    margin-top: 1rem;
}

.th-office-issue-bill .th-bill {
    border-radius: 12px;
}

@media (max-width: 800px) {
    .th-bill-meta,
    .th-bill__cols,
    .th-bill-row {
        grid-template-columns: 1fr 4rem 4.5rem 5.5rem;
    }

    .th-bill__cols span:last-child,
    .th-bill-row__amount {
        display: none;
    }

    .th-bill-off {
        padding-left: 0;
    }
}

@media (max-width: 640px) {
    .th-bill-meta {
        grid-template-columns: 1fr;
    }

    .th-bill__cols {
        display: none;
    }

    .th-bill-row {
        grid-template-columns: 1fr 1fr 1fr;
        align-items: start;
    }

    .th-bill-row__item {
        grid-column: 1 / -1;
    }

    .th-bill-row__amount {
        display: flex;
        grid-column: 1 / -1;
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .th-hire-row {
        grid-template-columns: 48px minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        gap: 0.4rem 0.6rem;
        padding: 0.7rem 0.75rem;
        align-items: start;
    }

    .th-hire-row img {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .th-hire-row__main {
        grid-column: 2;
        grid-row: 1;
    }

    .th-hire-row__main strong {
        font-size: 0.84rem;
        padding-right: 0.25rem;
    }

    .th-hire-row__bar {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.45rem 0.65rem;
        grid-column: 2 / span 2;
        grid-row: 2;
        width: 100%;
        min-width: 0;
    }

    .th-hire-row__bar:not(:has(.th-hire-row__toggle)) {
        justify-content: flex-end;
    }

    .th-hire-row__bar .th-hire-qtybox {
        grid-column: unset;
        grid-row: unset;
        align-self: center;
        justify-self: unset;
    }

    .th-hire-row__toggle {
        grid-column: unset;
        grid-row: unset;
    }

    .th-hire-row__toggle .mud-typography-body1 {
        font-size: 0.68rem;
    }

    .th-hire-qtybox {
        width: auto;
        min-width: 6.25rem;
        max-width: 9rem;
        flex-shrink: 0;
    }

    .th-hire-row__remove {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
    }

    .th-hire-row__dates,
    .th-hire-days {
        grid-template-columns: 1fr;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .th-hire-row__dates-slot.is-open > .th-hire-row__dates {
        padding-bottom: 0.6rem;
    }

    .th-hire-period {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        border-radius: 10px;
        overflow-anchor: none;
    }

    .th-hire-period__note,
    .th-hire-period__hint {
        min-height: 2.4em;
    }

    .th-hire-period__pickers,
    .th-hire-schedule-edit {
        grid-template-columns: 1fr;
    }

    .th-hire-group {
        border-radius: 10px;
    }

    .th-hire-group__head {
        padding: 0.5rem 0.75rem;
    }

    .th-hire-footer {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.65rem;
        align-items: stretch;
    }

    .th-hire-footer__meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.12rem;
    }

    .th-hire-footer__summary {
        font-size: 0.86rem;
    }

    .th-hire-footer__period {
        font-size: 0.74rem;
    }

    .th-hire-footer__totals {
        align-items: stretch;
        width: 100%;
        justify-self: stretch;
    }

    .th-hire-footer__total-row {
        justify-content: space-between;
        width: 100%;
    }

    .th-hire-footer__estimates {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        width: 100%;
        justify-self: stretch;
        justify-content: stretch;
        gap: 0;
        border: 1px solid var(--th-line);
        border-radius: 10px;
        overflow: hidden;
        background: var(--th-ivory);
    }

    .th-hire-footer__estimate {
        flex: none;
        width: 100%;
        min-width: 0;
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.55rem 0.7rem;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .th-hire-footer__estimate + .th-hire-footer__estimate {
        border-left: none;
        border-top: 1px solid var(--th-line);
        padding-left: 0.7rem;
    }

    .th-hire-footer__estimate-label {
        white-space: normal;
        letter-spacing: 0.06em;
        line-height: 1.25;
        text-align: left;
    }

    .th-hire-footer__estimate-value {
        font-size: 1.05rem;
        flex-shrink: 0;
        text-align: right;
    }

    .th-hire-footer__cta,
    .th-hire-footer__actions {
        margin-left: 0;
        width: 100%;
        justify-self: stretch;
    }

    .th-hire-footer__cta .mud-button-root,
    .th-hire-footer__actions .mud-button-root,
    .th-hire-footer__actions .th-hire-footer__back {
        width: 100%;
        min-width: 0 !important;
    }

    .th-hire-footer__actions {
        display: flex;
        flex-direction: column;
        gap: 0.45rem;
    }

    .th-hire-pane--form {
        padding: 0.85rem 0.75rem;
        border-radius: 10px;
    }

    .th-hire-fields--contact {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    .th-hire-row {
        grid-template-columns: 44px minmax(0, 1fr) auto auto;
    }

    .th-hire-row img {
        width: 44px;
        height: 44px;
    }
}

.th-hire-item-note,
.th-hire-schedule {
    margin: 0;
    padding: 0 0.85rem 0.65rem;
    font-size: 0.78rem;
    color: var(--th-muted);
    line-height: 1.45;
}

.th-hire-schedule {
    padding: 0;
    margin-bottom: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.th-hire-link {
    display: inline-block;
    margin: 0 0.85rem 0.65rem;
    padding: 0;
    border: none;
    background: none;
    color: var(--th-red);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.th-hire-link:hover {
    color: var(--th-red-deep);
}

.th-hire-schedule-edit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.th-hire-fields--contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.th-hire-fields__note {
    grid-column: 1 / -1;
}

.th-hire-fields__note .e-input-group textarea.e-input {
    min-height: 9.5rem;
}

.th-note-label {
    display: block;
    margin: 0 0 0.35rem;
    color: var(--th-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.th-hire-fields__note textarea::placeholder {
    color: color-mix(in srgb, var(--th-muted) 72%, transparent) !important;
    font-weight: 400;
}

.th-hire-item-times .mud-input-control {
    margin-top: 0;
}

.th-hire-item-times__inherit {
    margin: 0;
    font-size: 0.78rem;
    color: var(--th-muted);
}

.th-hire-when {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.th-hire-when--item {
    margin-top: 0.35rem;
}

.th-hire-pane--form .th-hire-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

@media (min-width: 900px) {
    .th-hire-layout:not(.th-hire-layout--wizard):not(.th-hire-layout--completed) {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: start;
    }

    .th-hire-layout--wizard .th-hire-fields--contact,
    .th-hire-layout--wizard .th-hire-schedule-edit {
        grid-template-columns: 1fr 1fr;
    }
}

.th-hire-footer {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem 1.25rem;
    width: 100%;
}

.th-hire-footer--confirm,
.th-hire-footer--readonly {
    grid-template-columns: minmax(0, 1fr) auto;
}

.th-hire-dialog .e-footer-content {
    padding: 0.85rem 1.05rem !important;
    border-top: 1px solid var(--th-line) !important;
    background: var(--th-surface) !important;
}

.th-hire-footer__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.65rem;
    min-width: 0;
}

.th-hire-footer__summary {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--th-ink);
}

.th-hire-footer__period {
    font-size: 0.78rem;
    color: var(--th-muted);
    font-variant-numeric: tabular-nums;
}

.th-hire-footer__totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.28rem;
    min-width: 0;
    justify-self: end;
}

.th-hire-footer__total-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 0.75rem;
}

.th-hire-footer__total-label {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--th-muted);
    white-space: nowrap;
}

.th-hire-footer__total-value {
    font-family: var(--th-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--th-red);
    font-variant-numeric: tabular-nums;
    min-width: 5.5rem;
    text-align: right;
}

.th-hire-footer__note {
    margin: 0.35rem 0 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--th-muted);
    max-width: 28rem;
}

.th-hire-footer__estimates {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: stretch;
    gap: 0.55rem 0.75rem;
    min-width: 0;
    justify-self: end;
}

.th-hire-footer__estimate {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
    min-width: 6.75rem;
}

.th-hire-footer__estimate + .th-hire-footer__estimate {
    border-left: 1px solid var(--th-line);
    padding-left: 0.75rem;
}

.th-hire-footer__estimate-label {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--th-muted);
    white-space: nowrap;
}

.th-hire-footer__estimate-value {
    font-family: var(--th-serif);
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--th-red);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.th-hire-footer__cta {
    justify-self: end;
    flex-shrink: 0;
}

.th-hire-footer__cta .mud-button-root,
.th-hire-footer__cta.mud-button-filled {
    min-width: 9.5rem;
    min-height: 2.7rem;
    border-radius: 999px !important;
    font-weight: 700 !important;
}

.th-hire-footer__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    justify-self: end;
    flex-shrink: 0;
}

.th-hire-footer__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 6.5rem;
    min-height: 2.7rem;
    padding: 0 1rem;
    border: 1px solid var(--th-line);
    border-radius: 999px;
    background: var(--th-surface);
    color: var(--th-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.th-hire-footer__back:hover,
.th-hire-footer__back:active,
.th-hire-footer__back:focus {
    border-color: var(--th-red);
    background: color-mix(in srgb, var(--th-red) 7%, var(--th-surface));
    color: var(--th-ink);
}

.th-hire-footer__back .mud-icon-root {
    color: var(--th-red) !important;
    font-size: 1.15rem !important;
}

.th-hire-footer__submit .mud-button-root,
.th-hire-footer__submit.mud-button-filled {
    min-width: 11rem;
    min-height: 2.7rem;
    border-radius: 999px !important;
    font-weight: 700 !important;
}

@media (max-width: 860px) {
    .th-hire-footer,
    .th-hire-footer--confirm,
    .th-hire-footer--readonly {
        grid-template-columns: 1fr;
        gap: 0.7rem;
        align-items: stretch;
    }

    .th-hire-footer__meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.12rem;
    }

    .th-hire-footer__totals,
    .th-hire-footer__estimates,
    .th-hire-footer__cta,
    .th-hire-footer__actions {
        justify-self: stretch;
        width: 100%;
    }

    .th-hire-footer__totals {
        align-items: stretch;
    }

    .th-hire-footer__total-row {
        justify-content: space-between;
        width: 100%;
    }

    .th-hire-footer__estimates {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: stretch;
        gap: 0;
        border: 1px solid var(--th-line);
        border-radius: 10px;
        overflow: hidden;
        background: var(--th-ivory);
    }

    .th-hire-footer__estimate {
        flex: none;
        width: 100%;
        min-width: 0;
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.55rem 0.75rem;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .th-hire-footer__estimate + .th-hire-footer__estimate {
        border-left: none;
        border-top: 1px solid var(--th-line);
        padding-left: 0.75rem;
    }

    .th-hire-footer__estimate-label {
        white-space: normal;
        letter-spacing: 0.06em;
        line-height: 1.25;
        text-align: left;
    }

    .th-hire-footer__estimate-value {
        flex-shrink: 0;
        text-align: right;
    }

    .th-hire-footer__cta .mud-button-root,
    .th-hire-footer__actions .mud-button-root,
    .th-hire-footer__actions .th-hire-footer__back {
        width: 100%;
        min-width: 0 !important;
    }

    .th-hire-footer__actions {
        display: grid;
        grid-template-columns: 1fr 1.4fr;
        gap: 0.5rem;
    }
}

.th-hire-estimates {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.th-hire-estimate {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

@media (max-width: 640px) {
    .th-hire-fields--contact,
    .th-hire-schedule-edit {
        grid-template-columns: 1fr;
    }
}

.th-hire-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.th-hire-toolbar__label {
    font-family: var(--th-serif);
    font-size: 1.35rem;
    color: var(--th-ink);
}

.th-hire-toolbar__hint {
    font-size: 0.82rem;
    color: var(--th-muted);
}

.th-hire-toolbar__actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.th-hire-empty {
    background: var(--th-surface);
    border: 1px dashed var(--th-line);
    border-radius: 16px;
    padding: 2.4rem 1.4rem;
    text-align: center;
    color: var(--th-muted);
}

.th-hire-empty p {
    margin: 0.45rem 0 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--th-ink);
}

.th-hire-empty .th-contact-cta {
    margin-top: 1.15rem;
}

.th-hire-form {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    padding: 1rem;
}

.th-hire-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.th-hire-fields__full {
    grid-column: 1 / -1;
}

.th-hire-note {
    margin: 0.75rem 0 0.85rem;
    font-size: 0.78rem;
    color: var(--th-muted);
    line-height: 1.45;
}

.th-hire-note strong {
    color: var(--th-red);
    font-weight: 600;
}

.th-hire-submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

@media (max-width: 1439px) {
    .th-account-btn span {
        display: none;
    }

    .th-account-btn {
        width: 2.4rem;
        padding: 0;
        justify-content: center;
        margin-right: 0.15rem;
    }

    .th-cart-label {
        display: none;
    }
}

@media (max-width: 640px) {
    .th-brand-name {
        font-size: 0.72rem;
        letter-spacing: 0.06em;
    }

    .th-brand-loc.th-brand-motto {
        display: block;
        font-size: 0.62rem;
        line-height: 1.25;
    }

    .th-brand-text {
        max-width: none;
    }

    .th-cart-label {
        display: none;
    }

    .th-cart-btn {
        padding: 0.28rem 0.38rem;
    }

    .th-page {
        padding: 0.35rem 0.75rem calc(2rem + env(safe-area-inset-bottom));
    }

    .th-main {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .th-panel nav a {
        font-size: clamp(1.8rem, 10vw, 2.6rem);
        padding: 0.45rem 0;
        min-height: 2.75rem;
        align-items: center;
    }

    .th-panel__ornament { display: none; }

.th-page-header__title {
        font-size: 1.05rem;
    }

    .th-page-header__subtitle {
        font-size: 0.74rem;
    }

    .th-category-card {
        height: 240px;
    }

    .th-product-card:hover {
        transform: none;
    }

    .th-hire-dialog.e-dialog {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        max-height: 100% !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .th-hire-dialog .e-dlg-header-content {
        padding: 0.75rem 0.85rem !important;
        padding-top: calc(0.75rem + env(safe-area-inset-top, 0px)) !important;
        flex-shrink: 0;
    }

    .th-hire-dialog .e-dlg-content {
        padding: 0.65rem 0.75rem 0.85rem !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
    }

    .th-hire-dialog .e-footer-content {
        padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0px)) !important;
        box-shadow: 0 -6px 16px rgba(36, 28, 21, 0.08);
        flex-shrink: 0;
    }

    .th-hire-title .th-serif {
        font-size: 1.15rem;
    }

    .th-hire-title__contact {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .th-hire-title__contact-item {
        font-size: 0.75rem;
    }

    .th-hire-title__contact-item:first-child {
        font-size: 0.82rem;
    }

    .th-add-dialog .e-dlg-content {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    .th-add-dialog .th-add {
        flex: 1 1 auto;
        min-height: 0;
        gap: 0.8rem;
    }

    .th-add-dialog .th-add__media {
        width: 92px;
        height: 92px;
        border-radius: 14px;
    }

    .th-add-dialog .th-add__intro h2 {
        font-size: 1.12rem;
        margin-bottom: 0.3rem;
    }

    .th-add-dialog .th-add__price .th-price {
        font-size: 1.2rem;
    }

    .th-add-dialog .e-footer-content {
        padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .th-add-dialog .th-add__footer {
        margin-top: 0;
        padding: 0;
    }

    .th-add-dialog .th-add__actions .mud-button,
    .th-add-dialog .th-add__submit {
        width: 100%;
    }

    .th-hire-toolbar {
        flex-direction: column;
    }

    .th-hire-submit {
        justify-content: stretch;
    }

    .th-hire-submit .mud-button {
        width: 100%;
    }

    .th-contact {
        padding: 1.4rem 1.1rem;
    }
}

@media (hover: none) {
    .th-product-card:hover {
        transform: none;
        box-shadow: 0 10px 24px rgba(26, 26, 26, 0.045);
        border-color: var(--th-line);
    }

    .th-product-card:active {
        transform: scale(0.99);
        border-color: color-mix(in srgb, var(--th-red) 35%, var(--th-line));
    }

    .th-add-btn.mud-button-filled:active {
        transform: scale(0.97);
    }
}

@media (min-width: 641px) {
    .th-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .th-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.35rem;
    }

    .th-product-card__media {
        margin: 0.8rem 0.8rem 0;
        height: 200px;
        border-radius: 14px;
        border: 1px solid var(--th-line);
    }

    .th-login-grid {
        grid-template-columns: 1fr 1fr;
    }

    .th-login-page {
        padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.5rem 2rem;
    }

    .th-login {
        padding: 2rem 1.75rem 1.6rem;
    }
}

@media (min-width: 960px) {
    .th-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .th-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .th-page-header__title {
        font-size: 1.18rem;
    }
}

@media (min-width: 1280px) {
    .th-product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1600px) {
    .th-category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .th-product-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Syncfusion toasts */
.e-toast-container {
    position: fixed !important;
    inset: 0 !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    transform: none !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-end !important;
    padding: 0 1.25rem 1.25rem 0 !important;
    pointer-events: none !important;
    z-index: 100000 !important;
}

.e-toast-container .e-toast {
    pointer-events: auto !important;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    background: var(--th-cream) !important;
    color: var(--th-ink) !important;
    border: 1px solid var(--th-line) !important;
    border-top: 3px solid var(--th-red) !important;
    border-left: 1px solid var(--th-line) !important;
    border-radius: 0 !important;
    box-shadow: 0 22px 50px rgba(44, 38, 34, 0.16) !important;
    font-family: var(--th-sans) !important;
    min-height: 0 !important;
    padding: 1.15rem 1.25rem 1.2rem !important;
    width: min(380px, calc(100vw - 2rem)) !important;
}

.e-toast-container .e-toast.e-toast-success,
.e-toast-container .e-toast.e-toast-info {
    border-top-color: var(--th-red) !important;
}

.e-toast-container .e-toast.e-toast-warning {
    border-top-color: var(--th-gold) !important;
}

.e-toast-container .e-toast.e-toast-danger {
    border-top-color: var(--th-red-deep) !important;
}

.e-toast-container .e-toast-icon,
.e-toast-container .e-toast .e-toast-icon {
    display: none !important;
}

.e-toast-container .e-toast-message {
    padding: 0 1.5rem 0 0 !important;
}

.e-toast-container .e-toast-title {
    font-family: var(--th-serif) !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: var(--th-red) !important;
    margin-bottom: 0.35rem !important;
}

.e-toast-container .e-toast-content {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    color: var(--th-ink) !important;
}

.e-toast-container .e-toast-close-icon {
    color: var(--th-muted) !important;
    font-size: 13px !important;
}

.e-toast-container .e-toast-progress {
    background: var(--th-gold) !important;
    height: 2px !important;
}

/* Syncfusion aligned to Talisman theme */
.e-control,
.e-control-wrapper,
.e-btn,
.e-css.e-btn,
.e-input-group,
.e-float-input,
.e-grid,
.e-dialog,
.e-tab,
.e-dropdownbase {
    font-family: var(--th-sans) !important;
}

.e-primary.e-btn,
.e-btn.e-primary,
.e-css.e-btn.e-primary {
    background: var(--th-red) !important;
    border-color: var(--th-red) !important;
    color: #fff !important;
}

.e-primary.e-btn:hover,
.e-btn.e-primary:hover,
.e-css.e-btn.e-primary:hover,
.e-primary.e-btn:active,
.e-btn.e-primary:active,
.e-css.e-btn.e-primary:active {
    background: var(--th-red-deep) !important;
    border-color: var(--th-red-deep) !important;
    color: #fff !important;
}

.e-primary.e-btn:focus,
.e-btn.e-primary:focus,
.e-css.e-btn.e-primary:focus {
    background: var(--th-red) !important;
    border-color: var(--th-red) !important;
    color: #fff !important;
}

.e-btn:focus,
.e-css.e-btn:focus,
.e-btn:active,
.e-css.e-btn:active,
.e-primary.e-btn:focus,
.e-btn.e-primary:focus,
.e-css.e-btn.e-primary:focus,
.e-footer-content .e-btn:focus,
.e-dialog .e-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.e-btn:focus-visible,
.e-css.e-btn:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--th-red) 28%, transparent) !important;
}

.e-primary.e-btn:focus-visible,
.e-btn.e-primary:focus-visible,
.e-css.e-btn.e-primary:focus-visible {
    background: var(--th-red) !important;
    border-color: var(--th-red) !important;
    box-shadow: 0 0 0 2px var(--th-surface), 0 0 0 4px var(--th-red) !important;
}

.e-input-group:not(.e-success):not(.e-warning):not(.e-error),
.e-input-group.e-control-wrapper:not(.e-success):not(.e-warning):not(.e-error) {
    border-color: var(--th-line) !important;
}

.e-input-group.e-input-focus:not(.e-success):not(.e-warning):not(.e-error),
.e-input-group.e-control-wrapper.e-input-focus:not(.e-success):not(.e-warning):not(.e-error) {
    border-color: var(--th-red) !important;
    box-shadow: 0 0 0 1px var(--th-red) !important;
}

.e-float-text,
.e-float-input .e-float-text {
    color: var(--th-muted) !important;
    font-family: var(--th-sans) !important;
}

.e-input-group input.e-input,
.e-input-group textarea.e-input,
.e-float-input input,
.e-float-input textarea {
    color: var(--th-ink) !important;
    background: transparent !important;
}

.e-input-group textarea.e-input,
.e-float-input textarea,
textarea.e-input {
    min-height: 4.4rem;
    resize: vertical;
}

.e-grid {
    border-color: var(--th-line) !important;
    font-family: var(--th-sans) !important;
}

.e-grid .e-headercell,
.e-grid .e-headercelldiv {
    background: var(--th-surface) !important;
    color: var(--th-ink) !important;
    font-family: var(--th-sans) !important;
}

.e-grid .e-rowcell {
    color: var(--th-ink) !important;
    border-color: var(--th-line) !important;
}

.e-grid .e-altrow {
    background: var(--th-ivory) !important;
}

.e-grid .e-toolbar,
.e-grid .e-groupdroparea,
.e-grid .e-gridheader,
.e-grid .e-gridcontent,
.e-grid .e-gridpager {
    background: var(--th-surface) !important;
    border-color: var(--th-line) !important;
    color: var(--th-ink) !important;
}

.e-pager .e-currentitem {
    background: var(--th-red) !important;
    border-color: var(--th-red) !important;
}

.e-tab .e-tab-header {
    background: var(--th-surface) !important;
    border-color: var(--th-line) !important;
}

.e-dialog {
    background: var(--th-surface) !important;
    border-color: var(--th-line) !important;
    color: var(--th-ink) !important;
}

.e-dlg-overlay {
    background: rgba(28, 25, 23, 0.45) !important;
}

.e-checkbox-wrapper .e-frame.e-check,
.e-css.e-checkbox-wrapper .e-frame.e-check {
    background-color: var(--th-red) !important;
    border-color: var(--th-red) !important;
}

.e-ddl.e-popup,
.e-dropdownbase.e-popup {
    background: var(--th-surface) !important;
    border-color: var(--th-line) !important;
    color: var(--th-ink) !important;
}

.e-dropdownbase .e-list-item {
    color: var(--th-ink) !important;
}

.e-dropdownbase .e-list-item.e-active,
.e-dropdownbase .e-list-item.e-hover {
    background: var(--th-ivory) !important;
    color: var(--th-red) !important;
}

.th-theme-fab {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--th-line);
    border-radius: 50%;
    background: var(--th-surface);
    color: var(--th-ink);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.th-theme-fab:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

html.th-dark .e-toast-container .e-toast {
    background: var(--th-surface) !important;
    color: var(--th-ink) !important;
}

html.th-dark body,
html.th-dark .th-main,
html.th-dark .mud-layout {
    background: var(--th-ivory) !important;
    color: var(--th-ink) !important;
}

html.th-dark .mud-appbar,
html.th-dark .mud-paper,
html.th-dark .mud-navmenu,
html.th-dark .e-grid,
html.th-dark .e-dialog,
html.th-dark .th-analytics-panel,
html.th-dark .th-analytics-kpi,
html.th-dark .th-analytics-mix,
html.th-dark .th-analytics-mix-card {
    background: var(--th-surface) !important;
    color: var(--th-ink) !important;
    border-color: var(--th-line) !important;
}

html.th-dark .mud-nav-link,
html.th-dark .mud-typography,
html.th-dark .e-headertext,
html.th-dark .e-rowcell {
    color: var(--th-ink) !important;
}

html.th-dark .mud-nav-link .mud-nav-link-text,
html.th-dark .th-analytics-toolbar__hint,
html.th-dark .th-analytics-panel__lead,
html.th-dark .th-analytics-kpi__label,
html.th-dark .th-analytics-donut-caption {
    color: var(--th-muted) !important;
}

html.th-dark .th-theme-fab {
    background: var(--th-surface);
    color: var(--th-ink);
    border: 1px solid var(--th-line);
    box-shadow: var(--th-shadow);
}

html.th-dark .e-input-group,
html.th-dark .e-control-wrapper,
html.th-dark .e-float-input {
    background: var(--th-bg) !important;
    color: var(--th-ink) !important;
    border-color: var(--th-line) !important;
}

/* Analytics dashboard */
.th-analytics {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.th-analytics-scope {
    margin: 0 0 1rem;
}

.th-analytics-scope__row + .th-analytics-scope__row {
    margin-top: 0.2rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--th-line);
}

.th-analytics-versus {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
    box-shadow: var(--th-shadow);
    padding: 1.05rem 1.15rem 1.15rem;
}

.th-analytics-versus__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    margin-bottom: 0.85rem;
}

.th-analytics-versus__header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.th-analytics-versus__header p {
    margin: 0;
    color: var(--th-muted);
    font-size: 0.84rem;
}

.th-analytics-versus__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.th-analytics-versus__cell {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--th-line);
    border-radius: 12px;
    background: var(--th-ivory);
}

.th-analytics-versus__label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--th-muted);
}

.th-analytics-versus__cell strong {
    font-family: var(--th-serif);
    font-size: 1.25rem;
    line-height: 1.15;
    color: var(--th-ink);
    font-variant-numeric: tabular-nums;
}

.th-analytics-versus__other {
    font-size: 0.72rem;
    color: var(--th-muted);
}

html.th-dark .th-analytics-versus__cell {
    background: var(--th-bg);
}

.th-analytics-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.th-analytics-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(170, 57, 48, 0.1);
    color: var(--th-red);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.th-analytics-toolbar__hint {
    color: var(--th-muted);
    font-size: 0.84rem;
}

.th-analytics-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.th-analytics-kpi {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: start;
    padding: 1rem 1rem 2.2rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
    box-shadow: var(--th-shadow);
}

.th-analytics-kpi__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(170, 57, 48, 0.1);
    color: var(--th-red);
}

.th-analytics-kpi__icon--revenue {
    background: rgba(170, 57, 48, 0.14);
}

.th-analytics-kpi__icon--avg {
    background: rgba(107, 107, 107, 0.12);
    color: var(--th-muted);
}

.th-analytics-kpi__icon--hire {
    background: rgba(46, 125, 79, 0.12);
    color: #2E7D4F;
}

html.th-dark .th-analytics-kpi__icon--hire {
    color: #6BCB77;
}

.th-analytics-kpi__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.th-analytics-kpi__label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-analytics-kpi__value {
    font-family: var(--th-serif);
    font-size: 1.55rem;
    line-height: 1.1;
    color: var(--th-ink);
}

.th-analytics-kpi__meta {
    font-size: 0.78rem;
    font-weight: 600;
}

.th-analytics-kpi__meta.is-up {
    color: #2E7D4F;
}

.th-analytics-kpi__meta.is-down {
    color: var(--th-red);
}

.th-analytics-kpi__meta.is-neutral {
    color: var(--th-muted);
    font-weight: 500;
}

html.th-dark .th-analytics-kpi__meta.is-up {
    color: #6BCB77;
}

.th-analytics-kpi__prior {
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0.75rem;
    font-size: 0.72rem;
    color: var(--th-muted);
}

.th-analytics-attn {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.th-analytics-attn__item {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
    box-shadow: var(--th-shadow);
    padding: 0.85rem 1rem 0.95rem;
}

.th-analytics-attn__item span {
    display: block;
    color: var(--th-muted);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 700;
}

.th-analytics-attn__item strong {
    display: block;
    margin-top: 0.3rem;
    font-family: var(--th-serif);
    font-size: 1.35rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.th-analytics-attn__item em {
    display: block;
    margin-top: 0.2rem;
    font-style: normal;
    color: var(--th-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.th-analytics-attn__item.is-warn {
    border-color: color-mix(in srgb, var(--th-red) 38%, var(--th-line));
    background: color-mix(in srgb, var(--th-red) 7%, var(--th-surface));
}

.th-analytics-attn__item.is-live {
    border-color: rgba(46, 125, 79, 0.28);
    background: color-mix(in srgb, #2e7d4f 8%, var(--th-surface));
}

.th-analytics-pipe {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.55rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
    box-shadow: var(--th-shadow);
    padding: 0.85rem;
}

.th-analytics-pipe__item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.55rem 0.65rem 0.6rem;
    border-radius: 12px;
    background: var(--th-ivory);
    border: 1px solid transparent;
}

.th-analytics-pipe__item.is-live {
    background: rgba(46, 125, 79, 0.1);
    border-color: rgba(46, 125, 79, 0.22);
}

.th-analytics-pipe__item.is-warn {
    background: rgba(170, 57, 48, 0.08);
    border-color: rgba(170, 57, 48, 0.18);
}

.th-analytics-pipe__count {
    font-family: var(--th-serif);
    font-size: 1.35rem;
    line-height: 1.1;
    color: var(--th-ink);
    font-variant-numeric: tabular-nums;
}

.th-analytics-pipe__label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--th-muted);
}

.th-analytics-pipe__vs {
    font-size: 0.68rem;
    color: var(--th-muted);
    font-variant-numeric: tabular-nums;
}

.th-analytics-trend {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.75fr);
    gap: 0.85rem;
    align-items: stretch;
}

.th-analytics-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
}

.th-analytics-day {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.65rem 0.5rem 0.7rem;
    border: 1px solid var(--th-line);
    border-radius: 12px;
    background: var(--th-ivory);
    text-align: center;
}

.th-analytics-day.is-today {
    background: rgba(170, 57, 48, 0.1);
    border-color: rgba(170, 57, 48, 0.28);
}

.th-analytics-day__name {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--th-muted);
}

.th-analytics-day__value {
    font-family: var(--th-serif);
    font-size: 0.92rem;
    line-height: 1.15;
    color: var(--th-ink);
    font-variant-numeric: tabular-nums;
}

.th-analytics-day__orders {
    font-size: 0.68rem;
    color: var(--th-muted);
}

.th-analytics-day__bar {
    height: 4px;
    margin-top: 0.2rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--th-line) 70%, transparent);
    overflow: hidden;
}

.th-analytics-day__bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--th-red);
}

.th-analytics-day__bar.is-dual {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: auto;
    background: transparent;
    overflow: visible;
}

.th-analytics-day__bar.is-dual > span {
    height: 4px;
    background: color-mix(in srgb, var(--th-line) 70%, transparent);
}

.th-analytics-day__bar.is-dual > span > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--th-red);
}

.th-analytics-day__bar.is-dual > span.is-compare > i {
    background: #8C6B62;
}

.th-analytics-week {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.th-analytics-week__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.th-analytics-week__label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-analytics-week__value {
    font-family: var(--th-serif);
    font-size: 1.35rem;
    color: var(--th-ink);
    font-variant-numeric: tabular-nums;
}

html.th-dark .th-analytics-pipe__item,
html.th-dark .th-analytics-day {
    background: var(--th-bg);
}

.th-analytics-mix {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
    box-shadow: var(--th-shadow);
    padding: 1.05rem 1.15rem 1.15rem;
}

.th-analytics-mix__header {
    margin-bottom: 0.85rem;
}

.th-analytics-mix__title {
    margin: 0;
    font-size: 1.15rem;
}

.th-analytics-mix__lead {
    margin: 0.25rem 0 0;
    color: var(--th-muted);
    font-size: 0.84rem;
}

.th-analytics-mix__cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.th-analytics-mix-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
    padding: 0.9rem 0.95rem 2rem;
    border: 1px solid var(--th-line);
    border-radius: 12px;
    background: var(--th-ivory);
}

.th-analytics-mix-card__label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--th-muted);
}

.th-analytics-mix-card__value {
    font-family: var(--th-serif);
    font-size: 1.35rem;
    line-height: 1.1;
    color: var(--th-red);
    font-variant-numeric: tabular-nums;
}

.th-analytics-mix-card__meta {
    font-size: 0.76rem;
    font-weight: 600;
}

.th-analytics-mix-card__meta.is-up {
    color: #2E7D4F;
}

.th-analytics-mix-card__meta.is-down {
    color: var(--th-red);
}

.th-analytics-mix-card__meta.is-neutral {
    color: var(--th-muted);
    font-weight: 500;
}

html.th-dark .th-analytics-mix-card__meta.is-up {
    color: #6BCB77;
}

.th-analytics-mix-card__share {
    font-size: 0.74rem;
    color: var(--th-muted);
}

.th-analytics-mix-card__prior {
    position: absolute;
    left: 0.95rem;
    right: 0.95rem;
    bottom: 0.7rem;
    font-size: 0.7rem;
    color: var(--th-muted);
}

.th-analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
    gap: 0.85rem;
    align-items: start;
}

.th-analytics-side {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.th-analytics-panel {
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 14px;
    box-shadow: var(--th-shadow);
    padding: 1.1rem 1.15rem 1.15rem;
}

.th-analytics-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.th-analytics-panel__title {
    margin: 0;
    font-size: 1.15rem;
}

.th-analytics-panel__lead {
    margin: 0.25rem 0 0;
    color: var(--th-muted);
    font-size: 0.84rem;
}

.th-analytics-panel__tag {
    flex-shrink: 0;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--th-ivory);
    border: 1px solid var(--th-line);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--th-red);
}

.th-analytics-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: -0.25rem 0 0.95rem;
}

.th-analytics-filter {
    appearance: none;
    border: 1px solid var(--th-line);
    background: var(--th-ivory);
    color: var(--th-muted);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.th-analytics-filter.is-active {
    background: rgba(170, 57, 48, 0.12);
    border-color: rgba(170, 57, 48, 0.28);
    color: var(--th-red);
}

.th-analytics-chart {
    margin-bottom: 1rem;
}

.th-analytics-chart--donut {
    position: relative;
    margin-bottom: 0.35rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.th-analytics-donut-wrap {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    overflow: hidden;
}

.th-analytics-donut-center {
    position: absolute;
    left: 50%;
    top: 58%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: min(46%, 7.5rem);
    text-align: center;
    pointer-events: none;
}

.th-analytics-donut-center.is-narrow {
    top: 50%;
    width: min(52%, 8.25rem);
}

.th-analytics-donut-center strong {
    display: block;
    font-family: var(--th-serif);
    font-size: clamp(0.95rem, 2.6vw, 1.25rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--th-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.th-analytics-donut-center.is-narrow strong {
    font-size: clamp(0.92rem, 4.6vw, 1.15rem);
}

.th-analytics-donut-caption {
    margin: 0 0 0.85rem;
    text-align: center;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-analytics-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 180px;
    color: var(--th-muted);
    text-align: center;
}

.th-analytics-empty .mud-icon-root {
    font-size: 2rem;
    opacity: 0.55;
}

.th-analytics-empty p {
    margin: 0;
    font-size: 0.9rem;
}

.th-analytics-rank {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.th-analytics-rank__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: center;
}

.th-analytics-rank__pos {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--th-ivory);
    border: 1px solid var(--th-line);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--th-muted);
}

.th-analytics-rank__main {
    min-width: 0;
}

.th-analytics-rank__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.th-analytics-rank__name {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    font-size: 0.84rem;
    color: var(--th-ink);
    overflow: hidden;
}

.th-analytics-rank__name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-analytics-type {
    flex-shrink: 0;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--th-line);
    background: var(--th-ivory);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-analytics-type--daily {
    color: var(--th-red);
    border-color: rgba(170, 57, 48, 0.28);
    background: rgba(170, 57, 48, 0.08);
}

.th-analytics-type--monthly {
    color: #8C6B62;
    border-color: rgba(140, 107, 98, 0.35);
    background: rgba(184, 149, 107, 0.16);
}

.th-analytics-type--onceoff {
    color: #555;
    border-color: rgba(107, 107, 107, 0.35);
    background: rgba(107, 107, 107, 0.1);
}

.th-analytics-rank__value {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--th-red);
}

.th-analytics-rank__bar {
    height: 4px;
    border-radius: 999px;
    background: var(--th-line);
    overflow: hidden;
}

.th-analytics-rank__bar::after {
    content: "";
    display: block;
    height: 100%;
    width: var(--fill, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--th-red), #C45B52);
}

.th-analytics-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.th-analytics-legend__item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.55rem 0.65rem;
    align-items: center;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--th-line);
}

.th-analytics-legend__item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.th-analytics-legend__swatch {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.th-analytics-legend__name {
    font-size: 0.84rem;
    color: var(--th-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-analytics-legend__pct {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--th-muted);
}

.th-analytics-legend__total {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--th-red);
    text-align: right;
    min-width: 4.5rem;
}

@media (max-width: 1100px) {
    .th-analytics-grid,
    .th-analytics-trend {
        grid-template-columns: 1fr;
    }

    .th-analytics-kpis,
    .th-analytics-versus__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .th-analytics {
        gap: 0.95rem;
    }

    .th-analytics-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .th-analytics-attn {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .th-analytics-pipe {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .th-analytics-mix__cards {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .th-analytics-mix-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "label value"
            "meta value"
            "share share"
            "prior prior";
        column-gap: 0.85rem;
        row-gap: 0.12rem;
        align-items: start;
        padding: 0.75rem 0.85rem 1.65rem;
    }

    .th-analytics-mix-card__label {
        grid-area: label;
    }

    .th-analytics-mix-card__value {
        grid-area: value;
        align-self: center;
        font-size: 1.2rem;
        text-align: right;
    }

    .th-analytics-mix-card__meta {
        grid-area: meta;
    }

    .th-analytics-mix-card__share {
        grid-area: share;
        margin-top: 0.15rem;
    }

    .th-analytics-mix-card__prior {
        left: 0.85rem;
        right: 0.85rem;
        bottom: 0.55rem;
    }
}

@media (max-width: 640px) {
    .th-analytics {
        gap: 0.8rem;
    }

    .th-analytics-toolbar {
        gap: 0.4rem 0.65rem;
    }

    .th-analytics-toolbar__hint {
        width: 100%;
        font-size: 0.76rem;
        line-height: 1.35;
    }

    .th-analytics-kpis,
    .th-analytics-versus__grid {
        grid-template-columns: 1fr;
    }

    .th-analytics-attn {
        grid-template-columns: 1fr;
    }

    .th-analytics-pipe {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0.7rem;
    }

    .th-analytics-days {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 0.28rem;
    }

    .th-analytics-day {
        padding: 0.45rem 0.2rem 0.5rem;
    }

    .th-analytics-day__value {
        font-size: 0.72rem;
    }

    .th-analytics-day__orders {
        display: none;
    }

    .th-analytics-kpi {
        gap: 0.65rem;
        padding: 0.85rem 0.85rem 1.85rem;
        border-radius: 12px;
    }

    .th-analytics-kpi__icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .th-analytics-kpi__value {
        font-size: 1.3rem;
    }

    .th-analytics-kpi__meta {
        font-size: 0.74rem;
    }

    .th-analytics-kpi__prior {
        left: 0.85rem;
        right: 0.85rem;
        bottom: 0.6rem;
        font-size: 0.68rem;
    }

    .th-analytics-mix {
        padding: 0.85rem;
        border-radius: 12px;
    }

    .th-analytics-mix__title {
        font-size: 1.05rem;
    }

    .th-analytics-mix__lead {
        font-size: 0.78rem;
    }

    .th-analytics-panel {
        padding: 0.9rem;
        border-radius: 12px;
    }

    .th-analytics-panel__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.45rem;
        margin-bottom: 0.75rem;
    }

    .th-analytics-panel__title {
        font-size: 1.05rem;
    }

    .th-analytics-panel__lead {
        font-size: 0.78rem;
    }

    .th-analytics-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: -0.1rem -0.15rem 0.8rem;
        padding: 0.1rem 0.15rem 0.2rem;
    }

    .th-analytics-filters::-webkit-scrollbar {
        display: none;
    }

    .th-analytics-filter {
        flex-shrink: 0;
    }

    .th-analytics-chart {
        margin-bottom: 0.75rem;
    }

    .th-analytics-chart--donut {
        overflow: hidden;
    }

    .th-analytics-donut-wrap {
        max-width: min(100%, 260px);
    }

    .th-analytics-donut-wrap .e-accumulationchart,
    .th-analytics-donut-wrap .e-chart-focused {
        max-width: 100% !important;
    }

    .th-analytics-chart--bar {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .th-analytics-empty {
        min-height: 140px;
    }

    .th-analytics-rank__row {
        align-items: flex-start;
        gap: 0.5rem;
    }

    .th-analytics-rank__name {
        flex-wrap: wrap;
        row-gap: 0.25rem;
    }

    .th-analytics-legend__item {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.2rem 0.55rem;
    }

    .th-analytics-legend__pct {
        grid-column: 2;
    }

    .th-analytics-legend__total {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
        min-width: 0;
    }
}

/* ── Motion, hero, and demo polish ── */
@keyframes th-page-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes th-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@keyframes th-shine {
    from { left: -45%; }
    to { left: 125%; }
}

@keyframes th-grid-shift {
    from { background-position: 0 0, 0 0, 0 0, 0 0; }
    to { background-position: 2.4rem 2.4rem, 2.4rem 2.4rem, 0 0, 0 0; }
}

@keyframes th-scan {
    0% { top: 8%; opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { top: 88%; opacity: 0; }
}

@keyframes th-hint-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@keyframes th-chevron {
    0%, 100% { transform: translateY(0); opacity: 0.35; }
    50% { transform: translateY(6px); opacity: 1; }
}

@keyframes th-mouse-dot {
    0% { top: 6px; opacity: 1; }
    70% { top: 18px; opacity: 0; }
    100% { top: 6px; opacity: 0; }
}

@keyframes th-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes th-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes th-hex-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

html.th-motion .th-reveal {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(4px);
    transition: opacity 0.75s var(--th-ease), transform 0.85s var(--th-ease), filter 0.75s var(--th-ease);
    transition-delay: var(--stagger, 0ms);
}

html.th-motion .th-reveal.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
}

html.th-motion [data-th-stagger] > .th-reveal:nth-child(odd):not(.is-visible) {
    transform: translate3d(-16px, 22px, 0);
}

html.th-motion [data-th-stagger] > .th-reveal:nth-child(even):not(.is-visible) {
    transform: translate3d(16px, 22px, 0);
}

.th-shine {
    position: relative;
    overflow: hidden !important;
}

.th-shine::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 -42%;
    width: 38%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: skewX(-18deg);
    pointer-events: none;
    z-index: 2;
}

.th-shine:hover::after {
    animation: th-shine 0.7s var(--th-ease);
}

.th-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-family: var(--th-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--th-red);
}

.th-kicker::before {
    content: "";
    width: 1.6rem;
    height: 1px;
    background: currentColor;
}

.th-browse {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.th-browse-head {
    position: relative;
    overflow: hidden;
    margin: 0 0 0.85rem;
    padding: 1.15rem 1.25rem 1.05rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-top: 3px solid var(--th-red);
    border-radius: 16px;
}

.th-browse-head::after {
    content: "";
    position: absolute;
    top: -40%;
    right: -8%;
    width: min(28rem, 70%);
    height: 12rem;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--th-red) 18%, transparent) 0%, transparent 70%);
    pointer-events: none;
    animation: th-glow-drift 22s ease-in-out infinite;
}

@keyframes th-glow-drift {
    0% { transform: translate(0, 8%); }
    35% { transform: translate(-28%, 18%); }
    65% { transform: translate(-12%, 36%); }
    100% { transform: translate(0, 8%); }
}

.th-browse-head__row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    flex-wrap: wrap;
}

.th-browse-head h1 {
    margin: 0.2rem 0 0;
    font-family: var(--th-serif);
    font-size: clamp(1.55rem, 2.4vw, 2.15rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.12;
    color: var(--th-ink);
}

.th-browse-head__meta {
    margin: 0.2rem 0 0;
    font-family: var(--th-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--th-muted);
}

.th-browse-head__meta span:first-child {
    color: var(--th-red);
    font-weight: 600;
}

.th-browse-head__dot {
    margin: 0 0.15rem;
    color: var(--th-line);
}

.th-browse-head__lede {
    position: relative;
    z-index: 1;
    margin: 0.45rem 0 0;
    max-width: 38rem;
    color: var(--th-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.th-browse-head .th-kicker {
    position: relative;
    z-index: 1;
}

.th-hero-spot {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--spot-x) var(--spot-y), color-mix(in srgb, var(--th-red) 10%, transparent), transparent 38%);
    z-index: 1;
}

.th-cat-rail-slot {
    display: block;
    height: var(--th-cat-rail-h, 2.25rem);
    margin: 0;
    pointer-events: none;
}

.th-cat-rail {
    --th-cat-rail-bg: var(--th-surface);
    position: fixed;
    top: var(--th-appbar-height, 4.25rem);
    left: 0;
    right: 0;
    z-index: 1080;
    margin: 0;
    padding: 0.28rem 1rem 0.32rem;
    background: var(--th-cat-rail-bg);
    border-bottom: 3px solid var(--th-red);
}

@media (min-width: 1280px) {
    .th-cat-rail {
        left: 0;
    }
}

.th-cat-jump-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.th-cat-jump {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.38rem;
    padding: 0.14rem 0.2rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
    scroll-padding-inline: 0.7rem;
    -webkit-overflow-scrolling: touch;
}

.th-cat-jump::-webkit-scrollbar {
    display: none;
}

.th-cat-jump button {
    flex: 0 0 auto;
    min-height: 2.1rem;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
    color: var(--th-ink);
    padding: 0.34rem 0.84rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    transition:
        background-color 0.38s var(--th-ease),
        border-color 0.38s var(--th-ease),
        color 0.38s var(--th-ease),
        box-shadow 0.38s var(--th-ease);
}

.th-cat-jump button:hover {
    background: color-mix(in srgb, var(--th-red) 8%, var(--th-surface));
    border-color: color-mix(in srgb, var(--th-red) 45%, var(--th-line));
    color: var(--th-red);
}

.th-cat-jump button.is-active {
    background: var(--th-red);
    border-color: var(--th-red);
    color: #fff;
    box-shadow: none;
}

.th-cat-jump button.is-active:hover {
    background: var(--th-red);
    border-color: var(--th-red);
    color: #fff;
}

.th-add-btn__short {
    display: none;
}

.th-add-btn .mud-button-label {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.th-cat-jump__nav {
    flex: 0 0 2rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--th-line);
    border-radius: 999px;
    background: var(--th-cat-rail-bg, var(--th-surface));
    color: var(--th-red);
    cursor: pointer;
    position: relative;
    z-index: 1;
    box-shadow: none;
    overflow: hidden;
    transition: background-color 0.28s var(--th-ease), border-color 0.28s var(--th-ease), opacity 0.28s var(--th-ease), color 0.28s var(--th-ease);
}

.th-cat-jump-wrap:not(.is-overflow) .th-cat-jump__nav {
    display: none;
}

.th-cat-jump__nav:hover:not(:disabled) {
    background: color-mix(in srgb, var(--th-red) 8%, var(--th-surface));
    border-color: color-mix(in srgb, var(--th-red) 40%, var(--th-line));
}

.th-cat-jump__nav:disabled {
    opacity: 0.34;
    color: var(--th-muted);
    cursor: default;
}

.th-cat-jump__nav::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.42rem;
    height: 0.42rem;
    border-left: 1.75px solid currentColor;
    border-bottom: 1.75px solid currentColor;
}

.th-cat-jump__nav--prev::before {
    transform: translate(-30%, -50%) rotate(45deg);
}

.th-cat-jump__nav--next::before {
    transform: translate(-70%, -50%) rotate(-135deg);
}

canvas.th-grid-laser {
    display: none !important;
}

.th-scroll-hint {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding: 0;
    border: none;
    background: none;
    color: rgba(247, 243, 238, 0.7);
    cursor: pointer;
    animation: th-hint-in 0.85s var(--th-ease) 1.05s both;
}

.th-scroll-hint__mouse {
    position: relative;
    width: 18px;
    height: 28px;
    border: 1px solid currentColor;
    border-radius: 10px;
}

.th-scroll-hint__mouse::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 6px;
    width: 3px;
    height: 6px;
    margin-left: -1.5px;
    border-radius: 999px;
    background: currentColor;
    animation: th-mouse-dot 1.6s var(--th-ease) infinite;
}

.th-scroll-hint__chevrons {
    display: flex;
    flex-direction: column;
    gap: 0;
    line-height: 0.45;
    font-size: 0.7rem;
    letter-spacing: 0;
}

.th-scroll-hint__chevrons span {
    animation: th-chevron 1.65s var(--th-ease) infinite;
}

.th-scroll-hint__chevrons span:nth-child(2) {
    animation-delay: 0.12s;
}

.th-scroll-hint__label {
    font-family: var(--th-mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.th-marquee {
    overflow: hidden;
    margin: 0 0 1.75rem;
    border: 1px solid var(--th-line);
    border-top: none;
    background: color-mix(in srgb, var(--th-red) 4%, var(--th-surface));
}

.th-marquee__track {
    display: flex;
    width: max-content;
    gap: 1.4rem;
    padding: 0.7rem 0;
    animation: th-marquee 36s linear infinite;
}

.th-marquee__track span {
    font-family: var(--th-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--th-muted);
    white-space: nowrap;
}

.th-marquee__sep {
    color: var(--th-red) !important;
}

.th-login-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.th-login-atmosphere__grid {
    position: absolute;
    inset: -10%;
    background-image:
        linear-gradient(color-mix(in srgb, var(--th-red) 16%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--th-red) 16%, transparent) 1px, transparent 1px);
    background-size: 3rem 3rem;
    animation: th-grid-shift 28s linear infinite;
    opacity: 0.55;
}

.th-login-atmosphere__scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--th-red), transparent);
    box-shadow: 0 0 18px var(--th-glow);
    animation: th-scan 6.4s ease-in-out infinite;
}

.th-login-hex {
    position: absolute;
    width: 7rem;
    height: 7rem;
    border: 1px solid color-mix(in srgb, var(--th-red) 35%, transparent);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0.35;
    animation: th-float 9s ease-in-out infinite;
}

.th-login-hex--a { top: 8%; left: 6%; animation-delay: 0s; }
.th-login-hex--b { bottom: 12%; right: 8%; width: 5.2rem; height: 5.2rem; animation-delay: -2s; }
.th-login-hex--c { top: 42%; right: 18%; width: 3.4rem; height: 3.4rem; animation-delay: -4s; opacity: 0.22; }

.th-login-mark {
    animation: th-fade-up 0.8s var(--th-ease) 0.08s both;
}

.th-top {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1.1rem, env(safe-area-inset-bottom));
    z-index: 40;
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid var(--th-line);
    background: var(--th-surface);
    color: var(--th-red);
    box-shadow: var(--th-shadow);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s var(--th-ease), transform 0.25s var(--th-ease);
}

.th-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

html.th-scroll-lock .th-top {
    opacity: 0 !important;
    pointer-events: none !important;
}

.th-top span {
    display: block;
    width: 0.7rem;
    height: 0.7rem;
    margin: 0.95rem auto 0;
    border-left: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
}

.th-contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin: 1.15rem 0 0.35rem;
}

.th-contact-card {
    padding: 1rem 1.05rem 1.05rem;
    background: color-mix(in srgb, var(--th-red) 4%, var(--th-surface));
    border: 1px solid var(--th-line);
}

.th-contact-card .th-contact-label {
    margin-bottom: 0.45rem;
}

.th-contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.85rem;
    padding: 0.7rem 1rem;
    background: var(--th-red);
    color: #fff !important;
    font-family: inherit;
    font-size: inherit;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    border: 0;
    border-bottom: none !important;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(170, 57, 48, 0.22);
}

.th-contact-cta:hover {
    background: var(--th-red-deep);
    color: #fff !important;
    border-bottom: none !important;
}

.th-notfound {
    max-width: 36rem;
    padding: 3rem 0 4rem;
    animation: th-page-in 0.6s var(--th-ease) both;
}

.th-notfound h1 {
    margin: 0.35rem 0 0.7rem;
    font-size: clamp(2rem, 4vw, 3rem);
}

.th-notfound p {
    color: var(--th-muted);
    margin-bottom: 1.2rem;
}

.th-nav a {
    transition: color 0.22s var(--th-ease);
}

.th-analytics-kpi,
.th-analytics-mix-card,
.th-analytics-panel {
    transition: transform 0.28s var(--th-ease), box-shadow 0.28s var(--th-ease);
}

.th-analytics-kpi:hover,
.th-analytics-mix-card:hover,
.th-analytics-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 36px rgba(170, 57, 48, 0.1);
}

.th-boot {
    position: relative;
}


html.th-dark .th-browse-head {
    background: var(--th-surface);
}

html.th-dark .th-cat-rail {
    --th-cat-rail-bg: var(--th-surface);
    background: var(--th-cat-rail-bg);
}

html.th-dark .th-marquee {
    background: color-mix(in srgb, var(--th-red) 8%, var(--th-surface));
}

@media (min-width: 720px) {
    .th-contact-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .th-scroll-hint {
        display: none;
    }

    .th-marquee {
        display: none;
    }

    .th-page-header .th-kicker,
    .th-browse-head .th-kicker,
    .th-browse-head__lede {
        display: none;
    }

    .th-page-header__card {
        padding: 0.45rem 0.7rem;
        border-radius: 10px;
    }

    .th-page-header__row {
        align-items: center;
    }

    .th-page-header__lead {
        flex-basis: 1.85rem;
        width: 1.85rem;
        height: 1.85rem;
        margin-top: 0;
    }

    .th-browse-head {
        margin: 0 0 0.55rem;
        padding: 0.7rem 0.85rem 0.65rem;
    }

    .th-browse-head::after {
        width: 12rem;
        height: 7rem;
        opacity: 0.7;
    }

    .th-browse-head h1 {
        font-size: 1.35rem;
        margin: 0;
    }

    .th-browse-head__meta {
        margin: 0;
        font-size: 0.64rem;
    }

    html {
        scroll-padding-top: calc(var(--th-mobile-chrome-height, var(--th-appbar-height, 4.25rem)) + var(--th-cat-rail-h, 3.65rem) + 0.5rem);
    }

    .th-cat-rail-slot {
        margin: 0;
    }

    .th-cat-rail {
        left: 0;
        top: var(--th-mobile-chrome-height, var(--th-appbar-height, 4.25rem));
        padding: 0.3rem 0.55rem 0.32rem;
    }

    .th-cat-jump-wrap {
        gap: 0.35rem;
    }

    .th-cat-jump {
        gap: 0.36rem;
        padding: 0.05rem 0.15rem;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 0.55rem;
    }

    .th-cat-jump button {
        min-height: 2.15rem;
        padding: 0.34rem 0.82rem;
        font-size: 0.8rem;
        scroll-snap-align: start;
    }

    .th-equipment {
        padding-bottom: max(3.75rem, calc(2rem + env(safe-area-inset-bottom, 0px)));
    }

    .th-equipment__section {
        margin-bottom: 1.45rem;
        scroll-margin-top: calc(var(--th-mobile-chrome-height, 7rem) + var(--th-cat-rail-h, 3.65rem) + 0.5rem);
    }

    .th-equipment__section:first-child {
        padding-top: 0.65rem;
    }

    .th-equipment__section-head {
        margin-bottom: 0.8rem;
        padding-bottom: 0.45rem;
    }

    .th-equipment__section-head h2 {
        font-size: 1.08rem;
    }

    .th-equipment__section-head h2::before {
        width: 0.18rem;
        height: 0.75em;
        margin-right: 0.48rem;
    }

    .th-equipment__section-head span {
        font-size: 0.62rem;
    }

    .th-product-grid {
        gap: 0.75rem;
    }

    .th-product-card {
        --th-card-radius: 16px;
        flex-direction: row;
        align-items: stretch;
        min-height: 7.75rem;
        transform: none;
        border-radius: var(--th-card-radius);
    }

    .th-product-card.is-added {
        box-shadow:
            0 0 0 1px color-mix(in srgb, var(--th-red) 32%, transparent),
            0 0 16px color-mix(in srgb, var(--th-red) 20%, transparent);
    }

    .th-product-card__media {
        flex: 0 0 7rem;
        align-self: stretch;
        width: 7rem;
        height: auto;
        min-height: 7.75rem;
        max-height: none;
        background: var(--th-photo);
    }

    .th-product-card__media img {
        max-width: 78%;
        max-height: 78%;
    }

    .th-product-card__body {
        padding: 0.8rem 0.9rem 0.75rem;
        min-width: 0;
        justify-content: center;
        gap: 0.5rem;
    }

    .th-product-card__body h3 {
        font-size: 0.98rem;
        line-height: 1.28;
        margin: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .th-product-card__footer {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .th-product-card__footer .mud-button {
        width: auto;
    }

    .th-price-lock {
        display: none;
    }

    .th-signin-chip {
        min-height: 34px;
        padding: 0.28rem 0.75rem;
        font-size: 0.76rem;
        margin-right: 0.2rem;
    }

    @media (max-width: 380px) {
        .th-signin-chip {
            display: none;
        }

        .th-product-card__media {
            flex-basis: 6.4rem;
            width: 6.4rem;
        }
    }

    .th-add-btn.mud-button-filled,
    .th-add-btn.is-added.mud-button-filled {
        min-width: 5.75rem;
        min-height: 2.45rem;
        padding-left: 0.8rem !important;
        padding-right: 0.85rem !important;
    }

    .th-add-btn__long {
        display: none;
    }

    .th-add-btn__short {
        display: inline;
    }

    .th-price-tag__amount {
        font-size: 1.08rem;
    }

    .th-price-tag__label {
        font-size: 0.6rem;
        letter-spacing: 0.05em;
        gap: 0.18rem;
    }

    .th-price-tag__was {
        font-size: 0.6rem;
    }

    .th-contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (hover: none) {
    .th-product-card:hover .th-product-card__media img {
        transform: none;
    }

    .th-analytics-kpi:hover,
    .th-analytics-mix-card:hover,
    .th-analytics-panel:hover {
        transform: none;
        box-shadow: var(--th-shadow);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    html.th-motion .th-reveal,
    html.th-motion .th-reveal.is-visible,
    html.th-motion [data-th-stagger] > .th-reveal:nth-child(odd):not(.is-visible),
    html.th-motion [data-th-stagger] > .th-reveal:nth-child(even):not(.is-visible) {
        opacity: 1;
        transform: none;
        filter: none;
        transition: none;
    }

    .th-page,
    .th-login,
    .th-browse-head h1,
    .th-cat-jump,
    .th-login-mark,
    .th-login-logo,
    .th-notfound,
    .th-empty-panel,
    .th-panel nav a,
    .th-panel.is-open nav a,
    .th-add-overlay,
    .th-add-sheet,
    .th-loader__arc,
    .th-loader__core {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .th-browse-head::after,
    .th-catalog-hero__grid,
    .th-catalog-hero__glow,
    .th-catalog-hero__scan,
    .th-login-atmosphere__grid,
    .th-login-atmosphere__scan,
    .th-login-page::before,
    .th-login-hex,
    .th-marquee__track,
    .th-shine::after,
    .th-product-card.is-added::before,
    .th-scroll-hint,
    .th-scroll-hint__mouse::after,
    .th-scroll-hint__chevrons span {
        animation: none !important;
    }

    .th-product-card.is-added::before {
        opacity: 0;
    }

    .th-product-card,
    .th-nav a,
    .th-analytics-kpi,
    .th-analytics-mix-card,
    .th-analytics-panel {
        transition: none;
    }
}

.th-office-page {
    padding-top: 0.15rem;
    padding-bottom: 1.5rem;
}

.th-office-banner {
    display: flex;
    align-items: baseline;
    gap: 0.65rem 1rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--th-line);
    border-radius: 16px;
    background: var(--th-surface);
    box-shadow: var(--th-shadow);
}

.th-office-banner strong {
    font-family: var(--th-serif);
    font-size: 1.02rem;
    font-weight: 600;
}

.th-office-banner p {
    margin: 0;
    color: var(--th-muted);
    font-size: 0.86rem;
}

.th-office-banner.is-locked,
.th-office-close-banner.is-locked {
    border-color: color-mix(in srgb, var(--th-red) 42%, var(--th-line));
    background: color-mix(in srgb, var(--th-red) 7%, var(--th-surface));
}

.th-office-panel {
    display: flex;
    flex-direction: column;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    box-shadow: var(--th-shadow);
    padding: 1.05rem 1.15rem 1.1rem;
    margin: 0 0 1rem;
}

.th-office-panel.is-board {
    min-height: 14.5rem;
}

.th-office-panel.is-focus {
    border-color: color-mix(in srgb, var(--th-red) 42%, var(--th-line));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--th-red) 28%, transparent), var(--th-shadow);
}

.th-office-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.7rem;
}

.th-office-panel__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-family: var(--th-serif);
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: 0;
}

.th-office-panel__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 9px;
    background: color-mix(in srgb, var(--th-red) 10%, var(--th-ivory));
    color: var(--th-red);
    flex: 0 0 auto;
}

.th-office-panel__tools {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.th-office-count {
    color: var(--th-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.th-office-empty {
    margin: 0;
    padding: 0.85rem 0 0.35rem;
    color: var(--th-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.th-office-blank {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    flex: 1;
    min-height: 8.75rem;
    padding: 1.4rem 1.1rem;
    text-align: center;
    color: var(--th-muted);
}

.th-office-blank__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    margin-bottom: 0.35rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--th-red) 9%, var(--th-ivory));
    color: var(--th-red);
}

.th-office-blank strong {
    display: block;
    color: var(--th-ink);
    font-family: var(--th-serif);
    font-size: 1.05rem;
    font-weight: 600;
}

.th-office-blank p {
    margin: 0;
    max-width: 22rem;
    font-size: 0.84rem;
    line-height: 1.45;
}

.th-office-wait {
    margin: 0.85rem 0 1rem;
    overflow: auto;
}

.th-office-wait .th-office-table {
    min-width: 36rem;
}

.th-office-wait__check {
    width: 2.2rem;
    text-align: center;
}

.th-office-wait input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--th-red);
    cursor: pointer;
}

.th-office-wait-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin: 0 0 0.75rem;
}

.th-office-bank {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.th-office-bank__hint {
    margin: 0;
    color: var(--th-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.th-office-select {
    appearance: none;
    max-width: 9.5rem;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--th-line);
    border-radius: 8px;
    background: var(--th-ivory);
    color: var(--th-ink);
    font: inherit;
    font-size: 0.78rem;
}

.th-office-issue,
.th-office-report-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.th-office-issue > * {
    min-width: 12rem;
    flex: 1 1 12rem;
}

.th-office-report-bar > * {
    flex: 0 1 auto;
}

.th-office-report-bar .th-admin-add,
.th-office-report-bar .th-office-link {
    min-width: auto;
}

.th-office-report-groups {
    display: grid;
    gap: 0.7rem;
    margin: 0 0 1rem;
}

.th-office-report-group span {
    display: block;
    margin: 0 0 0.35rem;
    color: var(--th-muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.th-office-report-group .th-admin-toolbar__filters {
    flex-wrap: wrap;
}

.th-office-report-shell {
    display: grid;
    grid-template-columns: 15.75rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.th-office-report-nav {
    position: sticky;
    top: 0.85rem;
    padding: 0.8rem 0.65rem 0.9rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    box-shadow: var(--th-shadow);
}

.th-office-report-nav__group {
    margin: 0.85rem 0.6rem 0.28rem;
    color: var(--th-muted);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}

.th-office-report-nav__group:first-child {
    margin-top: 0.15rem;
}

.th-office-report-nav__item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.42rem 0.7rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--th-ink);
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
}

.th-office-report-nav__item:hover {
    background: var(--th-ivory);
}

.th-office-report-nav__item.is-on {
    background: color-mix(in srgb, var(--th-red) 10%, var(--th-ivory));
    color: var(--th-red);
    font-weight: 650;
}

.th-office-report-stage {
    min-width: 0;
}

.th-office-report-stage__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.9rem 1.2rem;
    margin: 0 0 1rem;
    padding: 1.05rem 1.15rem 1.1rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    box-shadow: var(--th-shadow);
}

.th-office-kicker {
    margin: 0 0 0.18rem;
    color: var(--th-red);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}

.th-office-report-stage__head h2 {
    margin: 0;
    font-family: var(--th-serif);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.th-office-report-stage__range {
    margin: 0.28rem 0 0;
    color: var(--th-muted);
    font-size: 0.82rem;
}

.th-office-report-stage__run {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.65rem;
}

.th-office-report-stage__run .mud-input-control {
    min-width: 10.5rem;
}

.th-office-report-paper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    min-height: 12rem;
}

.th-office-report-paper .th-office-kpis {
    margin: 0;
}

.th-office-report-paper .th-admin-grid-shell {
    overflow: hidden;
}

.th-office-report-paper .th-office-blank {
    min-height: 12rem;
    padding: 2.4rem 1.4rem;
}

.th-office-report-busy {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 12rem;
    padding: 2.4rem 1.4rem;
    border: 1px solid var(--th-line);
    border-radius: 16px;
    background: var(--th-surface);
    box-shadow: var(--th-shadow);
    color: var(--th-muted);
    text-align: center;
}

.th-office-report-busy strong {
    color: var(--th-ink);
    font-family: var(--th-serif);
    font-size: 1.08rem;
    font-weight: 600;
}

.th-office-report-paper.is-busy > *:not(.th-office-report-busy) {
    display: none;
}

.th-report-spin {
    width: 1.35rem;
    height: 1.35rem;
    border: 2px solid color-mix(in srgb, var(--th-red) 25%, transparent);
    border-top-color: var(--th-red);
    border-radius: 50%;
    animation: th-login-spin 0.7s linear infinite;
}

.th-office-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.th-office-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--th-red);
    font-weight: 650;
    font-size: 0.8rem;
    cursor: pointer;
}

.th-office-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.th-office-link:disabled {
    color: var(--th-muted);
    cursor: not-allowed;
    text-decoration: none;
}

.th-office-link--danger {
    color: var(--th-red-deep);
}

.th-office-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.05rem;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.th-office-kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.18rem;
    width: 100%;
    margin: 0;
    padding: 1rem 1.05rem 1.05rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    box-shadow: var(--th-shadow);
    text-align: left;
    font: inherit;
    color: inherit;
    line-height: 1.2;
    white-space: normal;
    cursor: default;
    appearance: none;
    -webkit-appearance: none;
}

.th-office-kpi.has-icon {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
}

.th-office-kpi__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    flex: 0 0 auto;
    border-radius: 12px;
    background: color-mix(in srgb, var(--th-red) 10%, var(--th-ivory));
    color: var(--th-red);
}

.th-office-kpi.is-net .th-office-kpi__icon {
    background: color-mix(in srgb, var(--th-red) 16%, var(--th-ivory));
}

.th-office-kpi__copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.16rem;
    min-width: 0;
}

button.th-office-kpi {
    cursor: pointer;
}

button.th-office-kpi:hover {
    border-color: color-mix(in srgb, var(--th-red) 32%, var(--th-line));
    background: color-mix(in srgb, var(--th-ivory) 65%, var(--th-surface));
}

button.th-office-kpi.is-focus {
    border-color: color-mix(in srgb, var(--th-red) 55%, var(--th-line));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--th-red) 28%, transparent), var(--th-shadow);
}

.th-office-kpi > span:not([class]),
.th-office-kpi__label {
    display: block;
    color: var(--th-muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.th-office-kpi > strong,
.th-office-kpi__value {
    display: block;
    margin-top: 0.12rem;
    font-family: var(--th-serif);
    font-size: 1.42rem;
    line-height: 1.12;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.th-office-kpi.is-net {
    background: color-mix(in srgb, var(--th-red) 6%, var(--th-surface));
}

.th-office-kpi em,
.th-office-kpi__hint {
    display: block;
    margin-top: 0.08rem;
    font-style: normal;
    color: var(--th-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.th-office-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.1rem;
    padding: 0;
    color: var(--th-muted);
    font-size: 0.8rem;
}

.th-office-meta span {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.38rem 0.75rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 999px;
    box-shadow: var(--th-shadow);
}

.th-office-meta b {
    color: var(--th-ink);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.th-office-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.th-office-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border: 1px solid var(--th-line);
    border-radius: 999px;
    background: var(--th-ivory);
    color: var(--th-muted);
    font-size: 0.78rem;
}

.th-office-pill strong {
    color: var(--th-ink);
    font-variant-numeric: tabular-nums;
}

button.th-office-pill {
    cursor: pointer;
    font: inherit;
}

button.th-office-pill:hover {
    border-color: var(--th-red);
    color: var(--th-red);
}

.th-office-desk-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 0 0 1rem;
    padding: 0.7rem 0.9rem;
    background: var(--th-surface);
    border: 1px solid var(--th-line);
    border-radius: 16px;
    box-shadow: var(--th-shadow);
}

.th-office-desk-tools .th-admin-search {
    flex: 1 1 16rem;
}

.th-office-invoice-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0;
    padding: 0.9rem 1.05rem 0.85rem;
    border-bottom: 1px solid var(--th-line);
}

.th-office-invoice-bar__find {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    flex: 1 1 22rem;
}

.th-office-invoice-bar__go {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.th-office-invoice-bar__find .th-admin-toolbar__filters {
    flex: 1 1 auto;
}

.th-office-invoice-bar__go .th-admin-toolbar__count,
.th-office-desk-tools .th-admin-toolbar__count {
    margin-left: 0;
}

.th-office-desk-tools .th-admin-toolbar__count {
    margin-left: auto;
}

.th-office-panel:not(.is-board) .th-office-blank {
    min-height: 6.25rem;
}

.th-admin-grid-shell .th-office-blank {
    min-height: 14rem;
}

.th-office-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.th-office-dash-span {
    grid-column: 1 / -1;
}

.th-office-table tr.is-overdue td {
    color: var(--th-red-deep);
}

.th-office-preview {
    margin-top: 0.85rem;
}

.th-office-preview__total {
    margin: 0.65rem 0 0;
    font-weight: 650;
}

.th-office-detail {
    width: min(56rem, calc(100vw - 2rem));
    max-height: calc(100svh - 2rem);
    overflow: auto;
}

.th-office-adjust-hint {
    margin: 0 0 0.75rem;
    color: var(--th-muted);
    font-size: 0.82rem;
}

.th-office-edit-line {
    display: grid;
    gap: 0.45rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--th-line);
}

.th-office-edit-line__nums {
    display: grid;
    grid-template-columns: 5.5rem 7.5rem minmax(7rem, 1fr);
    gap: 0.5rem;
}

.th-office-edit-line__sum {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.45rem 0.85rem;
    color: var(--th-muted);
    font-size: 0.8rem;
}

.th-office-edit-line__sum strong {
    color: var(--th-ink);
    font-weight: 650;
}

.th-office-add-line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem;
    padding: 0.85rem 0 0.2rem;
}

.th-office-add-line .e-ddl {
    flex: 1;
    min-width: 12rem;
}

@media (max-width: 960px) {
    .th-office-report-shell {
        grid-template-columns: 1fr;
    }

    .th-office-report-nav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 0.2rem;
        padding: 0.75rem 0.7rem;
    }

    .th-office-report-nav__group {
        flex: 0 0 100%;
        margin: 0.55rem 0.2rem 0.1rem;
    }

    .th-office-report-nav__group:first-child {
        margin-top: 0;
    }

    .th-office-report-nav__item {
        width: auto;
    }
}

@media (max-width: 800px) {
    .th-office-dash-grid {
        grid-template-columns: 1fr;
    }

    .th-office-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .th-office-report-stage__head h2 {
        font-size: 1.28rem;
    }
}

@media (max-width: 560px) {
    .th-office-kpis {
        grid-template-columns: 1fr;
    }
}

.th-office-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.th-office-table th,
.th-office-table td {
    padding: 0.58rem 0.45rem;
    border-bottom: 1px solid var(--th-line);
    text-align: left;
    vertical-align: top;
}

.th-office-table th {
    color: var(--th-muted);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.th-office-table td:first-child {
    font-weight: 650;
}

.th-office-table tbody tr:last-child td {
    border-bottom: 0;
}

.th-office-table tbody tr:hover td {
    background: color-mix(in srgb, var(--th-ivory) 72%, transparent);
}

.th-office-table .is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.th-office-tag {
    display: inline-block;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: var(--th-ivory);
    color: var(--th-muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.th-office-tag.is-due {
    background: color-mix(in srgb, var(--th-red) 10%, var(--th-ivory));
    color: var(--th-red);
}

.th-office-report-block {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem 0.85rem;
}

.th-office-close-range {
    margin: 0.2rem 0 0.85rem;
    color: var(--th-muted);
    font-size: 0.82rem;
}

.th-office-warn {
    margin: 0 0 0.85rem;
    padding-left: 1.05rem;
    color: var(--th-red-deep);
    font-size: 0.84rem;
}

.th-office-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 0.86rem;
}

.th-office-actions--start {
    justify-content: flex-start;
    margin-top: 0.95rem;
}

.th-office-lead {
    margin: 0 0 1rem;
    max-width: 42rem;
    color: var(--th-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.th-print {
    max-width: 210mm;
    margin: 1.5rem auto 3rem;
    padding: 0 1.65rem 1.85rem;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #E6E0DA;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.07);
}

.th-print-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0 -1.65rem 0;
    padding: 1rem 1.65rem 0.35rem;
}

.th-print-band {
    height: 7px;
    margin: 0 -1.65rem;
    background: #AA3930;
}

.th-print-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.4rem;
    margin: 0 -1.65rem 1.25rem;
    padding: 1.2rem 1.65rem 1.1rem;
    background: #FAF8F6;
    border-bottom: 1px solid #E6E0DA;
}

.th-print-brand {
    display: flex;
    gap: 0.95rem;
    align-items: flex-start;
    min-width: 0;
}

.th-print-logo {
    width: 4.6rem;
    height: auto;
    flex: 0 0 auto;
    object-fit: contain;
}

.th-print-kicker {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    color: #AA3930;
    margin: 0 0 0.15rem;
}

.th-print-head h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.th-print-motto {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 0.92rem;
    color: #6b6b6b !important;
    margin: 0.2rem 0 0.45rem !important;
}

.th-print-head p {
    margin: 0.12rem 0;
    color: #4a4a4a;
    font-size: 0.86rem;
    line-height: 1.4;
}

.th-print-stamp {
    text-align: right;
    min-width: 11rem;
    max-width: 16rem;
    padding: 0.2rem 0 0 1.1rem;
    border-left: 1px solid #E6E0DA;
}

.th-print-stamp__type {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: #AA3930;
    margin: 0;
}

.th-print-stamp__no {
    font-family: var(--th-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0.2rem 0 0;
    line-height: 1.15;
    word-break: break-word;
}

.th-print-stamp__date {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: #6b6b6b;
}

.th-print-parties {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 0.85rem;
    margin-bottom: 1.2rem;
}

.th-print-parties > * {
    border: 1px solid #E6E0DA;
    background: #FAF8F6;
    padding: 0.85rem 1rem;
}

.th-print-parties strong {
    display: block;
    font-size: 1.02rem;
    margin: 0.1rem 0 0.3rem;
}

.th-print-parties p {
    margin: 0.12rem 0;
    color: #4a4a4a;
    font-size: 0.86rem;
    line-height: 1.4;
}

.th-print-parties .th-print-label {
    color: #AA3930;
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    margin: 0 0 0.35rem;
}

.th-print-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: #AA3930;
    margin: 0 0 0.35rem;
}

.th-print-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.9rem;
    row-gap: 0.32rem;
    align-items: baseline;
}

.th-print-facts span {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8A8A8A;
    font-weight: 700;
}

.th-print-facts strong {
    display: block;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 650;
}

.th-print-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0 0 1.15rem;
}

.th-print-kpis > div {
    border: 1px solid #E6E0DA;
    background: #FAF8F6;
    padding: 0.65rem 0.75rem;
}

.th-print-kpis span {
    display: block;
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8A8A8A;
    font-weight: 700;
}

.th-print-kpis strong {
    display: block;
    margin-top: 0.22rem;
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.th-print-kpis .is-total {
    background: #AA3930;
    border-color: #AA3930;
    color: #fff;
}

.th-print-kpis .is-total span {
    color: rgba(255, 255, 255, 0.78);
}

.th-print-kpis .is-total strong {
    color: #fff;
}

.th-print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.05rem;
    font-size: 0.86rem;
}

.th-print-table thead th {
    background: #1A1A1A;
    color: #fff;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.52rem 0.55rem;
    text-align: left;
    border: 0;
}

.th-print-table tbody td {
    border-bottom: 1px solid #E6E0DA;
    padding: 0.55rem;
    text-align: left;
    vertical-align: top;
}

.th-print-table tbody tr:nth-child(even) {
    background: #FAF8F6;
}

.th-print-table tbody tr:last-child td {
    border-bottom: 2px solid #1A1A1A;
}

.th-print-table .is-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.th-print-totals {
    margin: 0 0 1.15rem auto;
    width: min(22.5rem, 100%);
    border: 1px solid #E6E0DA;
    background: #FAF8F6;
    padding: 0.7rem 1rem 0.85rem;
}

.th-print-totals p {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.28rem 0;
    font-size: 0.88rem;
}

.th-print-totals .is-total {
    border-top: 2px solid #AA3930;
    margin-top: 0.4rem;
    padding-top: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
}

.th-print-totals .is-total strong {
    color: #AA3930;
    font-size: 1.12rem;
    font-variant-numeric: tabular-nums;
}

.th-print-pay {
    border: 1px solid #AA3930;
    background: color-mix(in srgb, #AA3930 6%, #fff);
    padding: 0.9rem 1.05rem 0.95rem;
    margin: 0 0 1.1rem;
}

.th-print-pay__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1.1rem;
    margin-top: 0.35rem;
}

.th-print-pay__grid span {
    display: block;
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8A8A8A;
    font-weight: 700;
}

.th-print-pay__grid strong {
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.th-print-pay > p:last-child {
    margin: 0.7rem 0 0;
    font-size: 0.82rem;
    color: #6b6b6b;
    line-height: 1.4;
}

.th-print-note {
    border: 1px solid #E6E0DA;
    background: #FAF8F6;
    padding: 0.75rem 0.9rem;
    margin: 0 0 1.1rem;
    color: #4a4a4a;
    font-size: 0.86rem;
    line-height: 1.45;
}

.th-print-foot {
    color: #8A8A8A;
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0.4rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid #E6E0DA;
}

.th-print-sign {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin: 1.6rem 0 1rem;
}

.th-print-sign > div {
    border: 1px solid #E6E0DA;
    padding: 0.75rem 0.85rem 0.65rem;
}

.th-print-sign p:first-child {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    color: #8A8A8A;
    margin: 0;
}

.th-print-sign span {
    display: block;
    border-bottom: 1px solid #1a1a1a;
    height: 2.6rem;
    margin: 0.25rem 0 0.45rem;
}

.th-print-sign p:last-child {
    margin: 0;
    font-size: 0.78rem;
    color: #6b6b6b;
}

@media (max-width: 720px) {
    .th-print-head,
    .th-print-parties,
    .th-print-sign,
    .th-print-kpis,
    .th-print-pay__grid {
        grid-template-columns: 1fr;
    }

    .th-print-stamp {
        text-align: left;
        max-width: none;
        padding: 0.85rem 0 0;
        border-left: 0;
        border-top: 1px solid #E6E0DA;
    }
}

.th-busy-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.th-busy-btn .th-btn-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 0.3rem;
}

.th-btn-spin {
    display: none;
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    border: 2px solid color-mix(in srgb, currentColor 35%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: th-login-spin 0.7s linear infinite;
    flex: 0 0 auto;
}

.th-btn-busy {
    display: none;
}

.th-busy-btn[aria-busy="true"] .th-btn-spin {
    display: inline-block;
}

.th-busy-btn[aria-busy="true"] .th-btn-busy {
    display: inline;
}

.th-busy-btn[aria-busy="true"] .th-btn-idle,
.th-busy-btn[aria-busy="true"] .th-btn-icon {
    display: none;
}

.th-admin-add.th-busy-btn[aria-busy="true"] .th-btn-spin,
.th-status-btn--primary.th-busy-btn[aria-busy="true"] .th-btn-spin,
.th-status-btn--danger.th-busy-btn[aria-busy="true"] .th-btn-spin,
.th-login-submit.th-busy-btn[aria-busy="true"] .th-btn-spin,
.th-hire-footer__submit.th-busy-btn[aria-busy="true"] .th-btn-spin,
.th-add__submit.th-busy-btn[aria-busy="true"] .th-btn-spin {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
}

button.th-hire-footer__submit.th-busy-btn {
    min-width: 11rem;
    min-height: 2.7rem;
    padding: 0 1.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--th-red);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

button.th-hire-footer__submit.th-busy-btn:disabled {
    opacity: 0.85;
    cursor: default;
}

button.th-add__submit.th-busy-btn {
    width: 100%;
    min-height: 2.7rem;
    border: 0;
    border-radius: 999px;
    background: var(--th-red);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    .th-btn-spin,
    .th-login-submit__spin {
        animation: none;
    }
}

@media print {
    html,
    body {
        background: #fff !important;
        background-image: none !important;
        color: #1a1a1a;
    }

    .th-print-actions,
    .th-boot,
    .th-header,
    .th-skip,
    .th-panel,
    .th-cat-rail,
    .th-footer {
        display: none !important;
    }

    .th-print {
        margin: 0;
        padding: 0;
        max-width: none;
        border: 0;
        box-shadow: none;
    }

    .th-print-band,
    .th-print-head,
    .th-print-actions {
        margin-left: 0;
        margin-right: 0;
    }

    .th-print-table thead {
        display: table-header-group;
    }

    .th-print-totals,
    .th-print-pay,
    .th-print-sign,
    .th-print-kpis {
        break-inside: avoid;
    }

    @page {
        size: A4;
        margin: 10mm 11mm 12mm;
    }
}


