:root {
    color-scheme: dark;
    --bg: #0b1117;
    --panel: #121a23;
    --panel-soft: #182330;
    --text: #e6edf3;
    --muted: #95a3b3;
    --line: #263445;
    --accent: #3aa6d8;
    --accent-dark: #2487b5;
    --danger: #ff6b6b;
    --success: #49d17d;
    --warn: #f2c14e;
    --shadow: rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html {
    max-width: 100%;
    overflow-x: hidden;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    max-width: 100%;
    overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
button, .primary {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #06111a;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}
button:hover, .primary:hover { background: var(--accent-dark); color: #06111a; }
input, select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #0f1720;
    color: var(--text);
    font: inherit;
}
label { display: grid; gap: 6px; color: var(--muted); font-weight: 600; }
.shell { max-width: 1500px; margin: 0 auto; padding: 20px; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 8px 0 24px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(18, 26, 35, .86);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand small, td small { display: block; color: var(--muted); margin-top: 3px; }
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}
.brand-mark.large { width: 54px; height: 54px; font-size: 18px; }
.nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(38, 52, 69, .86);
    border-radius: 10px;
    background: rgba(11, 17, 24, .72);
}
.menu-toggle,
.mobile-server-button,
.nav-mobile-head,
.nav-backdrop {
    display: none;
}
.nav a, .nav-button, .link-button, .nav-menu summary {
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 7px 10px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.nav-button {
    width: auto;
    font: inherit;
}
.mobile-server-button {
    display: none;
}
.nav a:hover, .nav-button:hover, .link-button:hover, .nav-menu summary:hover {
    background: var(--panel-soft);
    border-color: rgba(58, 166, 216, .34);
    color: var(--accent);
}
.nav-primary {
    color: #d8f3ff;
    font-weight: 700;
}
.nav a.is-active,
.nav-button.is-active,
.nav-menu summary.is-active {
    background: rgba(58, 166, 216, .18);
    border-color: rgba(58, 166, 216, .62);
    color: #e7f8ff;
    box-shadow: inset 0 -2px 0 var(--accent);
}
.nav-menu {
    position: relative;
}
.nav-menu summary {
    list-style: none;
}
.nav-menu summary::-webkit-details-marker {
    display: none;
}
.nav-menu summary::after {
    content: "▾";
    color: var(--muted);
    margin-left: 8px;
}
.nav-menu[open] summary::after {
    content: "▴";
}
.nav-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    width: 260px;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 18px 48px var(--shadow);
}
.nav-menu-panel a,
.nav-menu-panel button {
    width: 100%;
    justify-content: flex-start;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    border: 0;
}
.nav-menu-panel a:hover,
.nav-menu-panel button:hover {
    background: var(--panel-soft);
    color: var(--accent);
}
.auth-screen { min-height: calc(100vh - 40px); display: grid; place-items: center; }
.auth-card {
    width: min(420px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    display: grid;
    gap: 18px;
    box-shadow: 0 16px 44px var(--shadow);
}
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; min-height: auto; }
.filter-check {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0f1720;
    padding: 0 10px;
    color: var(--text);
}
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin: 8px 0 16px;
}
h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: 0; }
p { color: var(--muted); margin: 0; }
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 16px;
}
.filter-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}
.filter-panel summary::-webkit-details-marker {
    display: none;
}
.filter-panel summary::after {
    content: "Skryt";
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.filter-panel:not([open]) summary::after {
    content: "Zobrazit";
}
.filter-panel .filters {
    margin-top: 14px;
}
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack { display: grid; gap: 14px; }
.filters { display: grid; grid-template-columns: minmax(260px, 2fr) minmax(150px, 1fr) repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; align-items: end; }
.filter-switch {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #0f1720;
    padding: 0 10px;
    white-space: nowrap;
}
.log-filters { display: grid; grid-template-columns: 180px minmax(220px, 1fr) 240px auto auto; gap: 10px; align-items: end; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.toolbar button,
.toolbar-button {
    background: var(--panel-soft);
    border-color: var(--line);
    color: var(--text);
}
.toolbar-button {
    border: 1px solid var(--line);
    border-radius: 6px;
    min-height: 36px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.table-wrap {
    max-width: 100%;
    overflow-x: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}
table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 0; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; overflow-wrap: break-word; }
th:last-child,
td:last-child {
    width: 300px;
}
th:nth-child(7),
td:nth-child(7) {
    width: 150px;
}
th:nth-child(8),
td:nth-child(8) {
    width: 76px;
}
th { background: #0f1720; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
th a { color: var(--text); }
td span { display: block; color: var(--muted); margin-top: 3px; }
tr:hover { background: rgba(58, 166, 216, .06); }
tr.muted { opacity: .52; }
tr.expires-soon {
    background: rgba(255, 107, 107, .09);
}
tr.expires-soon:hover {
    background: rgba(255, 107, 107, .14);
}
tr.offline-never {
    background: rgba(148, 163, 184, .12);
    opacity: .86;
}
tr.offline-never:hover {
    background: rgba(148, 163, 184, .17);
}
tr.group-head .gid-cell strong {
    color: var(--success);
}
tr.sub-account .gid-cell {
    border-left: 3px solid rgba(58, 166, 216, .55);
    padding-left: 18px;
}
tr.sub-account .gid-cell strong::before {
    content: "pod ";
    color: var(--muted);
    font-weight: 600;
}
.state { color: var(--muted); font-weight: 700; }
.state.connected { color: var(--success); }
.state.online { color: var(--accent); }
.bad { color: var(--danger); font-weight: 700; }
.warn { color: var(--warn); font-weight: 700; }
.actions { display: grid; gap: 6px; min-width: 0; width: 100%; }
.action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    gap: 6px;
}
.actions button, .actions a {
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--text);
    border-radius: 6px;
    padding: 6px 7px;
    min-height: 32px;
    width: 100%;
    min-width: 0;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
}
.actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.actions form {
    margin: 0;
}
.actions .action-edit {
    color: var(--accent);
    border-color: rgba(58, 166, 216, .55);
}
.actions .action-add {
    color: var(--success);
    border-color: rgba(73, 209, 125, .5);
}
.actions .action-enable {
    color: var(--success);
    border-color: rgba(73, 209, 125, .5);
}
.actions .danger-button { color: var(--danger); border-color: rgba(255, 107, 107, .45); }
.mobile-toggle-cell { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.edit-sensitive-toggle {
    grid-column: 1 / -1;
    min-height: 42px;
    border: 1px solid rgba(242, 193, 78, .38);
    border-radius: 6px;
    background: rgba(242, 193, 78, .08);
    color: var(--text);
    padding: 0 12px;
}
.modal-form input:disabled {
    opacity: .62;
    cursor: not-allowed;
}
input.is-invalid {
    border-color: rgba(255, 107, 107, .85);
    background: rgba(255, 107, 107, .08);
}
.field-error {
    min-height: 15px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}
.alert { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert.success { background: rgba(73, 209, 125, .12); border-color: rgba(73, 209, 125, .35); color: var(--success); }
.alert.danger { background: rgba(255, 107, 107, .12); border-color: rgba(255, 107, 107, .35); color: var(--danger); }
.result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    margin: 0 0 10px;
}
.result-meta strong { color: var(--text); }
.active-filter-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 8px;
    background: var(--panel-soft);
}
.active-filter-inline button {
    min-height: 26px;
    padding: 2px 7px;
    background: transparent;
    border-color: var(--line);
    color: var(--text);
}
.gid-cell a {
    color: inherit;
}
.info-pop {
    position: relative;
    gap: 6px;
    min-height: 28px;
    padding: 3px 7px;
    border-color: var(--line);
    background: var(--panel-soft);
    color: var(--text);
}
.info-pop.is-empty strong {
    color: var(--danger);
}
.info-pop em {
    color: var(--muted);
    font-style: normal;
    font-size: 11px;
    text-transform: uppercase;
}
.info-pop > span {
    width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: #06111a;
    font-size: 12px;
    font-weight: 800;
    margin: 0;
}
.info-pop::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 40;
    display: none;
    width: max-content;
    max-width: 260px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #090f15;
    color: var(--text);
    box-shadow: 0 12px 34px var(--shadow);
    white-space: pre-line;
    text-align: left;
    font-weight: 500;
}
.info-pop:hover::after,
.info-pop:focus::after {
    display: block;
}
.last-seen-stack {
    display: grid;
    gap: 5px;
    justify-items: start;
}
.account-cell-stack {
    display: grid;
    gap: 4px;
    min-width: 0;
    justify-items: start;
}
.reader-status {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 16px;
}
.reader-status header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}
.reader-status h2,
.reader-server h3 {
    margin: 0 0 4px;
}
.reader-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.reader-server {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f1720;
    padding: 12px;
}
.reader-list {
    display: grid;
    gap: 0;
}
.reader-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.2fr) minmax(96px, .7fr) minmax(110px, .8fr) minmax(170px, 1fr) minmax(120px, .8fr);
    gap: 12px;
    align-items: center;
}
.reader-row > * {
    min-width: 0;
    overflow-wrap: anywhere;
}
.reader-name small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}
.reader-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0 0 7px;
}
.reader-item {
    border-top: 1px solid rgba(38, 52, 69, .65);
    padding: 8px 0;
}
.reader-item small {
    color: var(--muted);
}
.reader-item small span {
    display: block;
}
.reader-percent strong {
    color: var(--text);
}
.reader-percent strong.ok {
    color: var(--success);
}
.reader-percent strong.bad {
    color: var(--danger);
}
.reader-access.fresh,
.reader-access.fresh span {
    color: var(--success);
}
.reader-access.normal,
.reader-access.normal span {
    color: var(--text);
}
.reader-access.stale,
.reader-access.stale span {
    color: var(--danger);
}
.reader-state {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    justify-self: center;
    min-width: 96px;
    max-width: 100%;
}
.reader-state.ok {
    color: var(--success);
    border-color: rgba(73, 209, 125, .45);
}
.reader-state.warn {
    color: var(--warn);
    border-color: rgba(242, 193, 78, .45);
}
.reader-state.bad {
    color: var(--danger);
    border-color: rgba(255, 107, 107, .45);
}
.revenue-chart {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 16px;
}
.revenue-chart summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    list-style: none;
}
.revenue-chart summary::-webkit-details-marker {
    display: none;
}
.revenue-chart summary::after {
    content: "▾";
    color: var(--muted);
}
.revenue-chart[open] summary {
    margin-bottom: 18px;
}
.revenue-chart[open] summary::after {
    content: "▴";
}
.revenue-chart summary strong {
    display: block;
    margin-bottom: 4px;
    font-size: 18px;
}
.revenue-chart summary small {
    color: var(--muted);
}
.chart-summary-values {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 14px;
}
.chart-summary-values small {
    white-space: nowrap;
}
.chart-summary-values strong {
    display: inline;
    color: var(--success);
    font-size: 14px;
    margin: 0;
}
.chart-bars {
    display: grid;
    grid-template-columns: repeat(12, minmax(64px, 1fr));
    gap: 10px;
    min-height: 230px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.chart-item {
    display: grid;
    grid-template-rows: 22px 150px auto;
    gap: 8px;
    min-width: 64px;
}
.chart-value {
    color: var(--text);
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
}
.chart-track {
    align-self: stretch;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: #0f1720;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px;
}
.chart-bar {
    width: 100%;
    min-height: 0;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, var(--success), var(--accent));
}
.chart-label {
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    min-height: 32px;
}
#accounts-results.loading { opacity: .58; pointer-events: none; }
nav[role="navigation"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: var(--muted);
}
nav[role="navigation"] a,
nav[role="navigation"] span {
    color: var(--text);
}
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.change-list {
    display: grid;
    gap: 8px;
}
.change-list div {
    display: grid;
    gap: 2px;
}
.change-list strong {
    color: var(--text);
}
.change-list span {
    color: var(--muted);
    margin: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.diff-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f1720;
    padding: 14px;
    margin-top: 12px;
}
.diff-card.has-error {
    border-color: rgba(255, 107, 107, .5);
}
.diff-card.has-warning {
    border-color: rgba(242, 193, 78, .55);
}
.diff-check {
    justify-content: flex-start;
    margin-bottom: 12px;
}
.diff-check span {
    margin: 0;
}
.duplicate-list {
    display: grid;
    gap: 7px;
    margin-top: 10px;
}
.duplicate-list a {
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-soft);
    padding: 8px 10px;
    overflow-wrap: anywhere;
}
.change-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}
.change-pills span {
    border: 1px solid rgba(58, 166, 216, .35);
    border-radius: 999px;
    background: rgba(58, 166, 216, .08);
    color: var(--accent);
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 700;
}
.sync-progress {
    display: grid;
    gap: 12px;
}
.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #090f15;
    border: 1px solid var(--line);
}
.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width .2s ease;
}
.progress-fill.is-indeterminate {
    width: 42%;
    animation: progress-indeterminate 1.1s ease-in-out infinite;
}
@keyframes progress-indeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(260%); }
}
.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}
.danger-text {
    color: var(--danger);
}
.diff-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.diff-grid h2 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--muted);
}
.diff-grid pre {
    min-height: 140px;
    max-height: 320px;
    overflow: auto;
    margin: 0;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #090f15;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}
.sticky-actions {
    position: sticky;
    bottom: 12px;
    display: flex;
    justify-content: flex-end;
    padding: 12px;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(18, 26, 35, .92);
    backdrop-filter: blur(10px);
}
.modal {
    width: min(920px, calc(100vw - 28px));
    max-height: min(760px, calc(100vh - 28px));
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    padding: 0;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
}
.modal::backdrop {
    background: rgba(3, 7, 12, .76);
}
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}
.modal-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
}
.modal-head small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}
.modal-head button {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-color: var(--line);
    background: var(--panel-soft);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
}
.modal-body {
    padding: 18px;
    overflow: auto;
}
.modal-form {
    margin: 0;
}
.modal-loading {
    color: var(--muted);
    padding: 16px 0;
}
.readers-modal {
    width: min(1280px, calc(100vw - 28px));
    overflow-x: hidden;
}
.readers-modal .modal-body {
    overflow-x: hidden;
    overflow-y: auto;
}
.submit-progress-modal {
    width: min(520px, calc(100vw - 28px));
}
.readers-modal .reader-status {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.readers-modal .reader-grid,
.readers-modal .reader-server,
.readers-modal .reader-list {
    min-width: 0;
}
.readers-modal .reader-status > header {
    display: none;
}
.reader-modal-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.reader-modal-controls button:not([data-readers-modal-close]) {
    width: auto;
    min-height: 34px;
    padding: 0 12px;
    font-size: 14px;
}
.reader-modal-controls [data-readers-modal-close] {
    flex: 0 0 34px;
}
.switch-control {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}
.switch-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.switch-control > span {
    width: 38px;
    height: 22px;
    position: relative;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #090f15;
    transition: background .18s ease, border-color .18s ease;
}
.switch-control > span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--muted);
    transition: transform .18s ease, background .18s ease;
}
.switch-control input:checked + span {
    border-color: rgba(58, 166, 216, .65);
    background: rgba(58, 166, 216, .22);
}
.switch-control input:checked + span::after {
    transform: translateX(16px);
    background: var(--accent);
}
.switch-control input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.switch-control strong {
    color: var(--text);
    font-size: 13px;
}

@media (max-width: 900px) {
    .shell { padding: 14px; }
    .topbar, .page-head { align-items: flex-start; flex-direction: column; }
    .grid.two, .form-grid, .filters, .log-filters { grid-template-columns: 1fr; }
    .revenue-chart summary,
    .reader-status header {
        align-items: flex-start;
        flex-direction: column;
    }
    .reader-grid { grid-template-columns: 1fr; }
    .reader-head {
        display: none;
    }
    .reader-row {
        grid-template-columns: 1fr;
        justify-items: start;
    }
    .reader-item > *::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        margin-bottom: 2px;
    }
    .reader-state {
        justify-self: start;
    }
    .nav-menu-panel {
        left: 0;
        right: auto;
    }
}

@media (max-width: 760px) {
    body { font-size: 13px; }
    body.menu-open {
        overflow: hidden;
    }
    .shell { padding: 10px; }
    .topbar {
        position: relative;
        flex-direction: row;
        align-items: center;
        padding: 8px 10px;
    }
    .brand {
        min-width: 0;
        margin-right: auto;
    }
    .brand strong {
        display: none;
    }
    .mobile-server-button {
        width: auto;
        min-height: 38px;
        display: inline-flex;
        flex: 0 0 auto;
        padding: 7px 10px;
        border-color: rgba(58, 166, 216, .42);
        background: rgba(58, 166, 216, .12);
    }
    .desktop-server-button {
        display: none;
    }
    .menu-toggle {
        width: auto;
        min-height: 38px;
        display: inline-grid;
        grid-template-columns: 18px auto;
        align-items: center;
        gap: 8px;
        padding: 7px 10px;
        border-color: var(--line);
        background: var(--panel-soft);
        color: var(--text);
    }
    .menu-toggle span {
        grid-column: 1;
        width: 18px;
        height: 2px;
        display: block;
        border-radius: 999px;
        background: currentColor;
    }
    .menu-toggle strong {
        grid-column: 2;
        grid-row: 1 / span 3;
        font-size: 13px;
    }
    .nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 70;
        background: rgba(3, 7, 12, .68);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s ease;
    }
    body.menu-open .nav-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        width: min(330px, calc(100vw - 38px));
        display: flex;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 14px;
        border-width: 0 0 0 1px;
        border-radius: 0;
        background: #0b1118;
        box-shadow: -24px 0 60px rgba(0, 0, 0, .45);
        transform: translateX(100%);
        transition: transform .2s ease;
        overflow-y: auto;
    }
    body.menu-open .nav {
        transform: translateX(0);
    }
    .nav-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 2px 0 10px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--line);
    }
    .nav-mobile-head button {
        width: 36px;
        min-height: 36px;
        padding: 0;
        border-color: var(--line);
        background: var(--panel-soft);
        color: var(--text);
        font-size: 22px;
        line-height: 1;
    }
    .nav a, .nav .nav-button, .nav .link-button, .nav-menu summary {
        width: 100%;
        justify-content: flex-start;
        flex: 0 0 auto;
        padding: 10px 11px;
    }
    .nav-menu-panel {
        position: static;
        width: 100%;
        margin-top: 6px;
        box-shadow: none;
        background: rgba(18, 26, 35, .72);
    }
    .nav form {
        width: 100%;
    }
    .panel, .revenue-chart, .reader-status { padding: 12px; }
    .toolbar form, .toolbar button, .primary { width: 100%; }
    .toolbar-button { width: 100%; }
    .diff-grid { grid-template-columns: 1fr; }
    .sticky-actions { bottom: 8px; }
    .chart-bars {
        grid-template-columns: repeat(12, 58px);
        min-height: 210px;
    }
    .table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }
    table, thead, tbody, tr, th, td {
        display: block;
        width: 100%;
        min-width: 0;
    }
    thead { display: none; }
    tr {
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 8px 10px;
    }
    tr.expires-soon {
        border-color: rgba(255, 107, 107, .42);
    }
    tr.offline-never {
        background: rgba(148, 163, 184, .12);
        border-color: rgba(148, 163, 184, .3);
    }
    td {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 10px;
        border-bottom: 1px solid rgba(38, 52, 69, .7);
        padding: 9px 0;
    }
    tr:not(.expanded) td:not(.mobile-core):not(.mobile-toggle-cell) {
        display: none;
    }
    td.mobile-toggle-cell {
        display: grid;
        grid-template-columns: 1fr;
    }
    td.mobile-toggle-cell::before {
        content: "";
        display: none;
    }
    td.mobile-toggle-cell button {
        width: 100%;
        background: var(--panel-soft);
        border-color: var(--line);
        color: var(--text);
    }
    td:last-child { border-bottom: 0; }
    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 700;
    }
    td > * { min-width: 0; }
    .actions {
        min-width: 0;
        display: grid;
        width: 100%;
    }
    .action-row {
        grid-template-columns: 1fr;
    }
    tr.sub-account {
        margin-left: 10px;
        width: calc(100% - 10px);
    }
    tr.sub-account .gid-cell {
        padding-left: 10px;
    }
    .actions form, .actions button, .actions a {
        width: 100%;
    }
    .modal {
        width: min(100%, calc(100vw - 16px));
        max-height: calc(100vh - 16px);
    }
    .modal-head, .modal-body { padding: 12px; }
    .modal .form-grid { grid-template-columns: 1fr; }
}
