:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #162033;
    --muted: #667085;
    --line: #d9e0ea;
    --primary: #0f7b67;
    --primary-dark: #0a5e4f;
    --danger: #b42318;
    --success-bg: #ecfdf3;
    --success-border: #abefc6;
    --error-bg: #fef3f2;
    --error-border: #fecdca;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--primary);
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 16px clamp(18px, 4vw, 44px);
}

.brand {
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
}

.topbar nav {
    display: flex;
    gap: 18px;
}

.topbar nav a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.hero,
.container,
.admin-layout {
    margin: 0 auto;
    max-width: 1120px;
    padding: 42px 18px;
}

.hero {
    align-items: center;
    display: flex;
    min-height: calc(100vh - 118px);
}

.shortener,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(16, 24, 40, 0.06);
    padding: clamp(22px, 4vw, 38px);
    width: 100%;
}

.shortener {
    max-width: 880px;
}

.narrow {
    max-width: 520px;
}

.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

h1,
h2 {
    line-height: 1.18;
    margin: 0 0 18px;
}

h1 {
    font-size: clamp(32px, 4vw, 52px);
}

h2 {
    font-size: 22px;
}

label {
    color: #344054;
    display: grid;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
}

input,
textarea {
    background: #ffffff;
    border: 1px solid #bac5d5;
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    min-height: 46px;
    padding: 10px 12px;
    width: 100%;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 123, 103, 0.15);
    outline: none;
}

button,
.button {
    align-items: center;
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 800;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    text-decoration: none;
    white-space: nowrap;
}

button:hover,
.button:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: #e7eef8;
    color: #344054;
}

button.danger {
    background: var(--danger);
}

.shorten-form {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.turnstile-wrap {
    grid-column: 1 / -1;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-grid.compact {
    gap: 10px;
}

.split {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 140px;
}

.notice {
    border-radius: 6px;
    margin: 14px 0;
    padding: 13px 15px;
}

.notice.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
}

.notice.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--danger);
}

.notice label {
    margin-bottom: 8px;
}

.small-link {
    display: inline-block;
    font-size: 13px;
    margin-top: 8px;
}

.sr-only {
    height: 1px;
    left: -10000px;
    overflow: hidden;
    position: absolute;
    top: auto;
    width: 1px;
}

.footer {
    color: var(--muted);
    font-size: 13px;
    padding: 0 18px 28px;
    text-align: center;
}

.admin-head,
.section-title {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.stats-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: 18px;
}

.stats-grid div {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.stats-grid strong {
    display: block;
    font-size: 28px;
}

.stats-grid span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 900px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.truncate {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
}

.badge.active {
    background: #dcfae6;
    color: #067647;
}

.badge.suspended {
    background: #fee4e2;
    color: #b42318;
}

.actions {
    display: flex;
    gap: 8px;
}

.actions button,
.block-row button,
.report button {
    min-height: 34px;
    padding: 0 10px;
}

.search {
    display: flex;
    gap: 8px;
    min-width: min(420px, 100%);
}

.two-col,
.admin-panels {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr 1fr;
    margin-top: 18px;
}

.admin-panels {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.report {
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
}

.report p {
    margin: 8px 0;
}

.block-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.block-row {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding-bottom: 8px;
}

.redirect-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.redirect-row {
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 10px;
    padding-bottom: 12px;
}

.redirect-row strong,
.redirect-row span,
.redirect-row small {
    display: block;
}

.redirect-row span {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.redirect-row small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.checkbox-row {
    align-items: center;
    display: flex;
    font-weight: 700;
    gap: 9px;
}

.checkbox-row input {
    min-height: 0;
    width: auto;
}

@media (max-width: 820px) {
    .shorten-form,
    .split,
    .stats-grid,
    .two-col,
    .admin-panels {
        grid-template-columns: 1fr;
    }

    .admin-head,
    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .search {
        width: 100%;
    }

    .actions {
        flex-direction: column;
    }
}
