:root {
    color-scheme: dark;
    --bg: #0b1020;
    --bg-soft: #11182d;
    --panel: rgba(16, 24, 40, 0.92);
    --border: rgba(148, 163, 184, 0.18);
    --text: #e5eefc;
    --muted: #9fb0cc;
    --accent: #7dd3fc;
    --accent-strong: #38bdf8;
    --danger: #fb7185;
    --shadow: 0 30px 80px rgba(2, 6, 23, 0.45);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.14), transparent 22%),
        linear-gradient(180deg, #050816 0%, var(--bg) 100%);
    color: var(--text);
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: #bfe9ff;
}

.app-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 64px;
}

.admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(16, 24, 40, 0.76);
}

.admin-nav__links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-nav__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.admin-nav__link, .logout-button {
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: 650;
}

.admin-nav__link {
    color: var(--muted);
}

.admin-nav__link:hover, .admin-nav__link--active {
    color: var(--text);
    border-color: rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.62));
}

.logout-button {
    cursor: pointer;
    color: #fecdd3;
    background: rgba(251, 113, 133, 0.10);
    border-color: rgba(251, 113, 133, 0.28);
}

.logout-button:hover {
    background: rgba(251, 113, 133, 0.18);
}

.scheduler-toggle {
    padding: 9px 14px;
    border: 1px solid;
    border-radius: 10px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.scheduler-toggle--enabled {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, 0.42);
    background: rgba(251, 113, 133, 0.14);
}

.scheduler-toggle--enabled:hover {
    background: rgba(251, 113, 133, 0.24);
}

.scheduler-toggle--disabled {
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(34, 197, 94, 0.14);
}

.scheduler-toggle--disabled:hover {
    background: rgba(34, 197, 94, 0.24);
}

.empty-panel {
    min-height: 220px;
}

.login-shell {
    width: min(440px, calc(100% - 32px));
    min-height: 100vh;
    display: grid;
    place-items: center;
    margin: 0 auto;
}

.login-card {
    width: 100%;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.login-form label {
    color: var(--muted);
    font-size: 0.9rem;
}

.login-form input {
    width: 100%;
    margin-bottom: 8px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    font: inherit;
}

.login-form input:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.login-form .hero-link {
    width: 100%;
    margin-top: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    appearance: none;
}

.login-form .hero-link:focus {
    outline: none;
    border-color: rgba(125, 211, 252, 0.8);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 16px 40px rgba(14, 165, 233, 0.32);
}

/* Keep browser password-manager autofill consistent with the login form. */
.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus,
.login-form input:autofill {
    -webkit-text-fill-color: var(--text);
    caret-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.75) inset;
    box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.75) inset;
    border-color: var(--border);
    transition: background-color 9999s ease-out;
}

.login-message {
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 10px;
}

.login-message--error {
    color: #fecdd3;
    background: rgba(251, 113, 133, 0.14);
}

.login-message--success {
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.14);
}

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 36px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    background: linear-gradient(135deg, rgba(17, 24, 45, 0.96), rgba(8, 15, 30, 0.95));
    box-shadow: var(--shadow);
}

.hero--compact {
    align-items: center;
}

.hero--details .hero-details-content {
    min-width: 0;
}

.hero--details h1 {
    max-width: 100%;
    font-size: clamp(1.35rem, 2.4vw, 2.25rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.hero--details .lead {
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.hero--details.process-success {
    border-color: rgba(74, 222, 128, 0.68);
}

.hero--details.process-danger {
    border-color: rgba(251, 113, 133, 0.72);
}

.hero--details.process-neutral {
    border-color: var(--border);
}

.eyebrow {
    margin: 0 0 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--accent);
}

h1, h2, p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.02;
}

.lead {
    margin-bottom: 0;
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.02rem;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-strong), #0ea5e9);
    color: #04111f;
    font-weight: 700;
    box-shadow: 0 16px 40px rgba(14, 165, 233, 0.32);
    min-width: 180px;
    flex-shrink: 0;
    white-space: nowrap;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.refresh-note {
    color: var(--muted);
    font-size: 0.85rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.analysis-charts-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin: 18px 0;
}

.analysis-chart-filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.analysis-chart-filters label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.analysis-chart-filters input {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
    font: inherit;
}

.analysis-chart-panel {
    min-width: 0;
}

.analysis-chart {
    min-width: 0;
    padding-top: 12px;
}

.analysis-chart__plot {
    position: relative;
    height: 230px;
    padding-left: 34px;
    border-bottom: 1px solid var(--border);
}

.analysis-chart__grid,
.analysis-chart__bars {
    position: absolute;
    inset: 0 0 0 34px;
}

.analysis-chart__grid {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.analysis-chart__grid-line {
    position: relative;
    height: 1px;
    border-top: 1px dashed rgba(148, 163, 184, 0.16);
}

.analysis-chart__grid-line span {
    position: absolute;
    right: calc(100% + 8px);
    top: -9px;
    color: var(--muted);
    font-size: 0.68rem;
}

.analysis-chart__bars,
.analysis-chart__labels {
    display: flex;
    align-items: end;
    gap: 5px;
    overflow-x: auto;
}

.analysis-chart__bars {
    align-items: end;
}

.analysis-chart__bar {
    position: relative;
    display: flex;
    flex: 1 0 18px;
    min-height: 0;
    flex-direction: column-reverse;
    border-radius: 5px 5px 0 0;
    overflow: visible;
    cursor: help;
    background: rgba(148, 163, 184, 0.08);
}

.analysis-chart__tooltip {
    position: fixed;
    z-index: 5;
    transform: translate(-50%, -100%);
    display: none;
    min-width: 150px;
    padding: 9px 11px;
    border: 1px solid rgba(125, 211, 252, 0.35);
    border-radius: 9px;
    background: #0f172a;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.5);
    color: var(--text);
    font-size: 0.75rem;
    line-height: 1.45;
    pointer-events: none;
    white-space: nowrap;
}

.analysis-chart__tooltip--visible {
    display: grid;
}

.analysis-chart__tooltip strong {
    margin-bottom: 3px;
    color: var(--accent);
}

.analysis-chart__bar-success {
    min-height: 0;
    background: #38bdf8;
}

.analysis-chart__bar-error {
    min-height: 0;
    background: #fb7185;
}

.analysis-chart__bar-rejected {
    min-height: 0;
    background: #f59e0b;
}

.analysis-chart__bar-skipped {
    min-height: 0;
    background: #94a3b8;
}

.analysis-chart__labels {
    margin-left: 34px;
    padding-top: 7px;
}

.analysis-chart__labels span {
    flex: 1 0 18px;
    color: var(--muted);
    font-size: 0.65rem;
    text-align: center;
    white-space: nowrap;
}

.analysis-chart__legend {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.78rem;
}

.analysis-chart__legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.analysis-chart__legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
}

.analysis-chart__legend-success {
    background: #38bdf8;
}

.analysis-chart__legend-error {
    background: #fb7185;
}

.analysis-chart__legend-rejected {
    background: #f59e0b;
}

.analysis-chart__legend-skipped {
    background: #94a3b8;
}

.stat-card, .panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.stat-card {
    position: relative;
    padding: 18px;
    padding-right: 52px;
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--text);
    transition: transform 160ms ease, border-color 160ms ease;
}

a.stat-card:hover,
a.stat-card:focus-visible {
    z-index: 2;
    color: var(--text);
    border-color: rgba(56, 189, 248, 0.48);
    transform: translateY(-2px);
}

.stat-card__help {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(125, 211, 252, 0.45);
    border-radius: 50%;
    color: var(--accent);
    background: rgba(15, 23, 42, 0.82);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card__help::before {
    content: "";
    position: absolute;
    top: calc(100% + 4px);
    right: 7px;
    border: 6px solid transparent;
    border-bottom-color: #25324a;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease;
    pointer-events: none;
}

.stat-card__help::after {
    content: attr(data-tooltip);
    position: absolute;
    z-index: 4;
    top: calc(100% + 15px);
    right: -8px;
    width: min(260px, calc(100vw - 48px));
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    color: var(--text);
    background: #172137;
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease;
    pointer-events: none;
}

.stat-card__help:hover::before,
.stat-card__help:hover::after,
a.stat-card:focus-visible .stat-card__help::before,
a.stat-card:focus-visible .stat-card__help::after {
    opacity: 1;
    transform: translateY(0);
}

.stat-card > span:not(.stat-card__help) {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.stat-card strong {
    font-size: clamp(1.5rem, 2vw, 2.2rem);
}

.stat-card__split-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-card__split-value small {
    color: var(--muted);
    font-size: 0.65em;
    font-weight: 500;
}

.stat-card__timings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.stat-card__timings > div {
    display: grid;
    gap: 4px;
}

.stat-card__timings > div + div {
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.stat-card__timings strong {
    font-size: clamp(1.2rem, 1.8vw, 1.8rem);
}

.stat-card__timings small {
    color: var(--muted);
    font-size: 0.75rem;
}

.stat-card--primary {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.26), rgba(17, 24, 45, 0.95));
}

.stat-card--danger strong {
    color: var(--danger);
}

.processing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.report-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 14px;
}

.report-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 650;
}

.report-form input {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: rgba(15, 23, 42, 0.8);
    font: inherit;
}

.form-error {
    margin: 14px 0 0;
    color: var(--danger);
}

.report-actions {
    vertical-align: middle;
}

.report-actions-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.settings-form {
    display: grid;
    gap: 16px;
}

textarea {
    width: 100%;
    resize: vertical;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    font: inherit;
}

.phrase-add-form {
    gap: 8px;
}

.phrase-add-form label {
    color: var(--muted);
    font-size: 0.9rem;
}

.phrase-add-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.phrase-add-row input {
    min-width: 0;
    flex: 1;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: var(--text);
    font: inherit;
}

.phrase-actions {
    display: flex;
    gap: 8px;
}

.phrase-actions form {
    margin: 0;
}

.table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border: 1px solid rgba(56, 189, 248, 0.32);
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.10);
    color: var(--accent);
    cursor: pointer;
    font: inherit;
}

.table-action:hover {
    background: rgba(56, 189, 248, 0.18);
}

.table-action--danger {
    border-color: rgba(251, 113, 133, 0.32);
    background: rgba(251, 113, 133, 0.10);
    color: #fecdd3;
}

.table-action--danger:hover {
    background: rgba(251, 113, 133, 0.18);
}

.phrase-enabled {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}

.phrase-disabled {
    color: var(--muted);
    background: rgba(148, 163, 184, 0.12);
}

.panel {
    padding: 24px;
    margin-bottom: 24px;
}

.panel-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

th, td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    vertical-align: top;
}

th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(125, 211, 252, 0.12);
    color: var(--accent);
    font-weight: 600;
}

.table-status-cell {
    text-align: center;
    vertical-align: middle;
}

table td:has(.status-pill) {
    text-align: center;
    vertical-align: middle;
}

table td:has(.table-action) {
    text-align: center;
    vertical-align: middle;
}

.email-search {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.email-search label {
    color: var(--muted);
    font-size: 0.85rem;
}

.email-search input {
    min-height: 36px;
    min-width: 220px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--bg-soft);
    font: inherit;
}

.status-pill.status-success {
    border: 1px solid rgba(74, 222, 128, 0.62);
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}

.status-pill.status-danger {
    border: 1px solid rgba(251, 113, 133, 0.68);
    color: #fecdd3;
    background: rgba(225, 29, 72, 0.12);
}

.status-pill.status-neutral {
    border: 1px solid rgba(125, 211, 252, 0.12);
}

.email-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.email-page-size label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

.email-page-size select {
    min-height: 38px;
    padding: 7px 32px 7px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--bg-soft);
    font: inherit;
}

.email-filter, .pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.62);
}

.email-filter:hover, .email-filter--active, .pagination-link:hover {
    color: var(--text);
    border-color: rgba(56, 189, 248, 0.48);
    background: rgba(56, 189, 248, 0.13);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
}

.pagination__pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pagination-link--number {
    min-width: 38px;
    padding-right: 9px;
    padding-left: 9px;
}

.pagination-link--active {
    color: #04111f;
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    font-weight: 750;
}

.pagination-link--active:hover {
    color: #04111f;
    background: var(--accent);
}

.pagination__ellipsis {
    min-width: 24px;
    color: var(--muted);
    text-align: center;
}

.pagination-link--disabled {
    pointer-events: none;
    opacity: 0.4;
}

.recent-emails-panel table {
    font-size: 0.88rem;
}

.recent-emails-panel th {
    font-size: 0.7rem;
}

.recent-emails-panel td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.recent-emails-panel td:last-child {
    vertical-align: middle;
}

.email-list-table {
    font-size: 0.78rem;
}

.email-list-table th {
    font-size: 0.68rem;
}

.email-list-table td:nth-child(3),
.email-list-table td:last-child {
    vertical-align: middle;
}

.dashboard-tabs-panel {
    overflow: hidden;
}

.dashboard-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 16px 18px 0;
    border-bottom: 1px solid var(--border);
}

.dashboard-tab {
    padding: 10px 14px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-weight: 650;
}

.dashboard-tab:hover,
.dashboard-tab--active {
    color: var(--text);
    border-color: var(--border);
    background: rgba(56, 189, 248, 0.10);
}

.dashboard-tab-panel {
    padding: 24px;
}

.dashboard-tab-panel[hidden] {
    display: none;
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 32px 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.detail-grid--single-column {
    grid-template-columns: 1fr;
    gap: 10px;
}

.detail-grid--single-column .detail-item {
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.42);
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.detail-grid--single-column .detail-item:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.62));
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.10);
}

.analysis-summary-grid .detail-item {
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.analysis-summary-grid .detail-item:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.62));
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.10);
}

.detail-grid--single-column .detail-item--title {
    padding: 20px 22px;
    border-color: rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.62));
}

.detail-item--title .detail-label {
    color: var(--accent);
}

.detail-item--title .detail-value {
    font-size: 1.2rem;
    font-weight: 650;
}

.analysis-summary-grid {
    gap: 12px;
}

.analysis-summary-grid .detail-item {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.detail-value--highlight {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 700;
}

.analysis-items {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.28);
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.summary:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.62));
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.10);
}

.analysis-items h3 {
    margin-bottom: 12px;
}

.analysis-items table tbody tr {
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.analysis-items table tbody tr:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.62));
    box-shadow: inset 0 1px 0 rgba(56, 189, 248, 0.35), inset 0 -1px 0 rgba(56, 189, 248, 0.35);
}

.detail-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.74rem;
}

.detail-value {
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.detail-help {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.82rem;
}

.kalypso-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    line-height: 1.7;
}

.kalypso-path__stage {
    color: var(--muted);
}

.kalypso-path__stage--active {
    color: var(--text);
    font-weight: 800;
}

.kalypso-path__separator {
    margin-left: 7px;
    color: var(--muted);
    font-weight: 400;
}

.body-block, .summary {
    margin: 0;
    padding: 18px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.14);
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.summary {
    margin-top: 18px;
}

@media (max-width: 1180px) {
    .stats-grid, .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .processing-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .app-shell {
        width: min(100% - 20px, 1240px);
        padding-top: 16px;
    }

    .admin-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-nav__actions {
        justify-content: flex-end;
    }

    .hero, .panel {
        padding: 18px;
    }

    .stats-grid, .detail-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }

    .phrase-add-row {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination__pages {
        order: -1;
        width: 100%;
    }
}
