/* Shared icon geometry; desktop labels stay visible. */
.ui-icon { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.responsive-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.responsive-action .ui-icon { display: none; }
.mobile-only { display: none; }
.summary-disclosure > summary, .form-disclosure > summary { cursor: pointer; font-weight: 700; }
.action-feedback:empty { display: none; }
.action-feedback { color: var(--text-muted); font-size: 13px; }

/* Layout display rules must not reveal loading, error or action panels. */
[hidden] { display: none !important; }
#recent-sidebar:not(:has(.sidebar-actions:not([hidden]))) { display: none; }

@media (max-width: 719px) {
    :root { --paper-shadow: none; --soft-shadow: none; }
    html { scroll-padding-top: 64px; }
    .desktop-only { display: none; }
    body > header { justify-content: space-between; }
    body { background: var(--bg); }
    body.report-page { padding-bottom: 0; }
    body > header { padding: 4px 12px; min-height: 52px; gap: 8px; flex-wrap: nowrap; background: var(--surface); border-bottom: 1px solid var(--border); }
    body > header .logo { font-size: 17px; gap: 6px; white-space: nowrap; }
    body > header .logo-mark { width: 24px; height: 24px; }
    body > header .tagline { display: none; }
    body > header .account-nav { gap: 2px; }
    body > header .account-nav a[href="/login"] { display: flex; align-items: center; padding: 0 12px; border-radius: 8px; background: var(--accent-bg); color: var(--accent); font-size: 13px; font-weight: 600; }
    body > header .account-nav a, body > header .account-nav-logout button { min-height: 48px; min-width: 48px; }
    main { padding: 16px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
    .responsive-action .ui-icon, .mobile-only { display: inline-block; }
    .responsive-action .action-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
    .responsive-action { min-width: 48px; min-height: 48px; padding: 10px !important; }
    input:not([type=hidden]):not([type=checkbox]), select, textarea { font-size: 16px !important; min-width: 0; }
    button, .btn { min-height: 48px; }
    body > footer { display: none; }

    /* Admin rows retain one DOM source so live filtering updates both layouts. */
    .admin-shell { padding: 0; margin: 0; width: 100%; }
    .admin-heading { gap: 8px; margin-bottom: 8px; }
    .admin-heading h1 { font-size: 23px; margin: 4px 0; overflow-wrap: anywhere; }
    .admin-heading .report-eyebrow { display: none; }
    .admin-heading p { margin: 4px 0; font-size: 12px; }
    .admin-tabs { gap: 4px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
    .admin-tabs a { border: 0; border-radius: 6px; font-size: 13px; }
    .admin-tabs a.active { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px #20273312; }
    .admin-tabs a { padding: 10px 12px; min-height: 48px; }
    .admin-global-filter { padding: 0; margin: 8px 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
    .admin-global-filter input { min-height: 48px; }
    .admin-table-wrap { overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
    .admin-filter-table, .admin-filter-table tbody { display: block; min-width: 0; width: 100%; }
    .admin-filter-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .admin-filter-table tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 48px 10px 0; gap: 3px 8px; border-bottom: 1px solid var(--border); }
    .admin-filter-table td { display: block; padding: 0; border: 0; font-size: 12px; overflow-wrap: anywhere; }
    .admin-filter-table td:first-child { grid-column: 1 / -1; color: var(--text); font-weight: 600; font-size: 15px; }
    .admin-filter-table td:nth-child(2), .admin-filter-table td:nth-child(6) { grid-column: 1 / -1; }
    .admin-filter-table td[data-label=Роль] { color: var(--text-muted); }
    .admin-filter-table td:first-child .admin-badge { display: block; width: fit-content; margin: 4px 0; font-size: 10px; }
    .admin-filter-table tr { padding-top: 14px; padding-bottom: 14px; gap: 5px 8px; }
    .admin-filter-table td[data-label=Отчёт] { color: var(--accent); }
    .admin-filter-table td[data-label=Баланс]::before { content: 'Баланс: '; }
    .admin-filter-table td[data-label=Проверки]::before { content: 'Проверки: '; }
    .admin-filter-table td:last-child:not(:first-child) { position: absolute; right: 0; top: 8px; }
    .admin-filter-table td .responsive-action { color: var(--accent); }
    .admin-table time { font-size: 12px; white-space: normal; }
    .admin-pagination { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
    .admin-pagination a { min-width: 48px; min-height: 48px; display: inline-flex; justify-content: center; align-items: center; }
    .admin-badge { white-space: normal; }
    .admin-form, .credit-admin-panel, .danger-zone { padding: 14px; border: 1px solid var(--border); box-shadow: none; border-radius: 10px; }
    .admin-form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .admin-form > label:first-of-type, .admin-form > button { grid-column: 1 / -1; }
    .admin-form label, .admin-form-inline label, .danger-zone label { font-size: 12px; }
    .admin-user-shell .btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: none; }
    .admin-user-shell .btn { font-size: 13px; padding: 10px; }
    .credit-admin-panel > p { font-size: 12px; line-height: 1.5; }
    .credit-admin-history li { grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
    .credit-admin-history time { white-space: normal; font-size: 11px; }
    .credit-admin-history .credit-report-icon { width: 48px; height: 48px; }
    .admin-user-shell h2 { font-size: 19px; }

    /* Report: keep recommendations visible and only one action strip. */
    .layout-with-sidebar { position: relative; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .report-back { position: absolute; top: 0; left: 0; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; color: var(--accent); }
    .report-header { padding: 8px 0 8px 48px; border: 0; border-radius: 0; gap: 5px; margin-bottom: 8px; background: transparent; box-shadow: none; color: var(--text); }
    .report-header h1 { font-size: 22px; overflow-wrap: anywhere; }
    .report-header h1, .report-header a { color: var(--text); }
    .report-header .report-eyebrow { display: none; }
    .report-meta-card .ts { color: var(--text-muted); }
    .report-eyebrow { font-size: 10px; margin-bottom: 5px; }
    .report-meta-card { padding: 0; border: 0; border-radius: 0; background: transparent; }
    .report-meta-card .meta-label { display: none; }
    .audit-overview { gap: 8px; }
    .readiness-card, .metric-card, .priority-card, .summary-card, details.block-collapsible { background: var(--surface); box-shadow: none; border: 1px solid var(--border); border-radius: 10px; }
    .readiness-card { padding: 10px 12px; border-radius: 10px; }
    .score-ring { width: 48px; height: 48px; flex-basis: 48px; }
    .score-ring span { font-size: 18px; }
    .risk-title { font-size: 17px; }
    .readiness-card p { margin: 4px 0 0; font-size: 12px; }
    .metric-card { min-height: 60px; border-radius: 10px; padding: 8px 10px; }
    .metric-card span { display: block; font-size: 12px; line-height: 1.25; letter-spacing: 0; text-transform: none; }
    .metric-card strong { margin-top: 4px; font-size: 15px; }
    .priority-card { display: block; border-radius: 12px; padding: 12px; }
    .priority-card li:nth-child(n+3) { display: grid; }
    .summary-card { padding: 10px 12px; border-radius: 12px; }
    details.block-collapsible > summary.block-title { min-height: 48px; padding: 12px 40px 12px 12px; font-size: 14px; }
    .sidebar-actions:not([hidden]) { left: 0; right: 0; bottom: 0; display: flex; flex-direction: row; align-items: center; justify-content: space-around; gap: 4px; padding: 5px 12px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); border-radius: 0; background: var(--surface); box-shadow: none; }
    .sidebar-actions form { display: contents; }
    .sidebar-actions .btn, .sidebar-actions .rerun-form button, .sidebar-actions .account-saved { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 48px; width: 48px; height: 48px; min-width: 48px; min-height: 48px; margin: 0; border: 0; padding: 10px; background: transparent; }
    .sidebar-actions .btn, .sidebar-actions .rerun-form button, .sidebar-actions .account-saved { flex: 1; width: auto; flex-direction: column; gap: 3px; padding: 3px !important; }
    .summary-disclosure > summary { min-height: 28px; line-height: 28px; }
    .form-disclosure { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
    .form-disclosure > summary { position: relative; min-height: 48px; padding: 12px 22px 12px 0; font-size: 14px; line-height: 1.5; list-style: none; }
    .form-disclosure > summary::after { content: '+'; position: absolute; right: 0; top: 12px; font-size: 20px; color: var(--text-muted); }
    .form-disclosure[open] > summary::after { content: '−'; }
    .form-disclosure .kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: 12px; }
    .form-disclosure .kv dt, .form-disclosure .kv dd { margin: 0; padding: 8px 0; font-size: 12px; letter-spacing: 0; text-transform: none; overflow-wrap: anywhere; }
    .form-disclosure .kv .form-issue-label, .form-disclosure .kv .form-issues { grid-column: 1 / -1; }
    .form-disclosure .kv-list { padding-left: 14px; }
    .mobile-action-caption { font-size: 10px; line-height: 1.2; font-weight: 500; }
    .report-page #recent-sidebar { padding: 0; margin: 0; border: 0; background: transparent; box-shadow: none; }
    .report-page .sidebar-title { display: none; }
    .action-feedback:not(:empty) { position: fixed; left: 12px; right: 12px; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 46; padding: 10px 12px; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }

    .home-shell { margin: 0; gap: 12px; }
    .home-hero { margin: 0; padding: 0; border-radius: 0; box-shadow: none; background: transparent; }
    .home-hero h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.035em; margin: 6px 0 8px; }
    .home-hero .report-eyebrow { display: none; }
    .home-hero .lead { font-size: 14px; margin: 0 0 12px; line-height: 1.45; }
    .home-hero .alert { padding: 10px 12px; font-size: 12px; margin: 10px 0; }
    .home-hero .audit-form { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px; }
    .home-hero .audit-form input { width: 100%; padding: 10px 12px; min-height: 48px; border-radius: 10px; }
    .home-hero .audit-form button { width: 48px; min-height: 48px; border-radius: 10px; }
    .home-hero .audit-form-legal { grid-column: 1 / -1; font-size: 11px; }
    .home-hero .note { order: 1; font-size: 12px; margin: 10px 0 0; }
    .home-hero .note .mobile-only { display: flex; gap: 6px; align-items: center; }
    .home-hero .note .ui-icon { width: 14px; height: 14px; flex-basis: 14px; }
    .home-hero .audit-form { margin: 4px 0 0; }
    .home-hero .audit-form button { background: var(--accent); color: #fff; box-shadow: none; }
    .home-hero .audit-form-legal { color: var(--text-muted); line-height: 1.5; margin: 0; }
    .home-hero .audit-form-legal a { color: inherit; }
    .home-aside { grid-template-rows: auto auto; gap: 10px; margin-top: 8px; }
    .home-aside-card, .home-score-card { background: var(--surface); border: 1px solid var(--border); box-shadow: none; color: var(--text); }
    .home-score-card { position: relative; }
    .home-score-card strong { color: var(--text); font-size: 16px; letter-spacing: -0.02em; }
    .home-score-card p { font-size: 12px; color: var(--text-muted); margin-top: 6px; max-width: 210px; line-height: 1.5; }
    .home-score-card .home-kicker { color: var(--text-muted); font-size: 10px; letter-spacing: .06em; margin-bottom: 8px; }
    .home-example-link { display: flex; align-items: center; gap: 3px; color: var(--accent); text-decoration: none; font-size: 12px; margin-top: 12px; }
    .home-checks { gap: 9px; }
    .home-checks li { font-size: 13px; gap: 8px; }
    .home-checks li::before { width: 5px; height: 5px; flex-basis: 5px; box-shadow: none; margin-top: 6px; }
    .home-aside-card .home-kicker { margin-bottom: 10px; }
    .home-seo-links { padding: 14px 0 0; }
    .home-seo-links h2, .section-heading h2, .home-faq h2 { font-size: 19px; letter-spacing: -.025em; line-height: 1.25; }
    .home-seo-links .home-kicker, .section-heading .home-kicker { display: none; }
    .home-seo-links .seo-link-grid { gap: 0; }
    .home-seo-links .seo-link-grid a { min-height: 48px; padding: 12px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
    .example-reports { margin-top: 24px; }
    .section-heading p { font-size: 12px; }
    .example-grid { gap: 10px; }
    .example-card { background: var(--surface); box-shadow: none; border: 1px solid var(--border); }
    .example-card p { font-size: 13px; line-height: 1.5; }
    .example-card .example-button { min-height: 48px; padding: 10px 12px; background: var(--accent-bg); color: var(--accent); box-shadow: none; font-size: 13px; }
    .seo-landing-shell { margin: 0; gap: 16px; }
    .seo-landing-hero { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: none; }
    .seo-landing-hero h1 { font-size: 26px; line-height: 1.15; }
    .seo-landing-hero .lead { font-size: 14px; margin-bottom: 14px; }
    .seo-landing-hero .report-eyebrow { color: var(--text-muted); }
    .seo-landing-hero .btn { font-size: 13px; padding: 10px 12px; box-shadow: none; }
    .auth-card { width: 100%; margin: 0; padding: 8px 0 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
    .auth-card h1 { font-size: 24px; }
    .auth-card .report-eyebrow { display: none; }
    .auth-card > p { font-size: 13px; color: var(--text-muted); }
    .auth-form { margin-top: 20px; gap: 14px; }
    .auth-form label { font-size: 12px; }
    .auth-form input:not([type=checkbox]) { background: var(--surface); padding: 11px 12px; }
    .auth-form .btn-primary { background: var(--accent); color: #fff; border: 0; border-radius: 8px; box-shadow: none; }
    .auth-consent { line-height: 1.5; }
    .auth-switch { font-size: 13px; }
    .empty-state { padding: 24px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-top: 16px; }
    .empty-state h2 { font-size: 18px; }
    .empty-state p { font-size: 13px; }
    .home-aside-card, .example-card { padding: 14px; border-radius: 12px; }
    .home-aside-card strong { font-size: 16px; }
    .section-heading h2 { font-size: 19px; }
    .example-card h3 { font-size: 18px; }
    .cookie-consent { bottom: env(safe-area-inset-bottom); }
}

@media (max-width: 359px) {
    details.block-collapsible > summary.block-title { display: block; }
    details.block-collapsible > summary.block-title > .badge { display: table; margin-top: 6px; }
}

@media (min-width: 720px) and (max-width: 959px) {
    .report-header { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 20px; gap: 16px; border-radius: 16px; }
    .report-header h1 { font-size: 28px; overflow-wrap: anywhere; }
    .report-header .report-title-wrap > p { display: none; }
    .report-meta-card { padding: 12px; min-width: 0; }
    .report-meta-card .ts { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .responsive-action, .account-section-nav a, .account-disclosure-summary::after { transition: none; }
    .badge-icon-button.is-loading svg { animation: none; }
}

@media (max-width: 479px) {
    .admin-pagination { gap: 4px 12px; }
    .admin-page-links { margin-left: auto; }
    .admin-page-sizes { order: 3; flex-basis: 100%; }
}
