:root {
  --accent: #c2410c;
  --text: #1f2328;
  --muted: #646b73;
  --line: #dfe2e6;
  --bg: #f6f7f8;
  --card: #fff;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .75rem; }
.muted { color: var(--muted); }
.err { color: #b42318; min-height: 1.5em; margin: .5rem 0 0; }

#top { background: var(--card); border-bottom: 1px solid var(--line); }
#top nav { max-width: 64rem; margin: 0 auto; padding: .6rem 1rem; display: flex; gap: 1.25rem; align-items: center; }
#top .brand { font-weight: 700; color: var(--text); text-decoration: none; margin-right: auto; }
#top nav a { text-decoration: none; color: var(--muted); }
#top nav a.active { color: var(--text); font-weight: 600; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.25rem; }
footer a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
.narrow { max-width: 26rem; margin: 2rem auto; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

label { display: block; margin: .75rem 0 .25rem; font-weight: 500; }
input, select, textarea { font: inherit; width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: inherit; }
input:focus, select:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.row input, .row select { width: auto; flex: 1; }

button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--text); padding: .45rem .9rem; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
button:hover, .btn:hover { border-color: #b8bdc3; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: #b42318; }
button.primary.danger { background: #b42318; border-color: #b42318; color: #fff; }
button.small { padding: .2rem .55rem; font-size: .875rem; }
button:disabled { opacity: .5; cursor: default; }
.ok { color: #1a7f37; font-size: .9rem; }

.list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.list > li { padding: .7rem 1rem; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; }
.list > li:first-child { border-top: 0; }
.list > li > .grow { flex: 1; min-width: 0; }
.list a.item { color: inherit; text-decoration: none; display: block; }
.list a.item:hover strong { color: var(--accent); }

.icon { width: 28px; height: 28px; flex: none; color: var(--muted); }
.icon.own { color: var(--accent); }
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tabs a { padding: .35rem .8rem; border-radius: 7px; text-decoration: none; color: var(--muted); }
.tabs a.active { background: var(--card); border: 1px solid var(--line); color: var(--text); }

.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .75rem; margin-top: .75rem; }
.page { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; font-size: .85rem; display: flex; flex-direction: column; gap: .4rem; }
.page .thumb { height: 10rem; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: 5px; overflow: hidden; color: var(--muted); text-decoration: none; }
.page .thumb img { max-width: 100%; max-height: 100%; }
.page .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 1.25rem; text-align: center; color: var(--muted); margin-top: .75rem; cursor: pointer; }
.drop.over { border-color: var(--accent); color: var(--accent); }
.part { margin-top: 1rem; }
.part > .head { display: flex; align-items: center; gap: .6rem; }
.part > .head h3 { margin: 0; font-size: 1.05rem; flex: 1; }
audio { width: 100%; }
iframe.vocal { width: 100%; height: 26rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem; width: min(28rem, 92vw); }
dialog::backdrop { background: rgb(0 0 0 / .35); }
dialog .actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.qr { width: 14rem; margin: 1rem auto; }
.code { font: 600 1.75rem ui-monospace, monospace; letter-spacing: .25em; text-align: center; }
