:root {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 3.9%;
    --card-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --secondary: 240 3.7% 15.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --accent: 240 3.7% 15.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 3.7% 15.9%;
    --input: 240 3.7% 15.9%;
    --ring: 240 4.9% 83.9%;
    --radius: 0.5rem;
    color-scheme: dark;
}

* { border-color: hsl(var(--border)); }
body { background: hsl(var(--background)); color: hsl(var(--foreground)); }
[x-cloak] { display: none !important; }
html, body { overflow-x: clip; }
.grid > *, .flex > * { min-width: 0; }
pre, code { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; }

.glow-effect { box-shadow: 0 0 40px -10px rgba(255, 255, 255, 0.1); }
.glow-primary { box-shadow: 0 0 20px -5px rgba(255, 255, 255, 0.2); }

.input, .select, .textarea {
    display: flex;
    width: 100%;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--input));
    background: hsl(var(--background));
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
    transition: box-shadow .15s, border-color .15s;
}
.input, .select { height: 2.5rem; }
.textarea { min-height: 8rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.5; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: hsl(var(--muted-foreground)); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / .6);
}
.label { display: block; margin-bottom: .375rem; font-size: .875rem; font-weight: 500; }
.hint { margin-top: .25rem; font-size: .75rem; color: hsl(var(--muted-foreground)); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    height: 2.5rem; padding: 0 1rem; border-radius: calc(var(--radius) - 2px);
    font-size: .875rem; font-weight: 500; white-space: nowrap;
    transition: background-color .15s, color .15s, opacity .15s;
    border: 1px solid transparent; cursor: pointer;
}
.btn { flex-shrink: 0; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-sm { height: 2rem; padding: 0 .75rem; font-size: .8125rem; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / .9); }
.btn-outline { border-color: hsl(var(--input)); background: hsl(var(--background)); color: hsl(var(--foreground)); }
.btn-outline:hover, .btn-ghost:hover { background: hsl(var(--accent)); }
.btn-ghost { color: hsl(var(--muted-foreground)); }
.btn-danger { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }
.btn-danger:hover { background: hsl(var(--destructive) / .85); }

.card { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: .75rem; }

.table { width: 100%; font-size: .875rem; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: hsl(var(--muted-foreground)); padding: .75rem 1rem; border-bottom: 1px solid hsl(var(--border)); white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: hsl(var(--accent) / .35); }

@media (max-width: 639px) {
    .table:not(.table-compact) thead { display: none; }
    .table:not(.table-compact), .table:not(.table-compact) tbody, .table:not(.table-compact) tr, .table:not(.table-compact) td { display: block; width: 100%; }
    .table:not(.table-compact) tr { padding: .75rem 1rem; border-bottom: 1px solid hsl(var(--border)); }
    .table:not(.table-compact) tr:last-child { border-bottom: 0; }
    .table:not(.table-compact) td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .3rem 0; border: 0; text-align: right; white-space: normal; }
    .table:not(.table-compact) td::before { content: attr(data-label); flex-shrink: 0; font-size: .75rem; color: hsl(var(--muted-foreground)); text-align: left; }
    .table:not(.table-compact) td[data-label=""] { justify-content: flex-end; }
    .table:not(.table-compact) td[data-label=""]::before { display: none; }
    .table:not(.table-compact) td:first-child { display: block; text-align: left; padding-bottom: .5rem; }
    .table:not(.table-compact) td:first-child::before { display: none; }
    .table:not(.table-compact) td.w-14 { display: none; }
    .table:not(.table-compact) td.w-14 + td { display: block; text-align: left; padding-bottom: .5rem; }
    .table:not(.table-compact) td.w-14 + td::before { display: none; }
    .table-compact th, .table-compact td { padding: .6rem .5rem; }
    .table-compact th:first-child, .table-compact td:first-child { padding-left: 1rem; }
    .table-compact th:last-child, .table-compact td:last-child { padding-right: .5rem; }
}
}

.lyric-line { display: flex; gap: .75rem; padding: .2rem 0; }
.lyric-line .t { color: hsl(var(--muted-foreground)); font-family: ui-monospace, Menlo, monospace; font-size: .75rem; min-width: 4.5rem; flex-shrink: 0; padding-top: .15rem; }

.doc h2 { scroll-margin-top: 1.5rem; }
.doc code:not(pre code) { background: hsl(var(--secondary)); padding: .1rem .35rem; border-radius: .25rem; font-size: .85em; }

.prose-legal { max-width: 46rem; line-height: 1.7; color: hsl(var(--muted-foreground)); }
.prose-legal h2 { margin: 2.25rem 0 .75rem; font-size: 1.25rem; font-weight: 700; color: hsl(var(--foreground)); scroll-margin-top: 1.5rem; }
.prose-legal h2:first-child { margin-top: 0; }
.prose-legal p { margin: .75rem 0; }
.prose-legal ul { margin: .75rem 0; padding-left: 1.25rem; list-style: disc; }
.prose-legal li { margin: .35rem 0; }
.prose-legal strong { color: hsl(var(--foreground)); font-weight: 600; }
.prose-legal a { color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 3px; }
.prose-legal code { background: hsl(var(--secondary)); padding: .1rem .35rem; border-radius: .25rem; font-size: .85em; }
