:root { --bg: #f6f4ef; --card: #fff; --fg: #1d1d1b; --muted: #6f6c65; --line: #e3dfd5; --accent: #2f5d8a; --accent2: #a05a00; --danger: #b3261e; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .2em 0 .4em; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
code { background: #ece8de; padding: 1px 5px; border-radius: 4px; font-size: .88em; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .strong { font-weight: 700; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: #1d1d1b; color: #fff; flex-wrap: wrap; }
.top .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.top nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.top nav a, .top nav .linkbtn { color: #ddd; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.top nav a.on, .top nav a:hover, .top nav .linkbtn:hover { background: #3a3a37; color: #fff; }
main { max-width: 1100px; margin: 0 auto; padding: 20px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin: 0 0 16px; }
.card.narrow { max-width: 440px; }
.card.slim { padding: 10px 14px; }
details.card summary { cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; }
.grow { flex: 1; min-width: 220px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
label input, label select { display: block; margin-top: 4px; }
input[type=text], input:not([type]), input[type=password], input[type=search], input[type=date], select, textarea {
  font: inherit; color: var(--fg); background: #fff; border: 1px solid #cfcabd; border-radius: 7px; padding: 8px 10px; width: 100%; }
.row.wrap label { margin: 0; }
.row.wrap input[type=date] { width: auto; }
textarea { min-height: 460px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; resize: vertical; }

.btn { display: inline-block; font: inherit; font-size: .95rem; padding: 8px 14px; border-radius: 7px; border: 1px solid #cfcabd; background: #fff; color: var(--fg); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 3px 10px; font-size: .85rem; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.danger { color: var(--danger) !important; }
form.inline { display: inline; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 14px; background: #e6f2e6; border: 1px solid #b9d9b9; }
.flash.err { background: #fbe9e7; border-color: #efb9b2; }
.checks { list-style: none; padding: 0; } .checks .pass { color: #2e7d32; } .checks .fail { color: var(--danger); }

.search { display: flex; gap: 8px; margin: 0 0 14px; }
.upload { margin-top: 12px; }
.upload .radios { margin: 10px 0; font-size: .9rem; }
.upload .radios label { display: inline; margin-left: 10px; color: var(--fg); }

table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th, table.list td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
table.list th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #faf8f3; }
table.list tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions > * { margin-left: 12px; }
@media (max-width: 640px) { table.list th:nth-child(3), table.list td:nth-child(3) { display: none; } td.actions { white-space: normal; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--fg); }
.tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.tile strong { font-size: 1.15rem; } .tile .go { color: var(--accent); margin-top: 8px; font-weight: 600; }

ol.setlist { list-style: none; margin: 0 0 12px; padding: 0; }
ol.setlist li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); background: var(--card); }
ol.setlist li .num { color: var(--muted); min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
ol.setlist li .t { flex: 1; min-width: 0; }
ol.setlist li .t small { display: block; }
ol.setlist li form { display: flex; gap: 4px; flex: none; }
ol.setlist li.dragging { opacity: .4; }
.grip { cursor: grab; color: #b5b0a3; user-select: none; }
.icon { font: inherit; width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; color: var(--muted); }
.icon:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.icon:disabled { opacity: .3; cursor: default; }

ul.pick { list-style: none; margin: 0 0 12px; padding: 0; max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
ul.pick li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
ul.pick li:last-child { border-bottom: 0; }
ul.pick label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--fg); font-size: .95rem; flex: 1; cursor: pointer; }
ul.pick label input { margin: 0; }
.badge { font-size: .7rem; font-style: normal; background: #efe7d4; color: var(--accent2); border-radius: 4px; padding: 1px 6px; }
.sticky { position: sticky; bottom: 0; }

.tabs { display: flex; gap: 4px; margin: 6px 0 0; }
.tabs button { font: inherit; padding: 7px 14px; border: 1px solid var(--line); border-bottom: 0; background: #ece8de; border-radius: 8px 8px 0 0; cursor: pointer; }
.tabs button.on { background: var(--card); font-weight: 600; }
.tabpane { background: var(--card); border: 1px solid var(--line); border-radius: 0 10px 10px 10px; padding: 18px 22px; }

/* chord sheet */
.chordsheet .sec { margin: 0 0 1em; }
.chordsheet .lbl, .lyrics-preview .lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.chordsheet .cmt, .lyrics-preview .cmt { font-style: italic; color: var(--muted); }
.chordsheet .cmt.comment_box { display: inline-block; border: 1px solid var(--muted); padding: 0 6px; font-style: normal; }
.chordsheet .sec-chorus, .lyrics-preview .sec-chorus { border-left: 3px solid var(--accent2); padding-left: 12px; }
.chordsheet .cl { white-space: pre; line-height: 1.25; }
.chordsheet .cl.has-ch { margin-top: .2em; }
.chordsheet .cs { display: inline-flex; flex-direction: column; vertical-align: bottom; }
.chordsheet .ch { color: var(--accent2); font-weight: 700; font-size: .9em; padding-right: .35em; }
.chordsheet .ly { white-space: pre; }
.chordsheet .gap, .lyrics-preview .gap { height: .7em; }
.chordsheet pre.tab { font-size: 13px; background: #faf8f3; padding: 8px; border-radius: 6px; overflow-x: auto; }
.lyrics-preview { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; min-height: 200px; font-size: 1.05rem; }
.lyrics-preview .sec { margin: 0 0 1em; }
.lyrics-preview h3 { margin: 0 0 .6em; color: var(--accent2); }
.editor .lyrics-preview { min-height: 460px; max-height: 70vh; overflow-y: auto; margin-top: 4px; }
.radios label { display: inline-flex !important; align-items: center; gap: 5px; margin: 0 0 0 12px !important; color: var(--fg); }
.radios label:first-child { margin-left: 0 !important; }
.radios label input { display: inline; width: auto; margin: 0; }
table.users td { vertical-align: middle; }
table.users .row { gap: 6px; flex-wrap: wrap; }
table.users .row input, table.users .row select { width: auto; min-width: 110px; padding: 5px 8px; }
td.actions details.reset { display: inline-block; text-align: left; }
td.actions details.reset summary { list-style: none; display: inline; }
td.actions details.reset summary::-webkit-details-marker { display: none; }
td.actions details.reset[open] form { margin-top: 6px; }
.row.wrap label select { display: block; margin-top: 4px; width: auto; }
.scroll-x { overflow-x: auto; }
table.users td.actions { white-space: normal; min-width: 180px; }
table.users td.actions > * { margin-left: 0; display: block; margin-bottom: 4px; }
table.users td.actions details.reset input { width: 130px; min-width: 0; }
.forgot { margin-left: 14px; font-size: .9rem; }
ol.steps { padding-left: 22px; } ol.steps li { margin: 0 0 6px; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--fg); }
label.check input { display: inline; width: auto; margin: 0; }
