/* Course Studio online: same tokens as the desktop editor */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; src: url(fonts/ibm-plex-sans-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }

:root {
  --ground: #EEF0F3; --panel: #FFFFFF; --panel-2: #F7F8FA; --line: #D9DDE4; --line-2: #E3E6EB;
  --ink: #1B2130; --muted: #5D6677; --faint: #8A93A3;
  --accent: #1F6F5C; --accent-ink: #16564A; --accent-soft: #E3F1ED;
  --bar: #1B2130; --bar-2: #2E3647; --bar-ink: #E8EBF0; --bar-muted: #9AA3B2;
  --pin: #E0602A; --pin-soft: #FCE9DF; --danger: #B3261E; --stage-bg: #DFE2E7;
  --sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif; --mono: 'IBM Plex Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--sans); color: var(--ink); background: var(--ground); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent-ink); }

.appbar { height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 20px; background: var(--bar); color: var(--bar-ink); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: #fff; text-decoration: none; }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; font-size: 13px; }
.crumb { color: var(--bar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.appbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--bar-muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; }
.tabs button { padding: 7px 14px; border-radius: 6px; border: 0; background: transparent; color: #C9CFDA; }
.tabs button[aria-selected="true"] { background: var(--bar-2); color: #fff; font-weight: 600; }

.btn { height: 34px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: #B9C0CC; }
.btn.primary { border: 0; background: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.dark { border-color: #3A4357; background: transparent; color: var(--bar-ink); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.on { background: var(--pin); border-color: var(--pin); color: #fff; }

input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; width: 100%; }
textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }

/* ---------- sign in ---------- */
.signin { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.signin .card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.signin h1 { margin: 0 0 4px; font-size: 22px; }

/* ---------- dashboard ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: #AEB6C3; box-shadow: 0 6px 18px rgba(27,33,48,.08); }
.pcard .thumb { aspect-ratio: 16/9; background: var(--stage-bg); position: relative; overflow: hidden; }
.pcard .thumb iframe { width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; position: absolute; left: 0; top: 0; }
.pcard .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.pcard .title { font-weight: 600; font-size: 15px; }
.pcard .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--pin-soft); color: #9A3E14; }
.badge.role { background: var(--accent-soft); color: var(--accent-ink); }
.empty { padding: 48px; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }

table.team { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.team th, table.team td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
table.team th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); }
table.team tr:last-child td { border-bottom: 0; }

dialog { border: 0; border-radius: 14px; padding: 0; width: min(460px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(27,33,48,.45); }
dialog form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { margin: 0; font-size: 18px; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; }
.secret { font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; word-break: break-all; user-select: all; }

/* ---------- project + review workspace ---------- */
.work { height: calc(100% - 56px); display: grid; grid-template-columns: 1fr 360px; min-height: 0; }
.stagewrap { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--stage-bg); }
.stagebar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stagebar .now { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stagebar .spacer { flex: 1; }
.stagearea { flex: 1; min-height: 0; display: grid; place-items: center; padding: 18px; }
.frame { position: relative; width: min(100%, calc((100vh - 56px - 56px - 36px) * 16 / 9)); aspect-ratio: 16/9; background: #000; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.pins { position: absolute; inset: 0; pointer-events: none; }
.pins.placing { pointer-events: auto; cursor: crosshair; background: rgba(224,96,42,.06); outline: 2px dashed var(--pin); outline-offset: -2px; }
.pin { position: absolute; width: 28px; height: 28px; margin: -28px 0 0 -4px; border-radius: 14px 14px 14px 2px; background: var(--pin); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; pointer-events: auto; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: pointer; }
.pin.resolved { background: #8A93A3; }
.pin.active { transform: scale(1.18); }

.side { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side .tabs2 { display: flex; border-bottom: 1px solid var(--line); }
.side .tabs2 button { flex: 1; padding: 12px 6px; border: 0; background: transparent; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.side .tabs2 button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.side .pane { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.composer { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.composer .where { font-size: 12px; color: var(--muted); }
.comment { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.comment:hover, .comment.active { border-color: var(--pin); }
.comment.resolved { opacity: .6; }
.comment .who { display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.comment .who b { font-weight: 600; }
.comment .who .n { width: 20px; height: 20px; border-radius: 10px; background: var(--pin); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.comment .slide { font-size: 11.5px; color: var(--faint); }
.comment .text { white-space: pre-wrap; }
.comment .acts { display: flex; gap: 6px; margin-top: 4px; }
.filter { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.link-row { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.link-row .url { font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--muted); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--bar); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 99; }

@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: calc(100% - 56px); }
  .frame { width: 100%; }
  .side { border-left: 0; border-top: 1px solid var(--line); min-height: 50vh; }
  .crumb { max-width: 38vw; }
}
