:root {
  --primary: #6EA5C0;
  --primary-dark: #5a8aa3;
  --accent: #FE9E65;
  --text: #1a1a1a;
  --muted: #666;
  --bg: #f8f9fa;
  --card: #fff;
  --line: #e3e7ea;
  --ok: #2f8a5b;
  --warn: #b7791f;
  --err: #c0392b;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  color: var(--text);
  /* Same background as the visura.app landing page: blue glow top-left,
     orange glow bottom-right, dot grid, soft grey gradient. */
  background:
    radial-gradient(circle at 12% 18%, rgba(110, 165, 192, 0.28), transparent 38%),
    radial-gradient(circle at 88% 82%, rgba(254, 158, 101, 0.24), transparent 38%),
    radial-gradient(rgba(90, 138, 163, 0.22) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    linear-gradient(135deg, var(--bg) 0%, #e9ecef 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: var(--primary-dark); }
code { background: #eef3f6; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
h1, h2, h3 { line-height: 1.25; margin: .2em 0 .4em; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--muted); margin: 0; }

/* header */
.top {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .7rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--primary-dark); }
.brand span, .login h1 span { color: var(--accent); }
.top nav { display: flex; gap: .3rem; flex: 1; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--text); padding: .35rem .75rem; border-radius: 999px; }
.top nav a.on, .top nav a:hover { background: #eaf2f6; color: var(--primary-dark); }
.logout { display: flex; align-items: center; gap: .6rem; }
.who { color: var(--muted); font-size: .85rem; }

main.wide { max-width: 1200px; margin: 1.5rem auto; padding: 0 1.5rem; }
main.narrow { max-width: 420px; margin: 12vh auto; padding: 0 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1rem 0; box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.login h1 { color: var(--primary-dark); }
.login form { display: grid; gap: .8rem; margin: 1rem 0; }

/* forms */
label { display: grid; gap: .25rem; font-size: .85rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); padding: .5rem .65rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
button, .button {
  font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text);
  padding: .45rem .9rem; border-radius: 8px; text-decoration: none; display: inline-block;
}
button:hover, .button:hover { border-color: var(--primary); }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--primary-dark); }
button.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-size: .8rem; padding: .25rem .6rem; }
button.danger { color: var(--err); border-color: #f0c9c4; }
button.small { font-size: .8rem; padding: .25rem .6rem; }
button.link { border: 0; background: none; color: var(--primary-dark); padding: 0; text-decoration: underline; }
.row { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; }

/* messages */
.flash { padding: .6rem .9rem; border-radius: 8px; margin: .6rem 0; }
.flash.ok { background: #e8f5ee; color: var(--ok); }
.flash.err { background: #fbeceb; color: var(--err); }
.flash.warn { background: #fdf3e2; color: var(--warn); }
.attention { border-color: #f5d3c0; background: #fff8f3; }
.attention h2 { color: #b4552a; font-size: 1.05rem; }

.status-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill { font-size: .8rem; padding: .2rem .7rem; border-radius: 999px; }
.pill-ok { background: #e8f5ee; color: var(--ok); }
.pill-off { background: #f1f1f1; color: var(--muted); }

.page-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; }

/* week */
.week { margin: 1.2rem 0 2rem; }
.week-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.week-head h2 { font-size: 1.6rem; color: var(--primary-dark); }
.videos { display: grid; gap: 1rem; }
.video {
  display: grid; grid-template-columns: minmax(240px, 420px) 1fr; gap: 1.2rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
}
.video.vertical { grid-template-columns: 200px 1fr; }
.player video { width: 100%; border-radius: 8px; background: #000; display: block; }
.video.vertical .player video { aspect-ratio: 9 / 16; object-fit: contain; }
.nofile {
  aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; color: var(--muted);
  border: 2px dashed var(--line); border-radius: 8px; font-size: .9rem; padding: .5rem;
}
.video.vertical .nofile { aspect-ratio: 9 / 16; }
.info h3 { font-size: 1.05rem; }
.pubs { width: 100%; border-collapse: collapse; margin-top: .6rem; }
.pubs th { text-align: left; width: 90px; font-weight: 600; font-size: .9rem; }
.pubs td, .pubs th { padding: .45rem .3rem; border-top: 1px solid var(--line); vertical-align: top; }
.acts { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.acts form { margin: 0; }
.perr { color: var(--err); font-size: .8rem; margin-top: .2rem; }

/* status chips */
.st { font-size: .78rem; padding: .12rem .55rem; border-radius: 999px; background: #f1f1f1; color: var(--muted); white-space: nowrap; display: inline-block; margin: 1px 0; }
.st-approved { background: #eaf2f6; color: var(--primary-dark); }
.st-uploading, .st-scheduled { background: #e7f0fb; color: #2d6cb5; }
.st-published { background: #e8f5ee; color: var(--ok); }
.st-held, .st-needs_check { background: #fdf3e2; color: var(--warn); }
.st-failed { background: #fbeceb; color: var(--err); }
.st-skipped { background: #f1f1f1; color: #999; text-decoration: line-through; }

/* tables */
.grid { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.grid th, .grid td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { background: #f3f6f8; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.grid tr.current td { background: #fff8f3; }

/* guide */
.docs { list-style: none; padding: 0; margin: 0 0 1rem; }
.docs li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 2rem; overflow-x: auto; }
.doc table { border-collapse: collapse; margin: 1rem 0; font-size: .9rem; }
.doc th, .doc td { border: 1px solid var(--line); padding: .35rem .6rem; vertical-align: top; }
.doc th { background: #f3f6f8; }
.doc blockquote { border-left: 3px solid var(--primary); margin: 1rem 0; padding: .2rem 1rem; color: #444; background: #f7fafb; }
.editor { display: grid; gap: .8rem; }
.editor textarea { min-height: 70vh; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 760px) {
  .video, .video.vertical { grid-template-columns: 1fr; }
  .video.vertical .player { max-width: 260px; }
  .acts { justify-content: flex-start; }
}

/* editable slots */
.slot { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; margin: .6rem 0 .3rem; }
.slot input[type=datetime-local] { padding: .3rem .5rem; }
label.check { display: flex; align-items: center; gap: .3rem; color: var(--text); font-size: .9rem; padding-bottom: .35rem; }
.item-acts { display: flex; gap: .4rem; margin: .3rem 0; }
.item-acts form { margin: 0; }
.week-tools { display: grid; gap: .6rem; margin-top: 1rem; }
.week-tools .card { margin: 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); }
details[open] summary { margin-bottom: .8rem; }
details form { margin: .6rem 0; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: .6rem; }
.cal-head h2 { margin: 0; min-width: 12rem; text-align: center; color: var(--primary-dark); }
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .3rem; }
.cal td { border: 1px solid var(--line); vertical-align: top; height: 7.5rem; padding: .25rem; }
.cal td.out { background: #fafbfc; }
.cal td.out .cal-day { color: #bbb; }
.cal td.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day { font-size: .8rem; color: var(--muted); text-align: right; }
.cal-item {
  display: block; font-size: .75rem; line-height: 1.3; text-decoration: none; color: var(--text);
  background: #eef5f9; border-left: 3px solid var(--primary); border-radius: 4px; padding: .2rem .3rem; margin-top: .2rem;
}
.cal-item.cal-long { background: #fff1e8; border-left-color: var(--accent); font-weight: 600; }
.cal-item:hover { filter: brightness(.96); }
.cal-time { color: var(--muted); font-weight: normal; }
.dot { display: inline-block; font-size: .62rem; padding: 0 .25rem; border-radius: 3px; margin-left: .15rem; background: #e4e4e4; color: #555; font-weight: 600; }
.dot.st-approved { background: #d5e7f0; color: var(--primary-dark); }
.dot.st-scheduled, .dot.st-uploading { background: #d6e6fa; color: #2d6cb5; }
.dot.st-published { background: #d3efdf; color: var(--ok); }
.dot.st-failed { background: #f6d5d1; color: var(--err); }
.dot.st-held, .dot.st-needs_check { background: #f8e6c4; color: var(--warn); }
.reel-slots { display: grid; gap: .3rem; margin-bottom: .8rem; }
.defaults .row { margin-bottom: .6rem; }
@media (max-width: 760px) { .cal td { height: auto; } .cal-item small, .dot { display: none; } }

/* Cloudflare Turnstile box: centred in the sign-in card, height reserved
   so the button doesn't jump when the 300×65 widget loads. */
.cf-turnstile { display: flex; justify-content: center; min-height: 65px; }
