:root {
  --ink: #17202b; --ink-2: #4a5666; --ink-3: #7b8796; --line: #dde3ea; --bg: #f4f6f9; --card: #fff;
  --blue: #1f5fbf; --blue-2: #e8f0fb; --green: #1d7a46; --green-2: #e3f4ea; --amber: #9a6100; --amber-2: #fbf0dc;
  --grey-2: #eceff3; --red: #b42318; --red-2: #fdeceb;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.5; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: .4em .85em; }
button:hover { border-color: #b9c3cf; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: #1a51a3; }
button.danger { color: var(--red); }
button.small { font-size: .85rem; padding: .2em .6em; }
button:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: .45em .6em; border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
textarea { min-height: 5em; resize: vertical; }
label { display: block; font-size: .85rem; color: var(--ink-2); margin: .7em 0 .25em; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* top bar */
.top { background: #12243f; color: #fff; }
.top .in { max-width: 1180px; margin: 0 auto; padding: .8em 1.2em; display: flex; align-items: center; gap: 1em; }
.brand { font-weight: 650; letter-spacing: .01em; display: flex; align-items: center; gap: .5em; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.2); }
.top .who { color: #c9d4e3; font-size: .9rem; }
.top button { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.top button:hover { border-color: #fff; }
.top a { color: #c9d4e3; }

main { max-width: 1180px; margin: 0 auto; padding: 1.4em 1.2em 3em; }
.intro { margin-bottom: 1.4em; }
.intro p { color: var(--ink-2); max-width: 46em; margin: .3em 0 0; }

/* presenter banner */
.present { background: var(--blue-2); border: 1px solid #c7d9f3; color: #183f7a; border-radius: var(--radius);
  padding: .6em 1em; margin-bottom: 1.2em; display: flex; align-items: center; gap: .8em; }
.present .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* cards grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1em 1.2em; display: flex; flex-direction: column; gap: .6em; cursor: pointer; transition: border-color .15s; }
.card:hover { border-color: #9fb6d6; }
.card .thumb { margin: -1.1em -1.2em .2em; height: 150px; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--grey-2) center / cover no-repeat; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.card .foot { margin-top: auto; display: flex; gap: .5em; flex-wrap: wrap; align-items: center; }
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15em .6em; border-radius: 999px; background: var(--grey-2); color: var(--ink-2); }
.pill.live { background: var(--green-2); color: var(--green); }
.pill.partial, .pill.building { background: var(--amber-2); color: var(--amber); }
.pill.planned { background: var(--blue-2); color: var(--blue); }
.pill.view { background: #fff; border: 1px solid #c7d9f3; color: var(--blue); }
.pill.view::before { content: "●"; color: #22a05a; margin-right: .35em; font-size: .7em; vertical-align: .15em; }

/* detail */
.detail { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3em 1.4em; }
.detail .back { margin-bottom: 1em; }
.detail .blurb { color: var(--ink-2); max-width: 50em; white-space: pre-line; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9em; margin: 1.1em 0; }
.gallery figure { margin: 0; background: var(--grey-2); border-radius: 8px; overflow: hidden; }
.gallery img, .gallery video { width: 100%; display: block; background: #000; }
.gallery img { cursor: zoom-in; background: var(--grey-2); }
.gallery audio { width: 100%; display: block; padding: .8em; }
.gallery figcaption { font-size: .85rem; color: var(--ink-2); padding: .45em .7em .6em; background: #fff; }
.tabs { display: flex; gap: .3em; border-bottom: 1px solid var(--line); margin-top: 1.2em; flex-wrap: wrap; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: .55em .9em; color: var(--ink-2); }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.liveframe { width: 100%; height: 72vh; border: 1px solid var(--line); border-top: none; border-radius: 0 0 8px 8px; background: #fff; display: block; }
.livebar { display: flex; gap: .8em; align-items: center; padding: .5em .2em; font-size: .85rem; color: var(--ink-3); }

.lightbox { position: fixed; inset: 0; background: rgba(10,15,25,.85); display: flex; align-items: center; justify-content: center; z-index: 50; cursor: zoom-out; padding: 2em; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }

/* sign-in pages */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5em; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 2em 2.2em; max-width: 440px; width: 100%; }
.panel h1 { font-size: 1.35rem; }
.panel p { color: var(--ink-2); }
.panel .err { color: var(--red); min-height: 1.4em; font-size: .9rem; margin-top: .6em; }
.panel button.primary { width: 100%; margin-top: 1.2em; padding: .6em; }
body.blocked main { max-width: 560px; padding-top: 4em; }

/* admin */
.admintabs { display: flex; gap: .3em; margin-bottom: 1.2em; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admintabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: .6em 1em; color: var(--ink-2); }
.admintabs button.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 1.2em; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list .item { padding: .7em 1em; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .item:last-child { border-bottom: none; }
.list .item:hover { background: #f8fafc; }
.list .item.on { background: var(--blue-2); }
.list .item .t { font-weight: 600; }
.list .item .s { font-size: .82rem; color: var(--ink-3); }
.list .new { padding: .7em 1em; background: #fafbfc; border-bottom: 1px solid var(--line); }
.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1em 1.3em 1.3em; }
.form h2 { display: flex; align-items: center; gap: .6em; }
.form .actions { display: flex; gap: .6em; margin-top: 1.3em; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1em; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .25em .8em; border: 1px solid var(--line); border-radius: 7px; padding: .6em .8em; }
.checks label { display: flex; gap: .5em; align-items: flex-start; margin: 0; color: var(--ink); font-size: .92rem; cursor: pointer; }
.checks .sub { color: var(--ink-3); font-size: .8rem; }
.checks input { margin-top: .3em; }
.invite { background: var(--green-2); border: 1px solid #b9e2c9; border-radius: 8px; padding: .8em 1em; margin-top: 1em; }
.invite code { display: block; word-break: break-all; margin: .4em 0; font-size: .85rem; background: #fff; padding: .4em .6em; border-radius: 5px; }
.note { background: var(--amber-2); border: 1px solid #f0d9ab; color: #6b4600; border-radius: 8px; padding: .6em .9em; font-size: .88rem; margin-top: .8em; }
.ok { color: var(--green); } .bad { color: var(--red); }
table.log { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); font-size: .88rem; }
table.log th, table.log td { text-align: left; padding: .45em .8em; border-bottom: 1px solid var(--line); vertical-align: top; }
table.log th { background: #fafbfc; font-weight: 600; color: var(--ink-2); }
.medialist { display: flex; flex-direction: column; gap: .5em; margin-top: .4em; }
.medialist .m { display: grid; grid-template-columns: 64px 1fr auto; gap: .6em; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: .4em; }
.medialist .m .th { width: 64px; height: 44px; background: var(--grey-2) center / cover; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--ink-3); overflow: hidden; }
.medialist .m .th img { width: 100%; height: 100%; object-fit: cover; }
.toast { position: fixed; bottom: 1.2em; left: 50%; transform: translateX(-50%); background: #12243f; color: #fff; padding: .6em 1.1em; border-radius: 8px; z-index: 60; font-size: .9rem; }
