/* CapybaraNET · тема «Мастерская» (дерево, латунь, чертёж).
   Подключается после style.css и только переопределяет его.
   Чтобы вернуть старый вид, уберите <link> на этот файл из index.html. */

@font-face { font-family: "Russo One"; font-style: normal; font-weight: 400; font-display: swap; src: url(../assets/fonts/russo-one-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Russo One"; font-style: normal; font-weight: 400; font-display: swap; src: url(../assets/fonts/russo-one-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Russo One"; font-style: normal; font-weight: 400; font-display: swap; src: url(../assets/fonts/russo-one-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    color-scheme: dark;
    --display: "Russo One", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #0e1a2e;
    --text: #f6efe2;
    --hint: #a9bedb;
    --accent: #ffd36b;
    --accent-soft: rgba(246, 194, 76, .14);
    --healthy: #7cf08a;
    --danger: #ff7a5c;
    --warning: #ffb547;
    --expiry: #a6e85a;
    --border: rgba(216, 236, 255, .22);
    --control-bg: rgba(6, 30, 70, .45);

    --cream: #fff3dc;
    --ink: #3a1f06;
    --wood-edge: #2e1507;
    --brass-edge: #6b3f0e;
    --felt-edge: #5a0a06;
    --wood: repeating-linear-gradient(178deg, transparent 0 17px, rgba(46, 21, 7, .07) 18px, transparent 19px 38px),
            linear-gradient(180deg, #a9652f, #8c4b21);
    --wood-dark: repeating-linear-gradient(178deg, transparent 0 17px, rgba(30, 14, 4, .07) 18px, transparent 19px 38px),
                 linear-gradient(180deg, #74401b, #5e3014);
    --brass: linear-gradient(180deg, #ffe8a3 0%, #f6c24c 40%, #c8841a 62%, #f8d06a 100%);
    --felt: linear-gradient(180deg, #e4352a 0%, #c21d14 55%, #9e120c 100%);
    --blueprint: linear-gradient(rgba(255, 255, 255, .075) 1px, transparent 1px) 0 0 / 18px 18px,
                 linear-gradient(90deg, rgba(255, 255, 255, .075) 1px, transparent 1px) 0 0 / 18px 18px,
                 radial-gradient(130% 100% at 50% 18%, #1459ac 0%, #104a98 55%, #0b377b 100%);
    --press: 0 3px 0 #1e0f04, 0 6px 12px rgba(0, 0, 0, .35);
    --lift-brass: inset 0 2px 0 rgba(255, 246, 200, .85), inset 0 -2px 0 rgba(107, 63, 14, .35);
    --lift-wood: inset 0 2px 0 rgba(231, 174, 120, .45), inset 0 -2px 0 rgba(30, 14, 4, .35);
    --lift-felt: inset 0 2px 0 rgba(255, 154, 138, .6), inset 0 -2px 0 rgba(60, 5, 3, .4);
}
@media (prefers-color-scheme: light) {
    :root { color-scheme: dark; --bg: #0e1a2e; --text: #f6efe2; --hint: #a9bedb; --border: rgba(216, 236, 255, .22); --control-bg: rgba(6, 30, 70, .45); }
    body { background-image: linear-gradient(rgba(125, 151, 181, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(125, 151, 181, .07) 1px, transparent 1px), linear-gradient(180deg, #13233f, #0b1528 75%); }
}

body {
    overflow-wrap: anywhere;
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(125, 151, 181, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 151, 181, .07) 1px, transparent 1px),
        linear-gradient(180deg, #13233f, #0b1528 75%);
    background-size: 26px 26px, 26px 26px, 100% 100%;
}

/* ---------- Типографика ---------- */
h1, h2, h3, .brand-name, .welcome-block h2, summary, .connection-slot, .plan-card > span:first-child, .plan-card strong, .admin-stat strong {
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: 0;
}
h1, h2, h3 { color: var(--cream); text-shadow: 0 2px 0 rgba(20, 10, 2, .7); }
.brand-name { color: var(--accent); font-size: 14px; text-shadow: 0 2px 0 rgba(20, 10, 2, .7); }
a { color: var(--accent); }

/* ---------- Шапка: суконное знамя на латунной штанге ---------- */
.app-header {
    margin: calc(-20px - env(safe-area-inset-top)) -18px 20px;
    padding: env(safe-area-inset-top) 6px 0;
    border-style: solid;
    border-width: 26px 20px 34px;
    border-image: url(../assets/ui/banner.svg) 26 20 34 fill / 26px 20px 34px round stretch;
    background: none;
    box-shadow: none;
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .45));
}
.brand-logo { filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .45)); }
#pageTitle { font-size: 22px; }
.avatar { border: 2px solid var(--brass-edge); background: var(--brass); color: var(--ink); font-family: var(--display); font-weight: 400; box-shadow: var(--lift-brass), 0 3px 0 #1e0f04; }

/* ---------- Ленты-вымпелы для заголовков разделов ---------- */
.section-heading h2, .content-section > h2, .support-hero h2, .support-inbox .section-heading h3, .support-email-card h3 {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    height: auto;
    max-width: 100%;
    margin: 0 0 0 -6px;
    padding: 9px 4px 10px;
    border-style: solid;
    border-width: 0 30px 0 26px;
    border-image: url(../assets/ui/ribbon.svg) 0 30 0 26 fill / 0 30px 0 26px stretch;
    color: var(--cream);
    font-size: 15px;
    line-height: 1.3;
    text-transform: uppercase;
    white-space: normal;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4));
}
.content-section > h2 { margin-bottom: 12px; }
.section-heading { flex-wrap: wrap; row-gap: 6px; }

/* ---------- Панель-чертёж: дерево + латунь + синий лист + уголки ---------- */
.subscription-card, .plan-card, .payment-note, .support-inbox, .support-email-card, .support-thread, .modal, .admin-workspace {
    border: var(--frame-border, 16px) solid transparent;
    border-image: url(../assets/ui/frame.svg) 40 / var(--frame-width, 40px) stretch;
    border-radius: 14px;
    background: var(--blueprint);
    background-clip: padding-box;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
    color: #f4f8ff;
    --text: #f4f8ff;
    --hint: #c4daf6;
    --border: rgba(216, 236, 255, .3);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.subscription-card { padding: var(--frame-padding, 32px); }
.payment-note, .support-inbox, .support-email-card, .support-thread { padding: var(--frame-padding, 32px); }
.modal { padding: var(--frame-padding, 32px); }
.admin-workspace { padding: var(--frame-padding, 32px); }
.modal-close { top: 2px; right: 8px; color: var(--cream); text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }

.plan-card { min-height: 128px; padding: var(--frame-padding, 32px); border-radius: 4px; transition: box-shadow .18s ease, transform .18s ease, filter .18s ease; }
.plan-price { min-width: 0; flex-wrap: wrap; }
.plan-price strong { max-width: 100%; white-space: normal; }
@media (hover: hover) {
    .plan-card:hover { box-shadow: 0 0 0 2px rgba(255, 211, 107, .8), 0 0 18px rgba(255, 211, 107, .4), 0 10px 20px rgba(0, 0, 0, .5); filter: brightness(1.07); transform: translateY(-2px); }
}
.plan-card.selected, .plan-card.selected:hover { border-color: transparent; background: var(--blueprint); background-clip: padding-box; box-shadow: 0 0 0 2px var(--wood-edge), 0 0 0 5px #ffd36b, 0 0 0 6.5px var(--brass-edge), 0 0 26px 5px rgba(255, 211, 107, .55), 0 10px 20px rgba(0, 0, 0, .45); filter: brightness(1.07); transform: translateY(-2px); }
.plan-card > span:first-child { font-size: 18px; color: var(--cream); text-shadow: 0 2px 0 rgba(6, 33, 80, .8); text-transform: uppercase; }
.plan-card .discount { color: #9ef3ff; font-weight: 650; }
.plan-price strong {
    padding: 7px 12px;
    border: 2px solid var(--brass-edge);
    border-radius: 9px;
    background: var(--brass);
    color: var(--ink);
    font-size: 19px;
    box-shadow: var(--lift-brass), 0 3px 0 #1e0f04;
}
.hit-badge {
    padding: 5px 9px;
    border: 1.5px solid #f2b83a;
    border-radius: 6px;
    background: var(--felt);
    color: var(--cream);
    font-family: var(--display);
    font-size: 10px;
    text-transform: uppercase;
    box-shadow: 0 2px 0 var(--felt-edge);
}

/* ---------- Плашки: дерево с латунной окантовкой ---------- */
.payment-methods { margin-top: 20px; }
.payment-method-list { display: grid; gap: 10px; margin-top: 12px; }
.payment-method {
    position: relative;
    display: grid;
    grid-template-columns: 22px 30px minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    min-height: 76px;
    padding: 16px;
    border: 2px solid var(--wood-edge);
    border-radius: 14px;
    background: var(--wood-dark);
    box-shadow: inset 0 0 0 2px #e3a935, inset 0 0 0 3px var(--brass-edge), 0 4px 0 #1e0f04;
    cursor: pointer;
}
.payment-method input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.payment-method:has(input:checked) { box-shadow: inset 0 0 0 2px #ffd36b, inset 0 0 0 3px var(--brass-edge), 0 4px 0 #1e0f04, 0 0 16px 1px rgba(255, 211, 107, .45); }
.payment-method:has(input:focus-visible) { outline: 3px solid #ffd36b; outline-offset: 3px; }
.payment-method[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.payment-method-radio { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid #c8943a; border-radius: 50%; background: rgba(46, 21, 7, .55); }
.payment-method:has(input:checked) .payment-method-radio { border-color: #ffd36b; }
.payment-method:has(input:checked) .payment-method-radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #ffd36b; }
.payment-method img { width: 30px; height: 30px; }
.payment-method-copy { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.payment-method strong { color: #fff8ec; font-family: var(--display); font-size: 15px; font-weight: 400; white-space: normal; }
.payment-method small { color: #e6c79a; font-size: 12.5px; line-height: 1.4; white-space: normal; }
.payment-method-badge { align-self: start; padding: 3px 8px; border: 1.5px solid var(--brass-edge); border-radius: 9px; background: var(--brass); color: var(--ink); font-family: var(--display); font-size: 11px; text-transform: uppercase; }
.order-summary { padding: 4px 14px; border: 1px solid rgba(216, 236, 255, .3); border-radius: 14px; background: rgba(6, 30, 70, .45); }
.order-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.order-summary > div + div { border-top: 1px solid rgba(216, 236, 255, .18); }
.order-summary span { color: #c4daf6; font-size: 14px; }
.order-summary strong { color: #f4f8ff; font-size: 14px; text-align: right; }
.order-summary > div:last-child strong { color: #ffd36b; font-size: 20px; }
.payment-provider > .muted { margin-top: 10px; font-size: 14px; line-height: 1.5; }
.provider-expiry { margin: 14px 0 8px; color: #9fb6d6; font-size: 12px; text-align: center; }
.payment-note[data-provider="platega"] .section-heading > strong { display: none; }
details, .legal-consent, .checkout-auth, .subscription-warning, .subscription-load-error {
    border: 2px solid var(--wood-edge);
    border-radius: 14px;
    background: var(--wood-dark);
    box-shadow: inset 0 0 0 2px #e3a935, inset 0 0 0 3px var(--brass-edge), 0 4px 0 #1e0f04;
    color: #f4ddb8;
    --hint: #e6c79a;
    --text: #fff3dc;
}
details { padding: 14px 16px; }
summary { color: var(--cream); font-size: 14px; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.service-details details { border-bottom: 2px solid var(--wood-edge); }
.legal-copy a, .service-details a, .referral-terms a, .support-hero a { color: var(--accent); }
.subscription-warning { color: #ffe3a8; }
.subscription-load-error { color: #ffd0c4; }

/* ---------- Кнопки ---------- */
.primary-action, .sbp-action, .upload-receipt, .quick-actions .primary-action, .support-button, .email-login-form .primary-action, .auth-button, .telegram-auth-choice {
    border: 2px solid var(--brass-edge);
    border-radius: 12px;
    background: var(--brass);
    color: var(--ink);
    font-family: var(--display);
    font-weight: 400;
    text-shadow: 0 1px 0 rgba(255, 241, 184, .8);
    box-shadow: var(--lift-brass), var(--press);
}
.telegram-auth-choice { background: linear-gradient(180deg, #5cc6f5 0%, #229ed9 55%, #1b86bd 100%); border-color: #0e4a6b; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), var(--press); }
.auth-button { color: var(--ink); }

.secondary-action, .back-button, .quick-actions button:not(.primary-action), .connection-actions button, .admin-back {
    border: 2px solid var(--wood-edge);
    border-radius: 12px;
    background: var(--wood);
    color: #fff8ec;
    font-family: var(--display);
    font-weight: 400;
    text-shadow: 0 1.5px 0 rgba(30, 14, 4, .8);
    box-shadow: var(--lift-wood), var(--press);
}
.admin-back { padding: 7px 12px; }
.quick-actions button.is-copied { border-color: #1e4d0c; background: linear-gradient(180deg, #b8ff7a, #4fc72c); color: #123306; text-shadow: none; }

.danger-action, .connection-actions button:first-child, .device-disconnect {
    border: 2px solid var(--felt-edge);
    border-radius: 12px;
    background: var(--felt);
    color: var(--cream);
    font-family: var(--display);
    font-weight: 400;
    text-shadow: 0 1.5px 0 rgba(60, 5, 3, .8);
    box-shadow: var(--lift-felt), var(--press);
}
.primary-action:active, .secondary-action:active, .danger-action:active, .quick-actions button:active, .connection-actions button:active, .back-button:active, .auth-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #1e0f04; }
.reissue-action { color: var(--hint); }

/* ---------- Подключение: лампа, латунный значок, шкалы ---------- */
.connection-slot { color: var(--accent); font-size: 30px; text-shadow: 0 2px 0 rgba(6, 33, 80, .9); }
.status-badge { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; text-shadow: 0 1.5px 0 rgba(6, 33, 80, .8); }
.status-badge i { width: 11px; height: 11px; background: radial-gradient(circle at 35% 35%, #fff, currentColor 55%); box-shadow: 0 0 0 2.5px #e9a92e, 0 0 0 3.5px var(--brass-edge), 0 0 12px 3px currentColor; }
.access-badge { border: 1.5px solid var(--brass-edge); background: var(--brass); color: var(--ink); font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .04em; }
.access-badge[data-access-type="promo"], .access-badge[data-access-type="admin"] { border-color: var(--brass-edge); background: var(--brass); color: var(--ink); }

.progress-track { height: 16px; margin: 8px 0 18px; border: 2px solid #e3a935; border-radius: 9px; background: #08295c; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .5), 0 0 0 1px var(--brass-edge); }
.progress-track::-webkit-progress-bar { border-radius: 7px; background: #08295c; }
.progress-track::-webkit-progress-value { border-radius: 6px; background: repeating-linear-gradient(90deg, transparent 0 24px, rgba(8, 41, 92, .5) 24px 26px), linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%), var(--progress-color, var(--accent)); }
.progress-track::-moz-progress-bar { border-radius: 6px; background: repeating-linear-gradient(90deg, transparent 0 24px, rgba(8, 41, 92, .5) 24px 26px), linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%), var(--progress-color, var(--accent)); }
.progress-track.tone-accent { --progress-color: #3cc8ee; }
.progress-track.tone-expiry { --progress-color: #8bd63a; }

.subscription-connect {
    padding: 16px 8px 18px;
    border-style: solid;
    border-width: 26px 16px 34px;
    border-image: url(../assets/ui/banner.svg) 26 20 34 fill / 26px 16px 34px round stretch;
    border-radius: 0;
    background: none;
    --hint: var(--cream);
}
.device-row { border-top-color: rgba(216, 236, 255, .3); }
.device-manager > strong { font-family: var(--display); font-weight: 400; color: var(--cream); }
.payment-number { border-color: rgba(216, 236, 255, .3); }

/* ---------- Поля ввода ---------- */
input:not([type="file"]):not([type="checkbox"]):not([type="radio"]), textarea, select {
    border: 2px solid rgba(233, 169, 46, .7) !important;
    border-radius: 12px !important;
    background: rgba(6, 30, 70, .6) !important;
    color: #f4f8ff !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35);
}
input::placeholder, textarea::placeholder { color: rgba(196, 218, 246, .6); }
.attachment-control { border-color: rgba(216, 236, 255, .35) !important; }

/* ---------- Поддержка ---------- */
.support-ticket-card { border: 1.5px solid rgba(216, 236, 255, .3); border-radius: 12px; background: rgba(6, 30, 70, .45); }
.support-ticket-card.unread { border-color: #e9a92e; box-shadow: 0 0 0 1px var(--brass-edge); }
.support-ticket-card.unread strong::after { background: #7cf08a; box-shadow: 0 0 8px 2px rgba(124, 240, 138, .8); }
.support-ticket-card strong { font-family: var(--display); font-weight: 400; }
.support-message { border: 1.5px solid rgba(216, 236, 255, .3); background: rgba(6, 30, 70, .55); }
.support-message.own { border: 1.5px solid #c8841a; background: #f4eada; color: #3a2410; }
.support-message.own small { color: #7a5a38; }
.support-status { border: 1.5px solid var(--brass-edge); background: var(--brass); color: var(--ink); font-family: var(--display); }

/* ---------- Профиль ---------- */
.referral-stats div { border: 2px solid var(--wood-edge); background: var(--wood-dark); box-shadow: inset 0 0 0 1px #e3a935; }
.referral-stats strong { font-family: var(--display); font-weight: 400; color: var(--accent); font-size: 20px; }
.info-list div { border-bottom: 1px dashed rgba(216, 236, 255, .18); padding-bottom: 8px; }

/* ---------- Нижняя навигация: деревянная планка ---------- */
.bottom-nav {
    border: 2px solid var(--wood-edge);
    border-radius: 22px;
    background: var(--wood);
    box-shadow: inset 0 3px 0 rgba(242, 184, 58, .85), inset 0 4px 0 var(--brass-edge), 0 4px 0 #1e0f04, 0 12px 28px rgba(0, 0, 0, .5);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.nav-item { color: #fff8ec; border-radius: 14px; text-shadow: 0 1px 0 rgba(30, 14, 4, .7); }
.nav-item.active { border: 2px solid #f2b83a; background: var(--felt); color: var(--cream); box-shadow: var(--lift-felt), 0 2px 0 var(--felt-edge); }
/* Иконки меню в стиле мастерской (assets/icons/nav-*.svg) */
.nav-item > .nav-icon { width: 28px; height: 28px; background: center / 28px 28px no-repeat; filter: drop-shadow(0 1.5px 0 rgba(30, 14, 4, .55)); }
.nav-item > .nav-icon > svg { display: none; }
.nav-item[data-tab="shop"] > .nav-icon { background-image: url(../assets/icons/nav-shop.svg); }
.nav-item[data-tab="dashboard"] > .nav-icon { background-image: url(../assets/icons/nav-dashboard.svg); }
.nav-item[data-tab="profile"] > .nav-icon { background-image: url(../assets/icons/nav-profile.svg); }
.nav-item[data-tab="support"] > .nav-icon { background-image: url(../assets/icons/nav-support.svg); }
.nav-item[data-tab="admin"] > .nav-icon { background-image: url(../assets/icons/nav-admin.svg); }
.nav-item:not(.active) > .nav-icon { opacity: .92; }

/* Выравнивание пунктов меню: иконки в одну линию, подписи от одной верхней границы */
.bottom-nav { align-items: stretch; }
.nav-item { grid-template-rows: 28px auto; align-content: start; gap: 4px; padding: 7px 3px 6px; border: 2px solid transparent; line-height: 1.15; text-align: center; }
.nav-item.active { border-color: #f2b83a; }

/* Шапка карточки подписки: статус, плашка и счётчик устройств на общих линиях */
.connection-heading > div { grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 8px; align-items: center; }
.connection-heading .status-badge { grid-column: 1; grid-row: 1; padding-left: 4px; line-height: 1; }
.connection-heading .connection-devices { grid-column: 2; grid-row: 1; justify-self: end; line-height: 1.2; }
.connection-heading .access-badge { grid-column: 1; grid-row: 2; justify-self: start; }
.connection-slot { line-height: 1; }
.device-row small { white-space: pre-line; }

.auth-choice-status { margin: 0; text-align: center; font-size: 13px; }
/* Загрузчик в стиле мастерской */
.app-loader { background-color: var(--bg); background-image: linear-gradient(rgba(125, 151, 181, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(125, 151, 181, .07) 1px, transparent 1px), radial-gradient(60% 45% at 50% 45%, #1b3563, #0b1528 80%); background-size: 26px 26px, 26px 26px, 100% 100%; }
.app-loader .gear-loader span { font-family: var(--display); color: var(--cream); letter-spacing: .03em; text-shadow: 0 2px 0 #1b0e04; }
.gear-loader::before { filter: drop-shadow(0 2px 0 rgba(6, 20, 45, .45)); }
#supportUnreadBadge, .admin-menu-count { border: 1.5px solid var(--brass-edge); background: var(--brass); color: var(--ink); }

/* ---------- Прочее ---------- */
.empty-icon { border: 2px solid var(--brass-edge); background: var(--brass); color: var(--ink); box-shadow: var(--lift-brass), var(--press); }
.site-footer a { color: #9fb6d6; }
.welcome-block h2 { font-size: clamp(34px, 9.5vw, 52px); line-height: 1.02; color: var(--cream); text-shadow: 0 3px 0 #1b0e04; }
.admin-stat, .admin-row { border: 1.5px solid rgba(216, 236, 255, .3); border-radius: 12px; background: rgba(6, 30, 70, .45); }
.admin-stat strong { color: var(--accent); text-shadow: 0 2px 0 rgba(6, 33, 80, .9); }
.admin-drawer { background: var(--wood-dark); border-right: 3px solid #e9a92e; }
.admin-section-button.active { border: 2px solid #f2b83a; background: var(--felt); color: var(--cream); }
.admin-menu-button { border: 2px solid var(--wood-edge); background: var(--wood); }
.admin-menu-button span { background: var(--cream); }

.section-heading > p { flex-basis: 100%; margin: 4px 0 0; }
input[type="file"] { color: var(--hint); font-size: 12px; }
input[type="file"]::file-selector-button {
    margin-right: 8px;
    padding: 6px 10px;
    border: 2px solid var(--wood-edge);
    border-radius: 9px;
    background: var(--wood);
    color: #ffebc7;
    font-family: var(--display);
    font-size: 12px;
    text-shadow: 0 1px 0 rgba(30, 14, 4, .8);
    box-shadow: var(--lift-wood), 0 2px 0 #1e0f04;
    cursor: pointer;
}
.section-heading > div > h2 + .muted { display: block; margin-top: 8px; }

/* Stable icon and label cells in both client and admin navigation. */
.nav-item { grid-template-rows: 28px minmax(26px, auto); font-weight: 700; }
.nav-item:active { transform: none; }
.nav-item > .nav-label { display: block; width: 100%; min-height: 2.6em; font-size: 10px; line-height: 1.3; text-align: center; }
.brand-block { flex: 1; }
.brand-block > div { min-width: 0; flex: 1; }
#pageTitle { display: flex; align-items: center; min-height: 2.2em; font-size: clamp(18px, 5vw, 22px); line-height: 1.1; }
.account-actions { flex-shrink: 0; }
.payment-method-badge { grid-column: 3; justify-self: start; }
.nav-item { grid-template-columns: minmax(0, 1fr); }
.section-heading > *, .status-row > *, .traffic-label > *, .info-list div > *, .order-summary > div > *, .shop-order-summary dl > div > *, .setup-platform span { min-width: 0; }
.admin-actions { flex-wrap: wrap; }
.admin-support-ticket-grid > *, .admin-support-composer > *, .admin-support-controls > * { min-width: 0; }
.admin-support-composer select, .admin-support-controls select, .admin-support-composer textarea { min-width: 0; max-width: 100%; }
.admin-support-composer-actions { flex-wrap: wrap; }
@media (max-width: 360px) {
    .nav-item { padding-inline: 0; }
    .nav-item > .nav-label { font-size: 9px; }
}
@media (max-width: 420px) {
    .plan-card { grid-template-columns: minmax(0, 1fr); }
    .plan-price { grid-column: 1; grid-row: auto; justify-content: flex-start; }
    .admin-support-ticket-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
    :root { --frame-border: 6px; --frame-width: 16px; --frame-padding: 18px; }
    body { min-width: 0; }
    .app-shell { padding-inline: 8px; }
    .app-header { margin-inline: -8px; }
    .admin-workspace .promo-admin-card { padding: 12px; border-width: 1px; }
    #leadCandidates .admin-row { padding: 10px; }
}
