:root {
    --bg: #ffffff;
    --panel: #f7f7f7;
    --border: #e6e6e6;
    --text: #000000;
    --muted: #999999;
    --accent: #000000;
    --accent-hover: #0f0f0f;
    --accent-left: #ff4dff;
    --accent-right: #e5a82e;
    --accent-a: #000000;
    --accent-b: #666666;
    --error: #ff3333;
    --radius: 6px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --panel: #1a1a1a;
        --border: #333333;
        --text: #ffffff;
        --muted: #999999;
        --accent: #ffffff;
        --accent-hover: #f0f0f0;
        --accent-left: #ff66ff;
        --accent-right: #f2ba49;
        --accent-a: #ffffff;
        --accent-b: #999999;
        --error: #ff4d4d;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        "IBM Plex Sans",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    font-size: 13px;
    line-height: 1.25;
}

.app {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Header / mode toggle */
.mode-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.mode-card {
    flex: 1 1 0;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0.5;
    transition:
        opacity 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

.mode-card:hover {
    opacity: 1;
    background: var(--panel);
}

.mode-card[aria-selected="true"] {
    opacity: 1;
    background: var(--panel);
    border-color: var(--text);
}

.mode-card:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.mode-card .tagline {
    width: auto;
    margin: 0;
}

.title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 400;
}

.title-left {
    color: var(--accent-left);
}

.title-right {
    color: var(--accent-right);
}

.title-a {
    color: var(--accent-a);
}

.title-b {
    color: var(--accent-b);
}

.pronunciation {
    margin: 0;
    color: var(--muted);
    letter-spacing: 0.05em;
}

.heading-divider {
    height: 1px;
    width: 24px;
    background: var(--border);
    margin: 12px 0;
}

.tagline {
    margin: 0 0 24px;
    width: 50%;
    text-wrap: balance;
    line-height: 1.5;
}

/* Controls */
.controls {
    margin-bottom: 24px;
}

.generate-btn {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.generate-btn:hover {
    background: var(--accent-hover);
}

/* Error */
.error {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--error);
    border-radius: var(--radius);
    color: var(--error);
}

/* Results */
.results {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

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

.row:last-child {
    border-bottom: none;
}

.password {
    font-family:
        "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 16px;
    font-weight: 300;
    word-break: break-all;
    letter-spacing: 0.05em;
}

/* Color the two words so the structure is visible at a glance. */
.seg-left {
    color: var(--accent-left);
}

.seg-right {
    color: var(--accent-right);
}

.seg-a {
    color: var(--accent-a);
}

.seg-b {
    color: var(--accent-b);
}

.copy-btn {
    flex: none;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.copy-btn:hover {
    border-color: var(--muted);
}

.copy-btn.copied {
    color: var(--muted);
}

.copy-btn.copied:hover {
    border-color: var(--border);
}

/* Footer */
.footer {
    margin-top: 40px;
    color: var(--muted);
    line-height: 1.5;
}

.empty {
    color: var(--muted);
    padding: 24px 0;
}

@media (max-width: 480px) {
    .mode-toggle {
        flex-direction: column;
    }
}

@media (max-width: 320px) {
    .row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
