:root {
    color-scheme: light;
    --ink: #14253a;
    --navy: #112239;
    --paper: #f7f1e5;
    --white: #fffdf8;
    --gold: #f2c570;
    --rule: #d9d0be;
    --muted: #565e68;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--paper);
    color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
a { color: inherit; text-underline-offset: .22em; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #3d78a4; outline-offset: 4px; }
.wrap { width: min(1080px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.4rem; font-weight: 800; letter-spacing: -.055em; }
.brand-mark { position: relative; width: 31px; height: 31px; background: var(--navy); border-radius: 7px; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; width: 11px; height: 7px; border: 2px solid var(--gold); border-radius: 6px; transform: rotate(-45deg); }
.brand-mark::before { top: 7px; left: 12px; }
.brand-mark::after { top: 13px; left: 6px; }
.header-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; font-weight: 650; }

.hero {
    background-color: var(--navy);
    background-image: radial-gradient(circle at 1px 1px, #dcc08f2b 1px, transparent 1.25px);
    background-size: 22px 22px;
    color: var(--white);
    border-bottom: 4px solid var(--gold);
}
.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(32px, 6vw, 86px);
    min-height: 390px;
    padding-block: 56px 66px;
}
.hero-copy, .stats-summary > div:first-child { min-width: 0; }
.hero h1 { font-size: clamp(3.25rem, 7vw, 6.3rem); line-height: .97; letter-spacing: -.072em; }
.hero h1 em { font-family: Georgia, serif; font-weight: 400; color: var(--gold); }
.hero-copy p { max-width: 34ch; color: #f2e8d5; margin-top: 24px; line-height: 1.65; }
.shortener { color: var(--ink); background: var(--white); padding: 25px; border: 1px solid var(--rule); border-radius: 10px; min-width: 0; }
.shortener label { display: block; font-weight: 750; margin-bottom: 10px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
input { min-width: 0; min-height: 48px; padding: 10px 12px; border: 1px solid #a69e8d; border-radius: 6px; background: #fff; color: var(--ink); }
input[aria-invalid=true] { border-color: #a32c20; }
.error { color: #a32c20; font-size: .875rem; line-height: 1.5; margin-top: 12px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: var(--ink);
    font-size: .875rem;
    font-weight: 750;
    text-align: center;
}
.primary { background: var(--gold); border-color: #b78430; }
.primary:hover { background: #efb954; }
.secondary { background: var(--white); border-color: #a69e8d; }
.secondary:hover { background: #eee6d6; }

.library { padding-block: 48px 72px; scroll-margin-top: 22px; }
h2 { font-size: clamp(1.3rem, 2.8vw, 1.8rem); letter-spacing: -.035em; }
.section-heading p, .link-info p, .muted, .private p { color: var(--muted); }
.section-heading p, .muted { font-size: .9rem; margin-top: 5px; }
.empty { background: #f2eadb; border: 1px dashed #a99e87; border-radius: 8px; padding: 23px; margin-top: 20px; color: var(--muted); line-height: 1.55; }
.result, .private { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border: 1px solid #bc9b63; border-radius: 8px; background: var(--white); }
.result { margin-top: 27px; }
.result h2, .private h2 { font-size: 1.2rem; }
.result .short-url { display: inline-block; margin-top: 7px; }
.links, .daily, .sources { list-style: none; margin: 20px 0 0; padding: 0; }
.links { border-top: 1px solid var(--rule); }
.links li { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.link-info { min-width: 0; }
.link-info p { margin-top: 5px; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.short-url { font-size: .95rem; font-weight: 750; overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 0 0 auto; }
.click-count { font-size: .875rem; margin-right: 7px; font-variant-numeric: tabular-nums; }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; margin-top: 18px; }
.pagination a { min-height: 44px; display: inline-flex; align-items: center; }

.stats-summary { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 40px; }
.compact h1 { font-size: clamp(2.1rem, 5vw, 3.9rem); margin-bottom: 16px; letter-spacing: -.055em; }
.compact .short-url { color: var(--gold); }
.destination { overflow-wrap: anywhere; color: #f2e8d5; margin-top: 7px; max-width: 65ch; font-size: .9rem; }
.total { display: grid; gap: 3px; min-width: 130px; padding-left: 20px; border-left: 1px solid #ffffff52; }
.total strong { color: var(--gold); font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.total span { font-size: .875rem; }
.report { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding-block: 27px 60px; }
.report-panel { min-width: 0; padding: 22px; border: 1px solid var(--rule); border-radius: 8px; background: var(--white); }
.daily li { display: grid; grid-template-columns: 3em minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 9px; font-size: .875rem; font-variant-numeric: tabular-nums; }
.daily li strong { min-width: 2em; text-align: right; }
meter { display: block; width: 100%; height: 15px; accent-color: #245379; }
meter::-webkit-meter-bar { background: #e8e2d8; border: 0; border-radius: 3px; }
meter::-webkit-meter-optimum-value { background: #245379; }
meter::-moz-meter-bar { background: #245379; }
.sources li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-block: 10px; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.source-empty, .private p { font-size: .9rem; line-height: 1.55; }
.source-empty { margin-top: 20px; color: var(--muted); }
.private { grid-column: 1 / -1; }
.private p { margin-top: 4px; }
.message { padding-block: 60px; }
.message p { margin-top: 12px; }
.message .button { margin-top: 22px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.header-nav { display: flex; align-items: center; gap: clamp(12px, 4vw, 28px); }
.account-section { padding-bottom: 56px; scroll-margin-top: 22px; }
.account-panel { max-width: 550px; padding: clamp(16px, 4vw, 25px); background: var(--white); border: 1px solid var(--rule); border-radius: 8px; }
.account-panel p { margin-top: 8px; line-height: 1.55; }
.account-panel > p { color: var(--muted); }
.account-panel .actions, .account-form { margin-block: 16px; }
.account-form { display: grid; gap: 8px; }
.account-form label { font-weight: 700; margin-top: 6px; }
.account-form small { color: var(--muted); }
.account-form .button { justify-self: start; margin-top: 8px; }

@media (max-width: 920px) {
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 660px) {
    .wrap { width: calc(100% - 36px); }
    .header-inner { min-height: 62px; }
    .hero-inner { grid-template-columns: 1fr; min-height: 0; gap: 28px; padding-block: 36px; }
    .hero-copy p { margin-top: 16px; }
    .shortener { padding: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .library { padding-block: 32px 50px; }
    .links li, .result, .private { align-items: stretch; flex-direction: column; gap: 10px; }
    .result, .private { padding: 17px; }
    .actions { flex: auto; }
    .stats-summary { flex-direction: column; align-items: flex-start; padding-block: 30px; }
    .report { grid-template-columns: 1fr; gap: 14px; }
    .report-panel { padding: 17px; }
}
