/* Shared admin presentation. Public landing templates keep their own styles. */
:root {
    --ink: #203735;
    --muted: #637571;
    --teal: #15786b;
    --navy: #163f37;
    --bg: #f3f6f5;
    --line: #dfe8e4;
    --radius: 16px;
    --shadow: 0 3px 16px #183e3405;
}
body { font-size: 14px; line-height: 1.55; }
h1, h2, h3, h4, .brand { letter-spacing: -.035em; }
h1 { font-size: 29px; }
h2, .section-heading h2, .conversion-card h2 { font-size: 19px; }
h3 { font-size: 17px; margin-bottom: 18px; }
p { overflow-wrap: anywhere; }
small, .small, label small, .pill, .timezone, .chip, .kpi p,
.report-section > summary > span:nth-child(2), .pagination,
.app-footer, .app-footer a, .period-badge small, .trend-day,
.website-metrics span, .method, .card-bottom, .section-editor summary span {
    font-size: 12px; line-height: 1.5;
}
label, .topnav a, .tabs a, .back-link, .text-link, .number-link,
.snapshot-line, .explanation, summary, .check, .explanation summary,
.inline-details summary, .section-editor summary { font-size: 13px; }
.eyebrow { font-size: 10px; letter-spacing: .13em; }
label { gap: 6px; min-width: 0; }
input, select, textarea, td input, td select, .date-form input, .token-row input {
    min-width: 0; min-height: 44px; font-size: 14px; border-radius: 9px;
    border-color: #d7e2dc; padding: 10px 12px; box-shadow: 0 1px 2px #183e3403;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
input::placeholder, textarea::placeholder { color: #7a8983; }
button, .button, .save-bar button, .save-bar .button {
    min-height: 42px; padding: 10px 15px; border-radius: 9px; font-size: 13px;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
button:not(.secondary, .ghost, .icon-button, .dialog-close, .danger-button):hover,
.button:not(.secondary, .ghost, .danger-button):hover { background: #106354; border-color: #106354; }
.secondary { border-color: #d7e2dc; }
.secondary:hover { background: #edf6f1; border-color: #abcabe; color: #156859; }
.small-button { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.icon-button { width: 36px; height: 36px; min-height: 36px; padding: 0; font-size: 21px; }
.dialog-close { width: 32px; min-height: 32px; padding: 0; font-size: 24px; }
.topbar {
    height: 76px; padding: 0 max(28px, calc((100vw - 1380px) / 2)); gap: 48px;
    background: #ffffff; border-bottom-color: var(--line);
}
.brand { font-size: 17px; gap: 10px; }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: #167d6c; }
.topnav { gap: 5px; align-self: center; padding: 4px; background: #f3f6f4; border-radius: 11px; }
.topnav a { padding: 9px 16px; border: 0; border-radius: 8px; font-weight: 600; }
.topnav a.current { color: #146c5b; background: white; box-shadow: 0 1px 5px #173c3510; }
.topnav a:hover { text-decoration: none; color: var(--teal); }
.account-name { font-size: 12px; }
.account-name small { font-size: 11px; font-weight: 400; }
.account-link .avatar { width: 34px; height: 34px; font-size: 13px; background: #e8f3ee; }
.shell { max-width: 1380px; padding: 28px 28px 40px; }
.page-heading { padding: 0; margin: 0 0 24px; gap: 18px; }
.page-heading h1 { margin: 0 0 5px; }
.page-heading p, .overview-hero p { font-size: 14px; }
.back-link { display: inline-flex; margin-bottom: 15px; }
.card, .website-card { border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card { margin-bottom: 20px; }
.card > summary { font-size: 16px; }
.card > h3 { margin-bottom: 16px; }
.pill { border-radius: 6px; padding: 4px 9px; font-size: 11px; }
.green { background: #edf7f0; color: #287451; border-color: #d7ebdf; }
.amber { background: #fff7e8; color: #916620; border-color: #f0e4c8; }
.overview-hero {
    padding: 26px 28px; margin-bottom: 20px; border: 1px solid #dce9e2; border-radius: 18px;
    background: linear-gradient(110deg, #e8f2eb, #f7faf7); align-items: center;
}
.overview-hero h1 { font-size: 29px; }
.overview-hero p { color: #577166; }
.period-badge { flex-shrink: 0; padding: 10px 14px; background: #ffffffb8; border-color: #d7e5db; font-size: 12px; border-radius: 10px; }
.period-badge small { font-size: 11px; margin-top: 3px; }
.kpi-grid { gap: 12px; margin-bottom: 20px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi, .summary-kpis .kpi {
    border-radius: 13px; padding: 17px 18px; position: relative; overflow: hidden;
    border: 1px solid var(--line); box-shadow: var(--shadow);
}
.kpi::before { content: ''; position: absolute; width: 3px; background: #8eb8a1; top: 18px; bottom: 18px; left: 0; border-radius: 0 3px 3px 0; }
.kpi:nth-child(4)::before, .kpi:nth-child(5)::before { background: #177c67; }
.kpi-top, .kpi .small, .summary-kpis .kpi-top { font-size: 12px; line-height: 1.4; font-weight: 500; }
.kpi strong, .summary-kpis .kpi strong { font-size: 29px; font-weight: 700; margin-top: 8px; letter-spacing: -.04em; }
.kpi p { font-size: 11px; margin-top: 4px; }
.overview-panels { gap: 20px; }
.trend-chart { height: 170px; }
.trend-day { font-size: 11px; }
.trend-track { max-width: 44px; border-radius: 7px 7px 3px 3px; background: #f0f5f2; }
.trend-track > div { border-radius: 7px 7px 0 0; background: linear-gradient(#6fad91, #1e816c); }
.conversion-value { font-size: 37px; color: #176e5b; }
.conversion-card p { font-size: 12px; }
.snapshot-line { font-size: 12px; }
.conversion-progress { background: #e9f2ec; height: 6px; }
.conversion-progress span { background: #328e71; }
.section-heading { gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.section-heading > div { min-width: 0; }
.section-heading p { font-size: 12px; }
.workspace-heading { margin-bottom: 16px; }
.workspace-heading h1 { font-size: 26px; }
.workspace-identity { gap: 12px; }
.workspace-status { background: #eaf3ed; color: #46745b; border: 1px solid #dce9df; border-radius: 20px; padding: 4px 9px; font-size: 11px; }
.workspace-status.is-paused { background: #fff6e7; color: #92632b; border-color: #efe3cb; }
.tabs { border: 1px solid var(--line); background: #eaf0ec; border-radius: 12px; gap: 3px; padding: 5px; margin: 0 0 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 16px; border: 0; border-radius: 8px; font-size: 13px; }
.tabs a.active { background: white; color: #176b58; box-shadow: 0 1px 4px #183e3410; }
.tabs a:hover { background: #ffffff80; color: var(--teal); }
.date-card { padding: 16px 20px; }
.date-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12px; font-weight: 600; }
.timezone { font-size: 11px; font-weight: 400; margin: 0; }
.date-form { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 200px) auto; justify-content: start; align-items: end; gap: 10px; }
.date-form label { width: auto; min-width: 0; font-size: 11px; gap: 4px; }
.date-form input { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 40px; padding: 7px 10px; font-size: 14px; -webkit-appearance: none; }
.date-form input::-webkit-date-and-time-value { text-align: left; min-width: 0; }
.date-form input::-webkit-datetime-edit { padding: 0; }
.date-form input::-webkit-calendar-picker-indicator { margin: 0; padding: 0; }
.date-form button { min-height: 40px; margin: 0; font-size: 12px; gap: 0; }
.date-arrow { display: none; }
.quick-dates { gap: 6px; margin-top: 10px; }
.chip { padding: 5px 10px; font-size: 11px; border-radius: 6px; background: #f3f6f4; color: #586f64; text-align: center; }
.chip:hover { background: #e7f0e9; text-decoration: none; }
.chip.selected { background: #e5f3ea; border-color: #b7d8c5; color: #176c53; font-weight: 600; }
.filters { gap: 8px; flex-wrap: nowrap; }
.filters label { min-width: 0; }
.filters input, .filters select { font-size: 13px; min-height: 40px; padding: 8px 10px; }
.filters input { width: 210px; }
.filters select { width: 135px; }
.report-total { display: flex; gap: 16px; justify-content: space-between; align-items: center; background: #edf6f0; border: 1px solid #d8eadf; border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 12px; color: #416754; }
.report-total strong { color: #17684d; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.report-section { border-radius: 11px; margin-top: 12px; }
.report-section > summary { padding: 13px 16px; font-size: 13px; gap: 8px; flex-wrap: nowrap; background: #f7faf8; }
.report-section > summary > span:nth-child(2) { font-size: 11px; margin-left: auto; }
.report-section > summary::after { display: block; font-size: 17px; }
.report-section > summary > span:first-child { gap: 9px; }
table { font-size: 13px; line-height: 1.5; }
th { font-size: 11px; font-weight: 600; background: #f7faf8; color: #61776a; }
th, td { padding: 13px 14px; }
td strong { font-size: 13px; }
td input, td select { font-size: 14px; min-height: 40px; }
.cell-sub { margin-top: 4px; }
.code { font-size: 11px; padding: 3px 6px; background: #edf5f0; color: #2a765c; }
.source { font-size: 11px; padding: 4px 8px; border-radius: 6px; }
.number-link { font-size: 13px; font-weight: 600; }
.text-link { font-size: 12px; }
.report-campaign { max-width: 260px; white-space: normal; min-width: 155px; overflow-wrap: anywhere; }
.report-campaign .code { overflow-wrap: anywhere; }
.report-amount { font-weight: 600; }
.report-links .row { gap: 8px; }
.report-links .small-button { font-size: 11px; min-height: 32px; padding: 6px 9px; }
.report-empty { padding: 24px 16px; font-size: 12px; }
.explanation { font-size: 12px; }
.explanation summary { font-size: 12px; gap: 10px; }
.explanation p { line-height: 1.75; }
.search-toolbar { background: white; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 20px; gap: 8px; }
.search-toolbar input, .search-toolbar select { font-size: 13px; min-height: 42px; }
.search-toolbar > button { font-size: 13px; }
.search-toolbar > a { padding: 8px; font-size: 12px; }
.website-grid { gap: 18px; }
.website-card { padding: 22px; }
.website-card:hover { border-color: #93bca6; box-shadow: 0 6px 24px #183e3409; }
.website-card h2 { font-size: 19px; margin: 18px 0 4px; overflow-wrap: anywhere; }
.website-card > p { font-size: 13px; margin-bottom: 20px; }
.website-symbol { width: 42px; height: 42px; border-radius: 13px; font-size: 19px; background: #eaf3ec; color: #3d7755; }
.website-metrics { background: #f2f7f3; padding: 14px; border-radius: 10px; }
.website-metrics span { font-size: 11px; }
.website-metrics strong { font-size: 22px; overflow-wrap: anywhere; }
.card-bottom { font-size: 11px; border-color: var(--line); }
.website-workspace-link { color: var(--teal); padding-left: 0; background: transparent; border: 0; }
.website-workspace-link::after { border-radius: var(--radius); }
.website-actions { margin-top: 10px; }
.website-actions .ghost { padding-right: 0; }
.overview-shortcut { align-items: center; }
.overview-shortcut p { margin: 0; }
.form-grid { gap: 20px; }
.form-grid > *, .admin-fields > *, .save-bar > *, .doc-section-heading > * { min-width: 0; }
.save-bar { background: white; border: 1px solid var(--line); padding: 16px 20px; gap: 16px; border-radius: 13px; }
.save-bar .row { flex-shrink: 1; }
.notice { padding: 12px 16px; font-size: 13px; border-radius: 10px; }
.admin-dialog { padding: 0; }
.admin-dialog-header p { font-size: 12px; }
.admin-dialog-header h2 { font-size: 20px; }
.admin-dialog-footer { background: #f5f8f5; }
.admin-row-actions { gap: 10px; }
.admin-accounts { padding: 10px 14px; }
.admin-accounts td:first-child strong { font-size: 14px; }
.account-page { max-width: 760px; margin-top: 0; }
.account-page > .card { padding: 26px; }
.account-page .page-heading p { overflow-wrap: anywhere; }
.password-form { margin-top: 22px; gap: 18px; }
.pagination { padding-top: 16px; gap: 12px; font-size: 12px; flex-wrap: wrap; }
.pagination .row { gap: 8px; }
.app-footer { max-width: 1324px; padding: 18px 0 24px; margin: 0 auto; font-size: 11px; gap: 12px; }
.app-footer a { font-size: 11px; }
.toast { max-width: calc(100vw - 32px); font-size: 13px; }
pre, code { font-size: 12px; }
.api-documentation { max-width: none; }
.api-documentation pre { line-height: 1.7; background: #f4f7f5; padding: 16px; }
.api-documentation .card > p { font-size: 13px; }
.integration-keys dd { font-size: 13px; }
.step-number { flex-shrink: 0; font-size: 12px; }
.doc-copy-button { font-size: 12px; min-height: 34px; padding: 7px 10px; }
.integration-step { gap: 9px; }
.doc-section-heading { flex-direction: row; align-items: center; }
.template-picker legend { font-size: 13px; }
.template-choice { border-radius: 12px; }
.login-page { background: #f1f6f2; }
.login-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 1160px; margin: 0 auto; padding: 36px; min-height: 100dvh; align-items: stretch; }
.login-story {
    border-radius: 24px 0 0 24px; padding: 38px; min-height: 600px;
    background: radial-gradient(ellipse at 5% 100%, #40785a 0, transparent 65%), #173f34;
}
.login-story .brand { font-size: 17px; }
.login-story .brand-mark { background: #ffffff18; border: 1px solid #ffffff20; }
.login-story h1 { font-size: clamp(34px, 3.5vw, 49px); font-weight: 600; line-height: 1.16; margin: 0 0 22px; }
.login-story p { font-size: 14px; color: #bfd8c8; max-width: 30ch; line-height: 1.7; }
.login-journey { display: flex; gap: 6px; margin-top: 30px; flex-wrap: wrap; }
.login-journey span { font-size: 11px; padding: 8px 12px; border: 1px solid #ffffff26; border-radius: 20px; color: #d6eade; background: #ffffff08; }
.login-journey span + span::before { content: '→'; margin-right: 9px; color: #9fc8ad; }
.login-bottom { font-size: 11px; color: #b0d1bc; }
.login-form-wrap { background: white; border: 1px solid var(--line); border-left: 0; border-radius: 0 24px 24px 0; padding: 44px; }
.login-form { max-width: 350px; }
.login-form h2 { font-size: 28px; font-weight: 700; margin: 8px 0; }
.login-form > p { font-size: 13px; }
.login-form form { gap: 18px; margin: 26px 0 22px; }
.login-form label { font-size: 12px; }
.login-form input { padding: 11px 12px; }
.login-form input[type=checkbox] { padding: 0; width: 17px; min-height: 17px; }
.login-form .check { font-size: 12px; margin: 0; }
.login-form button { min-height: 46px; padding: 12px 15px; font-size: 14px; }
.login-form > .small { font-size: 12px; margin-bottom: 0; }
@media (min-width: 761px) and (max-width: 1100px) {
    .topbar { padding: 0 24px; gap: 24px; }
    .account-name { max-width: 110px; }
    .account-name small { font-size: 10px; }
    .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
    .kpi, .summary-kpis .kpi { padding: 15px 12px; }
    .kpi .small, .summary-kpis .kpi-top { font-size: 11px; }
    .login-layout { padding: 24px; }
    .login-story, .login-form-wrap { padding: 30px; }
}
@media (max-width: 760px) {
    body { font-size: 13px; }
    h1, .page-heading h1, .overview-hero h1 { font-size: 24px; }
    h2, .section-heading h2, .conversion-card h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    input, select, textarea, .date-form input, .filters input, .filters select,
    .search-toolbar input, .search-toolbar select, td input, td select, .token-row input { font-size: 16px; }
    .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; height: auto; padding: 12px 16px 10px; gap: 10px 12px; }
    .topbar .brand { font-size: 15px; gap: 8px; min-width: 0; }
    .topbar .brand-mark { width: 32px; height: 32px; font-size: 21px; border-radius: 10px; }
    .topbar .account { grid-column: 2; grid-row: 1; margin: 0; gap: 7px; }
    .topbar .account-name { display: none; }
    .topbar .topnav { grid-column: 1 / -1; grid-row: 2; margin: 0; gap: 4px; justify-content: stretch; }
    .topnav a { flex: 1; justify-content: center; font-size: 12px; padding: 7px 12px; min-height: 34px; }
    .account-link .avatar { width: 30px; height: 30px; font-size: 12px; }
    .shell { margin: 0; width: 100%; padding: 20px 16px 28px; }
    .page-heading { margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
    .page-heading p, .overview-hero p { font-size: 13px; }
    .page-heading > .button { width: auto; }
    .page-heading > .row { gap: 8px; }
    .card, .website-card { padding: 17px; border-radius: 14px; margin-bottom: 16px; }
    .card > summary { font-size: 14px; }
    .overview-hero { padding: 20px; border-radius: 15px; gap: 14px; margin-bottom: 16px; }
    .overview-hero h1 { font-size: 25px; }
    .period-badge { padding: 8px 11px; font-size: 11px; }
    .period-badge small { display: inline; margin: 0 0 0 7px; font-size: 10px; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
    .kpi, .summary-kpis .kpi { padding: 13px 14px; border-radius: 11px; }
    .kpi-top, .kpi .small, .summary-kpis .kpi-top { font-size: 11px; }
    .kpi strong, .summary-kpis .kpi strong { font-size: 25px; margin-top: 5px; }
    .kpi p { font-size: 10px; margin-top: 2px; }
    .kpi:last-child { column-gap: 12px; }
    .kpi:last-child strong { margin: 0; }
    .kpi::before { top: 14px; bottom: 14px; }
    .overview-panels { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .section-heading { gap: 12px; margin-bottom: 14px; }
    .section-heading p, .small, label small { font-size: 12px; }
    .trend-chart { height: 155px; gap: 13px; }
    .trend-day { font-size: 10px; }
    .snapshot-line { font-size: 12px; }
    .workspace-heading { gap: 10px; margin-bottom: 14px; }
    .workspace-heading h1 { font-size: 23px; }
    .workspace-heading > .button { font-size: 11px; min-height: 36px; padding: 8px 10px; }
    .workspace-identity { flex-wrap: wrap; gap: 6px 8px; }
    .workspace-status { font-size: 10px; padding: 3px 7px; }
    .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; padding: 4px; gap: 3px; border-radius: 10px; overflow: visible; }
    .tabs a { font-size: 11px; padding: 8px 4px; border-radius: 7px; text-align: center; }
    .date-card { padding: 13px; }
    .date-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; justify-content: stretch; }
    .date-heading { font-size: 11px; margin-bottom: 8px; }
    .timezone { font-size: 10px; }
    .date-form label { width: auto; font-size: 10px; }
    .date-form input { padding: 7px 8px; min-height: 40px; }
    .date-form button { min-height: 40px; font-size: 12px; padding: 8px 12px; }
    .quick-dates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 8px; }
    .chip { display: flex; align-items: center; justify-content: center; padding: 7px 2px; font-size: 11px; white-space: nowrap; }
    .filters { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); width: 100%; gap: 8px; }
    .filters label { min-width: 0; }
    .filters input, .filters select { width: 100%; max-width: none; min-height: 42px; }
    .report-total { padding: 10px 12px; margin-bottom: 12px; font-size: 11px; }
    .report-total strong { font-size: 20px; }
    .campaign-report { padding: 15px; }
    .report-section { border: 0; border-radius: 0; overflow: visible; margin-top: 14px; }
    .report-section > summary { background: #f1f6f2; border: 1px solid var(--line); border-radius: 9px; padding: 11px 10px; gap: 6px; font-size: 12px; }
    .report-section > summary > span:first-child { gap: 7px; }
    .report-section > summary > span:nth-child(2) { font-size: 10px; margin-left: auto; text-align: right; }
    .report-section > summary::after { display: block; font-size: 15px; }
    .report-section .table-scroll { overflow: visible; }
    .report-table, .report-table tbody { display: block; }
    .report-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .report-table tbody tr {
        display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
        padding: 13px 11px 0; margin-top: 10px; border: 1px solid var(--line); border-radius: 11px;
        background: white; white-space: normal; align-items: start;
    }
    .report-table td { display: block; min-width: 0; padding: 10px 4px; border: 0; white-space: normal; overflow-wrap: anywhere; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
    .report-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 400; }
    .report-table .report-campaign { grid-column: 1 / 3; grid-row: 1; min-width: 0; max-width: none; padding: 0 4px 11px; border-bottom: 1px solid var(--line); align-self: stretch; }
    .report-table .report-campaign strong { font-size: 13px; line-height: 1.4; }
    .report-table td.report-campaign::before, .report-table td.report-source::before, .report-table td.report-links::before { display: none; }
    .report-table .report-source { grid-column: 3; grid-row: 1; padding: 0 4px 11px; border-bottom: 1px solid var(--line); text-align: right; align-self: stretch; }
    .report-table .source { padding: 3px 7px; font-size: 10px; }
    .report-table .code { font-size: 10px; }
    .report-table .number-link { font-size: 16px; }
    .report-table small { font-size: 10px; font-weight: 400; }
    .report-table .report-amount { color: #176c53; }
    .report-table .report-links { grid-column: 1 / -1; padding: 9px 4px; margin-top: 2px; border-top: 1px solid var(--line); }
    .report-links .row { justify-content: space-between; }
    .report-links .small { font-size: 11px; font-weight: 400; }
    .report-links .small-button { min-height: 32px; font-size: 11px; }
    .explanation { margin-top: 14px; font-size: 12px; }
    .explanation summary { font-size: 12px; }
    .search-toolbar { flex-wrap: wrap; padding: 10px; gap: 8px; margin-bottom: 16px; }
    .search-toolbar .search-field { flex: 1 0 100%; }
    .search-toolbar > label:not(.search-field) { flex: 1; width: auto; flex-basis: auto; }
    .search-toolbar > button { font-size: 12px; }
    .website-grid { gap: 12px; grid-template-columns: minmax(0, 1fr); }
    .website-card { margin-bottom: 0; padding: 19px; }
    .website-card h2 { margin-top: 15px; }
    .website-card > p { margin-bottom: 16px; }
    .website-metrics { padding: 12px; }
    .website-metrics span { font-size: 10px; }
    .website-metrics strong { font-size: 21px; }
    .website-actions { flex-wrap: nowrap; gap: 8px; }
    .website-actions .button { padding-left: 0; }
    .card-bottom { font-size: 11px; }
    .overview-shortcut { flex-direction: row; align-items: center; gap: 12px; }
    .overview-shortcut .button { flex-shrink: 0; padding: 8px 10px; font-size: 11px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
    .span-2, .span-3 { grid-column: 1 / -1; }
    .save-bar { padding: 14px; align-items: stretch; gap: 12px; }
    .save-bar > .row { display: flex; flex-wrap: wrap; gap: 7px; width: 100%; }
    .save-bar button, .save-bar .button { width: auto; flex: 1 1 auto; font-size: 12px; padding: 10px; }
    .notice { font-size: 12px; }
    .admin-accounts, .campaign-list { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
    .admin-accounts tbody tr, .campaign-list tbody tr { padding: 16px; gap: 13px 12px; border-radius: 13px; margin-bottom: 12px; }
    .admin-accounts td[data-label]::before, .campaign-list td[data-label]::before { font-size: 11px; margin-bottom: 4px; }
    .admin-accounts td, .campaign-list td { font-size: 13px; }
    .admin-accounts td:first-child .small { font-size: 11px; }
    .admin-accounts td:first-child strong { font-size: 15px; }
    .admin-row-actions { justify-content: space-between; gap: 7px; }
    .admin-row-actions .text-link { font-size: 12px; }
    .campaign-key { font-size: 12px; }
    .campaign-list [data-save-status]:empty { display: none; }
    .campaign-list .campaign-row-actions { padding-top: 10px !important; }
    .campaign-list td.empty, .admin-accounts td.empty { grid-column: 1 / -1; }
    .admin-dialog { padding: 0; border-radius: 16px; }
    .admin-dialog-header, .admin-dialog-body { padding: 18px; }
    .admin-dialog-header h2 { font-size: 18px; }
    .admin-dialog-footer { padding: 14px 18px; }
    .account-page { margin: 0; }
    .account-page > .card { padding: 19px; }
    .password-form { gap: 17px; }
    .password-form button { width: 100%; }
    .pagination { gap: 12px; font-size: 11px; }
    .app-footer { margin: 0 16px; padding: 16px 0 20px; gap: 6px 14px; font-size: 10px; flex-wrap: wrap; }
    .app-footer a { font-size: 10px; }
    .doc-section-heading { gap: 10px; align-items: flex-start; }
    .doc-section-heading h3 { font-size: 15px; }
    .api-documentation .card > p, .integration-keys dd { font-size: 12px; }
    .api-documentation th, .api-documentation td { font-size: 12px; padding: 11px; }
    pre, code { font-size: 12px; }
    .token-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .token-row input { grid-column: 1 / -1; }
    .token-row button { font-size: 12px; }
    .template-details { padding: 10px; }
    .template-name { font-size: 12px; }
    .template-description { font-size: 11px; }
    .login-page { background: white; }
    .login-layout { display: flex; flex-direction: column; justify-content: center; min-height: 100dvh; padding: 28px 24px; max-width: 440px; }
    .login-story { display: block; background: none; color: var(--ink); min-height: 0; padding: 0; border-radius: 0; margin-bottom: 34px; overflow: visible; }
    .login-story .brand { color: var(--ink); margin: 0; font-size: 16px; }
    .login-story .brand-mark { background: var(--teal); border: 0; width: 36px; height: 36px; }
    .login-intro, .login-bottom { display: none; }
    .login-form-wrap { display: block; border: 0; border-radius: 0; padding: 0; }
    .login-form { max-width: none; }
    .login-form h2 { font-size: 27px; margin: 7px 0; }
    .login-form > p { font-size: 13px; }
    .login-form form { margin: 23px 0 20px; gap: 16px; }
    .login-form label { font-size: 12px; }
    .login-form input { font-size: 16px; min-height: 46px; }
    .login-form .check { font-size: 12px; }
    .login-form input[type=checkbox] { min-height: 17px; }
    .login-form > .small { font-size: 11px; }
    /* Labelled records expose every metric without horizontal swiping. */
    .record-table, .record-table tbody { display: block; }
    .record-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .record-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding: 14px 0; gap: 12px 16px; }
    .record-table tr:first-child { padding-top: 0; }
    .record-table tr:last-child { border-bottom: 0; padding-bottom: 0; }
    .record-table td { display: block; min-width: 0; border: 0; padding: 0; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
    .record-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
    .record-table td:first-child, .record-table td.empty { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .date-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .date-form button { grid-column: 1 / -1; min-height: 36px; }
    .date-form input { width: 100%; }
    .report-section > summary > span:nth-child(2) { max-width: 45%; }
}
@media (max-width: 359px) {
    .shell { padding-left: 12px; padding-right: 12px; }
    .topbar { padding-left: 12px; padding-right: 12px; }
    .topbar .brand { font-size: 13px; }
    .campaign-report { padding: 12px; }
    .chip { font-size: 10px; }
    .report-table td[data-label]::before { font-size: 10px; }
    .report-table td, .report-table .number-link { font-size: 14px; }
    .report-total strong { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    button, .button { transition: none; }
}

/* Campaign reporting and details */
.report-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.report-filters label { flex: 1 1 145px; }
.report-filters label:last-child { flex-basis: 190px; }
.report-filters input, .report-filters select { width: 100%; max-width: none; }
.report-sort-note { margin: -4px 0 14px; }
.campaign-details-link { color: var(--ink); overflow-wrap: anywhere; }
.campaign-details-link:hover { color: var(--teal); }
.campaign-details-link > span { color: var(--teal); font-size: 12px; }
button.campaign-delete { width: 38px; min-width: 38px; height: 38px; min-height: 38px; padding: 0; color: #a44b48; background: white; border-color: #ecd9d7; }
button.campaign-delete:hover { background: #fff0ee; color: #922e2a; border-color: #d9aaa6; }
button.campaign-delete:focus-visible, .daily-chart [role=button]:focus-visible { outline: 3px solid #15786b; outline-offset: 3px; }
#delete-name-field[hidden] { display: none; }
#delete-heading { overflow-wrap: anywhere; }
.campaign-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 24px; }
.campaign-detail-heading > div { min-width: 0; }
.campaign-detail-heading h1 { overflow-wrap: anywhere; margin: 7px 0 12px; }
.campaign-detail-heading .code { overflow-wrap: anywhere; }
.campaign-detail-actions { flex-shrink: 0; }
.campaign-detail-kpis { grid-template-columns: repeat(3, minmax(0,1fr)); }
.campaign-detail-kpis .kpi:last-child { background: #eaf5ef; }
.campaign-detail-kpis strong { display: block; overflow-wrap: anywhere; }
.chart-metric-label { min-width: 190px; }
.chart-summary { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
.chart-summary strong { display: block; font: 700 30px Manrope,system-ui,sans-serif; color: var(--teal); margin-top: 4px; }
.daily-chart { width: 100%; min-height: 240px; }
.daily-chart svg { display: block; width: 100%; overflow: visible; }
.daily-chart text { font: 11px 'DM Sans',system-ui,sans-serif; fill: var(--muted); }
.daily-chart .chart-grid { stroke: #e5ede9; stroke-dasharray: 3 4; }
.daily-chart .chart-bar { fill: #9dc9b5; }
.daily-chart .chart-hit { fill: transparent; }
.daily-chart [role=button] { cursor: pointer; }
.daily-chart [aria-pressed=true] .chart-bar, .daily-chart [role=button]:hover .chart-bar { fill: #15786b; }
.chart-empty { text-align: center; padding: 8px; }
.chart-day-summary { background: #f3f7f4; border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px 18px; }
.chart-day-summary > strong { grid-column: 1 / -1; font-size: 13px; }
.chart-day-summary span { display: block; font-size: 11px; color: var(--muted); }
.chart-day-summary b { font-size: 14px; }
.campaign-insights { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.campaign-insights strong { display: block; font-size: 23px; margin: 6px 0; }
.campaign-insights p { margin: 0; }
.daily-breakdown > summary { display: flex; align-items: center; gap: 8px; }
.daily-breakdown > summary > span { margin-left: auto; text-align: right; font-size: 10px; }
.daily-breakdown > summary::after { flex-shrink: 0; }
.daily-breakdown[open] > summary { margin-bottom: 16px; }
@media (max-width: 700px) {
    .report-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .report-filters label:first-child { grid-column: 1 / -1; }
    .report-links .row { justify-content: flex-start; flex-wrap: wrap; }
    .report-links .campaign-delete { margin-left: auto; min-height: 44px; width: 44px; }
    .campaign-detail-heading { flex-direction: column; align-items: stretch; gap: 16px; }
    .campaign-detail-actions { flex-wrap: wrap; gap: 8px; }
    .campaign-detail-actions .campaign-delete { margin-left: auto; }
    .campaign-detail-heading h1 { font-size: 24px; }
    .campaign-detail-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .campaign-detail-kpis .kpi:last-child { display: block; grid-column: auto; }
    .campaign-detail-kpis .kpi:last-child strong { margin-top: 5px; }
    .campaign-detail-kpis .kpi strong { font-size: clamp(19px,5.6vw,25px); }
    .chart-metric-label { width: 100%; }
    .chart-summary { align-items: start; flex-direction: column; gap: 8px; }
    .chart-summary strong { font-size: 27px; }
    .chart-day-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 12px; }
    .campaign-insights { grid-template-columns: minmax(0,1fr); gap: 0; }
    .campaign-insights .card { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; }
    .campaign-insights strong { grid-column: 2; grid-row: 1 / 3; margin: 0; align-self: center; font-size: 20px; }
    .campaign-insights p { grid-column: 1; }
    .daily-breakdown { padding-bottom: 10px; }
    .daily-breakdown .record-table tr { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .daily-breakdown .record-table td:last-child { grid-column: 2 / -1; }
    .action-dialog .dialog-actions > button { min-height: 44px; }
}
