:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --panel-2: #fafaf9;
  --line: #e5e3de;
  --text: #1c1c1a;
  --muted: #8a8880;
  --accent: #1c1c1a;
  --accent-dim: #44443f;
  --brand: #b98a1b;
  --danger: #b4443c;
  --ok: #3f7d54;
  --radius: 3px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; letter-spacing: -0.006em; }
.boot { padding: 48px 20px; text-align: center; color: var(--muted); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 3px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #b7b4ab; }
label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 0 5px; font-weight: 700; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 22px; height: 52px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 800; font-size: 13px; letter-spacing: .18em; white-space: nowrap; text-transform: uppercase; }
.brand em { color: var(--brand); font-style: normal; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 12.5px; color: var(--muted); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout */
.wrap { max-width: 1060px; margin: 0 auto; padding: 26px 22px 80px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Buttons */
.btn { display: inline-block; background: var(--accent); color: #f6f6f4; font-weight: 600; letter-spacing: -0.006em; border: none; border-radius: 3px; padding: 10px 16px; font-size: 14px; }
.btn:hover { background: var(--accent-dim); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn.ghost:hover { border-color: #b7b4ab; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid #e2c3bf; font-weight: 600; }
.btn.danger:hover { border-color: var(--danger); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 3px; }

/* Auth */
.auth { max-width: 380px; margin: 10vh auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 36px 30px; }
.auth h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: .06em; }
.auth h1 em { color: var(--brand); font-style: normal; }
.auth .tag { color: var(--muted); margin-bottom: 26px; font-size: 14px; line-height: 1.5; }
.auth .oauth { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #fff; color: #1f1f1f; border: 1px solid var(--line); border-radius: 3px; padding: 11px; font-size: 14.5px; font-weight: 600; }
.auth .oauth:hover { border-color: #b7b4ab; }
.auth .divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .1em; }
.auth .divider::before, .auth .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth .magic { display: flex; gap: 8px; }
.auth .magic input { flex: 1; }

/* Project list */
h1.page { font-size: 21px; margin: 4px 0 2px; font-weight: 800; letter-spacing: -.022em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; }
.card:hover { border-color: #b7b4ab; }
.card h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 700; }
.card .meta { color: var(--muted); font-size: 12.5px; }
.card.new { display: flex; align-items: center; justify-content: center; min-height: 90px; color: var(--muted); font-weight: 600; border-style: dashed; }
.card.new:hover { color: var(--text); }

/* Project layout: sidebar */
.proj-layout { display: flex; min-height: calc(100vh - 52px); }
.sidebar { width: 208px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--panel-2); padding: 18px 12px; position: sticky; top: 52px; height: calc(100vh - 52px); }
.side-back { display: block; font-size: 12.5px; color: var(--muted); padding: 6px 10px; border-radius: 3px; margin-bottom: 14px; }
.side-back:hover { background: #f0efec; color: var(--text); }
.side-title { font-size: 14.5px; font-weight: 800; padding: 0 10px 14px; letter-spacing: -.01em; border-bottom: 1px solid var(--line); margin-bottom: 10px; overflow-wrap: break-word; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button { background: none; border: none; text-align: left; color: var(--muted); font-size: 13.5px; font-weight: 600; padding: 8px 10px; border-radius: 3px; }
.side-nav button:hover { background: #f0efec; color: var(--text); }
.side-nav button.active { background: #eceae5; color: var(--text); }
.proj-main { flex: 1; min-width: 0; padding: 24px 30px 80px; }
@media (max-width: 760px) {
  .proj-layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .side-title { display: none; }
  .side-back { display: none; }
  .proj-main { padding: 18px 16px 60px; }
}

/* Generic rows / tables */
.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 14px; }
.section-head h2 { margin: 0; font-size: 16.5px; font-weight: 800; letter-spacing: -.02em; }
.section-head .spacer { flex: 1; }
.rowlist { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.item .item-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.item .item-head strong { font-size: 14.5px; }
.chip { display: inline-block; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 2px 10px; font-size: 12px; color: var(--muted); margin: 2px 3px 0 0; }
.chip.cast { color: #2f5f86; border-color: #c8d8e4; }
.chip.prop { color: #8a5426; border-color: #e4d4c8; }
.chip.ward { color: #68438a; border-color: #d8cce4; }
.chip.loc { color: #2f6b45; border-color: #cbe2d3; }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 8px; font-size: 14px; }

/* Script editor: full-screen Celtx-style screen */
.wrap.wide { max-width: none; padding: 0; }
.proj-main.no-pad { padding: 0; }
.scr-screen { display: flex; flex-direction: column; height: 100vh; background: #545453; }
.scr-top { display: flex; align-items: center; gap: 14px; background: #1e1e1e; color: #eee; padding: 0 14px; height: 46px; flex-shrink: 0; }
.scr-back { background: none; border: none; color: #ccc; font-size: 19px; padding: 4px 8px; border-radius: 3px; }
.scr-back:hover { background: #333; color: #fff; }
.scr-title { font-size: 14px; font-weight: 700; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.scr-menus { display: flex; gap: 2px; margin-left: 10px; }
.scr-menus button { background: none; border: none; color: #bbb; font-size: 13.5px; padding: 6px 11px; border-radius: 3px; }
.scr-menus button:hover { background: #333; color: #fff; }
.scr-top-email { font-size: 12px; color: #777; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scr-tools-row { display: flex; align-items: center; gap: 4px; background: #262626; padding: 5px 12px; flex-shrink: 0; border-top: 1px solid #111; }
.scr-tools-row select { width: auto; background: #333; color: #eee; border: 1px solid #484848; font-size: 13px; padding: 4px 8px; border-radius: 2px; }
.scr-tools-row select:focus { outline: none; border-color: #777; }
.scr-icbtn { background: none; border: 1px solid transparent; border-radius: 2px; color: #ddd; font-size: 13.5px; padding: 4px 10px; }
.scr-icbtn:hover { background: #3a3a3a; border-color: #4a4a4a; }
.scr-vsep { width: 1px; height: 18px; background: #484848; margin: 0 6px; }
.scr-canvas { flex: 1; overflow: auto; padding: 26px 20px 40px; }
.scr-page { background: #fff; color: #111; width: 816px; max-width: 100%; min-height: 1056px; margin: 0 auto; box-shadow: 0 6px 30px rgba(0,0,0,.45); padding: 96px 96px 96px 144px; font-family: 'Courier Prime', 'Courier New', monospace; font-size: 12pt; line-height: 1.25; flex-shrink: 0; }
#scr-pages { display: flex; flex-direction: column; gap: 28px; width: 100%; }
.scr-tools-panel { position: absolute; top: 112px; right: 20px; z-index: 15; background: #2b2b2b; border-radius: 4px; overflow: hidden; width: 210px; box-shadow: 0 8px 28px rgba(0,0,0,.4); }
.scr-tools-panel .stp-head { color: #eee; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; padding: 13px 16px 10px; border-bottom: 1px solid #1d1d1d; }
.scr-tools-panel button, .scr-tools-panel a { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid #1d1d1d; color: #ccc; font-size: 13.5px; padding: 11px 16px; text-decoration: none; }
.scr-tools-panel button:hover, .scr-tools-panel a:hover { background: #363636; color: #fff; }
.stp-sep { height: 8px; background: #1d1d1d; }
.scr-status { display: flex; align-items: center; gap: 18px; background: #3a3a3a; color: #ccc; font-size: 12.5px; padding: 7px 16px; flex-shrink: 0; }
.scr-status .script-save { color: #8fce9f; }
.scr-status .script-save:not(.saved) { color: #e0b85c; }
.scr-drop { position: fixed; z-index: 60; background: #2b2b2b; border-radius: 0; overflow: hidden; min-width: 200px; box-shadow: 0 10px 30px rgba(0,0,0,.45); padding: 4px 0; }
.scr-drop button.has-sub { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.scr-drop button.has-sub::after { content: '\203a'; color: #999; }
.scr-drop button.has-sub:hover::after { color: #fff; }
.scr-drop button { display: block; width: 100%; text-align: left; background: none; border: none; color: #ddd; font-size: 13.5px; padding: 9px 16px; }
.scr-drop button:hover { background: #3a3a3a; color: #fff; }
.kbd-list div { padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.kbd-list div:last-child { border-bottom: none; }
.el { white-space: pre-wrap; overflow-wrap: break-word; margin-top: 0; min-height: 1.25em; outline: none; }
.el + .el { margin-top: 15px; }
.el:empty::before { content: attr(data-ph); color: #b5b3ac; }
.el-act { text-transform: uppercase; text-align: center; font-weight: 700; }
.el + .el-act { margin-top: 30px; }
.el-scene { text-transform: uppercase; }
.el-character { text-transform: uppercase; margin-left: 22ch; }
.el-dialogue { margin-left: 10ch; max-width: 33ch; }
.el-paren { margin-left: 16ch; max-width: 24ch; }
.el-transition { text-transform: uppercase; text-align: right; }
.el-shot { text-transform: uppercase; }
.el-text { font-style: italic; }
@media print {
  .scr-top, .scr-tools-row, .scr-tools-panel, .scr-status, .scr-drop, .avatar { display: none !important; }
  .scr-screen { position: static; background: #fff; }
  .scr-canvas { padding: 0; overflow: visible; }
  .scr-page { box-shadow: none; max-width: none; width: auto; zoom: 1 !important; page-break-after: always; }
  .scr-page:last-child { page-break-after: auto; }
}


/* Script create/upload choice */
.scr-choice { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.scr-choice[hidden] { display: none; }
.char-drop { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: 220px; max-width: 300px; padding: 3px 0; }
.cd-item { padding: 7px 12px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; gap: 14px; color: var(--text); font-weight: 600; letter-spacing: .02em; }
.cd-item.sel { background: var(--accent); color: #f6f6f4; }
.cd-item .cd-count { color: var(--muted); font-size: 11px; font-weight: 400; }
.cd-item.sel .cd-count { color: rgba(246,246,244,.75); }
.scr-choice-box { text-align: center; }
.scr-choice-title { color: #eee; font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 20px; }
.scr-choice-cards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.scr-choice-card { width: 250px; text-align: left; background: #2b2b2b; border: 1px solid #3d3d3d; border-radius: 3px; padding: 20px; color: #ddd; }
.scr-choice-card:hover { border-color: #888; background: #313131; }
.scc-h { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.scc-d { font-size: 12.5px; color: #999; line-height: 1.5; }

/* Shot list table */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.tbl th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl input, table.tbl select { padding: 5px 7px; font-size: 13.5px; background: transparent; border-color: transparent; }
table.tbl input:focus, table.tbl select:focus { background: #fff; border-color: #b7b4ab; }
table.tbl tr.done td { opacity: .45; }

/* Tasks */
.task { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task .t-date { font-size: 12px; color: var(--brand); font-weight: 700; white-space: nowrap; }
.task .t-date.overdue { color: var(--danger); }
.task-check { width: 18px; height: 18px; accent-color: var(--accent); }


/* Dashboard header + project cards */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.pf-top { display: flex; align-items: flex-start; gap: 12px; }
.pf-top-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; min-height: 38px; }
.pf-top-txt h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-top-txt .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-mono { width: 38px; height: 38px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0; letter-spacing: .02em; }
.pf-mono.sm { width: 28px; height: 28px; border-radius: 3px; font-size: 11px; }
.pf-stats { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Sidebar project header + grouped nav */
.side-proj { display: flex; align-items: center; gap: 9px; padding: 0 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.side-proj .side-title { border-bottom: none; padding: 0; margin: 0; font-size: 14px; }
.side-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; padding: 12px 10px 4px; }
.side-nav button { display: flex; align-items: center; gap: 9px; }
.side-ic { display: inline-flex; opacity: .75; }
.side-nav button.active .side-ic { opacity: 1; }

/* Call sheet */
.csheet { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 3px; padding: 26px 24px; }
.csheet h2 { margin: 0 0 2px; font-size: 21px; }
.csheet .cs-sub { color: #555; font-size: 13.5px; margin-bottom: 14px; }
.csheet table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.csheet th { text-align: left; background: #f4f3f0; padding: 6px 8px; border: 1px solid #ddd; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.csheet td { padding: 6px 8px; border: 1px solid #ddd; }
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .no-print, .wrap > .btn { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .proj-layout { display: block; }
  .proj-main { padding: 0; }
  .csheet, .scr-page { border: none; }
}


/* App frame with rail */
.app-frame { display: flex; min-height: 100vh; }
.avatar { position: fixed; top: 12px; right: 16px; z-index: 60; width: 34px; height: 34px; background: #17171a; color: #f5f4f0; border: 1px solid #3a3a3e; border-radius: 3px; font-size: 12.5px; font-weight: 700; letter-spacing: .05em; cursor: pointer; font-family: inherit; }
.avatar:hover { background: #26262b; }
.acct-menu { position: fixed; top: 54px; right: 16px; z-index: 60; width: 236px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0,0,0,.14); padding: 14px; }
.am-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.am-name { font-weight: 700; font-size: 14px; }
.am-email { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.sb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.sb-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.sb-img { aspect-ratio: 16 / 9; background: #141416; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; position: relative; }
.sb-name { position: absolute; top: 8px; left: 8px; background: rgba(18,18,20,.78); color: #f4f3ef; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 2px; letter-spacing: .05em; }
.sb-clrbtn { width: 15px; height: 15px; border: 1px solid var(--line); border-radius: 0; cursor: pointer; padding: 0; position: relative; display: inline-block; vertical-align: middle; }
.sb-clrbtn i { position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: #b00020; transform: rotate(-45deg); transform-origin: center; }
.sb-clr-pop { position: fixed; z-index: 70; background: #2b2b2b; border-radius: 3px; box-shadow: 0 10px 30px rgba(0,0,0,.45); padding: 6px; display: flex; gap: 6px; }
.sb-clr-sw { width: 18px; height: 18px; border: 1px solid #555; border-radius: 0; cursor: pointer; padding: 0; position: relative; }
.sb-clr-sw.on { outline: 2px solid #fff; outline-offset: 1px; }
.sb-clr-sw i { position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: #b00020; transform: rotate(-45deg); transform-origin: center; }
.sb-trash { padding: 4px 7px; }
.sb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-img-ph { color: #666; font-size: 13px; text-align: center; line-height: 1.4; }
.sb-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 7px; }
.sb-num { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sb-in { font-size: 13px; padding: 6px 8px; }
.sb-row { display: flex; align-items: center; gap: 6px; }
.rail { width: 68px; background: #17171a; display: flex; flex-direction: column; padding: 10px 6px; position: sticky; top: 0; height: 100vh; flex-shrink: 0; z-index: 25; }
.r-logo { display: flex; align-items: center; justify-content: center; height: 40px; margin-bottom: 14px; font-weight: 800; font-size: 14px; letter-spacing: .04em; color: #eee; }
.r-logo em { color: var(--brand); font-style: normal; }
.r-item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 2px; color: #83838b; font-size: 9.5px; font-weight: 600; border-left: 2px solid transparent; position: relative; }
.r-item:hover { color: #ddd; }
.r-item.active { color: #fff; background: #212125; }
.r-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: radial-gradient(200% 60% at 50% 0%, rgba(31,140,98,.85), transparent 80%), radial-gradient(200% 60% at 50% 33%, rgba(36,136,223,.85), transparent 80%), radial-gradient(200% 60% at 50% 66%, rgba(210,67,60,.85), transparent 80%), radial-gradient(200% 60% at 50% 100%, rgba(240,208,111,.85), transparent 80%); }
.r-sep { height: 1px; background: #2a2a2e; margin: 8px 8px; }
.app-side { flex: 1; min-width: 0; }
.tb-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

/* Home */
.home-hero { text-align: center; margin: 36px 0 28px; }
.home-date { color: var(--muted); font-size: 13px; }
.home-hi { font-size: 26px; font-weight: 800; letter-spacing: -.025em; margin-top: 6px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } }
.home-bar { display: flex; align-items: center; margin: 0 0 10px; }
.home-bar h3 { font-size: 15px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.home-cols { display: flex; gap: 16px; align-items: flex-start; }
.home-main { flex: 1; min-width: 0; }
.home-side { width: 310px; flex-shrink: 0; }
@media (max-width: 860px) { .home-cols { flex-direction: column; } .home-side { width: 100%; } }
.hrow { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; }
.hrow:hover { border-color: #b7b4ab; }
.hrow-mid { flex: 1; min-width: 0; }
.hrow-links { display: flex; gap: 12px; flex-shrink: 0; }
.hrow-links a { font-size: 12.5px; color: var(--muted); text-decoration: none; border-bottom: 1px solid transparent; }
.hrow-links a:hover { color: var(--text); border-bottom-color: var(--text); }
.stat-strip { display: flex; gap: 10px; margin-bottom: 20px; }
.stat-tile { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; }
.stat-num { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.stat-label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-month { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.cal-nav { background: none; border: 1px solid var(--line); border-radius: 2px; width: 24px; height: 24px; cursor: pointer; color: var(--muted); font-size: 12px; line-height: 1; }
.cal-nav:hover { color: var(--text); border-color: #b7b4ab; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-size: 10px; color: var(--muted); text-align: left; padding: 3px 2px; }
.cal-day { min-height: 66px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 6px 8px; font-size: 12.5px; border-radius: 2px; cursor: pointer; border: 1px solid var(--line); }
.cal-day:hover { background: var(--panel-2); border-color: var(--line); }
.cal-day.today { border-color: var(--text); }
.cal-day.sel { background: #e9e8e4; color: var(--text); }
.cal-day.other { cursor: default; border-color: transparent; }
.cal-day.other:hover { background: none; border-color: transparent; }
.cal-dots { display: flex; gap: 2px; margin-top: auto; padding-top: 3px; height: 7px; }
.cal-dot { flex: 0 0 auto; width: 4px; height: 4px; border-radius: 50%; display: inline-block; }
.cal-dot.dtask { background: #8a8880; }
.cal-dot.dshoot { background: var(--brand); }
.cal-detail-head { font-size: 12px; font-weight: 700; letter-spacing: .02em; margin: 12px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-ev { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; cursor: pointer; }
.cal-ev .cal-dot { margin-top: 6px; }
.cal-ev-title { font-size: 13px; font-weight: 600; }
.cal-ev-title.done { text-decoration: line-through; color: var(--muted); }
.home-cal-card { flex: 1.6; min-height: 430px; }
.home-side-stack { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cal-wrap { display: block; margin-top: 10px; }
#home-cal { min-width: 0; }
#home-cal-detail { min-width: 0; }
#home-cal-detail .cal-detail-head { margin-top: 18px; }
.home-cal-card .cal-day { font-size: 13px; }
.shoot-date-chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 2px; font-size: 11.5px; font-weight: 700; padding: 5px 8px; white-space: nowrap; color: var(--accent-dim); }
@media (max-width: 860px) { .cal-day { min-height: 44px; padding: 4px 5px; } }
.sb-scene { margin-bottom: 24px; }
.sb-scene-head { font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 10px; }
.sb-scene-count { color: var(--muted); font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 8px; font-size: 12px; }
.sb-desc-line { font-size: 13px; min-height: 18px; color: var(--text); }
.board-ov { position: fixed; inset: 0; background: rgba(18,18,18,.55); z-index: 80; display: flex; align-items: center; justify-content: center; }
.board-modal { background: var(--panel); width: min(1120px, 94vw); border-radius: 3px; display: flex; flex-direction: column; max-height: 92vh; }
.board-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.board-main { display: flex; flex: 1; min-height: 0; }
.board-pal { width: 118px; border-right: 1px solid var(--line); padding: 10px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex-shrink: 0; }
.board-pal button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 2px; padding: 8px; font-size: 12px; cursor: pointer; text-align: left; }
.board-pal button:hover { border-color: #b7b4ab; }
.board-canvas { flex: 1; padding: 16px; display: flex; align-items: center; justify-content: center; background: #eceae5; min-width: 0; }
.board-canvas svg { width: 100%; max-width: 780px; height: auto; border: 1px solid var(--line); background: #f4f3ef; touch-action: none; }
.board-ctl { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.board-ctl select, .board-ctl input[type=range] { width: auto; padding: 5px 7px; font-size: 13px; }
.board-ctl label { margin: 0; }
.sel-box { fill: none; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 6 4; }
.sel-handle { fill: #fff; stroke: var(--brand); stroke-width: 1.6; cursor: nwse-resize; }
.board-meta { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.board-meta label { margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.board-meta input, .board-meta select { width: auto; padding: 5px 7px; font-size: 13px; }
.board-meta .rp-meta { margin-left: auto; }
.sb-card .sb-img svg { width: 100%; height: 100%; display: block; }
.hcard { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 18px 20px; }
.hcard.full { grid-column: 1 / -1; }
.hcard h3 { font-size: 15px; margin: 0 0 4px; font-weight: 700; letter-spacing: -.01em; }
.hcard .desc { color: var(--muted); font-size: 13.5px; margin: 2px 0 14px; line-height: 1.5; }
.rp-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.rp-row.task { cursor: default; }
.rp-name { font-size: 14px; font-weight: 600; }
.rp-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }

@media (max-width: 760px) {
  .rail { width: 56px; }
  .r-item { font-size: 8.5px; }
}
@media print {
  .rail { display: none !important; }
}

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(28,28,26,.35); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 18px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 24px; width: 100%; max-width: 460px; max-height: 86vh; overflow-y: auto; }
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal .actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1c1c1a; color: #f6f6f4; border-radius: 3px; padding: 9px 18px; font-size: 13.5px; z-index: 60; }

/* ---------- Export cards ---------- */
.exp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.exp-card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.exp-t { font-weight: 600; font-size: 14.5px; }
.exp-d { color: var(--muted); font-size: 12.5px; line-height: 1.5; flex: 1; }
.exp-card .btn { align-self: flex-start; }

/* ---------- Script watermark overlay ---------- */
.scr-page { position: relative; }
.scr-wm { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.scr-wm-band { position: absolute; top: -45%; left: -45%; width: 190%; height: 190%; transform: rotate(-28deg); display: flex; flex-direction: column; justify-content: space-around; }
.scr-wm-band div { white-space: nowrap; display: flex; justify-content: space-around; }
.scr-wm-band span { font: 600 42px Inter, sans-serif; color: rgba(0,0,0,.09); letter-spacing: 3px; text-transform: uppercase; padding: 0 30px; }

/* ---------- Script title page ---------- */
.scr-page.title-page { position: relative; }
.tp-mid { position: absolute; top: 300px; left: 144px; right: 96px; text-align: center; }
.tp-field { outline: none; min-height: 1.25em; white-space: pre-wrap; }
.tp-field:empty::before { content: attr(data-ph); color: #b5b3ac; }
.tp-field:focus { background: rgba(0,0,0,.03); }
.tp-title { text-transform: uppercase; letter-spacing: .04em; }
.tp-byline { margin-top: 26px; }
.tp-author { margin-top: 26px; }
.tp-based { margin-top: 64px; }
.tp-bottom { position: absolute; bottom: 96px; left: 144px; right: 96px; display: flex; justify-content: space-between; gap: 20px; }
.tp-copy { max-width: 45%; }
@media print {
  .scr-page.title-page { width: 100%; }
  .tp-mid { position: static; margin: 300px 0 0; text-align: center; }
  .tp-bottom { position: static; margin-top: 320px; }
  .tp-field:empty::before { content: none !important; }
}
.tp-contact { max-width: 45%; text-align: left; }
.pf-script { background: #17171a; color: #f5f4f0; display: flex; align-items: center; justify-content: center; }

/* Analytics */
.an-gate { max-width: 420px; margin: 80px auto; padding: 0 24px; }
.an-gate h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.an-gate .muted { margin: 0 0 18px; }
.an-form { display: flex; gap: 8px; }
.an-form input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font-size: 14px; color: var(--text); }
.an-err { color: #b00020; font-size: 12.5px; margin-top: 8px; min-height: 16px; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 28px; }
.an-card { border: 1px solid var(--line); border-radius: 3px; background: var(--panel-2); padding: 14px 16px; }
.an-num { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.an-sub { font-size: 13px; font-weight: 600; color: var(--muted); }
.an-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 2px; }
.an-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.an-h { font-size: 13px; font-weight: 800; margin: 0 0 10px; }
.an-bar-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 12.5px; }
.an-bar-w { width: 64px; color: var(--muted); flex-shrink: 0; }
.an-bar-track { flex: 1; height: 8px; background: var(--line); border-radius: 0; }
.an-bar { display: block; height: 100%; background: var(--brand); }
.an-bar-n { width: 22px; text-align: right; font-weight: 700; }

/* Landing */
.land { min-height: 100vh; background: var(--panel); display: flex; flex-direction: column; }
.land-stripe { display: flex; height: 4px; width: 88px; margin: 0 0 26px; }
.land-stripe i { flex: 1; }
.land-stripe i:nth-child(1) { background: #d2433c; }
.land-stripe i:nth-child(2) { background: #f0762b; }
.land-stripe i:nth-child(3) { background: #f0d06f; }
.land-stripe i:nth-child(4) { background: #1f8c62; }
.land-stripe i:nth-child(5) { background: #3a6fd8; }
.land-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: #0e0e10; border-bottom: 1px solid #232326; position: sticky; top: 0; z-index: 50; }
.land-top .brand, .land-top .brand em { color: #f4f3ef; }
.land-nav { display: flex; gap: 8px; }
.land-hero { background: #0e0e10; color: #f4f3ef; padding: 100px 24px 60px; text-align: center; }
.land-hero .land-stripe { margin: 0 auto 30px; }
.land-hero h1 { font-size: 76px; line-height: .98; letter-spacing: -.035em; font-weight: 800; margin: 0 auto 24px; max-width: 980px; }
.land-hero p { font-size: 17px; line-height: 1.6; color: #9d9da6; max-width: 620px; margin: 0 auto 34px; }
.land-cta { display: flex; gap: 10px; }
.land-hero .land-cta { justify-content: center; }
.land-hero .land-cta .btn, .land-free .land-cta .btn { padding: 13px 24px; font-size: 15px; }
.land-hero .btn.ghost { color: #f4f3ef; border-color: #3a3a40; }
.land-words { margin-top: 44px; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #8b8b93; }
.land-words i { font-style: normal; color: #3f3f46; margin: 0 14px; }
.land-shot-full { background: #0e0e10; padding: 30px 24px 90px; }
.land-shot-full img { display: block; width: 100%; max-width: 1080px; margin: 0 auto; border: 1px solid #2a2a2e; }
.land-intro { text-align: center; padding: 90px 24px 40px; }
.land-intro h2 { font-size: 44px; line-height: 1.06; letter-spacing: -.03em; font-weight: 800; margin: 0 auto 16px; max-width: 760px; }
.land-intro p { font-size: 16px; color: var(--muted); margin: 0 auto; max-width: 560px; line-height: 1.6; }
.land-tiles { display: grid; grid-template-columns: repeat(9, 1fr); gap: 10px; max-width: 1120px; margin: 0 auto; padding: 30px 24px 40px; }
.land-tile { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 8px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 0; cursor: pointer; font-family: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; color: var(--text); }
.land-tile:hover { border-color: var(--text); }
.land-tile-ico { color: var(--brand); display: flex; }
.land-tile-ico svg { width: 22px; height: 22px; }
.land-sec { border-top: 1px solid var(--line); padding-top: 70px; }
.land-sec-head { text-align: center; padding: 0 24px; }
.land-sec-ico { display: flex; justify-content: center; color: var(--brand); margin-bottom: 14px; }
.land-sec-ico svg { width: 26px; height: 26px; }
.land-sec-head h2 { font-size: 40px; line-height: 1.06; letter-spacing: -.03em; font-weight: 800; margin: 0 auto 12px; max-width: 720px; }
.land-sec-head .land-cap-kick { margin-bottom: 10px; }
.land-sec-head > p { font-size: 15.5px; color: var(--muted); margin: 0 auto; max-width: 540px; line-height: 1.6; }
.land-cap { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; max-width: 1120px; margin: 0 auto; padding: 56px 24px 84px; }
.land-cap.flip .land-cap-txt { order: 2; }
.land-cap.flip .land-cap-img { order: 1; }
.land-cap-kick { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--brand); font-weight: 800; margin-bottom: 14px; }
.land-cap h3 { font-size: 20px; line-height: 1.25; letter-spacing: -.015em; font-weight: 800; margin: 0 0 14px; }
.land-cap p { font-size: 15px; line-height: 1.65; color: var(--muted); margin: 0 0 12px; }
.land-cap-img img { display: block; width: 100%; border: 1px solid var(--line); }
.land-platform { background: var(--bg); border-top: 1px solid var(--line); padding: 84px 24px; }
.land-platform .land-stripe { margin: 0 auto 26px; }
.land-platform h2 { font-size: 34px; letter-spacing: -.025em; font-weight: 800; margin: 0 auto 34px; max-width: 860px; text-align: center; }
.land-acc { max-width: 860px; margin: 0 auto; border-top: 1px solid var(--line); }
.land-acc-item { border-bottom: 1px solid var(--line); }
.land-acc-item > button { display: block; width: 100%; text-align: left; background: none; border: none; font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--muted); padding: 16px 4px; cursor: pointer; }
.land-acc-item > button:hover { color: var(--text); }
.land-acc-item.open > button { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.land-acc-body { display: none; padding: 2px 4px 18px; }
.land-acc-item.open .land-acc-body { display: block; }
.land-acc-body p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 640px; }
.land-free { background: #0e0e10; color: #f4f3ef; text-align: center; padding: 96px 24px; }
.land-free .land-stripe { margin: 0 auto 26px; }
.land-free h2 { font-size: 54px; letter-spacing: -.03em; font-weight: 800; margin: 0 0 16px; }
.land-free p { color: #9d9da6; font-size: 16px; margin: 0 auto 30px; max-width: 520px; line-height: 1.6; }
.land-free .land-cta { justify-content: center; }
.land-about { padding: 72px 24px; text-align: center; border-top: 1px solid var(--line); background: var(--bg); }
.land-about h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0 auto 14px; max-width: 640px; }
.land-about p { color: var(--muted); line-height: 1.6; font-size: 15.5px; margin: 0 auto; max-width: 640px; }
.land-foot { padding: 22px; text-align: center; font-size: 11px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; border-top: 1px solid var(--line); }

.land-top a.brand { text-decoration: none; }
.land-links { display: flex; align-items: center; gap: 20px; margin-left: auto; margin-right: 20px; }
.land-link { color: #b9b9c0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; padding: 6px 0; }
.land-link:hover { color: #fff; }
.land-dd-wrap { position: relative; }
.land-dd { position: absolute; top: 100%; left: -14px; background: #161618; border: 1px solid #2a2a2e; min-width: 210px; padding: 4px 0; box-shadow: 0 12px 30px rgba(0,0,0,.5); z-index: 60; }
.land-dd a { display: flex; align-items: center; gap: 11px; padding: 9px 14px; color: #d5d5da; font-size: 13.5px; text-decoration: none; }
.land-dd a:hover { background: #232328; color: #fff; }
.land-dd svg { width: 15px; height: 15px; color: #8b8b93; flex: 0 0 auto; }
.land-page-head { text-align: center; padding: 84px 24px 26px; }
.land-page-head .land-stripe { margin: 0 auto 26px; }
.land-page-head h1 { font-size: 48px; line-height: 1.02; letter-spacing: -.03em; font-weight: 800; margin: 0 auto 14px; max-width: 800px; }
.land-page-head p { font-size: 16px; color: var(--muted); margin: 0 auto; max-width: 560px; line-height: 1.6; }
.land-foot2 { border-top: 1px solid #26262a; background: #0e0e10; color: #f4f3ef; }
.land-foot-cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; max-width: 1120px; margin: 0 auto; padding: 52px 24px; }
.land-foot-brand p { color: #9d9da6; font-size: 13px; margin: 12px 0 0; max-width: 280px; line-height: 1.6; }
.land-foot-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #9d9da6; margin: 4px 0 10px; font-weight: 700; }
.land-foot-col a { display: block; color: #f4f3ef; text-decoration: none; font-size: 14px; padding: 4px 0; }
.land-foot-col a:hover { text-decoration: underline; }
.land-foot-base { text-align: center; padding: 18px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #9d9da6; border-top: 1px solid #26262a; }
.free-card { max-width: 460px; margin: 30px auto 90px; border: 1px solid var(--line); background: var(--panel); padding: 34px 34px 26px; }
.free-plan { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.free-price { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: 12px; }
.free-per { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.free-list { margin: 24px 0; padding: 0; list-style: none; }
.free-list li { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.free-note { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 14px; line-height: 1.5; }
.land-about2 { max-width: 700px; margin: 0 auto; padding: 10px 24px 90px; }
.land-about2 > p { font-size: 17px; line-height: 1.65; color: var(--text); margin: 0 0 40px; }
.about-beliefs { display: grid; gap: 12px; }
.about-b { border: 1px solid var(--line); padding: 22px; background: var(--panel); }
.about-b h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.about-b p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.contact-card { max-width: 460px; margin: 26px auto 100px; text-align: center; border: 1px solid var(--line); background: var(--panel); padding: 40px 30px; }
.contact-card .btn { display: inline-block; text-decoration: none; }
.contact-addr { margin-top: 16px; font-size: 14px; color: var(--muted); letter-spacing: .02em; }
@media (max-width: 860px) {
  .land-links { gap: 13px; margin-right: 10px; }
  .land-link { font-size: 11px; }
  .land-page-head { padding: 56px 18px 18px; }
  .land-page-head h1 { font-size: 32px; }
  .land-foot-cols { grid-template-columns: 1fr 1fr; }
  .free-card, .contact-card { margin-left: 18px; margin-right: 18px; }
}


.land-mini { margin-top: 20px; font-size: 13.5px; }
.land-mini a { color: #b9b9c0; }
.land-mini a:hover { color: #fff; }
.land-wl { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.land-wl input { max-width: 260px; background: #161618; border: 1px solid #2a2a2e; color: #f4f3ef; border-radius: 0; }
.land-wl .btn.ghost { color: #f4f3ef; border-color: #3a3a40; }
.an-inv-gen { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.an-code-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.an-code { font-family: 'Courier New', monospace; font-weight: 700; letter-spacing: .12em; }
.an-tag { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border: 1px solid var(--line); color: var(--muted); }
.an-tag.ok { color: #1f8c62; border-color: #1f8c62; }
.an-tag.used { color: var(--text); border-color: var(--text); }
.an-tag.rev { color: #d2433c; border-color: #d2433c; }

@media (max-width: 980px) { .land-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) {
  .land-hero { padding: 64px 18px 40px; }
  .land-hero h1 { font-size: 42px; }
  .land-words i { margin: 0 8px; }
  .land-intro h2 { font-size: 30px; }
  .land-sec-head h2 { font-size: 28px; }
  .land-cap { grid-template-columns: 1fr; gap: 24px; padding: 36px 18px 56px; }
  .land-cap.flip .land-cap-txt { order: 0; }
  .land-cap.flip .land-cap-img { order: 1; }
  .land-free h2 { font-size: 34px; }
  .land-shot-full { padding: 20px 18px 56px; }
}
.land-foot em { color: var(--brand); font-style: normal; }
@media (max-width: 900px) { .land-cap { grid-template-columns: 1fr; gap: 24px; } .land-cap.flip .land-cap-txt { order: 1; } .land-cap.flip .land-cap-img { order: 2; } .land-grid { grid-template-columns: repeat(2, 1fr); } .land-hero h1 { font-size: 46px; } .land-free h2 { font-size: 36px; } }
@media (max-width: 560px) { .land-grid { grid-template-columns: 1fr; } .land-hero { padding: 64px 20px 48px; } .land-hero h1 { font-size: 34px; } .land-free h2 { font-size: 28px; } }

/* Project dashboard */
.pd-doc { max-width: 720px; }
.pd-title-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 2px 0 18px; }
.pd-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.pd-sec { border-top: 1px solid var(--line); padding: 14px 0 16px; }
.pd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.pd-line { padding: 3px 0; font-size: 14px; }
.pd-empty { font-size: 14px; }
.pd-empty a, .pd-link { color: var(--text); font-weight: 600; }
.pd-link { display: inline-block; margin-top: 8px; margin-right: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pd-scene { padding: 6px 0; }
.pd-scene-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pd-scene-idx { color: var(--muted); font-size: 13px; }
.pd-scene-h { font-weight: 700; font-size: 14px; }
.pd-scene-loc { font-size: 12.5px; }
.pd-scene-status { margin-left: auto; font-size: 12px; }
.pd-shot { padding: 2px 0 2px 22px; font-size: 13.5px; color: var(--muted); }
.pd-shot.got { color: var(--text); }
.pd-got { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand); }

/* ---- Mobile pass: phones ---- */
.land-menu-btn { display: none; }
@media (max-width: 700px) {
  /* Lander top bar: brand + menu button + CTA, links collapse into a panel */
  .land-top { padding: 12px 16px; gap: 10px; }
  .land-menu-btn { display: inline-block; background: none; border: 1px solid #3a3a3e; color: #ddd; font-family: inherit; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 9px 12px; border-radius: 2px; cursor: pointer; }
  .land-links { display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0; background: #0e0e10; border-bottom: 1px solid #232326; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 16px 10px; }
  .land-links.open { display: flex; }
  .land-links .land-link { font-size: 12px; padding: 13px 2px; border-top: 1px solid #1c1c20; text-align: left; }
  .land-dd-wrap { position: static; }
  .land-dd { position: static; min-width: 0; border: none; box-shadow: none; background: transparent; padding: 0 0 4px 14px; }
  .land-nav .btn.ghost { display: none; }

  /* Keep fixed avatar off header actions */
  .section-head { padding-right: 46px; }

  /* Script editor */
  .scr-top { padding: 0 6px; gap: 4px; height: 44px; }
  .scr-title { display: none; }
  .scr-menus { margin-left: 2px; }
  .scr-menus button { padding: 6px 8px; font-size: 13px; }
  .scr-tools-row { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .scr-tools-row::-webkit-scrollbar { display: none; }
  .scr-tools-row > * { flex-shrink: 0; }
  .scr-canvas { padding: 14px 10px 32px; }
  .scr-tools-panel { left: 8px; right: 8px; width: auto; top: 96px; }

  /* Constrain wide controls so the viewport does not expand */
  .app-side { overflow-x: hidden; }
  .proj-main select, .proj-main input, .wrap select { max-width: 100%; }

  /* Frame editor stacks: palette becomes a horizontal strip */
  .board-modal { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .board-head { flex-wrap: wrap; row-gap: 6px; padding: 10px 12px; }
  .board-head .rp-meta { display: none; }
  .board-main { flex-direction: column; overflow: hidden; }
  .board-pal { width: auto; flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: none; border-bottom: 1px solid var(--line); padding: 8px; }
  .board-pal button { flex-shrink: 0; padding: 8px 10px; }
  .board-canvas { padding: 10px; }
  .board-meta, .board-ctl { padding: 8px 10px; gap: 6px; }
  .board-meta .rp-meta { display: none; }

  /* Project rows: links wrap under the title */
  .hrow { flex-wrap: wrap; }
  .hrow-links { flex: 1 1 100%; flex-wrap: wrap; gap: 6px 14px; }

  /* Comfortable tap targets and no iOS input auto-zoom */
  .btn { min-height: 38px; }
  .r-item { min-height: 44px; justify-content: center; }
  input, select, textarea { font-size: 16px; }
  .scr-tools-row select { font-size: 13px; }
}
@media (max-width: 480px) {
  /* Rail goes icon-only on narrow phones */
  .rail { width: 52px; padding: 10px 4px; }
  .r-item span { display: none; }
  .r-item { padding: 12px 2px; }
}

/* Brand mark placements (Envision rebrand) */
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand .brand-mark { height: 34px; width: auto; display: block; flex: none; object-fit: contain; }
.land-foot-brand .brand-mark { height: 22px; width: auto; vertical-align: middle; margin-right: 8px; }
.r-logo img { height: 26px; width: auto; display: block; flex: none; object-fit: contain; }
.auth h1 { display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-mark { height: 34px; width: auto; display: block; }

/* Sign-in (dark) */
.auth2 { min-height: 100vh; background: #101114; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; text-align: center; }
.auth2-mark img { display: block; width: 110px; height: 135px; margin: 0 auto; }
.auth2-tag { color: #9a978e; font-size: 14px; margin: 22px 0 30px; max-width: 300px; line-height: 1.5; }
.auth2 .oauth { display: flex; align-items: center; justify-content: center; gap: 10px; width: 300px; background: #f4f3ef; color: #1c1c1a; border: none; border-radius: 2px; padding: 12px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.auth2-div { display: flex; align-items: center; gap: 10px; width: 300px; color: #6d6b64; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin: 22px 0 12px; }
.auth2-div::before, .auth2-div::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.14); }
.auth2-magic { display: flex; gap: 8px; width: 300px; }
.auth2-magic input { flex: 1; background: #1a1c20; border: 1px solid rgba(255,255,255,.16); color: #f4f3ef; border-radius: 2px; padding: 11px 12px; font-size: 16px; font-family: inherit; }
.auth2-magic input::placeholder { color: #6d6b64; }
.auth2-send { background: #f4f3ef; color: #1c1c1a; border: none; border-radius: 2px; padding: 11px 16px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.auth2-note { color: #6d6b64; font-size: 12px; margin-top: 20px; max-width: 300px; line-height: 1.5; }
.auth2-back { color: #9a978e; font-size: 12.5px; margin-top: 22px; text-decoration: none; }

/* Email+password auth */
.auth2-form { width: 300px; display: flex; flex-direction: column; gap: 8px; }
.auth2-form input { background: #1a1c20; border: 1px solid rgba(255,255,255,.16); color: #f4f3ef; border-radius: 2px; padding: 11px 12px; font-size: 16px; font-family: inherit; }
.auth2-form input::placeholder { color: #6d6b64; }
.auth2-form .auth2-send { width: 100%; padding: 12px; }
.auth2-links { margin-top: 16px; font-size: 12.5px; display: flex; gap: 16px; }
.auth2-links a { color: #9a978e; cursor: pointer; text-decoration: none; }
.auth2 .an-err { color: #e88; font-size: 12.5px; margin-top: 10px; max-width: 300px; }

/* Ghost buttons on dark lander */
.land .btn.ghost { color: #f4f3ef; border-color: rgba(255,255,255,.35); }
.land .btn.ghost:hover { border-color: rgba(255,255,255,.65); }

/* Wordmark: bold, never italic */
.wm { font-style: normal; font-weight: 800; letter-spacing: .04em; }

/* Apple-design polish: instant press feedback (respond on pointer-down) */
.btn { transition: transform 100ms ease-out; }
.btn:active { transform: scale(.97); }
.oauth { transition: transform 100ms ease-out; }
.oauth:active { transform: scale(.97); }
.auth2-send { transition: transform 100ms ease-out; }
.auth2-send:active { transform: scale(.97); }
.r-item { transition: color 120ms ease-out, transform 100ms ease-out; }
.r-item:active { transform: scale(.96); }
.land-link { transition: color 120ms ease-out; }


/* Type details: tighter tracking on large headings */
.land-cap h2, .land-free h2 { letter-spacing: -.02em; }

/* Toast: materialize on enter */
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.98); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
.toast { animation: toastIn 180ms ease-out; box-shadow: 0 8px 28px rgba(0,0,0,.28); }

/* Reduced motion / reduced transparency */
@media (prefers-reduced-motion: reduce) {
  .btn, .oauth, .auth2-send, .r-item, .land-link { transition: none !important; }
  .btn:active, .oauth:active, .auth2-send:active, .r-item:active { transform: none !important; }
  .toast { animation: none !important; }
}
