:root {
    color-scheme: light;
    --ink: #16243a;
    --muted: #526276;
    --canvas: #f3f6fa;
    --surface: #fff;
    --border: #dce4ed;
    --brand: #1d477a;
    --brand-hover: #15375f;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand); text-underline-offset: .16em; }
a:focus-visible, input:focus-visible, button:focus-visible, select:focus-visible {
    outline: 3px solid #4a91d8;
    outline-offset: 3px;
}

.shell { width: min(calc(100% - 40px), 1120px); margin-inline: auto; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 650; }
.brand-mark {
    display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px;
    border-radius: 10px; background: var(--brand); color: white; font-size: .88rem; font-weight: 750;
}
.directory, .narrow, .form-shell { margin-block: 45px; }
.narrow { max-width: 500px; }
.form-shell { max-width: 680px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.15rem); letter-spacing: -.027em; line-height: 1.15; }
h2 { margin: 0; font-size: 1.1rem; }
p { line-height: 1.55; }
.page-heading p, .card > p, .empty p { margin: .5rem 0 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 5px 19px #16243a07; }
.card { padding: clamp(20px, 5vw, 32px); }
.card > .button { margin-top: 20px; }
.button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
    border: 1px solid transparent; border-radius: 8px; padding: .56rem .85rem;
    font: inherit; font-size: .9rem; font-weight: 650; white-space: nowrap; cursor: pointer;
    text-decoration: none;
}
.primary { background: var(--brand); color: white; }
.primary:hover { background: var(--brand-hover); }
.secondary { border-color: var(--border); background: white; color: var(--brand); }
.secondary:hover { background: #eef4fb; border-color: #b7c7da; }
.plain-button {
    padding: .55rem .1rem; border: 0; background: none; color: var(--brand);
    font: inherit; font-size: .9rem; font-weight: 650; white-space: nowrap; cursor: pointer;
}

.search-bar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 9px; padding: 16px 20px; }
.search-bar input { flex: 1 1 240px; min-width: 0; }
input, select {
    min-height: 42px; width: 100%; border: 1px solid #bcc9d8; border-radius: 8px; padding: .5rem .7rem;
    background: white; color: var(--ink); font: inherit; font-size: 1rem;
}
input::placeholder { color: #66778b; }
.list-meta {
    display: flex; justify-content: space-between; gap: 10px; border-block: 1px solid var(--border);
    background: #f7f9fc; padding: .62rem 20px; color: var(--muted); font-size: .85rem; font-weight: 650;
}
.store-list { margin: 0; padding: 0; list-style: none; }
.store-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .75fr) auto; align-items: center; gap: 18px; padding: 13px 20px; }
.store-row + .store-row { border-top: 1px solid #e9eef4; }
.store-detail { min-width: 0; display: flex; flex-direction: column; gap: .24rem; align-items: flex-start; }
.store-detail strong { overflow-wrap: anywhere; font-weight: 650; }
.muted { font-size: .85rem; line-height: 1.45; color: var(--muted); }
.short-link {
    font-family: "SFMono-Regular", Consolas, monospace; font-size: .88rem;
    width: fit-content; max-width: 100%; overflow-wrap: anywhere;
}
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.copy { min-width: 73px; }
.status {
    padding: 2px 6px; border-radius: 4px; background: #fff4d8; color: #6e4a12;
    font-size: .75rem; font-weight: 650;
}
.pagination {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px;
    padding: 14px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem;
}
.empty { padding: 22px 20px; }
.stack { display: grid; gap: 16px; margin-top: 22px; }
.stack label { display: grid; gap: .4rem; font-size: .93rem; font-weight: 650; }
.stack .muted { font-weight: 400; }
.stack > .button { justify-self: start; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { margin-top: 4px; }
.back { display: inline-block; margin-bottom: 14px; font-weight: 650; }
p.feedback { margin: 0 0 18px; padding: .7rem .85rem; border-radius: 8px; }
.card p.feedback { margin-top: 18px; }
.feedback.error { background: #fff0ee; color: #8c241a; }
.feedback.success { background: #eaf6ed; color: #1c6030; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

@media (max-width: 650px) {
    .shell { width: calc(100% - 28px); }
    .directory, .narrow, .form-shell { margin-block: 28px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .store-row { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 12px; }
    .store-detail { grid-column: 1 / -1; }
    .search-bar, .list-meta { padding-inline: 12px; }
    .short-link { font-size: .8rem; }
    .actions { gap: 4px; }
    .store-row .button { padding-inline: .5rem; }
    .copy { min-width: 56px; }
}

@media (max-width: 375px) {
    .store-row { grid-template-columns: minmax(0, 1fr); }
    .fields { grid-template-columns: minmax(0, 1fr); }
}
