@font-face { font-family: 'Creato Display'; src: url('/fonts/CreatoDisplay-Regular.woff2') format('woff2'), url('/fonts/CreatoDisplay-Regular.otf') format('opentype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Creato Display'; src: url('/fonts/CreatoDisplay-Bold.woff2') format('woff2'), url('/fonts/CreatoDisplay-Bold.otf') format('opentype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Optima'; src: local('Optima'), url('/fonts/Optima.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Rosie Brown'; src: url('/fonts/RosieBrown.woff2') format('woff2'), url('/fonts/RosieBrown.otf') format('opentype'); font-display: swap; }

:root {
  --bistre: #382318; --almond: #F5E4D1; --gold: #D9982C; --green: #2F6A2B;
  --mint: #D4E9E2; --red: #8A0101; --white: #FFFFFF; --rule: #E7DCCF; --muted: #7A6A5F;
  --head: Optima, Candara, 'Segoe UI', sans-serif;
  --body: 'Creato Display', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--bistre); font: 16px/1.5 var(--body); }
a { color: var(--bistre); text-decoration-color: var(--gold); text-underline-offset: 3px; }
h1, h2 { font-family: var(--head); font-weight: 400; letter-spacing: .01em; }
h1 { font-size: 1.9rem; margin: .2rem 0 1.4rem; }
h2 { font-size: 1.3rem; margin: 0 0 .8rem; }
main { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: var(--almond); padding: .15rem .4rem; border-radius: 3px; word-break: break-all; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding: .9rem 1rem; border-bottom: 1px solid var(--rule); }
.brand { font-family: var(--head); font-size: 1.35rem; text-decoration: none; color: var(--bistre); }
.brand span { color: var(--gold); }
.top nav { display: flex; flex-wrap: wrap; gap: .2rem; flex: 1; }
.top nav a { text-decoration: none; padding: .35rem .7rem; border-radius: 3px; }
.top nav a.on { background: var(--almond); }
.me { display: flex; gap: .8rem; align-items: center; font-size: .9rem; }
.me form { margin: 0; }

/* banner and flash */
.takeover-banner { background: var(--red); color: var(--white); display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: center; padding: .6rem 1rem; }
.takeover-banner form { margin: 0; }
.flash { padding: .7rem 1rem; border-left: 3px solid var(--green); background: var(--mint); margin-bottom: 1rem; }
.flash.err { border-color: var(--red); background: #F7E3E0; }
.note { background: var(--almond); padding: .7rem 1rem; }

/* buttons and forms */
.btn, .btn-light, button.link { font: inherit; cursor: pointer; border-radius: 3px; }
.btn { background: var(--gold); color: var(--bistre); border: 1px solid var(--gold); padding: .55rem 1.1rem; font-weight: 700; display: inline-block; }
.btn:hover { filter: brightness(.95); }
.btn.danger { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-light { background: var(--white); border: 1px solid var(--rule); padding: .4rem .8rem; color: var(--bistre); text-decoration: none; display: inline-block; }
.btn-light:disabled { opacity: .35; cursor: default; }
.danger-text { color: var(--red); }
button.link { background: none; border: 0; text-decoration: underline; text-decoration-color: var(--gold); padding: 0; color: var(--bistre); }
label { display: block; margin-bottom: .9rem; font-size: .92rem; }
input, select { font: inherit; display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; border: 1px solid var(--rule); border-radius: 3px; background: var(--white); color: var(--bistre); }
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 0; }
label.check { display: flex; gap: .5rem; align-items: center; }
label.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--rule); padding: .6rem .9rem; margin: 0 0 .9rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.inline-form input, .inline-form select { width: auto; margin: 0; flex: 1 1 140px; }
.inline-form input[type=time] { flex: 0 0 auto; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; align-items: end; }
.grid-form .btn { margin-bottom: .9rem; }
.card { border: 1px solid var(--rule); padding: 1.2rem; margin-bottom: 1.5rem; background: var(--white); }
.card.narrow { max-width: 420px; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.filters select, .filters input { width: auto; margin: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.toolbar form { margin: 0; flex: 1; }

/* overview */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.tile { border: 1px solid var(--rule); padding: 1rem; background: var(--almond); }
.tile-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .3rem; }
.pill { display: inline-block; font-size: .78rem; padding: .1rem .55rem; border-radius: 99px; background: var(--mint); color: var(--bistre); white-space: nowrap; }
.pill.on { background: var(--green); color: var(--white); }
.pill.off { background: var(--red); color: var(--white); }

/* media */
.dropzone { border: 1px dashed var(--gold); padding: 1.4rem; text-align: center; background: #FCF7F1; margin-bottom: 1rem; }
.dropzone.over { background: var(--almond); }
.dropzone p { margin: .4rem 0; }
#upload-list { list-style: none; padding: 0; margin: .8rem 0 0; text-align: left; }
#upload-list li { padding: .3rem 0; border-top: 1px solid var(--rule); font-size: .9rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.media-card { display: block; border: 1px solid var(--rule); text-decoration: none; background: var(--white); margin: 0; }
.media-card img, .video-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #111; display: block; }
.video-thumb { color: var(--almond); display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.video-thumb.small { width: 64px; height: 40px; aspect-ratio: auto; }
.media-meta { padding: .5rem .6rem; display: flex; flex-direction: column; gap: .15rem; font-size: .9rem; }
.media-card.pick .btn-light, .pick .media-card .btn-light { margin: 0 .6rem .6rem; }
.preview { max-width: 100%; border: 1px solid var(--rule); background: #111; }

/* playlist */
.pl-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.pl-item { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .5rem; border-bottom: 1px solid var(--rule); background: var(--white); }
.pl-item.dragging { opacity: .5; }
.pl-item img { width: 64px; height: 40px; object-fit: cover; }
.pl-item form { margin: 0; display: flex; gap: .3rem; align-items: center; }
.pl-info { flex: 1 1 160px; display: flex; flex-direction: column; }
.handle { cursor: grab; color: var(--muted); user-select: none; }
.dur input { width: 70px; margin: 0; }

/* tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-bottom: 1.2rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font-weight: 400; font-family: var(--head); border-bottom: 1px solid var(--bistre); }
table.grid select { min-width: 140px; }
form.sched { margin-bottom: 2.5rem; }
tr.inactive { opacity: .5; }
td form { margin: 0; }

/* login */
body.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; background: var(--white); }
.login-box { width: 100%; max-width: 380px; padding: 2rem 1.2rem; text-align: center; }
.login-box form { text-align: left; margin-top: 1.5rem; }
.login-box .btn { width: 100%; }
.wordmark img { max-width: 220px; height: auto; }
.wordmark-text { font-family: 'Rosie Brown', var(--head); font-size: 3.2rem; color: var(--bistre); }
.strap { font-family: var(--head); color: var(--muted); margin: .2rem 0 0; }

@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .top { justify-content: space-between; }
  .top nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -1rem; padding: 0 1rem; }
  .top nav a { white-space: nowrap; }
  .me { font-size: .85rem; }
}
