@font-face {
    font-family: Inter;
    src: url('/fonts/inter-latin.woff2') format('woff2');
    font-weight: 400 800;
    font-display: swap;
}
:root {
    color-scheme: light;
    --paper: #f6f5ef;
    --white: #fffefa;
    --ink: #172b24;
    --muted: #59675e;
    --line: #e2e5da;
    --green: #205b47;
    --green-dark: #174433;
    --green-pale: #e6efe6;
    --teal: #367b73;
    --clay: #9c582b;
    --red: #8e3329;
    --radius: 16px;
    font-family: Inter, system-ui, sans-serif;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 780; }
h2 { font-size: 1.35rem; font-weight: 760; }
h3 { font-size: 1rem; font-weight: 730; }
a { color: var(--green-dark); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #1d7358; outline-offset: 3px; }
button:disabled { opacity: .45; cursor: default; }
input:not([type=checkbox]), select, textarea {
    width: 100%; min-width: 0; min-height: 44px; color: var(--ink); border: 1px solid #cbd4c8;
    background: #fff; border-radius: 9px; padding: 9px 12px;
}
input[type=color] { padding: 5px; width: 100%; cursor: pointer; }
input[type=checkbox] { accent-color: var(--green); }
input[type=file] { padding: 6px; }
input[type=file]::file-selector-button { padding: 5px 8px; border: 0; border-radius: 5px; background: var(--green-pale); color: var(--ink); cursor: pointer; }
textarea { resize: vertical; }
label { font-size: .875rem; font-weight: 680; }
label > small { font-weight: 400; }
.icon { display: inline-block; width: 1em; height: 1em; fill: currentColor; flex-shrink: 0; }
.muted { color: var(--muted); }
.button {
    display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 42px;
    padding: 8px 13px; border: 1px solid transparent; border-radius: 9px;
    color: var(--ink); background: transparent; text-decoration: none; font-size: .875rem; font-weight: 680;
    white-space: nowrap; cursor: pointer;
}
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { background: #f4f7ef; border-color: #dce4d7; }
.button.secondary:hover, .button.quiet:hover { background: var(--green-pale); }
.button.danger { color: var(--red); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.03rem; text-decoration: none; letter-spacing: -.035em; }
.brand-icon { display: grid; place-items: center; background: var(--green); color: #fff; width: 35px; height: 35px; border-radius: 10px; font-size: 1.1rem; }
.shell { width: min(1136px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 65px; }
.dashboard { padding-block: clamp(29px, 6vw, 57px); display: grid; gap: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-heading p { margin-top: 6px; }
.section-heading.compact { align-items: center; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.reports { display: grid; gap: 13px; }
.filter { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.filter select { width: auto; max-width: 245px; min-height: 42px; padding-block: 7px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric { min-height: 121px; display: grid; grid-template-columns: auto 1fr; align-items: center; align-content: center; column-gap: 10px; row-gap: 3px; padding: 14px 17px; font-size: .85rem; font-weight: 650; }
.metric-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; font-size: .92rem; background: var(--pale); color: var(--series); }
.metric strong { grid-column: 2; font-size: 1.85rem; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.065em; }
.menu_view { --series: var(--green); --pale: #e5f0e7; }
.direct_redirect { --series: var(--teal); --pale: #e6f0ef; }
.item_redirect { --series: var(--clay); --pale: #f6ede0; }
.chart-card, .links-card, .editor, .item-report { min-width: 0; padding: 19px; }
.chart-card .section-heading > span { font-size: .82rem; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; list-style: none; margin: 13px 0 0; padding: 0; color: var(--muted); font-size: .73rem; }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.swatch, .bar { background: var(--series); border-radius: 2px; }
.swatch { width: 8px; height: 8px; }
.chart-scroll, .table-scroll { overflow-x: auto; }
.chart { min-width: max(100%, calc(var(--days) * 30px)); display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); gap: 3px; padding: 12px 0 3px; }
.chart-day { min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
.bars { height: 94px; display: flex; align-items: end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.bar { display: block; width: min(9px, 24%); height: var(--bar-height); }
.chart-date { font-size: .6rem; color: var(--muted); }
.note { margin-top: 9px; font-size: .78rem; }
.empty { text-align: center; padding: 21px 10px; color: var(--muted); }
.links-card .table-scroll, .item-report .table-scroll { margin-top: 9px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 10px 10px 0; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: .75rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
tbody th { min-width: 112px; }
td:last-child, th:last-child { padding-right: 0; }
td.actions { white-space: nowrap; }
td.number { font-variant-numeric: tabular-nums; }
th small { display: block; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; max-width: 220px; }
.status { display: inline-block; font-weight: 700; font-size: .72rem; padding: 3px 7px; border-radius: 6px; }
.status.active { color: #1e513e; background: #e4f2e6; }
.status.draft { color: #554b33; background: #f0eddc; }
.status.paused { color: #774c32; background: #f5e8de; }
summary { cursor: pointer; font-weight: 700; }
.editor { scroll-margin-top: 15px; }
.editor form { display: grid; gap: 17px; margin-top: 16px; }
.url-line { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.url-line code { white-space: normal; overflow-wrap: anywhere; font-size: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label, .item-row label { display: grid; gap: 5px; align-content: start; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .check { display: flex; align-items: center; align-self: center; }
.direct-destination { min-width: 0; margin: 0; padding: 9px 12px 12px; border: 1px solid var(--line); border-radius: 10px; }
.direct-destination legend { padding-inline: 4px; font-size: .875rem; font-weight: 730; }
.destination-fields { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 7px; }
.colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.menu-editor { border-top: 1px solid var(--line); display: grid; gap: 12px; padding-top: 17px; }
.button-heading { margin-top: 4px; }
.item-row { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.05fr) minmax(0, .75fr) minmax(0, .72fr) auto; align-items: end; gap: 7px; padding: 10px 0; border-top: 1px solid var(--line); }
.item-row.item-removed { opacity: .65; }
.move-actions { display: flex; gap: 2px; }
.move-actions .button { padding-inline: 9px; }
.editor-footer { display: flex; flex-wrap: wrap; gap: 6px; }
.notice { padding: 9px 12px; border-radius: 9px; font-size: .86rem; }
.notice.success { background: #e5f2e7; color: var(--green-dark); }
.notice.error { background: #f9ebe5; color: var(--red); }
.notice ul { margin: 0; padding-left: 22px; }
.editor > .notice { margin-top: 10px; }
.login-page { min-height: 100svh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 72% 15%, #e0ebe0, var(--paper) 53%); }
.login-card { width: min(100%, 440px); display: grid; gap: 11px; padding: clamp(22px, 7vw, 37px); border: 1px solid var(--line); border-radius: 21px; background: var(--white); }
.login-card h1 { font-size: clamp(1.45rem, 6vw, 2.1rem); }
.login-card .brand { margin-bottom: 15px; }
.stack { display: grid; gap: 7px; margin-top: 10px; }
.stack .button { width: 100%; margin-top: 5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.public-wrap { min-height: 100svh; display: grid; grid-template-rows: 1fr auto; gap: 25px; background: var(--menu-bg); color: var(--menu-text); padding: clamp(38px, 11vh, 100px) 21px 21px; }
.public-content { width: min(100%, 460px); margin-inline: auto; text-align: center; }
.public-content h1 { font-size: clamp(1.8rem, 8vw, 2.7rem); overflow-wrap: anywhere; }
.menu-logo { object-fit: contain; display: block; margin: 0 auto 17px; border-radius: 19px; }
.description { margin-top: 9px; white-space: pre-line; overflow-wrap: anywhere; }
.public-buttons { margin: 25px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.public-buttons a { display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px; place-items: center; gap: 8px; text-decoration: none; color: var(--menu-accent-text); background: var(--menu-accent); min-height: 55px; padding: 12px 14px; border-radius: 12px; font-weight: 710; overflow-wrap: anywhere; }
.public-buttons a:hover { text-decoration: underline; }
.public-buttons a:focus-visible { outline-color: var(--menu-text); }
.public-buttons .icon { font-size: 1.12rem; }
.public-buttons .menu-arrow { font-size: .82rem; }
.preview-label { display: inline-block; margin-bottom: 13px; border: 1px solid currentColor; padding: 3px 8px; border-radius: 6px; font-size: .74rem; }
.menu-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; font-size: .8rem; }
.menu-footer a { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; color: inherit; font-weight: 650; text-decoration: none; }
.menu-footer a:hover { text-decoration: underline; }
.menu-footer a:focus-visible { outline-color: currentColor; }
@media (max-width: 720px) {
    .shell { width: calc(100% - 28px); }
    .metrics { gap: 7px; }
    .metric { grid-template-columns: 1fr; row-gap: 6px; padding: 12px 8px; font-size: .69rem; }
    .metric strong { grid-column: 1; font-size: 1.55rem; }
    .metric-icon { width: 28px; height: 28px; border-radius: 7px; }
    .chart-card, .links-card, .editor, .item-report { padding: 12px; }
    .item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .item-row .destination-fields { grid-column: 1 / -1; }
    .filter { width: 100%; }
    .filter select { max-width: 100%; }
    td.actions .button { padding-inline: 5px; }
}
@media (max-width: 430px) {
    .form-grid { grid-template-columns: 1fr; }
}
