:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #69758a;
    --line: #dbe3ef;
    --primary: #1769e0;
    --primary-dark: #1153b5;
    --danger: #d13f3f;
    --danger-dark: #a92f2f;
    --success-bg: #e8f7ee;
    --success: #197744;
    --error-bg: #fdecec;
    --error: #aa2525;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

.shell {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0;
}

.shell.compact {
    width: min(560px, calc(100% - 32px));
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 16px 40px rgba(23, 32, 51, 0.08);
}

.panel + .panel {
    margin-top: 20px;
}

.topbar,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 32px;
    line-height: 1.15;
}

h2 {
    margin-bottom: 0;
    font-size: 20px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.shorten-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.login-row {
    grid-template-columns: 1fr 120px;
}

input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--text);
    font: inherit;
}

input:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(23, 105, 224, 0.16);
}

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

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

.link-button,
.secondary {
    background: #eef3fb;
    color: var(--text);
}

.link-button:hover,
.secondary:hover {
    background: #e1e9f6;
}

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

.danger:hover {
    background: var(--danger-dark);
}

.danger.strong {
    background: #8f2424;
}

.alert {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
    font-weight: 700;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success);
}

.alert.error {
    background: var(--error-bg);
    color: var(--error);
}

.result {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfe;
}

.result span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.result strong {
    display: block;
    overflow-wrap: anywhere;
}

.recent-links {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.recent-links .section-heading {
    margin-bottom: 14px;
}

.recent-list {
    display: grid;
    gap: 10px;
}

.recent-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: #f9fbfe;
}

.recent-main {
    min-width: 0;
}

.recent-main a,
.recent-main span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-main a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.recent-main a:hover {
    text-decoration: underline;
}

.recent-main span,
.recent-item time,
.empty-state {
    color: var(--muted);
}

.recent-item time {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.empty-state {
    margin-bottom: 0;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.status {
    border-radius: 999px;
    padding: 6px 10px;
    background: #eef3fb;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.status.online {
    background: var(--success-bg);
    color: var(--success);
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: -6px 0 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.docs {
    line-height: 1.65;
}

pre {
    overflow-x: auto;
    border-radius: 8px;
    padding: 16px;
    background: #111827;
    color: #e9f0fb;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (max-width: 680px) {
    .shell {
        width: min(100% - 20px, 920px);
        padding: 20px 0;
    }

    .panel {
        padding: 20px;
    }

    .topbar,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
    }

    h1 {
        font-size: 28px;
    }

    .input-row,
    .login-row {
        grid-template-columns: 1fr;
    }

    button,
    .primary-link,
    .link-button {
        width: 100%;
    }

    .admin-actions,
    .admin-actions form,
    .topbar-actions a {
        width: 100%;
    }

    .recent-item {
        grid-template-columns: 1fr;
    }
}
