:root {
  color-scheme: dark;
  --bg: #101713;
  --panel: #19241d;
  --line: #344638;
  --accent: #c6f870;
  --ink: #f0f6ed;
  --muted: #afc0b0;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
header, nav { background: var(--bg); }
header { border-bottom: 1px solid var(--line); }
.head, main { width: min(100% - 32px, 760px); margin-inline: auto; }
.head { display: flex; align-items: center; gap: 9px; height: 65px; font-weight: 850; font-size: 1.3rem; }
.head img { width: 35px; border-radius: 10px; }
.head small { margin-left: auto; color: var(--muted); font-weight: 550; font-size: .8rem; }
main { padding: 24px 0 calc(105px + env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 8vw, 2.65rem); line-height: 1.05; letter-spacing: -.055em; }
h2 { font-size: 1.24rem; }
h3 { font-size: 1.02rem; }
small, .sub { color: var(--muted); }
.sub { margin: 8px 0; }
.section { margin-top: 24px; }
.card, .login { background: var(--panel); border-radius: 17px; border: 1px solid var(--line); padding: 16px; margin-top: 12px; }
.card p { white-space: pre-line; }
.login { max-width: 420px; margin: min(12vh, 115px) auto 0; padding: 26px; }
button, input, select, textarea, .link { font: inherit; border-radius: 10px; }
button, .link { min-height: 44px; cursor: pointer; border: 1px solid var(--line); background: #223028; color: var(--ink); padding: 7px 13px; }
a { color: var(--accent); }
.link { display: inline-flex; align-items: center; text-decoration: none; }
.primary, button[aria-current=true] { background: var(--accent); border-color: var(--accent); color: #17220c; font-weight: 750; }
.danger { color: #ffc4b9; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
label { display: grid; gap: 5px; font-size: .93rem; }
input, select, textarea { min-width: 0; width: 100%; color: var(--ink); background: var(--bg); padding: 10px; border: 1px solid var(--line); font-size: 16px; }
textarea { min-height: 110px; resize: vertical; }
form { display: grid; gap: 13px; margin-top: 14px; }
.row, .bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar { justify-content: space-between; }
.actions { margin-top: 12px; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr)); }
.triple { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.days { display: flex; overflow: auto; gap: 6px; padding: 5px 3px; margin: 15px -3px 0; }
.days button { flex: 0 0 auto; }
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 1; }
nav button { border: 0; flex: 1; max-width: 160px; font-size: .85rem; padding-inline: 5px; }
#notice { position: fixed; bottom: calc(65px + env(safe-area-inset-bottom)); z-index: 2; left: 50%; transform: translateX(-50%); max-width: min(90vw, 640px); width: max-content; }
#notice:not(:empty) { background: #e0f5db; color: #121e14; padding: 10px 15px; border-radius: 12px; }
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 17px; width: min(100% - 22px, 590px); max-height: 88dvh; padding: 16px; }
dialog::backdrop { background: #000b; }
iframe, video { width: 100%; display: block; border: 0; height: min(49dvh, 405px); background: #080b09; border-radius: 12px; margin-top: 12px; }
.photo { width: 100%; max-height: 460px; object-fit: contain; border-radius: 12px; background: #101713; }
canvas { display: block; width: 100%; height: 145px; }

.series-list { display: grid; gap: 12px; }
.series-list fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 0; min-width: 0; }
.series-list legend { color: var(--accent); font-weight: 750; padding-inline: 6px; }
.series-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 9px; }
.series-history { margin-bottom: 0; padding-left: 22px; }
.player iframe, .player video {
  aspect-ratio: 9 / 16;
  width: min(100%, 300px, 36dvh);
  min-width: min(200px, 100%);
  height: auto;
  margin: 12px auto;
}
.import-entry label + label { margin-top: 8px; }
.import-entry button { margin-top: 9px; }
.pdf-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 35vh; overflow: auto; }
