/* ============================================================
   THEME — change these to match your brand
   ============================================================ */
:root {
  --bg: #07090c;
  --text: #f6f1ec;
  --muted: rgba(246, 241, 236, .58);
  --faint: rgba(246, 241, 236, .35);
  --line: rgba(255, 255, 255, .09);
  --glass: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.035));
  --glass-flat: rgba(255, 255, 255, .06);
  --glass-2: rgba(255, 255, 255, .10);
  --glass-3: rgba(255, 255, 255, .16);
  --rail: #050608;
  --accent: #8fd3ff;        /* signature light blue */
  --accent-ink: #17140f;
  --hot: #ff6b1f;           /* warm orange glow */
  --ok: #8fd3ff;          /* light blue (approved, delivered) */
  --warn: #ffb547;
  --bad: #ff6b6b;
  --blue: #6aa8ff;
  --pink: #ff7ab8;
  --radius: 28px;
  --radius-sm: 18px;
  --shadow: 0 24px 60px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: Outfit, system-ui, -apple-system, sans-serif;
  font-size: 15px; line-height: 1.5; color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background:
    radial-gradient(1100px 700px at 72% 10%, rgba(140,210,255,.62), transparent 62%),
    radial-gradient(900px 650px at 6% 88%, rgba(140,210,255,.38), transparent 62%),
    linear-gradient(160deg, #0d1218, #07090c 55%, #000);
  background-attachment: fixed;
}
a { color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }

/* ---------- generic building blocks (used by admin + portal) ---------- */
.wrap { max-width: 1320px; margin: 0 auto; }
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.card h2 { font-size: 18px; font-weight: 400; color: var(--text); margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack > * + * { margin-top: 20px; }
.grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; }
.eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.04; font-weight: 600; letter-spacing: -.02em; }
h3 { font-size: 19px; line-height: 1.2; font-weight: 500; }
.muted, .fspec { font-size: 13px; color: var(--muted); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.brand { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; text-decoration: none; }
.brand span { color: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--text); }
.demo-banner { background: rgba(255,181,71,.10); border: 1px solid rgba(255,181,71,.35); color: var(--warn); font-size: 13px; padding: 10px 16px; border-radius: 14px; margin: 0 auto 18px; max-width: 1320px; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 24px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--glass); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; box-shadow: var(--shadow); }
.stat .k { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.stat .v { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font: inherit; font-weight: 500; font-size: 14px; border-radius: 999px; padding: 11px 20px; cursor: pointer; border: 1px solid var(--line); background: var(--glass-2); color: var(--text); transition: transform .15s, background .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: var(--glass-3); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { background: #b5e3ff; }
.btn.white { background: #fff; color: #111; border-color: transparent; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.btn.white:hover { background: #fff; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 999px; background: var(--glass-2); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); background: rgba(143,211,255,.14); }
.badge.warn { color: var(--warn); background: rgba(255,181,71,.12); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; display: inline-block; }

/* Thread */
.thread { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; margin-top: 18px; padding-right: 2px; }
.msg { background: var(--glass-flat); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; font-size: 14px; }
.msg.studio { background: rgba(143,211,255,.06); border-color: rgba(143,211,255,.18); }
.msg .hd { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.msg .hd b { color: var(--text); font-weight: 500; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.msg .kind { font-weight: 500; font-size: 13px; }
.msg .kind.approval { color: var(--ok); }
.msg .kind.changes { color: var(--warn); }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
label, .lbl { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(143,211,255,.6); }
input[type=date] { color-scheme: dark; }
select { color-scheme: dark; }
input[type=range] { padding: 0; accent-color: var(--accent); background: none; border: 0; }
textarea { resize: vertical; min-height: 92px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.rep-row { display: grid; grid-template-columns: var(--cols) 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.icon-btn { width: 40px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass-flat); color: var(--muted); font-size: 18px; cursor: pointer; }
.icon-btn:hover { color: var(--bad); border-color: var(--bad); }
.hint { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }

/* Login */
.login { max-width: 440px; margin: 9vh auto 0; }
.login h1 { font-size: 36px; margin: 20px 0 8px; }
.login p { color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.msgline { font-size: 14px; margin-top: 12px; color: var(--muted); }
.msgline.err { color: var(--bad); }

/* Admin project list */
.plist { display: grid; gap: 12px; }
.pitem { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: var(--glass); border: 1px solid var(--line); border-radius: 24px; padding: 18px 22px; text-decoration: none; box-shadow: var(--shadow); }
.pitem .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pitem .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

footer { text-align: center; color: var(--faint); font-size: 12px; margin-top: 30px; }
.center { text-align: center; color: var(--muted); padding: 60px 0; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: #fff; color: #111; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   CLIENT PORTAL — app shell
   ===================================================================== */
.shell {
  max-width: 1320px; margin: 0 auto;
  display: grid; grid-template-columns: 78px 1fr; gap: 28px;
  background: rgba(130, 190, 240, .14); border: 1px solid var(--line);
  border-radius: 40px; padding: 22px;
  box-shadow: 0 40px 120px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
}
.rail {
  background: var(--rail); border-radius: 26px; padding: 20px 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: sticky; top: 24px; align-self: start; height: min(calc(100vh - 92px), 820px);
}
.rail .logo { color: var(--text); margin-bottom: 26px; }
.rail a, .rail button {
  width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center;
  color: var(--muted); background: none; border: 0; cursor: pointer; position: relative; text-decoration: none;
  transition: background .15s, color .15s;
}
.rail a:hover, .rail button:hover { color: var(--text); background: rgba(255,255,255,.06); }
.rail a.on { color: var(--text); background: rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.rail .spacer { flex: 1; }
.rail .ping::after { content: ""; position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 3px var(--rail); }
.main { min-width: 0; }

.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 8px 0 26px; flex-wrap: wrap; }
.pagehead h1 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 500; letter-spacing: -.01em; }
.headicons { display: flex; align-items: center; gap: 8px; }
.ibtn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: none; border: 0; cursor: pointer; text-decoration: none; }
.ibtn:hover { background: rgba(255,255,255,.08); }
.me { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--accent-ink); background: radial-gradient(circle at 30% 30%, #e8f7ff, var(--accent) 45%, #4f9fd6); box-shadow: 0 0 0 4px rgba(0,0,0,.35); }

/* Hero */
.pgrid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; }
.hero-card {
  position: relative; overflow: hidden; border-radius: 32px; min-height: 520px;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  background-color: #0e141b;
  background-size: cover; background-position: center;
}
.hero-card::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(8,12,18,.95) 0%, rgba(8,12,18,.70) 40%, rgba(8,12,18,.10) 78%),
    linear-gradient(0deg, rgba(4,6,10,.7) 0%, transparent 45%);
}
.hero-card.noimg {
  background:
    radial-gradient(500px 380px at 78% 35%, rgba(125,200,255,.45), transparent 65%),
    radial-gradient(420px 300px at 95% 90%, rgba(143,211,255,.22), transparent 60%),
    linear-gradient(140deg, #16202b, #0a0e13);
}
.hero-in { position: relative; padding: 48px 52px 170px; max-width: 620px; }
.hero-in .small { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.hero-in h1 { font-size: clamp(36px, 5vw, 62px); font-weight: 600; margin-bottom: 18px; }
.hero-in .chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; background: rgba(255,255,255,.10); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; margin-bottom: 28px; }
.hero-in .btn.white { padding: 16px 44px; font-size: 15px; border-radius: 16px; }
.hero-in .btn.white svg { margin-left: -6px; }

.strip {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: center; gap: 10px;
  padding: 22px 26px; border-radius: 26px;
  background: rgba(90, 130, 170, .22); border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
}
.strip .s { min-width: 0; }
.strip .v { font-size: clamp(26px, 3vw, 40px); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .l { display: flex; align-items: center; gap: 7px; font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }
.strip .l i { width: 13px; height: 13px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.strip .u { height: 2px; width: 72%; margin-top: 10px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,255,255,.75), rgba(255,255,255,.08)); }
.round { width: 46px; height: 46px; border-radius: 50%; background: #0f0d0e; color: #fff; display: grid; place-items: center; border: 0; cursor: pointer; text-decoration: none; }
.round:hover { background: #000; }

/* Right column cards */
.side { display: grid; gap: 20px; align-content: start; }
.chart-wrap { margin: 0 -6px; }
.chart-wrap text { font-family: Outfit, sans-serif; }
.legend { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend b { color: var(--text); font-weight: 500; }

.review .big { font-size: clamp(34px, 3.6vw, 46px); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin: 6px 0 8px; }
.review .big.awaiting { color: var(--accent); }
.review .big.approved { color: var(--ok); }
.review .big.changes { color: var(--warn); }
.review .when { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.contact { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.avatar { width: 42px; height: 42px; border-radius: 14px; background: #0f0d0e; color: var(--accent); display: grid; place-items: center; font-weight: 600; flex: none; }
.contact .grow { flex: 1; min-width: 0; }

/* Deliverables table */
.files { margin-top: 20px; }
.thead { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 16px; font-size: 14px; color: var(--muted); padding: 0 4px 14px; border-bottom: 1px solid rgba(255,255,255,.22); margin-bottom: 14px; }
.thead span:last-child { width: 124px; }
.frow {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 16px; align-items: center;
  background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 24px; padding: 10px 20px 10px 10px;
}
.frow + .frow { margin-top: 10px; }
.fmain { display: flex; align-items: center; gap: 18px; min-width: 0; }
.thumb { width: 132px; height: 84px; border-radius: 18px; flex: none; background-size: cover; background-position: center; position: relative; overflow: hidden; background-color: #0e141b; }
.thumb.noimg { background: radial-gradient(120px 80px at 70% 30%, rgba(125,200,255,.5), transparent 70%), linear-gradient(140deg, #16202b, #0a0e13); }
.thumb b { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 8px; }
.fname { font-size: 16px; font-weight: 500; line-height: 1.25; }
.ftag { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.ftag .pl { width: 20px; height: 20px; border-radius: 50%; background: #0f0d0e; display: grid; place-items: center; color: var(--accent); }
.fcell { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,.8); min-width: 0; }
.fcell .dot { width: 7px; height: 7px; }
.frow .btn { width: 124px; }

/* Modal player */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(8,6,7,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: grid; place-items: center; padding: 20px; }
.modal-in { width: min(1080px, 100%); }
.modal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 22px; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
.vtabs { display: flex; gap: 8px; flex-wrap: wrap; }
.vtab { background: var(--glass-2); border: 1px solid var(--line); color: var(--text); padding: 8px 16px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.vtab.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }

.notes { color: rgba(246,241,236,.82); font-size: 15px; white-space: pre-line; }

/* Project picker */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.pcard { display: block; text-decoration: none; border-radius: 28px; overflow: hidden; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s; }
.pcard:hover { transform: translateY(-3px); }
.pcard .img { height: 170px; background-size: cover; background-position: center; background-color: #0e141b; }
.pcard .img.noimg { background: radial-gradient(260px 160px at 70% 30%, rgba(125,200,255,.45), transparent 70%), linear-gradient(140deg, #16202b, #0a0e13); }
.pcard .bd { padding: 18px 20px 20px; }
.bar { height: 4px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .pgrid { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; padding: 14px; border-radius: 30px; gap: 16px; }
  .rail { position: static; height: auto; flex-direction: row; padding: 8px; border-radius: 20px; gap: 4px; overflow-x: auto; }
  .rail .logo { margin: 0 8px 0 6px; }
  .rail .spacer { flex: 1; }
  .side { grid-template-columns: 1fr; }
  .hero-card { min-height: 0; }
  .hero-card::before { background: linear-gradient(0deg, rgba(8,12,18,.96) 30%, rgba(8,12,18,.45) 100%); }
  .hero-in { padding: 34px 26px 22px; }
  .strip { position: relative; left: auto; right: auto; bottom: auto; margin: 0 12px 12px; grid-template-columns: 1fr 1fr; gap: 18px; padding: 20px; }
  .strip .round { display: none; }
  .thead { display: none; }
  .frow { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .frow .fcell { padding: 0 6px; }
  .frow .btn { width: 100%; }
}
@media (max-width: 640px) {
  body { padding: max(12px, env(safe-area-inset-top)) 10px max(40px, env(safe-area-inset-bottom)); }
  .row2, .row3 { grid-template-columns: 1fr; }
  .rep-row { grid-template-columns: 1fr 40px; }
  .rep-row > :not(.icon-btn) { grid-column: 1; }
  .rep-row > .icon-btn { grid-column: 2; grid-row: 1; }
  .pitem { grid-template-columns: 1fr; }
  .pitem .meta { justify-content: flex-start; }
  .card { padding: 20px; border-radius: 24px; }
  .pagehead { flex-wrap: nowrap; margin: 4px 0 18px; }
  .pagehead h1 { font-size: 24px; }
  .headicons { gap: 2px; }
  .headicons .ibtn { width: 38px; height: 38px; }
  .me { width: 40px; height: 40px; }
  .thumb { width: 104px; height: 68px; }
}

/* ---------- home screen app: install tip ---------- */
.install-tip {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(440px, calc(100% - 24px)); z-index: 45;
  display: flex; gap: 14px; align-items: center;
  background: rgba(14, 20, 27, .92); border: 1px solid rgba(143,211,255,.25); border-radius: 22px; padding: 14px 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.install-tip img { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.install-tip .t { flex: 1; font-size: 13px; color: var(--muted); line-height: 1.4; }
.install-tip .t b { display: block; color: var(--text); font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.install-tip .share { display: inline-block; vertical-align: -3px; color: var(--accent); }
.install-tip .x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; padding: 4px 6px; align-self: flex-start; }

/* Installed app: no browser chrome, so tighten the outer frame */
@media (display-mode: standalone) {
  .demo-banner { margin-top: 4px; }
}

/* Sign-in code entry */
.code-input { font-size: 26px; letter-spacing: .5em; text-align: center; font-weight: 600; padding: 14px; }
