:root {
  --ink: #1c2430;
  --muted: #6b7484;
  --line: #e3e7ee;
  --bg: #f6f8fb;
  --card: #ffffff;
  --navy: #0b2235;
  --gold: #c0a060;
  --royal: #2050a0;
  --accent: #14344d;
  --accent-dark: #0b2235;
  --danger: #b3402e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px -8px rgba(16, 24, 40, .16);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .06), 0 18px 38px -14px rgba(16, 24, 40, .30);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eaf0f6 0, var(--bg) 280px) fixed, var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ---------- */
#topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 58px;
  background: linear-gradient(90deg, #071626, var(--navy) 55%, #14334e); color: #fff;
  border-bottom: 2px solid rgba(192, 160, 96, .6);
  box-shadow: 0 2px 14px rgba(7, 22, 38, .35);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.brand .topbar-logo { height: 46px; width: auto; display: block; }
.brand-product { color: var(--gold); font-weight: 600; font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; padding: 4px 12px 0; }
.brand-product + .nav-sec { padding-top: 3px; }
#topbar nav { display: flex; gap: 6px; margin-left: 8px; }
.navbtn {
  background: transparent; border: 0; color: #cdd5e0;
  padding: 8px 14px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.navbtn:hover { background: rgba(255,255,255,.08); color: #fff; }
.navbtn.active { background: rgba(192,160,96,.22); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: #cdd5e0; }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 8px; padding: 9px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink); font-weight: 500;
}
.btn-ghost:hover { background: #eef1f6; }
.btn-block { width: 100%; margin-top: 6px; }
.back { margin-bottom: 12px; }

/* ---------- layout ---------- */
#app { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.view.hidden, .hidden { display: none !important; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 27px; font-weight: 800; letter-spacing: -.01em; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.error { color: var(--danger); font-size: 13px; }
.empty { color: var(--muted); padding: 36px 0; text-align: center; }

/* ---------- login (split screen, Billdr-style) ---------- */
#view-login, #view-set-password {
  width: 100vw; margin-left: calc(50% - 50vw);
  margin-top: -28px; margin-bottom: -60px;
}
.auth-split {
  display: grid; grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}
.auth-brand {
  background: var(--navy); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 48px; text-align: center;
}
.auth-brand img { width: min(520px, 100%); height: auto; display: block; }
.auth-tagline {
  font-family: Georgia, "Times New Roman", serif; font-size: 21px;
  color: #ece5d3; margin: 30px 0 0; letter-spacing: .3px;
}
.auth-product {
  color: var(--gold); font-size: 12px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; margin: 14px 0 0;
}
.auth-formside {
  background: #fff; display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
}
.login-card {
  width: 360px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow);
}
.auth-card { border: 0; box-shadow: none; width: 380px; max-width: 100%; padding: 8px; }
.auth-h { font-size: 26px; margin: 0 0 6px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-forgot { margin: 16px 0 0; text-align: center; }
.linkbtn { background: none; border: none; padding: 0; color: var(--royal); font-size: 13px; cursor: pointer; text-decoration: underline; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.login-card input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 15px;
}
.login-card input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.btn-primary { border-bottom: 2px solid var(--gold); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c9d4e2; }
.card .thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #dfe4ec; display: block; }
.card .thumb-placeholder {
  width: 100%; aspect-ratio: 16/10; background: linear-gradient(135deg, #dfe4ec, #c9d2e0);
  display: flex; align-items: center; justify-content: center; color: #8a94a6; font-size: 13px;
}
.card .body { padding: 12px 14px 14px; }
.card .title { font-weight: 700; font-size: 15px; margin: 0 0 4px; }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 0; line-height: 1.5; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; padding: 3px 8px; border-radius: 20px; margin-top: 8px;
  background: #e8eef5; color: #44506a;
}
.pill.green { background: #dff3e7; color: var(--accent-dark); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tab {
  background: none; border: 0; padding: 10px 16px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab:hover { color: var(--ink); }

/* ---------- project module bar (PM alignment) ---------- */
.modbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.mod-door {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 8px 13px; font: inherit; cursor: pointer; color: var(--muted);
  box-shadow: var(--shadow);
}
.mod-door:hover { color: var(--ink); border-color: #c6cfdd; }
.mod-door.active { color: var(--ink); border-color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold), var(--shadow); }
.mod-ico { font-size: 16px; line-height: 1; }
.mod-name { font-weight: 700; font-size: 14px; }
.mod-count { font-size: 12px; font-weight: 600; background: #eef1f6; color: #55617a; border-radius: 9px; padding: 1px 8px; white-space: nowrap; }
.mod-door.active .mod-count { background: #f6ecd2; color: #7c5e10; }

/* ---------- module content bits ---------- */
.pill.red { background: #fbe7e1; color: var(--danger); }
.pill.grey { background: #e8ebf0; color: #66707f; }
.pill.gold { background: #f6ecd2; color: #7c5e10; }
.tag-gold { background: #f6ecd2; color: #7c5e10; font-weight: 700; }
.due-overdue { color: var(--danger); font-weight: 700; }
.attn {
  background: #fdf8ea; border: 1px solid #ecd28a; border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.attn p { margin: 2px 0; font-size: 14px; }
.attn button { font: inherit; font-weight: 700; color: var(--accent-dark); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
button.stat-tile { text-align: left; font: inherit; cursor: pointer; }
button.stat-tile:hover { border-color: var(--gold); }
.mod-h { font-size: 16px; margin: 22px 0 10px; }
.mod-h:first-child { margin-top: 0; }
.task-hist { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.task-hist p { font-size: 12.5px; color: var(--muted); margin: 3px 0; }
.proof-thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); cursor: zoom-in; flex: none; }
.ci-check { flex: none; width: 26px; text-align: center; font-size: 16px; }
.ci-done-label { color: var(--muted); }
.floor-thumb { width: 100%; aspect-ratio: 16/10; object-fit: contain; background: #eef1f6; display: block; }

/* ---------- photo grid ---------- */
.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photogrid .ph { position: relative; cursor: zoom-in; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #dfe4ec; transition: transform .12s ease, box-shadow .12s ease; }
.photogrid .ph:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.photogrid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photogrid .badge {
  position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700;
  background: rgba(20,28,40,.78); color: #fff; padding: 3px 8px; border-radius: 6px;
}
.photogrid .badge.video { background: rgba(32,80,160,.9); }

/* ---------- timeline ---------- */
.filterbar {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: end;
  padding: 14px 16px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filterbar label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.filterbar select {
  display: block; margin-top: 5px; padding: 8px 10px; min-width: 170px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; color: var(--ink); background: #fff;
}
.filterbar select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.tl-day {
  position: sticky; top: 0; z-index: 5;
  margin: 26px 0 12px; padding: 8px 2px; font-size: 16px;
  background: var(--bg); border-bottom: 2px solid var(--gold);
}
.tl-cell { min-width: 0; }
.tl-cell .ph { position: relative; cursor: zoom-in; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #dfe4ec; }
.tl-cell .ph img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.tl-cap { color: var(--muted); font-size: 12px; margin: 6px 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photogrid .badge.qm { background: rgba(11,34,53,.85); color: var(--gold); }

/* ---------- tables / lists ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow);
}
.row.clickable { cursor: pointer; }
.row.clickable:hover { border-color: var(--accent); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 700; font-size: 14px; margin: 0 0 2px; }
.row .s { color: var(--muted); font-size: 12.5px; margin: 0; }
.row .val { font-weight: 800; font-size: 16px; color: var(--accent-dark); white-space: nowrap; }
.tag { font-size: 11px; background: #eef1f6; border-radius: 4px; padding: 2px 6px; color: #55617a; margin-right: 4px; }

/* ---------- walkthrough areas ---------- */
.area { margin-bottom: 22px; }
.area > h3 { margin: 0 0 10px; font-size: 17px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.entry {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.entry .note { margin: 0 0 6px; font-size: 14px; }
.entry .meta { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.entry .photogrid { margin-top: 8px; }

/* ---------- lightbox ---------- */
#lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(10, 15, 25, .82); }
.lb-panel {
  position: relative; width: min(1060px, 94vw); max-height: 92vh; overflow: auto;
  background: #101826; border-radius: 12px; display: flex; flex-direction: column;
}
.lb-x {
  position: absolute; top: 8px; right: 12px; z-index: 2; background: rgba(255,255,255,.12);
  border: 0; color: #fff; font-size: 26px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
}
.lb-media { display: flex; align-items: center; justify-content: center; background: #000; min-height: 300px; }
.lb-media img, .lb-media video { max-width: 100%; max-height: 66vh; display: block; }
.lb-info { color: #dbe2ee; padding: 16px 20px 20px; font-size: 13px; }
.lb-info h3 { margin: 0 0 8px; color: #fff; font-size: 15px; }
.lb-info dl { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; margin: 0; }
.lb-info dt { color: #8fa0b8; }
.lb-info dd { margin: 0; }
.lb-info .audio-row { margin-top: 10px; }
.lb-info audio { width: 100%; margin-top: 6px; }

@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; }
  .auth-brand { padding: 32px 24px 26px; }
  .auth-brand img { width: min(340px, 100%); }
  .auth-tagline { font-size: 17px; margin-top: 18px; }
  .auth-formside { padding: 28px 18px 44px; }
  #view-login, #view-set-password { margin-top: -18px; margin-bottom: -50px; }
}

@media (max-width: 640px) {
  #app { padding: 18px 14px 50px; }
  #topbar { padding: 0 14px; gap: 12px; }
  .brand-product { display: none; }
  .brand .topbar-logo { height: 36px; }
  .userbox #user-email { display: none; }
  .lb-info dl { grid-template-columns: 1fr; }
}

/* ---------- room plans ---------- */
.card .plan-thumb { object-fit: contain; background: #fff; padding: 6px; }
.plan-cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr); gap: 22px; align-items: start; }
@media (max-width: 860px) { .plan-cols { grid-template-columns: 1fr; } }
.plan-stage {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.plan-stage > img { width: 100%; display: block; }
.plan-pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold); color: #101826; border: 2px solid #fff;
  font-size: 13px; font-weight: 800; cursor: pointer;
  box-shadow: 0 1px 4px rgba(16,24,40,.4); padding: 0; line-height: 1;
}
.plan-pin:hover { background: var(--navy); color: #fff; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.stat-v { font-size: 19px; font-weight: 800; color: var(--accent-dark); margin: 0 0 2px; }
.stat-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 0; }
.plan-h { font-size: 15px; margin: 20px 0 8px; }
table.mini { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.mini th, table.mini td { text-align: left; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid var(--line); }
table.mini th { background: #eef1f6; color: #44506a; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
table.mini tr:last-child td { border-bottom: 0; }
.wall-chip {
  display: inline-block; min-width: 26px; text-align: center;
  background: var(--navy); color: var(--gold); font-weight: 800; font-size: 12.5px;
  border-radius: 6px; padding: 2px 7px;
}

/* ---------- daily log ---------- */
.kind-ico { font-size: 19px; flex: none; width: 28px; text-align: center; }
.log-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); flex: none; }

/* ---------- map ---------- */
.map-wrap {
  height: calc(100vh - 260px); min-height: 420px;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); background: #dfe7ee; z-index: 0;
}
.map-legend { margin: 12px 2px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.map-legend .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-left: 10px; }
.map-legend .dot:first-child { margin-left: 0; }
.dot-project { background: var(--navy); border: 2px solid var(--gold); }
.dot-qm { background: var(--gold); border: 2px solid var(--navy); }
.map-icon { background: transparent; border: none; }
.map-pin {
  width: 20px; height: 20px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .35);
}
.pin-project { background: var(--navy); }
.pin-qm { background: var(--gold); }
.map-pop p { margin: 4px 0; }
.map-pop-title { font-weight: 600; font-size: 15px; margin-top: 0; }
.map-pop .map-open { margin-top: 8px; }
.map-unmapped-h { font-size: 17px; margin: 28px 0 12px; }

/* ---------- design pass: dashboard, covers, downloads ---------- */
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.dash-tile {
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.dash-tile .stat-v { font-size: 25px; }
.card .cover { position: relative; }
.card .thumb-placeholder { aspect-ratio: 16/9; font-size: 14px; }
.cover-pill {
  position: absolute; left: 10px; bottom: 10px; margin: 0 !important;
  background: rgba(11, 34, 53, .88); color: #f0e6cf;
}
.card .sub-dim { opacity: .72; font-size: 11.5px; margin-top: 3px; }
.actions-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dl-chip {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: rgba(11, 34, 53, .85); color: #fff; font-size: 14px;
  cursor: pointer; opacity: 0; transition: opacity .12s ease;
  display: flex; align-items: center; justify-content: center;
}
.ph:hover .dl-chip, .dl-chip:focus-visible { opacity: 1; }
@media (hover: none) { .dl-chip { opacity: .92; } }
.lb-info .btn-ghost {
  color: #dbe2ee; border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .06);
}
.lb-info .btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.row { transition: box-shadow .12s ease, border-color .12s ease; }
.row.clickable:hover { box-shadow: var(--shadow-lg); }

/* ---------- the colony (easter egg) ---------- */
.penguin-waddle {
  position: fixed; left: 0; bottom: 18px; z-index: 200;
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
  animation: pg-cross 7.2s linear forwards;
}
.penguin-waddle .pg-bird {
  font-size: 54px; display: inline-block;
  animation: pg-waddle .42s ease-in-out infinite alternate;
}
.penguin-waddle .pg-line {
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 600;
  padding: 8px 12px; border-radius: 12px; border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow-lg); white-space: nowrap;
}
@keyframes pg-cross { from { transform: translateX(-110%); } to { transform: translateX(105vw); } }
@keyframes pg-waddle { from { transform: rotate(-6deg) translateY(0); } to { transform: rotate(6deg) translateY(-4px); } }

/* ---------- layout pass: left sidebar (Billdr / CompanyCam shell) ---------- */
#topbar {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 50;
  width: 236px; height: auto;
  flex-direction: column; align-items: stretch;
  padding: 18px 14px 14px; gap: 0; overflow-y: auto;
}
.brand { flex-direction: column; align-items: flex-start; gap: 9px; padding: 2px 8px 16px; cursor: pointer; }
.brand .topbar-logo { width: 178px; height: auto; display: block; }
@media (max-width: 900px) {
  .brand .topbar-logo { width: auto; height: 42px; }
}
.brand-product { font-size: 15px; }
#topbar nav { flex-direction: column; align-items: stretch; gap: 2px; margin: 2px 0 0; width: 100%; }
#topbar .navbtn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; padding: 10px 12px;
  font-size: 14.5px; border-radius: 9px;
}
.nav-ico { width: 20px; text-align: center; flex: none; }
.nav-sec {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: #7f8ea3; padding: 16px 12px 6px;
}
.navbtn.soon { color: #8b98ab; }
.navbtn.soon:hover { color: #cdd5e0; }
.soon-tag {
  margin-left: auto; font-size: 9.5px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--gold);
  background: rgba(192, 160, 96, .16); border: 1px solid rgba(192, 160, 96, .45);
  padding: 2px 7px; border-radius: 20px;
}
.userbox {
  margin: auto 0 0; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 14px 8px 2px; border-top: 1px solid rgba(255, 255, 255, .12);
}
.userbox #user-email { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#app { max-width: 1500px; }
body:has(#topbar:not(.hidden)) #app {
  margin-left: max(236px, calc(236px + (100vw - 236px - 1500px) / 2));
}
#soon-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 300;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  background: var(--navy); color: #e8edf4; font-size: 13.5px;
  padding: 12px 18px; border-radius: 12px; border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow-lg); max-width: min(560px, 92vw); text-align: center;
}
#soon-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Bundle 3: attribution, comments, For you ---------- */
.ph-cap {
  margin: 0; padding: 6px 9px; font-size: 12px; color: var(--muted);
  background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fy-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1;
  padding: 3px 8px; border-radius: 20px;
}
.mention {
  background: rgba(192, 160, 96, .22); border-radius: 4px;
  padding: 0 3px; font-weight: 700; white-space: nowrap;
}
.wt-comments-h { font-size: 17px; margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
#walkthrough-comments .c-slot, .lb-comments .c-slot { display: block; }
#walkthrough-comments .comments-list, #walkthrough-comments .composer {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
#walkthrough-comments .comments-list { padding: 6px 16px; }
#walkthrough-comments .composer { margin-top: 10px; padding: 12px 16px; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.c-head { margin: 0 0 3px; font-size: 13.5px; }
.c-time { color: var(--muted); font-size: 12px; font-weight: 400; }
.c-body { margin: 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.c-deleted { margin: 0; font-size: 13px; font-style: italic; color: var(--muted); }
.c-actions { margin: 6px 0 0; display: flex; gap: 14px; }
.c-actions .c-del { color: var(--danger); }
.c-edited { font-size: 12px; }
.c-history { margin-top: 8px; padding: 8px 10px; background: #f2f5f9; border-radius: 8px; }
.c-hist-item { margin: 0 0 4px; font-size: 12.5px; color: #44506a; white-space: pre-wrap; word-break: break-word; }
.c-hist-item:last-child { margin-bottom: 0; }
.c-none { padding: 10px 0; }
.composer-box { position: relative; }
.composer textarea {
  display: block; width: 100%; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; color: var(--ink); background: #fff;
}
.composer textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.mention-picker {
  position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 30;
  min-width: 220px; max-height: 240px; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 4px;
}
.mp-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 7px; font-size: 14px; cursor: pointer; color: var(--ink);
}
.mp-item:hover { background: #eef1f6; }
.composer-bar { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.composer-actions { margin-left: auto; display: flex; gap: 8px; }
.c-at { font-weight: 700; }
/* comments inside the dark lightbox */
.lb-comments { border-top: 1px solid rgba(255, 255, 255, .14); padding: 14px 20px 20px; color: #dbe2ee; }
.lb-comments .c-title { margin: 0 0 4px; color: #fff; font-size: 15px; }
.lb-comments .comment { border-bottom-color: rgba(255, 255, 255, .12); }
.lb-comments .c-time, .lb-comments .c-deleted { color: #8fa0b8; }
.lb-comments .c-history { background: rgba(255, 255, 255, .07); }
.lb-comments .c-hist-item { color: #c3cede; }
.lb-comments .composer { margin-top: 10px; }
.lb-comments .composer textarea {
  background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .25);
}
.lb-comments .mention-picker { background: #16222f; border-color: rgba(255, 255, 255, .2); }
.lb-comments .mp-item { color: #dbe2ee; }
.lb-comments .mp-item:hover { background: rgba(255, 255, 255, .1); }
.lb-comments .btn-ghost { color: #dbe2ee; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); }
/* For you list */
.fy-reason { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.fy-new {
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .6px; padding: 2px 6px; border-radius: 4px; vertical-align: 2px;
}
.fy-body { font-size: 13px !important; color: var(--ink) !important; margin-top: 2px !important; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 900px) {
  #topbar {
    position: sticky; width: auto; height: 58px; bottom: auto;
    flex-direction: row; align-items: center; padding: 0 14px; gap: 12px;
    overflow: visible;
  }
  .brand { flex-direction: row; align-items: center; padding: 0; gap: 10px; }
  .brand .topbar-logo { height: 36px; width: auto; }
  .brand-product { display: none; }
  #topbar nav { flex-direction: row; align-items: center; margin: 0; width: auto; overflow-x: auto; }
  #topbar .navbtn { width: auto; white-space: nowrap; padding: 8px 10px; font-size: 13.5px; }
  .nav-sec, .soon-tag { display: none; }
  .userbox { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0; border-top: 0; }
  .userbox #user-email { display: none; }
  body:has(#topbar:not(.hidden)) #app { margin-left: auto; }
  .tl-day { top: 58px; }
}

/* ---------- Rookery Assistant drawer ---------- */
.asst-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 120;
  width: min(400px, 94vw);
  display: flex; flex-direction: column;
  background: var(--card); color: var(--ink);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.asst-drawer.hidden { display: none; }
.asst-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: linear-gradient(90deg, #071626, var(--navy) 55%, #14334e);
  color: #fff; padding: 14px 16px 12px;
  border-bottom: 2px solid var(--gold);
}
.asst-title { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--gold); letter-spacing: .3px; }
.asst-sub { margin: 3px 0 0; font-size: 12px; color: #cdd5e0; line-height: 1.4; }
.asst-x {
  flex: none; background: transparent; border: 0; color: #cdd5e0;
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.asst-x:hover { color: #fff; }
.asst-messages {
  flex: 1; overflow-y: auto; padding: 14px 14px 6px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg);
}
.asst-msg {
  max-width: 92%; padding: 10px 12px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
}
.asst-msg p { margin: 0 0 6px; }
.asst-msg p:last-child { margin-bottom: 0; }
.asst-bot {
  align-self: flex-start; background: var(--card);
  border: 1px solid var(--line); border-left: 4px solid var(--gold);
}
.asst-user {
  align-self: flex-end; background: var(--navy); color: #fff;
  border-bottom: 2px solid var(--gold);
}
.asst-thinking { color: var(--muted); font-style: italic; }
.asst-examples { color: var(--muted); font-size: 13px; }
.asst-sources { padding: 8px 14px 6px; background: var(--bg); }
.asst-sources.hidden { display: none; }
.asst-sources-toggle {
  display: block; margin: 0; padding: 2px 0; background: none; border: 0;
  font: inherit; font-size: 10.5px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted);
  cursor: pointer; text-align: left;
}
.asst-sources-toggle:hover { color: var(--navy); }
.asst-sources-arrow { letter-spacing: 0; }
.asst-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.asst-chips.hidden { display: none; }
.asst-list { margin: 2px 0 6px; padding-left: 18px; }
.asst-list:last-child { margin-bottom: 0; }
.asst-list li { margin: 0 0 2px; }
.asst-chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 20px;
  color: var(--navy); background: rgba(192, 160, 96, .14);
  border: 1px solid rgba(192, 160, 96, .55);
}
.asst-form {
  display: flex; gap: 8px; padding: 12px 14px 6px;
  border-top: 1px solid var(--line); background: var(--card);
}
.asst-form input {
  flex: 1; min-width: 0; padding: 10px 12px; font-size: 14.5px;
  border: 1px solid var(--line); border-radius: 9px; color: var(--ink);
}
.asst-form input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.asst-note { margin: 0; padding: 6px 14px 12px; font-size: 11.5px; color: var(--muted); background: var(--card); }

/* ---------- 360 viewer ---------- */
.badge.b360 { background: rgba(94, 53, 177, .92); color: #fff; }
.pano-badge {
  position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
}
#pano-overlay {
  position: fixed; inset: 0; z-index: 120; background: #0b1220;
  display: flex; flex-direction: column;
}
.pano-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: #101826; color: #fff;
}
.pano-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pano-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.pano-actions .btn-ghost {
  color: #dbe2ee; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06);
}
.pano-actions .btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.pano-x {
  background: rgba(255, 255, 255, .12); border: 0; color: #fff; font-size: 24px;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; line-height: 1;
}
#pano-viewer { flex: 1; width: 100%; min-height: 0; }
#pano-fallback {
  flex: 1; overflow: auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 20px;
}
#pano-fallback img { max-width: 100%; max-height: 70vh; display: block; }
.pano-note { color: #b9c4d6; font-size: 13.5px; text-align: center; max-width: 520px; margin: 0; }

/* ---------- schedule (Bundle 5) ---------- */
.seg { display: inline-flex; background: #eef1f6; border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; }
.seg-btn {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; border-radius: 7px; padding: 6px 14px; cursor: pointer;
}
.seg-btn.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.sched-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.sched-month-label { font-size: 19px; margin: 0; }
.sched-nav-right { display: inline-flex; gap: 8px; }
.sched-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.sched-dow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); text-align: center; padding: 2px 0; }
.sched-day {
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  min-height: 104px; padding: 6px; cursor: pointer; overflow: hidden;
}
.sched-day:hover { border-color: #c6cfdd; }
.sched-day.dim { background: #eef1f6; }
.sched-day.dim .sched-dnum, .sched-day.dim .sched-chip { opacity: .55; }
.sched-day.today { border-color: var(--gold); box-shadow: inset 0 0 0 1.5px var(--gold); }
.sched-dnum { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 4px; }
.sched-day.today .sched-dnum { color: #7c5e10; }
.sched-chip {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 11.5px; font-weight: 600;
  color: var(--accent-dark); background: #e8eef5; border: 1px solid transparent; border-radius: 6px;
  padding: 3px 6px; margin: 0 0 4px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sched-chip:hover { border-color: var(--accent); }
.sched-chip.proposed { background: #fdf8ea; border: 1.5px dashed var(--gold); color: #7c5e10; }
.sched-more { font: inherit; font-size: 11px; font-weight: 700; color: var(--royal); background: none; border: 0; padding: 1px 2px; cursor: pointer; }
.sched-legend { margin-top: 12px; font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sched-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: #e8eef5; border: 1px solid #c6cfdd; vertical-align: -2px; }
.sched-swatch.proposed { background: #fdf8ea; border: 1.5px dashed var(--gold); }
.sched-past { opacity: .55; }
.sched-warn { cursor: help; }
@media (max-width: 760px) {
  .sched-day { min-height: 74px; padding: 4px; }
  .sched-chip { font-size: 10.5px; padding: 2px 4px; }
}
