/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

img, picture, svg, video {
    display: block;
    max-width: 100%;
}

body {
    min-height: 100vh;
}

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

/* Style */
:root {
    font-family:
        "JetBrains Mono",
        "Iosevka",
        "SF Mono",
        Consolas,
        monospace;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #111111;
    --surface: #1d1d1d;
    --border: #3a3a3a;

    --text: #eeeeee;
    --text-muted: #aaaaaa;

    --accent: #7aa2f7;
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg: #f7f7f7;
    --surface: #ffffff;
    --border: #d8d8d8;

    --text: #1f1f1f;
    --text-muted: #6b6b6b;

    --accent: #3b82f6;
}

body {
    background: var(--bg);
    color: var(--text);
}

/* Components */
.button {
    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 4px;

    padding: 0.5em 0.9em;

    cursor: pointer;
    outline: none;
}
.button:hover,
.button:focus {
    border-color: var(--accent);
}

.input {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    outline: none;
}
.input:hover,
.input:focus {
    border-color: var(--accent);
}

.popup {
    background: var(--bg);

    border: 1px solid var(--border);
    border-radius: 6px;

    padding: 1.2rem;
    margin: auto;
    outline: none;
}
.popup::backdrop {
    background: rgba(0, 0, 0, 0.65);
}
.popup p {
    line-height: 1.5;
}
.popup code {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.1em 0.3em;
}

.tab-button {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.3em 0.1em;
    cursor: pointer;
    color: var(--text-muted);
}
.tab-button:hover {
    color: var(--text);
}
.tab-button.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab-panel {
    padding-left: 1.4em;
    line-height: 1.5;
}
.tab-panel li {
    margin-bottom: 0.4em;
}

.setting {
    display: flex;
    align-items: center;
    gap: 1em;
}
.setting label {
    width: 8em;
    flex-shrink: 0;
}
.setting input,
.setting select {
    flex: 1;
    min-width: 0;
}

/* Util */
.fg-bold  { font-weight: 700; }
.fg-muted { color: var(--text-muted); }

.link {
    color: var(--accent);
    text-decoration: underline;
}

.text-xl     { font-size: 2.0rem; }
.text-lg     { font-size: 1.4em; }
.text-center { text-align: center; }

.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

.py-0\.2 { padding-block: 0.2em; }
.py-0\.8 { padding-block: 0.8em; }
.px-0\.6 { padding-inline: 0.6em; }
.px-1\.2 { padding-inline: 1.2em; }

.space-x > * { margin-right: 0.4em; }
.space-y > * { margin-bottom: 0.8em; }

.w-full       { width: 100%; }
.max-w-lg     { max-width: 18rem; }
.max-w-xl     { max-width: 34rem; }
.min-h-screen { min-height: 100vh; }

.flex           { display: flex; }
.flex-column    { flex-direction: column; }
.justify-center { justify-content: center; }
.align-center   { align-items: center; }

.gap-1 { gap: 1em; }
