/* PRM Song Portal: the app's blue pastel look, no build step. */
:root {
  --ink: #1f2a44;
  --muted: #5b6785;
  --line: #d6deee;
  --bg: #f4f7fc;
  --card: #ffffff;
  --brand: #2f4a72;
  --brand-soft: #dfe8f5;
  --accent: #3d6aa8;
  --ok: #2e7d5b;
  --ok-soft: #dff2e8;
  --warn: #9a4b2f;
  --warn-soft: #fbe8df;
  --chord: #2f4a72;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6ebf5;
    --muted: #a5b0c8;
    --line: #2e3a52;
    --bg: #121826;
    --card: #1a2233;
    --brand: #9fbbe4;
    --brand-soft: #24324c;
    --accent: #9fbbe4;
    --ok: #8fd6b3;
    --ok-soft: #1d3a2e;
    --warn: #f0b199;
    --warn-soft: #3d2620;
    --chord: #a9c4ee;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Tamil", "Noto Sans Kannada", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); }
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; color: var(--brand); line-height: 1.2; }
h1 { font-size: 2.1rem; margin: .4rem 0 .6rem; }
h2 { font-size: 1.5rem; margin: 1.6rem 0 .6rem; }
code, .mono, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

.top { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; padding: .8rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.4rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; }
.top nav a { text-decoration: none; color: var(--muted); padding: .25rem .1rem; }
.top nav a.on { color: var(--brand); font-weight: 600; border-bottom: 2px solid var(--brand); }
.badge { background: var(--warn); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .8rem; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: .8rem 0; }
.narrow { max-width: 440px; margin: 2rem auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.pre { white-space: pre-wrap; }
.flash, .banner { background: var(--brand-soft); border-radius: 10px; padding: .7rem 1rem; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.errors { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: .7rem 1rem; margin: .8rem 0; }
.errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.or { text-align: center; color: var(--muted); margin: .8rem 0; }
.empty { text-align: center; }

.stack { display: grid; gap: .9rem; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.grow { flex: 1 1 12rem; min-width: 0; }
.grid { display: grid; gap: .8rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid .span2 { grid-column: span 2; }
@media (max-width: 760px) { .grid.four { grid-template-columns: repeat(2, 1fr); } }
.head-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }

label { display: grid; gap: .3rem; font-size: .9rem; color: var(--muted); }
label.check { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; width: 100%; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; }
.short { max-width: 9rem; }

.button { display: inline-block; font: inherit; font-weight: 600; background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: .55rem 1.2rem; cursor: pointer; text-decoration: none; text-align: center; }
@media (prefers-color-scheme: dark) { .button { color: #0f1626; } }
.button.small { padding: .3rem .8rem; font-size: .875rem; }
.button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.button.danger { background: var(--warn); }
.button.wide { display: block; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
button.icon { background: transparent; border: 1px solid var(--line); border-radius: 8px; width: 2rem; height: 2rem; cursor: pointer; color: var(--ink); }
button.icon.danger { color: var(--warn); }
form.inline { display: inline; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.filters input[type=search] { flex: 2 1 16rem; }
.filters select { flex: 1 1 10rem; width: auto; }
.song-row { display: flex; gap: .9rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; margin: .5rem 0; text-decoration: none; color: var(--ink); }
a.song-row:hover { border-color: var(--accent); }
.song-row .grow { display: grid; }
.first-line { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; flex: none; }
.tag { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: .05rem .6rem; font-size: .8rem; margin: .1rem .15rem; text-decoration: none; }
.status, .source { border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; white-space: nowrap; background: var(--brand-soft); color: var(--brand); }
.status-approved { background: var(--ok-soft); color: var(--ok); }
.status-rejected, .source-web { background: var(--warn-soft); color: var(--warn); }
.source-library { background: var(--ok-soft); color: var(--ok); }
.meta { margin: .2rem 0; font-weight: 600; }
.pager { display: flex; gap: 1rem; justify-content: center; align-items: center; margin: 1.2rem 0; }

/* Song sheet: chords sit above the syllable they fall on. */
.sheet-controls { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: 1rem 0; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.segmented button { background: transparent; border: 0; padding: .35rem .9rem; font: inherit; color: var(--ink); cursor: pointer; }
.segmented button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .3rem; }
.stepper button { background: none; border: 0; font-size: 1.2rem; width: 2rem; cursor: pointer; color: var(--ink); }
.part { margin: 1.2rem 0; }
.part h3 { font-family: system-ui, sans-serif; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 .3rem; }
.lyrics { font-size: 1.15rem; margin-bottom: .5rem; }
.lyrics.roman { font-style: italic; color: var(--muted); font-size: 1rem; }
.line { display: flex; flex-wrap: wrap; align-items: flex-end; min-height: 1.6em; }
.chunk { display: inline-flex; flex-direction: column; }
.chord { color: var(--chord); font-weight: 700; font-size: .85em; min-height: 1.25em; padding-right: .35em; font-style: normal; }
.words { white-space: pre; }
.sheet.no-chords .chord { display: none; }
.sheet.mode-native .lyrics.roman { display: none; }
.sheet.mode-roman .lyrics.native { display: none; }
.sheet.mode-roman .lyrics.roman { color: var(--ink); font-size: 1.15rem; }

/* Paste results */
.candidates { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .8rem; }
.candidate { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; display: grid; gap: .4rem; align-content: start; }
.candidate header { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.preview .lyrics { font-size: .95rem; }
.section-card { display: grid; gap: .5rem; }
.section-card select { width: auto; }
.tools { display: inline-flex; gap: .25rem; }

/* Moderation diff */
.diff { width: 100%; border-collapse: collapse; }
.diff th, .diff td { border-bottom: 1px solid var(--line); padding: .4rem .6rem; text-align: left; vertical-align: top; }
.old { background: var(--warn-soft); }
.new { background: var(--ok-soft); }
.diff-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.diff-pair.same { opacity: .55; }
.diff-pair pre { white-space: pre-wrap; padding: .6rem; border-radius: 8px; margin: 0 0 .8rem; }
.review-actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin: 1.5rem 0; }

/* Secure */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.list { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.list th, .list td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.list select { width: auto; }
.highlight { border-color: var(--accent); }
.key-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.key-row .grow { display: grid; }
.key-row input { width: 16rem; }
