/* Content Board v2 additions (on top of styles.css). */
:root { --blue: #2d6fd2; --blue-soft: #e7effb; --tm: #fff3c4; --tm-line: #e8c547; --chg: #e7effb; }
:root[data-theme="dark"] { --blue-soft: #1f2a3d; --tm: #3a3214; --tm-line: #8a6d12; --chg: #1f2a3d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --blue-soft: #1f2a3d; --tm: #3a3214; --tm-line: #8a6d12; --chg: #1f2a3d; } }

/* login */
body.logged-out .app { display: none; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login[hidden] { display: none; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.login-card .sb-logo { font-size: 28px; }
.login-msg { color: var(--critical); min-height: 1.2em; font-size: 14px; }

/* board cells */
.bcell.ready { background: var(--blue); border: 2px solid var(--blue); color: #fff; }
.bcell.ready .bc-who { background: rgba(255,255,255,.85); color: var(--blue); border-radius: 999px; padding: 1px 10px; font-weight: 600; }
.bcell.late:not(.done) { outline: 3px solid var(--critical); outline-offset: 1px; }
.lg.blue { background: var(--blue); } .lg.dashed { background: transparent; border: 2px dashed var(--line); }
.tdot.ready, .tdot.todo, .tdot.wait, .tdot.done, .tdot.future { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.tdot.todo { background: var(--red); } .tdot.wait { background: var(--yellow); } .tdot.done { background: var(--green); } .tdot.ready { background: var(--blue); } .tdot.future { border: 1.5px dashed var(--muted); }
.qst { font-size: 13px; padding: 2px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.qst.todo { background: var(--red-soft); color: var(--red); } .qst.wait { background: var(--yellow-soft); color: var(--yellow-ink); } .qst.done { background: var(--green-soft); color: var(--green); } .qst.ready { background: var(--blue-soft); color: var(--blue); } .qst.future { color: var(--muted); }
.ist.red { background: var(--red-soft); color: var(--red); } .ist.yellow { background: var(--yellow-soft); color: var(--yellow-ink); } .ist.green { background: var(--green-soft); color: var(--green); } .ist.blue { background: var(--blue-soft); color: var(--blue); }
.ist { padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; display: inline-block; }
.pill.red { background: var(--red-soft); color: var(--red); } .pill.yellow { background: var(--yellow-soft); color: var(--yellow-ink); } .pill.blue { background: var(--blue-soft); color: var(--blue); } .pill.gold { background: var(--tm); color: var(--gold); border: 1px solid var(--tm-line); }
.grow { flex: 1 1 auto; }
.small { font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { background: var(--critical); color: #fff; border-color: var(--critical); }
.btn[aria-disabled="true"] { opacity: .55; }
.st-good { color: var(--good-text); } .st-warn { color: var(--yellow-ink); } .st-crit { color: var(--critical); }
table.qt { width: 100%; border-collapse: collapse; } table.qt th, table.qt td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; } table.qt th { font-weight: 600; font-size: 13px; color: var(--muted); }
table.qt input, table.qt select { width: 100%; min-width: 80px; }
.late-row td:first-child { font-weight: 600; }

/* idea batch screen */
.mixbar { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.mixc { padding: 2px 9px; border-radius: 999px; font-size: 13px; } .mixc.ok { background: var(--green-soft); color: var(--green); } .mixc.bad { background: var(--red-soft); color: var(--red); }
.icards { display: grid; gap: 12px; padding-bottom: 90px; }
.icard { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.icard.red { border-left-color: var(--red); } .icard.yellow { border-left-color: var(--yellow); } .icard.green { border-left-color: var(--green); }
.icard.bad { box-shadow: 0 0 0 3px var(--red-soft); }
.icard-head, .icard-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icard-foot { margin-top: 8px; }
.field.bad input, .field.bad select, .field.bad textarea, [aria-invalid="true"] { border-color: var(--critical) !important; box-shadow: 0 0 0 2px var(--red-soft); }
.field.changed input, .field.changed textarea, .field.changed select, dd.changed { background: var(--chg); }
.stickybar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-top: 12px; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.form-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field.inline { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .field.inline input { max-width: 110px; }

/* content window */
.modal-card.wide { max-width: 1180px; width: calc(100vw - 32px); }
.ppane { padding-top: 12px; display: grid; gap: 12px; }
.pfoot { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.pfoot.sticky { position: sticky; bottom: -1px; background: var(--surface); z-index: 3; }
.blockers ul { margin: 4px 0 0 18px; padding: 0; color: var(--critical); }
.promptbox { border: 1px solid var(--tm-line); background: var(--tm); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.pb-head { display: flex; flex-direction: column; gap: 2px; }
.check, .radio { display: inline-flex; gap: 6px; align-items: center; margin: 4px 12px 4px 0; }
.gcomment textarea { width: 100%; }
.thread { display: grid; gap: 6px; margin-top: 8px; max-height: 220px; overflow: auto; }
.tmsg { background: var(--bg); border-radius: 8px; padding: 6px 10px; }
.semak .kitem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.semak .kitem.ok label { color: var(--good-text); }
.kitem.ok { color: var(--good-text); }
.units { display: grid; gap: 10px; }
.unit { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.unit.trademark { background: var(--tm); border-color: var(--tm-line); }
.unit.flagged { box-shadow: 0 0 0 3px var(--red-soft); border-color: var(--red); }
.unit.changed { box-shadow: 0 0 0 3px var(--blue-soft); }
.unit.amended:not(.flagged) { border-left: 6px solid var(--yellow); }
.unit-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.amend { margin-top: 8px; display: grid; gap: 6px; }
.amcard { background: var(--yellow-soft); border-radius: 8px; padding: 6px 10px; display: grid; gap: 4px; }
.amcard.resolved { background: var(--green-soft); opacity: .8; }
.amform { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.amform .field { min-width: 200px; } .amform .field.grow { flex: 1 1 260px; } .amform textarea { width: 100%; }
.amtag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; background: #5d6b7a; }
.amtag.t0 { background: #5d6b7a; } .amtag.t1 { background: #7a4bb0; } .amtag.t2 { background: #3b78b5; } .amtag.t3 { background: #b5733b; } .amtag.t4 { background: #2f8a6a; } .amtag.t5 { background: #b23b5e; } .amtag.t6 { background: #c39a12; } .amtag.t7 { background: #444; }
.sbs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; }
.sbs-l, .sbs-r { min-width: 0; }
.cunit { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-bottom: 6px; background: var(--surface); }
.cunit.trademark { background: var(--tm); border-color: var(--tm-line); }
.cunit.changed { box-shadow: 0 0 0 3px var(--blue-soft); }
.cunit summary { cursor: pointer; }
.kv3 { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 6px 0; } .kv3 dt { color: var(--muted); } .kv3 dd { margin: 0; overflow-wrap: anywhere; }
.pkgstatus { display: flex; gap: 8px; flex-wrap: wrap; }
.sbpick { display: grid; gap: 8px; } .sbpick select { width: 100%; }
.tplbody { white-space: pre-wrap; font-size: 13px; background: var(--bg); padding: 10px; border-radius: 8px; max-height: 420px; overflow: auto; }
.tpl.retired { opacity: .6; }
.promptinput { width: 100%; margin-top: 10px; }

/* calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-h { font-weight: 600; font-size: 13px; color: var(--muted); padding: 4px; }
.cal-d { min-height: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-d.empty { background: transparent; border: none; } .cal-d.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cal-n { font-size: 12px; color: var(--muted); }
.cal-p { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; padding: 1px 4px; color: inherit; text-decoration: none; }
.cal-p.todo { background: var(--red-soft); } .cal-p.wait { background: var(--yellow-soft); } .cal-p.done { background: var(--green-soft); } .cal-p.ready { background: var(--blue-soft); }

/* teleprompter */
.prompter { position: fixed; inset: 0; z-index: 100; background: #000; color: #fff; overflow: auto; padding: 24px 6vw 80px; }
.prompter[hidden] { display: none; }
.prompter h1 { font-size: 34px; margin: 18px 0; }
.prompter .btn { margin-right: 8px; }
.tp-line { margin: 26px 0; } .tp-t { color: #aaa; font-size: 18px; } .tp-x { font-size: clamp(28px, 4.2vw, 52px); line-height: 1.25; }
.tp-line.tm .tp-t, .tp-line.tm .tp-x { color: #e8c547; }

/* progress */
.progressbox { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: 0 8px 30px rgba(0,0,0,.2); display: grid; gap: 8px; width: min(520px, calc(100vw - 32px)); }
.progressbox[hidden] { display: none; }

@media (max-width: 900px) {
  .sbs { grid-template-columns: minmax(0, 1fr); }
  .form-grid.g4, .form-grid.g3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .semak .kitem { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .form-grid.g4, .form-grid.g3, .form-grid.g2 { grid-template-columns: minmax(0, 1fr); }
  .cal-grid { grid-template-columns: repeat(7, minmax(40px, 1fr)); overflow-x: auto; }
  .cal-p { font-size: 0; padding: 4px; } .cal-p .adot { width: 8px; height: 8px; }
  .modal-card.wide { width: 100vw; }
}

.toast { pointer-events: none; }
input[type="checkbox"], input[type="radio"] { width: auto; min-width: 0; flex: none; }
.kv3 dt { display: flex; gap: 6px; align-items: flex-start; }
.amcard { justify-items: start; }
.amcard .btn { justify-self: start; }
.amcard .amtag { margin-right: 6px; }
.pfoot.sticky .blockers { max-height: 120px; overflow: auto; flex: 1 1 300px; }

.createbtn { font-size: 15px; padding: 8px 16px; border-radius: 999px; vertical-align: middle; margin-left: 10px; }
.sb-create { width: calc(100% - 8px); margin: 10px 4px 0; }
.crnext { border: 2px solid var(--accent); }
.mrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.mrow:first-of-type { border-top: 0; }
.mrow > span { min-width: 0; overflow-wrap: anywhere; }
.mrow > b { white-space: nowrap; flex: none; }
.login { position: fixed; inset: 0; z-index: 200; overflow: auto; }
