:root {
    color-scheme: dark;
    --bg: #101315;
    --surface: #181d21;
    --surface-strong: #20272c;
    --line: #2e373d;
    --text: #edf1f2;
    --muted: #9ca9ad;
    --accent: #60c7a8;
    --accent-strong: #44a98b;
    --warn: #f0b35b;
    --bad: #e06f6f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.topnav {
    align-items: center;
    background: rgba(16, 19, 21, 0.92);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 28px;
    justify-content: space-between;
    padding: 18px clamp(18px, 5vw, 64px);
    position: sticky;
    top: 0;
    z-index: 3;
}

.brand {
    color: var(--accent);
    font-weight: 800;
}

.topnav nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.topnav nav a {
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    padding: 8px 10px;
}

.topnav nav a:hover {
    border-color: var(--line);
    color: var(--text);
}

.shell {
    margin: 0 auto;
    max-width: 1280px;
    padding: 34px clamp(18px, 5vw, 64px) 70px;
}

.page-heading {
    margin-bottom: 26px;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    margin: 0 0 8px;
    text-transform: uppercase;
}

h1, h2 {
    letter-spacing: 0;
    margin: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
    font-size: 1.1rem;
}

p {
    color: var(--muted);
    line-height: 1.55;
}

.metric-grid,
.entry-grid,
.two-column {
    display: grid;
    gap: 16px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
}

.entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.two-column {
    grid-template-columns: 2fr 1fr;
    margin-bottom: 18px;
}

.metric-card,
.entry-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric-card span {
    color: var(--muted);
    display: block;
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.metric-card strong {
    font-size: 1.8rem;
}

.entry-card__head,
.section-title {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.entry-card__head p {
    margin: 6px 0 0;
}

label {
    color: var(--muted);
    display: grid;
    gap: 8px;
    font-size: 0.88rem;
}

input,
textarea {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    min-width: 0;
    padding: 10px 11px;
    width: 100%;
}

textarea {
    resize: vertical;
}

.field-row {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 0.8fr 0.8fr;
    margin-bottom: 12px;
}

.switch {
    align-items: center;
    display: flex;
    gap: 9px;
    white-space: nowrap;
}

.switch input {
    accent-color: var(--accent);
    width: auto;
}

button {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    min-height: 42px;
    padding: 10px 14px;
}

.primary-button {
    background: var(--accent);
    color: #0b1412;
    margin-top: 14px;
}

.secondary-button {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    color: var(--text);
}

.copy-panel pre {
    background: #0c0f10;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #d9e5e2;
    line-height: 1.5;
    margin: 0;
    overflow-x: auto;
    padding: 16px;
    white-space: pre-wrap;
}

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

.alert.success {
    background: rgba(96, 199, 168, 0.16);
    border: 1px solid rgba(96, 199, 168, 0.45);
}

.alert.error {
    background: rgba(224, 111, 111, 0.16);
    border: 1px solid rgba(224, 111, 111, 0.45);
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 11px 8px;
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 0.8rem;
}

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

.insight-list p {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0;
}

.insight-list strong,
.rate-pill {
    color: var(--text);
}

.rate-pill {
    background: rgba(96, 199, 168, 0.12);
    border: 1px solid rgba(96, 199, 168, 0.4);
    border-radius: 6px;
    padding: 6px 10px;
}

@media (max-width: 900px) {
    .metric-grid,
    .entry-grid,
    .two-column {
        grid-template-columns: 1fr;
    }

    .field-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topnav {
        align-items: flex-start;
        flex-direction: column;
    }
}
