:root {
    --primary: #4d38cc;
    --primary-hover: #3a2a99;
    --primary-light: #6046ff;
    --error: #fb3728;
    --success: #23b7b7;
    --radius: 8px;
    --radius-sm: 4px;

    --bg: #ffffff;
    --bg-secondary: #f0f2f5;
    --text: #181e21;
    --text-weak: #646f75;
    --border: #d8dbdc;
    --code-bg: #f0f2f5;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #a090ff;
        --primary-hover: #bfb5ff;
        --primary-light: #806bff;
        --bg: #0c0f10;
        --bg-secondary: #181e21;
        --text: #f0f2f5;
        --text-weak: #b1b7ba;
        --border: #3d4b52;
        --code-bg: #181e21;
    }
}

* { box-sizing: border-box; }

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    padding: 2rem;
}

.container {
    max-width: 720px;
    margin: 0 auto;
}

.container-narrow {
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.centered {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    margin-bottom: 2rem;
}

.logo svg, .logo img {
    height: 32px;
    width: auto;
}

@media (prefers-color-scheme: dark) {
    .logo img {
        filter: invert(1);
    }
}

h1 {
    font-weight: 700;
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
}

h1.small {
    font-size: 1.5rem;
}

h2 {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 2.5rem 0 1rem 0;
}

h3 {
    font-weight: 600;
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem 0;
}

h4 {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-weak);
    margin: 1.25rem 0 0.5rem 0;
}

.subtitle {
    color: var(--text-weak);
    margin: 0 0 2rem 0;
}

code {
    font-family: 'Space Mono', monospace;
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
}

pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}

ol, ul {
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

blockquote {
    background: var(--bg-secondary);
    border-left: 3px solid var(--border);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-family: 'Space Mono', monospace;
    font-size: 0.85em;
}

.note {
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.note strong {
    color: var(--primary);
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 2rem;
}

.card-label {
    font-size: 0.85rem;
    color: var(--text-weak);
    margin-bottom: 0.25rem;
}

.card-value {
    font-weight: 600;
    word-break: break-all;
}

.buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

button {
    font-family: inherit;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-weak);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-weak);
}

.btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.error {
    background: rgba(251, 55, 40, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.checkmark {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkmark svg {
    width: 32px;
    height: 32px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
}

.code-block {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-weak);
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.copy-btn .icon-check {
    display: none;
}

.copy-btn.copied .icon-copy {
    display: none;
}

.copy-btn.copied .icon-check {
    display: block;
}

.copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

/* OS Switcher */
.os-switcher {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.os-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-weak);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.os-btn:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--text-weak);
}

.os-btn.active {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
}

.os-icon {
    font-size: 1.1em;
    line-height: 1;
}

/* OS-specific content visibility */
.os-linux,
.os-macos {
    display: none;
}

.os-linux.active,
.os-macos.active {
    display: block;
}

/* External links */
a.external::after {
    content: " ↗";
    font-size: 0.85em;
}

/* Stats table */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.stats-table th,
.stats-table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.stats-table th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.stats-table tbody th {
    width: 60%;
}

.stats-table td {
    font-family: 'Space Mono', monospace;
    font-size: 0.95em;
}

.chart-container {
    position: relative;
    height: 280px;
    margin: 1.5rem 0;
}

.stats-generated {
    color: var(--text-weak);
    font-size: 0.85rem;
    margin-top: 1.5rem;
}

/* Admin details toggle */
.admin-details summary {
    list-style: none;
    cursor: pointer;
}

.admin-details summary::-webkit-details-marker {
    display: none;
}

.admin-details summary h2 {
    display: inline-block;
    margin: 2.5rem 0 1rem 0;
}

.admin-details summary h2::before {
    content: "\25b6";
    display: inline-block;
    font-size: 0.6em;
    margin-right: 0.5em;
    transition: transform 0.2s;
    vertical-align: middle;
}

.admin-details[open] summary h2::before {
    transform: rotate(90deg);
}

/* Pricing table */
.table-scroll {
    overflow-x: auto;
    margin: 1.5rem 0;
}

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

.pricing-table th,
.pricing-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    text-align: left;
}

.pricing-table th.num,
.pricing-table td.num {
    text-align: right;
    white-space: nowrap;
}

.pricing-table thead th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.pricing-table .section-header th {
    background: var(--bg-secondary);
    font-weight: 700;
    font-size: 1.1em;
    padding-top: 1rem;
}

.pricing-table .family-header td {
    font-weight: 600;
    color: var(--text-weak);
    font-size: 0.9em;
    padding: 0.4rem 0.75rem;
    border-bottom: none;
}

.pricing-table td code {
    font-size: 0.85em;
}

.recommended-badge {
    font-size: 0.7em;
    font-weight: 600;
    color: #fff;
    background: var(--primary);
    padding: 0.15em 0.5em;
    border-radius: 1em;
    margin-left: 0.5em;
    white-space: nowrap;
    vertical-align: middle;
}

@media (prefers-color-scheme: dark) {
    .recommended-badge {
        color: #4d38cc;
        background: #fff;
    }
}
