:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #18202b;
    --muted: #667085;
    --line: #e5e9f0;
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --danger: #b42318;
    --good-bg: #ecfdf3;
    --good: #027a48;
    --warn-bg: #fffaeb;
    --warn: #b54708;
    --bad-bg: #fef3f2;
    --bad: #b42318;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.main { padding: 36px 0 64px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.nav { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { font-weight: 750; color: var(--text); }
nav { display: flex; align-items: center; gap: 18px; }
.inline-form { display: inline; margin: 0; }
.link-button { border: 0; background: transparent; color: var(--primary); padding: 0; font: inherit; cursor: pointer; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px rgba(16,24,40,.04); padding: 24px; }
.narrow { max-width: 720px; }
.login-card { max-width: 460px; margin: 36px auto; }
.center { text-align: center; }
h1 { margin: 0 0 8px; font-size: 1.65rem; }
p { color: var(--muted); margin: 0 0 20px; line-height: 1.55; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.section-head p { margin-bottom: 0; }
.form-grid { display: grid; gap: 18px; }
label { display: grid; gap: 7px; font-weight: 650; }
small, .muted { color: var(--muted); font-weight: 400; }
input { width: 100%; border: 1px solid #cfd6e3; border-radius: 9px; padding: 11px 12px; font: inherit; color: var(--text); background: #fff; }
input:focus { outline: 3px solid rgba(29,78,216,.12); border-color: var(--primary); }
.input-prefix { display: flex; align-items: center; border: 1px solid #cfd6e3; border-radius: 9px; overflow: hidden; background: #f8fafc; }
.input-prefix span { padding-left: 12px; white-space: nowrap; color: var(--muted); }
.input-prefix input { border: 0; border-radius: 0; background: #fff; }
.check-row { display: flex; grid-template-columns: none; align-items: center; gap: 9px; font-weight: 500; }
.check-row input { width: auto; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cfd6e3; background: #fff; color: var(--text); border-radius: 9px; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.button:hover { text-decoration: none; background: #f8fafc; }
.button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-hover); }
.button.danger { color: var(--danger); border-color: #f1b7b3; }
.button.small { padding: 7px 10px; font-size: .9rem; }
.flash { border-radius: 9px; padding: 12px 14px; margin-bottom: 18px; border: 1px solid transparent; }
.flash.success { background: var(--good-bg); color: var(--good); border-color: #abefc6; }
.flash.error { background: var(--bad-bg); color: var(--bad); border-color: #fecdca; }
.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.destination { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { white-space: nowrap; display: flex; gap: 7px; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: .78rem; font-weight: 700; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.empty { color: var(--muted); }
@media (max-width: 720px) {
    .wrap { width: min(100% - 20px, 1120px); }
    .nav, .section-head { align-items: stretch; }
    .nav { gap: 10px; }
    nav { gap: 10px; font-size: .9rem; }
    .section-head { flex-direction: column; }
    .card { padding: 18px; }
    .input-prefix { align-items: stretch; flex-direction: column; }
    .input-prefix span { padding: 9px 12px 0; }
}
.created-link { margin: 0 0 22px; padding: 14px; border: 1px solid #abefc6; background: var(--good-bg); border-radius: 10px; }
.created-link strong { display: block; margin-bottom: 8px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { background: #fff; }
@media (max-width: 520px) { .copy-row { flex-direction: column; } }
