/* HH Applicant Tool — mobile-first рабочий интерфейс */

:root {
    --canvas: #edf1ef;
    --surface: #ffffff;
    --ink: #151b18;
    --accent: #0b6b4f;
    --accent-strong: #085539;
    --danger: #b42336;
    --warning: #8a5a00;
    --muted: color-mix(in srgb, var(--ink) 60%, var(--surface));
    --line: color-mix(in srgb, var(--ink) 12%, var(--surface));
    --surface-soft: color-mix(in srgb, var(--ink) 4%, var(--surface));
    --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
    --danger-soft: color-mix(in srgb, var(--danger) 8%, var(--surface));
    --warning-soft: color-mix(in srgb, #d99a00 14%, var(--surface));
    --shadow: 0 16px 40px -12px color-mix(in srgb, var(--ink) 18%, transparent);
    --shadow-sm: 0 1px 2px color-mix(in srgb, var(--ink) 4%, transparent), 0 6px 16px -8px color-mix(in srgb, var(--ink) 7%, transparent);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
html, body { margin: 0; }
body {
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.56; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 2px; }
.hidden { display: none !important; }
.mobile-bottom-nav, .mobile-more-menu, .mobile-local-pill { display: none; }
svg { display: block; }

/* Каркас */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    width: 252px;
    height: 100vh;
    flex: 0 0 252px;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--surface);
}
.main-shell { min-width: 0; height: 100vh; flex: 1; overflow-y: auto; }
.content-frame { width: min(1280px, 100%); margin: 0 auto; padding: 40px 44px 56px; }

/* Бренд и desktop-навигация */
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px; border-bottom: 1px solid var(--line); }
.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 11px;
    background: var(--accent);
    color: var(--surface);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16), 0 3px 8px -3px color-mix(in srgb, var(--accent) 65%, transparent);
}
.brand-copy { min-width: 0; flex: 1; }
.brand-name { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.brand-subtitle { margin-top: 1px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.app-nav { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 22px 13px; }
.nav-label {
    padding: 0 11px 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.nav-label-secondary { margin-top: 18px; }
.sidebar-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    padding: 0 11px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}
.sidebar-link:hover { background: var(--surface-soft); color: var(--ink); }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 750; }
.nav-mark { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; }
.nav-mark svg { width: 19px; height: 19px; }
.sidebar-footer { margin: 12px 13px 14px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.sidebar-footer-label { color: var(--accent); font-size: 14px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.sidebar-footer p { margin: 7px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.version-label { color: var(--muted); font-size: 14px; }

/* Общие заголовки */
.section { display: none; }
.section.active { display: block; animation: section-in 260ms ease; }
@keyframes section-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.eyebrow, .section-kicker { color: var(--accent); font-size: 14px; font-weight: 800; letter-spacing: 0.07em; line-height: 1.4; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow::before { content: ""; width: 16px; height: 2px; flex: 0 0 16px; border-radius: 1px; background: var(--accent); }
.page-title { margin: 7px 0 8px; color: var(--ink); font-size: clamp(27px, 3vw, 36px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.08; text-wrap: balance; }
.page-title[tabindex="-1"]:focus { outline: none; }
.page-lead { max-width: 650px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.header-status { display: flex; align-items: center; gap: 8px; padding-top: 8px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.header-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* Поверхности */
.card, .hero-card, .onboarding-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.card { padding: 24px; }
.section-title { margin: 0 0 7px; color: var(--ink); font-size: 17px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.3; }
.form-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.form-card-description { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* Обзор */
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.82fr); gap: 18px; }
.hero-card {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    padding: 30px;
    background: radial-gradient(150% 135% at 92% -25%, color-mix(in srgb, var(--accent) 11%, var(--surface)) 0%, var(--surface) 56%);
}
.hero-card-copy { max-width: 590px; }
.hero-card h3 { max-width: 650px; margin: 9px 0 10px; font-size: clamp(25px, 3vw, 34px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.08; text-wrap: balance; }
.hero-card-copy p { max-width: 560px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.status-panel { max-width: 550px; margin-top: 30px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.status-panel-main { display: flex; align-items: center; gap: 12px; }
.status-copy { min-width: 0; flex: 1; }
.status-title { font-size: 15px; font-weight: 800; }
.status-subtitle { margin-top: 2px; color: var(--muted); font-size: 14px; }
.status-hint { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.auth-error { margin-top: 12px; padding: 10px 11px; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 14px; line-height: 1.45; }
.status-dot { width: 11px; height: 11px; flex: 0 0 11px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px var(--surface-soft); }
.status-dot.online { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.status-dot.offline { background: var(--muted); }
.quick-actions { display: flex; flex-direction: column; gap: 10px; }
.quick-actions .section-kicker { margin: 3px 4px 2px; }
.quick-action {
    display: flex;
    width: 100%;
    min-height: 92px;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.quick-action:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.quick-action:active { transform: translateY(0); }
.quick-action > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; }
.quick-action strong { font-size: 15px; }
.quick-action small { color: var(--muted); font-size: 14px; line-height: 1.4; }
.action-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.action-icon svg { width: 18px; height: 18px; }
.action-arrow { display: grid; place-items: center; color: var(--muted); transition: color 160ms ease, transform 160ms ease; }
.action-arrow svg { width: 18px; height: 18px; }
.quick-action:hover .action-arrow { color: var(--accent); transform: translateX(3px); }
.onboarding-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-top: 18px; padding: 24px 26px; }
.onboarding-card h3 { margin: 7px 0 0; font-size: 18px; letter-spacing: -0.02em; }
.onboarding-steps { display: grid; max-width: 800px; flex: 1; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 22px; }
.onboarding-step { display: flex; gap: 11px; }
.step-number { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--surface); font-size: 14px; font-weight: 800; box-shadow: 0 0 0 4px var(--accent-soft); }
.onboarding-step strong { display: block; font-size: 14px; }
.onboarding-step p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

/* Кнопки */
.btn-primary, .btn-danger, .btn-secondary, .btn-sm, .text-button, .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 750;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.btn-primary, .btn-danger { min-height: 44px; padding: 0 16px; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: var(--surface); box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 1px 0 rgb(255 255 255 / 0.14); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 5px 14px -5px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 1px 0 rgb(255 255 255 / 0.14); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 34%, var(--line)); background: var(--surface); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger:active { transform: scale(0.98); }
.btn-secondary, .btn-sm { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn-secondary:hover, .btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.btn-secondary:active, .btn-sm:active { transform: scale(0.98); }
.text-button { min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--accent); }
.text-button:hover { background: var(--accent-soft); }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 24px; }
.icon-button:hover { border-color: var(--accent); color: var(--accent); }
.icon-button svg { width: 20px; height: 20px; }

/* Подсказки */
.callout { display: flex; max-width: 920px; align-items: flex-start; gap: 12px; margin: -7px 0 18px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.callout-info { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); background: var(--accent-soft); }
.callout-neutral { background: var(--surface-soft); }
.callout-icon { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 8px; background: var(--surface); color: var(--accent); }
.callout-info .callout-icon { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.callout-icon svg { width: 16px; height: 16px; }
.callout strong { display: block; font-size: 14px; }
.callout p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.inline-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding: 11px 12px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 14px; }

/* Форма поиска */
.preset-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.preset-panel > summary { padding: 12px 16px; cursor: pointer; font-size: 14px; font-weight: 700; }
.preset-panel[open] > summary { border-bottom: 1px solid var(--line); }
.preset-panel .preset-toolbar { padding: 16px; }
.preset-toolbar { display: grid; min-width: 390px; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: end; gap: 8px; }
.preset-toolbar .toolbar-label { grid-column: 1 / -1; }
.page-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar-label { color: var(--muted); font-size: 14px; font-weight: 700; }
.preset-toolbar select, .page-toolbar select { min-height: 42px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; outline: none; }
.preset-toolbar select:focus, .page-toolbar select:focus { border-color: var(--accent); }
.search-form { display: flex; flex-direction: column; gap: 16px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.form-group { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.form-group label, .form-label-sm { color: var(--ink); font-size: 14px; font-weight: 750; line-height: 1.4; }
.form-group input[type="text"], .form-group input[type="number"], .form-group input[type="password"], .form-group input[type="date"], .form-group select, .form-group textarea {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}
.form-group input[type="text"]:hover, .form-group input[type="number"]:hover, .form-group input[type="password"]:hover, .form-group input[type="date"]:hover, .form-group select:hover, .form-group textarea:hover { border-color: color-mix(in srgb, var(--ink) 28%, var(--surface)); }
.form-group select {
    padding-right: 34px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f6b66' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.preset-toolbar select, .page-toolbar select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f6b66' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.form-group textarea { min-height: 84px; resize: vertical; }
.form-group input::placeholder, .form-group textarea::placeholder { color: color-mix(in srgb, var(--muted) 72%, var(--surface)); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.form-label-sm { display: block; margin-bottom: 9px; }
.field-hint { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.field-hint a { color: var(--accent); text-decoration: none; }
.field-hint a:hover { text-decoration: underline; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 11px 22px; }
.checkbox-item { display: flex; min-height: 30px; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; line-height: 1.4; cursor: pointer; transition: color 140ms ease; }
.checkbox-item:hover { color: var(--ink); }
.checkbox-item input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--accent); }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.choice-card { display: flex; min-height: 86px; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease; }
.choice-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice-card:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--accent-soft); }
.choice-card input { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; accent-color: var(--accent); }
.choice-card span { display: flex; flex-direction: column; gap: 3px; }
.choice-card strong { font-size: 14px; }
.choice-card small { color: var(--muted); font-size: 14px; line-height: 1.4; }

/* Справочники и теги */
.lookup-field { position: relative; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color 160ms ease, box-shadow 160ms ease; }
.lookup-field:hover { border-color: color-mix(in srgb, var(--ink) 28%, var(--surface)); }
.lookup-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.lookup-search { width: 100%; min-height: 42px; padding: 9px 11px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 15px; outline: none; }
.lookup-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 8px; }
.lookup-tags:empty { display: none; }
.lookup-dropdown { position: absolute; z-index: 50; top: calc(100% + 5px); right: -1px; left: -1px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.lookup-option { padding: 11px 12px; color: var(--ink); font-size: 14px; cursor: pointer; }
.lookup-option:hover, .lookup-option.selected { background: var(--accent-soft); color: var(--accent); }
.lookup-option.selected { font-weight: 750; }
.lookup-loading { display: flex; align-items: center; gap: 8px; padding: 12px; color: var(--muted); font-size: 14px; }
.tag-pill { display: inline-flex; max-width: 230px; align-items: center; gap: 6px; overflow: hidden; padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.tag-pill button { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 18px; line-height: 1; }
.tag-input-wrap { display: flex; min-height: 44px; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color 160ms ease, box-shadow 160ms ease; }
.tag-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.tag-input-field { min-width: 150px; flex: 1; padding: 4px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 15px; }
.tip { position: relative; display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; margin-left: 3px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); color: var(--muted); font-size: 14px; font-weight: 800; cursor: help; vertical-align: middle; }
.tip:hover { border-color: var(--accent); color: var(--accent); }
.tip[data-tip]:hover::after { content: attr(data-tip); position: absolute; z-index: 200; bottom: calc(100% + 7px); left: 50%; width: max-content; max-width: 300px; padding: 9px 10px; transform: translateX(-50%); border-radius: 8px; background: var(--ink); color: var(--surface); font-size: 14px; font-weight: 400; line-height: 1.45; white-space: pre-wrap; pointer-events: none; box-shadow: var(--shadow); }

/* Раскрывающиеся настройки */
details.card { padding: 0; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
.advanced-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 23px; cursor: pointer; }
.advanced-summary-copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.advanced-summary .section-title { margin: 0; }
.summary-action { display: inline-flex; min-height: 38px; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--accent); font-size: 14px; font-weight: 750; white-space: nowrap; transition: border-color 160ms ease, background-color 160ms ease; }
.advanced-summary:hover .summary-action { border-color: var(--accent); background: var(--accent-soft); }
.advanced-card[open] .summary-action::before { content: "Скрыть"; }
.advanced-card[open] .summary-action { font-size: 0; }
.advanced-card[open] .summary-action::before { font-size: 14px; }
.advanced-card[open] .advanced-summary { border-bottom: 1px solid var(--line); }
.advanced-content { padding: 22px 23px 24px; }
.inner-details { margin-top: 18px; border-top: 1px solid var(--line); }
.inner-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 0; color: var(--ink); font-size: 14px; font-weight: 750; cursor: pointer; }
.inner-details > summary span { color: var(--muted); font-weight: 500; }
.inner-details-content { padding-top: 18px; }
.advanced-options { margin-top: 18px; }
details.card:not(.advanced-card) > summary { padding: 20px 23px; cursor: pointer; }
details.card:not(.advanced-card)[open] > summary { border-bottom: 1px solid var(--line); }
details.card:not(.advanced-card) > p, details.card:not(.advanced-card) > .form-grid-3 { margin-right: 23px; margin-left: 23px; }
details.card:not(.advanced-card) > p { margin-top: 18px; }
details.card:not(.advanced-card) > .form-grid-3 { margin-bottom: 23px; }
.summary-hint { margin-left: 7px; color: var(--muted); font-size: 14px; font-weight: 500; }

/* Запуск */
.progress-card { padding-bottom: 18px; }
.progress-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.progress-live { padding: 5px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 750; }
.progress-bar { height: 8px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.progress-bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent) 60%, color-mix(in srgb, var(--accent) 70%, var(--surface))); transition: width 300ms ease; }
.progress-log { max-height: 256px; overflow-y: auto; user-select: text; }
.progress-line { padding: 2px 0; line-height: 1.5; }
.progress-log a { color: var(--accent); }
.sticky-runbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 17px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.sticky-runbar.live-mode { border-color: color-mix(in srgb, var(--danger) 34%, var(--line)); }
.run-mode-control { position: relative; display: flex; min-width: 0; flex: 1; align-items: center; gap: 12px; cursor: pointer; }
.run-mode-control > input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.switch-track { position: relative; width: 46px; height: 26px; flex: 0 0 46px; border-radius: 99px; background: var(--accent); box-shadow: inset 0 1px 3px color-mix(in srgb, var(--ink) 22%, transparent); transition: background-color 160ms ease; }
.switch-track span { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px color-mix(in srgb, var(--ink) 35%, transparent); transition: transform 160ms ease; }
.run-mode-control > input:not(:checked) + .switch-track { background: var(--danger); }
.run-mode-control > input:not(:checked) + .switch-track span { transform: translateX(-20px); }
.run-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.run-copy strong { font-size: 15px; }
.run-copy span { color: var(--muted); font-size: 14px; }
.run-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.connection-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 16px; margin-bottom: 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--muted); font-size: 14px; }
.connection-notice strong { color: var(--ink); }
.connection-notice span { flex: 1; min-width: 220px; }
.empty-state { grid-column: 1 / -1; padding: 28px 20px; text-align: center; }
.empty-state h3 { margin: 0 0 8px; font-size: 17px; color: var(--ink); }
.empty-state p { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.empty-state p:last-child { margin-bottom: 0; }
.progress-card { scroll-margin-top: 88px; }
.progress-heading { flex-wrap: wrap; }
.progress-live[data-state="error"] { background: var(--danger-soft); color: var(--danger); }
.progress-log, #progress-text, .resume-card, .stack-table td { overflow-wrap: anywhere; }
.progress-bar.indeterminate .progress-bar-fill { width: 35% !important; animation: progress-pending 1.5s ease-in-out infinite alternate; }
@keyframes progress-pending { from { transform: translateX(0); } to { transform: translateX(185%); } }
.run-mode-control > input:focus-visible + .switch-track { outline: 3px solid var(--accent); outline-offset: 3px; }
.run-mode-control:has(input:disabled) { cursor: not-allowed; }
.toast { pointer-events: none; }
body.menu-open { overflow: hidden; }
.lookup-option { width: 100%; border: 0; background: var(--surface); color: var(--ink); text-align: left; font: inherit; }

/* Данные */
.resumes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.resume-card { display: flex; min-height: 175px; flex-direction: column; gap: 13px; padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.resume-card-title { font-size: 17px; font-weight: 800; line-height: 1.3; }
.resume-card-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.resume-counter { color: var(--muted); font-size: 14px; }
.resume-badge, .state-badge { display: inline-flex; width: fit-content; align-items: center; padding: 4px 10px; border-radius: 99px; background: var(--surface-soft); color: var(--muted); font-size: 14px; font-weight: 750; white-space: nowrap; }
.resume-badge.published, .state-response { background: var(--accent-soft); color: var(--accent); }
.resume-badge.not_published, .state-discard { background: var(--danger-soft); color: var(--danger); }
.resume-badge.blocked, .state-invitation { background: var(--surface-soft); color: var(--ink); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: 14px; font-weight: 800; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 15px 16px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.data-table tbody tr { transition: background-color 120ms ease; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table a { color: var(--accent); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.state-active { background: var(--surface-soft); color: var(--ink); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.stat-card { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card .stat-value { color: var(--accent) !important; font-size: 28px; font-weight: 850; letter-spacing: -0.04em; line-height: 1; }
.stat-card .stat-label { margin-top: 8px; color: var(--muted); font-size: 14px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.bar-label { min-width: 150px; font-size: 14px; }
.bar-track { height: 8px; flex: 1; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.bar-count { min-width: 30px; color: var(--muted); font-size: 14px; text-align: right; }

/* Настройки */
.settings-stack { display: flex; max-width: 900px; flex-direction: column; gap: 16px; }
.config-section { padding: 21px 23px 23px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.config-section legend { padding: 0 7px; color: var(--ink); font-size: 16px; font-weight: 800; }

/* Обратная связь */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; z-index: 120; right: 22px; bottom: 22px; max-width: 360px; padding: 13px 16px; border: 1px solid var(--line); border-left-width: 3px; border-radius: 11px; background: var(--surface); color: var(--ink); font-size: 14px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); transition: opacity 200ms ease, transform 200ms ease; }
.toast.show { opacity: 1; transform: none; }
.toast.success, .toast.info { border-left-color: var(--accent); }
.toast.error { border-left-color: var(--danger); }
.text-gray-400, .text-gray-500 { color: var(--muted) !important; }
.text-red-400, .text-red-500 { color: var(--danger) !important; }
.text-blue-500, .text-blue-600, .text-blue-700 { color: var(--accent) !important; }
.bg-gray-50, .bg-gray-100 { background: var(--surface-soft) !important; }
.border-gray-200, .border-gray-300 { border-color: var(--line) !important; }

/* ===== Серверная панель ===== */
.sidebar-footer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-footer-row .text-button { min-height: 32px; padding: 0 8px; }
#sidebar-activity { overflow-wrap: anywhere; }
.mobile-local-pill.busy > span:first-child { animation: pulse-dot 1.2s ease-in-out infinite; }
@keyframes pulse-dot { 50% { opacity: 0.3; } }
code, .mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
textarea.mono { font-size: 13px; }

/* Уведомление о задаче в других разделах */
.running-notice { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); }
.running-notice .spinner { flex: 0 0 18px; }
.running-notice-line { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

/* Обзор: вход в hh.ru */
.hh-login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.hh-login-form .status-actions { margin-top: 2px; }
.hh-step-message { margin: 0; color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.5; }
.inline-details > summary { width: fit-content; color: var(--accent); font-size: 14px; font-weight: 700; cursor: pointer; }
.captcha-image { display: block; max-width: 100%; height: auto; min-height: 60px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.hh-login-progress { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding: 12px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 14px; }
.hh-login-progress .spinner { flex: 0 0 18px; }
.hh-login-progress > span:nth-child(2) { flex: 1; min-width: 160px; }
.login-screenshot { display: block; width: 100%; max-height: 420px; margin-top: 12px; object-fit: contain; object-position: top; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Обзор: сводка */
.side-stack { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.compact-card { padding: 20px; }
.card-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-heading-row .section-title { margin-bottom: 0; }
.next-runs { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 8px; padding: 0; list-style: none; }
.next-runs li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.next-runs li:last-child { border-bottom: 0; }
.next-runs li > span { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.next-runs small { flex: 0 0 auto; max-width: 55%; color: var(--muted); font-size: 13px; text-align: right; }
.compact-card > .text-button { margin-left: -10px; }
.today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.today-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 11px; background: var(--surface-soft); }
.today-grid strong { color: var(--accent); font-size: 24px; font-weight: 850; letter-spacing: -0.03em; line-height: 1.1; }
.today-grid span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.current-card { margin-top: 18px; }
.current-card #dash-current-line { margin: 8px 0 0; overflow-wrap: anywhere; }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.quick-chip { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease; }
.quick-chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.onboarding-steps-4 { grid-template-columns: repeat(4, minmax(130px, 1fr)); }

/* Журнал задачи */
.log-view { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--ink) 3%, var(--surface)); color: var(--ink); font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-view .progress-line { padding: 1px 0; }
.log-tall { max-height: min(560px, 62vh); }
.progress-log.log-view { max-height: 360px; }
.progress-log.log-view.log-tall { max-height: min(560px, 62vh); }
.level-error { color: var(--danger); font-weight: 650; }
.level-warning { color: var(--warning); }
.log-empty { color: var(--muted); font-style: italic; }
.system-log { min-height: 200px; }
.run-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.run-stats:empty { display: none; }
.run-chip { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 11px; border-radius: 99px; background: var(--surface-soft); color: var(--muted); font-size: 13px; }
.run-chip strong { color: var(--ink); font-size: 14px; }
.state-running { background: var(--accent-soft); color: var(--accent); }

/* Автопилот */
fieldset.config-section { min-width: 0; margin: 0; }
.autopilot-master { display: flex; flex-direction: column; gap: 4px; }
.master-switch { width: 100%; }
.run-mode-control > input:not(:checked) + .switch-track.switch-neutral { background: color-mix(in srgb, var(--ink) 28%, var(--surface)); }
.job-toggle { color: var(--ink); font-weight: 700; }
.job-schedule { margin-top: 14px; }
.schedule-grid { gap: 12px; }
.weekday-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.weekday-chip { position: relative; cursor: pointer; }
.weekday-chip input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.weekday-chip span { display: grid; min-width: 44px; height: 38px; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 750; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
.weekday-chip:hover span { border-color: var(--accent); }
.weekday-chip input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.weekday-chip input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 2px; }
.job-next { margin-top: 10px; }
.job-next:empty { display: none; }
.next-line { display: block; }

/* Журнал */
.page-header:has(> .tabs) { flex-wrap: wrap; }
.tabs { display: inline-flex; flex: 0 0 auto; flex-wrap: nowrap; width: fit-content; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.tab { min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 750; white-space: nowrap; transition: background-color 140ms ease, color 140ms ease; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.run-detail { margin-bottom: 16px; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); scroll-margin-top: 20px; }
.run-detail .auth-error { margin: 0 0 12px; }
.clickable-row { cursor: pointer; }
.clickable-row:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: -3px; }
.pager { display: flex; justify-content: center; margin-top: 14px; }
.pager:has(> .hidden:only-child) { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; }
.filter-chip button { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--accent); font-size: 18px; line-height: 1; }
.filter-chip button:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.message-details > summary { color: var(--muted); cursor: pointer; }
.message-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.stack-table td { overflow-wrap: anywhere; }
.data-table td.empty-state { padding: 34px 20px; }

/* Статистика и формы */
.col-span-4 { grid-column: 1 / -1; }
.daily-table { max-height: 380px; }
.currency-select { width: 104px !important; flex: 0 0 104px; }
.token-card > summary { margin: 0; cursor: pointer; }
.token-card[open] > summary { margin-bottom: 4px; }
.secret-clear { align-self: flex-start; min-height: 30px; margin-top: -2px; padding: 0 8px; font-size: 13px; }
.form-group input[type="url"] { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 15px; outline: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.form-group input[type="url"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.form-group input:user-invalid, .form-group textarea:user-invalid { border-color: var(--danger); }

/* Страница входа в панель */
.login-body { display: grid; min-height: 100vh; place-items: center; padding: 24px 16px; background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 12%, var(--canvas)) 0%, var(--canvas) 60%); }
.login-shell { width: min(420px, 100%); }
.login-card { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand { padding: 0 0 22px; border-bottom: 0; }
.login-title { margin: 0 0 8px; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.login-lead { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .auth-error { margin-top: 0; }
.login-submit { width: 100%; }

@media (max-width: 1050px) {
    .content-frame { padding-right: 28px; padding-left: 28px; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .quick-actions .section-kicker { grid-column: 1 / -1; }
    .onboarding-card { flex-direction: column; }
    .onboarding-steps { width: 100%; max-width: none; }
    .choice-grid { grid-template-columns: 1fr; }
    .onboarding-steps-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .app-sidebar { width: 216px; flex-basis: 216px; }
    .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-header { flex-direction: column; }
    .page-toolbar, .preset-toolbar, .preset-panel { width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    body { font-size: 15px; padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
    .app-shell { display: block; }
    .app-sidebar { position: sticky; z-index: 40; top: 0; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 2px 12px color-mix(in srgb, var(--ink) 6%, transparent); backdrop-filter: blur(14px); }
    .brand { min-height: 64px; padding: 11px 16px; border-bottom: 0; }
    .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
    .brand-subtitle { display: none; }
    .mobile-local-pill { display: flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 650; }
    .mobile-local-pill > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
    .app-nav, .sidebar-footer { display: none; }
    .main-shell { height: auto; overflow: visible; }
    .content-frame { padding: 20px 16px 40px; }
    .form-group input, .form-group select, .form-group textarea, .lookup-search { font-size: 16px; }
    .config-section { min-width: 0; }
    .resumes-grid > [class*="col-span"], .stats-grid > [class*="col-span"] { grid-column: 1 / -1; }
    .page-toolbar > button { grid-column: 1 / -1; }
    .connection-notice { margin-bottom: 22px; }
    .resume-card > .flex { flex-wrap: wrap; }
    .btn-sm, .btn-secondary { min-height: 44px; }
    .page-header { gap: 14px; margin-bottom: 22px; }
    .page-title { margin-top: 4px; font-size: 29px; }
    .page-lead { font-size: 15px; }
    .header-status { padding-top: 0; }
    .card { padding: 19px 18px; border-radius: 15px; }
    .dashboard-layout { gap: 14px; }
    .hero-card { min-height: 0; padding: 20px 18px; }
    .hero-card h3 { font-size: 27px; }
    .status-panel { margin-top: 22px; padding: 15px; }
    .status-actions, .status-actions > button { width: 100%; }
    .quick-actions { display: flex; }
    .quick-action { min-height: 82px; }
    .onboarding-card { gap: 20px; margin-top: 14px; padding: 20px 18px; }
    .onboarding-steps { grid-template-columns: 1fr; gap: 17px; }
    .form-grid-2, .form-grid-3, .resumes-grid, .stats-grid { grid-template-columns: 1fr; }
    .form-grid-2 .col-span-2 { grid-column: auto; }
    .preset-toolbar, .page-toolbar { display: grid; min-width: 0; grid-template-columns: 1fr 1fr; }
    .preset-toolbar .toolbar-label, .preset-toolbar select, .page-toolbar .toolbar-label, .page-toolbar select { grid-column: 1 / -1; width: 100%; }
    .callout { margin-top: 0; }
    .search-form { gap: 13px; }
    .form-card-heading { margin-bottom: 18px; }
    .checkbox-group { flex-direction: column; gap: 8px; }
    .checkbox-item { min-height: 38px; }
    .choice-grid { grid-template-columns: 1fr; }
    .choice-card { min-height: 78px; }
    .advanced-summary { align-items: flex-start; padding: 18px; }
    .advanced-content { padding: 18px; }
    .summary-action { min-height: 36px; padding: 0 9px; }
    .inline-notice { align-items: flex-start; flex-direction: column; }
    .inner-details > summary { align-items: flex-start; flex-direction: column; gap: 2px; }
    details.card:not(.advanced-card) > summary { padding: 18px; }
    details.card:not(.advanced-card) > p, details.card:not(.advanced-card) > .form-grid-3 { margin-right: 18px; margin-left: 18px; }
    .summary-hint { display: block; margin: 4px 0 0; }
    .sticky-runbar { position: static; align-items: stretch; flex-direction: column; gap: 13px; padding: 14px; }
    .run-mode-control { align-items: flex-start; }
    .run-actions, .run-actions .btn-primary, .run-actions .btn-danger { width: 100%; }
    .table-wrap { overflow: visible; }
    .stack-table thead { display: none; }
    .stack-table, .stack-table tbody { display: block; width: 100%; }
    .stack-table tr { display: grid; gap: 8px; margin: 0 0 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
    .stack-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 9px; padding: 0; border: 0; }
    .stack-table td::before { content: attr(data-label); color: var(--muted); font-size: 14px; font-weight: 650; }
    .stack-table td[colspan] { display: block; padding: 22px 10px; text-align: center; }
    .stack-table td[colspan]::before { display: none; }
    .stack-table tbody tr:hover { background: var(--surface); }
    .table-wrap.card { padding: 0; border: 0; background: transparent; box-shadow: none; }
    .bar-row { align-items: flex-start; flex-wrap: wrap; }
    .bar-label { width: calc(100% - 42px); min-width: 0; }
    .bar-track { order: 3; flex-basis: 100%; }
    .settings-stack { gap: 13px; }
    .config-section { padding: 18px 17px 20px; }
    .toast { right: 14px; bottom: 92px; left: 14px; max-width: none; }
    .onboarding-steps-4 { grid-template-columns: 1fr; }
    .today-grid strong { font-size: 22px; }
    .page-toolbar.tabs { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .page-toolbar.tabs > .tab { grid-column: auto; }
    .tab { padding: 0 6px; white-space: normal; line-height: 1.2; }
    .schedule-grid { grid-template-columns: 1fr 1fr; }
    .schedule-grid > .form-group:first-child { grid-column: 1 / -1; }
    .weekday-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
    .weekday-chip span { min-width: 0; padding: 0; }
    .running-notice-line { white-space: normal; }
    .log-view { font-size: 12.5px; padding: 10px; }
    .progress-log.log-view { max-height: 300px; }
    .login-card { padding: 22px 18px; }
    .next-runs small { max-width: 50%; }
    .quick-chip { flex: 1 1 auto; }
    .pager .btn-sm { width: 100%; }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 90;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        height: calc(76px + env(safe-area-inset-bottom));
        grid-template-columns: repeat(5, minmax(0, 1fr));
        padding: 7px 5px max(7px, env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        box-shadow: 0 -8px 24px color-mix(in srgb, var(--ink) 7%, transparent);
        backdrop-filter: blur(14px);
    }
    .mobile-nav-link { display: flex; min-width: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 3px 1px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 650; }
    .mobile-nav-link.active { color: var(--accent); font-weight: 750; }
    .mobile-nav-icon { display: grid; min-width: 42px; height: 28px; place-items: center; border-radius: 99px; transition: background-color 160ms ease, transform 120ms ease; }
    .mobile-nav-icon svg { width: 21px; height: 21px; }
    .mobile-nav-link.active .mobile-nav-icon { background: var(--accent-soft); }
    .mobile-nav-link:active .mobile-nav-icon { transform: scale(0.9); }
    .mobile-more-menu { position: fixed; z-index: 110; inset: 0; display: block; }
    .mobile-menu-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: color-mix(in srgb, var(--ink) 42%, transparent); }
    .mobile-menu-sheet { position: absolute; right: 0; bottom: 0; left: 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--surface); box-shadow: var(--shadow); }
    .mobile-menu-handle { width: 42px; height: 5px; margin: 0 auto 14px; border-radius: 99px; background: var(--line); }
    .mobile-menu-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
    .mobile-menu-header h2 { margin: 2px 0 0; font-size: 25px; letter-spacing: -0.03em; }
    .mobile-menu-link { display: flex; width: 100%; min-height: 72px; align-items: center; gap: 12px; padding: 12px 4px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
    .mobile-menu-link .nav-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
    .mobile-menu-link .nav-mark svg { width: 18px; height: 18px; }
    .mobile-menu-link > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
    .mobile-menu-link strong { font-size: 15px; }
    .mobile-menu-link small { color: var(--muted); font-size: 14px; }
    .menu-arrow { display: grid; place-items: center; color: var(--muted); transition: color 160ms ease, transform 160ms ease; }
    .menu-arrow svg { width: 18px; height: 18px; }
    .mobile-menu-link:hover .menu-arrow { color: var(--accent); transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
