:root {
  --navy: #0b2a6b; --blue: #1e6fe8; --cyan: #13b5f0;
  --bg: #f4f6fb; --card: #ffffff; --line: #e1e6f0; --ink: #172036; --muted: #637089;
  --good: #1a8a54; --good-bg: #e5f5ec; --warn: #a76200; --warn-bg: #fff3dc; --bad: #c0362c; --bad-bg: #fde8e6;
  --wait: #6a4fc8; --wait-bg: #efeafc; --run: #1e6fe8; --run-bg: #e6f0fd;
  --radius: 10px; --shadow: 0 1px 2px rgba(15, 30, 70, .06), 0 4px 16px rgba(15, 30, 70, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Telugu", "Telugu Sangam MN", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; margin-bottom: 26px; }
.brand img { height: 30px; background: #fff; border-radius: 8px; padding: 4px 6px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { color: #cfdaf3; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.side nav a.on, .side nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.side-foot { margin-top: auto; font-size: 12px; color: #aebcdc; display: grid; gap: 4px; }
.side-foot .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.main { padding: 26px 32px 60px; max-width: 1400px; width: 100%; }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stack { display: grid; gap: 14px; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.btn:hover { border-color: #c6cfe0; background: #fafbfe; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: #185fca; }
.btn.good { background: var(--good); color: #fff; border-color: var(--good); }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); padding: 6px 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

label.f { display: grid; gap: 4px; font-weight: 600; font-size: 12px; color: #3a4660; }
label.f span.hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], input[type=password], input[type=url], select, textarea {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(30,111,232,.25); border-color: var(--blue); }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.form .wide { grid-column: 1 / -1; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 500; }
.checks label { display: inline-flex; gap: 6px; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; background: #eef1f7; color: #44506a; white-space: nowrap; }
.chip.good, .chip.done, .chip.approved, .chip.pass { background: var(--good-bg); color: var(--good); }
.chip.warn, .chip.needs_approval { background: var(--warn-bg); color: var(--warn); }
.chip.bad, .chip.failed, .chip.fail { background: var(--bad-bg); color: var(--bad); }
.chip.running, .chip.queued { background: var(--run-bg); color: var(--run); }
.chip.waiting { background: var(--wait-bg); color: var(--wait); }
.chip.lang { background: #e8f1ff; color: var(--navy); }

.project-card { cursor: pointer; display: grid; gap: 8px; transition: transform .08s; }
.project-card:hover { transform: translateY(-2px); border-color: #c8d4ec; }
.project-card p { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.new-card { border: 2px dashed #c8d2e6; box-shadow: none; display: grid; place-items: center; color: var(--blue); font-weight: 700; cursor: pointer; min-height: 140px; background: transparent; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: none; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }

table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #f8faff; }

/* Episode workspace */
.ws { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.steps { position: sticky; top: 18px; padding: 8px; }
.step { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 9px 8px; border-radius: 8px; cursor: pointer; }
.step:hover { background: #f4f7fd; }
.step.on { background: #e9f1fe; }
.step .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: #eef1f7; color: #56627c; }
.step .num.done, .step .num.approved { background: var(--good); color: #fff; }
.step .num.needs_approval { background: #f0a020; color: #fff; }
.step .num.failed { background: var(--bad); color: #fff; }
.step .num.running, .step .num.queued { background: var(--blue); color: #fff; animation: pulse 1.2s infinite; }
.step .num.waiting { background: var(--wait); color: #fff; }
.step .name { font-weight: 600; line-height: 1.2; }
.step .agent { font-size: 11px; color: var(--muted); }
.step .stale { font-size: 10px; color: var(--warn); }
@keyframes pulse { 50% { opacity: .55; } }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.callout { border-radius: 8px; padding: 10px 14px; background: var(--run-bg); color: #1d3f78; }
.callout.warn { background: var(--warn-bg); color: #6d4400; }
.callout.bad { background: var(--bad-bg); color: #7d221b; }
.callout.good { background: var(--good-bg); color: #145f3a; }

.beat { display: grid; grid-template-columns: 38px 1fr 1fr 150px 30px; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.beat .id { font-weight: 700; color: var(--muted); padding-top: 8px; }
.beat textarea { min-height: 70px; }
.te { font-size: 15px; }
.shot { display: grid; grid-template-columns: 220px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.thumb { width: 100%; aspect-ratio: 16/9; border-radius: 8px; background: #e9edf5 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; overflow: hidden; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .badge { position: absolute; top: 6px; left: 6px; }
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pic { display: grid; gap: 8px; }
.pic .line { font-size: 12px; color: var(--muted); }
video { width: 100%; border-radius: 8px; background: #000; }
.videos { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.videos .vert video { max-height: 640px; }
.log { font-size: 12px; max-height: 240px; overflow: auto; display: grid; gap: 4px; }
.log div { display: grid; grid-template-columns: 58px 1fr; gap: 8px; }
.log time { color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 45, .45); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: min(720px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.choice { border: 2px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; display: grid; gap: 4px; }
.choice.on { border-color: var(--blue); background: #f3f8ff; }
.choice-title { display: flex; gap: 8px; align-items: center; }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; max-width: 80vw; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); }
.list-edit { display: grid; gap: 10px; }
.list-edit .item { display: grid; grid-template-columns: 120px 160px 1fr 34px; gap: 8px; align-items: start; }
.list-edit .item.env { grid-template-columns: 120px 180px 1fr 34px; }
.empty { text-align: center; padding: 36px; color: var(--muted); }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 16px; }
  .brand { margin: 0; }
  .side nav { flex-direction: row; }
  .side-foot { display: none; }
  .ws { grid-template-columns: 1fr; }
  .steps { position: static; }
  .beat { grid-template-columns: 1fr; }
  .shot { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 60px; }
}

/* sign-in */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--navy); }
.login { width: min(380px, 100%); display: grid; gap: 14px; text-align: left; }
.login h1 { margin: 0; }
.login-mark { width: 56px; height: 56px; object-fit: contain; }
.bad-text { color: var(--bad); }
.locked { font-size: 12px; color: var(--good); font-weight: 600; }

/* ---- AI Office ---------------------------------------------------------------------------------- */
@keyframes blink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.memo { background: #fff; border-left: 4px solid var(--warn); border-radius: 6px; padding: 7px 10px; font-size: 13px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.memo[data-href] { cursor: pointer; }

/* ---- AI Office movie --------------------------------------------------------------------------- */
.office-scene { width: 100%; height: auto; display: block; border-radius: 14px; box-shadow: var(--shadow); background: #ffe9cf; }
.office-scene .actor { cursor: pointer; }
.office-scene .leg, .office-scene .arm { transform-box: fill-box; transform-origin: 50% 0; }
@keyframes legA { 0%,100% { transform: rotate(22deg); } 50% { transform: rotate(-22deg); } }
@keyframes legB { 0%,100% { transform: rotate(-22deg); } 50% { transform: rotate(22deg); } }
@keyframes stepbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes typeA { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(-24deg); } }
@keyframes wave2 { 0%,100% { transform: rotate(-165deg); } 50% { transform: rotate(-145deg); } }
@keyframes popin { 0% { transform: scale(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes glowvu { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
.office-scene .walking .leg.l { animation: legA .5s infinite linear; }
.office-scene .walking .leg.r { animation: legB .5s infinite linear; }
.office-scene .walking .arm.l { animation: legB .5s infinite linear; }
.office-scene .walking .arm.r { animation: legA .5s infinite linear; }
.office-scene .walking .person { animation: stepbob .25s infinite; }
.office-scene .working .arm.l { animation: typeA .3s infinite; }
.office-scene .working .arm.r { animation: typeA .3s infinite .15s; transform: scaleX(-1); }
.office-scene .raise .arm.r { animation: wave2 .8s infinite; }
.office-scene .pop { animation: popin .35s ease-out; transform-box: fill-box; transform-origin: center; }
.office-scene .eyes { transform-box: fill-box; transform-origin: center; animation: blink 4s infinite; }
.office-scene .vu { animation: glowvu .6s infinite; }
@media (prefers-reduced-motion: reduce) { .office-scene * { animation: none !important; } }
.series-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.series-tabs a { padding: 7px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); font-weight: 600; color: var(--ink); cursor: pointer; }
.series-tabs a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.series-tabs a.add { color: var(--blue); border-style: dashed; }
.office-below { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.office-below .memo { margin-bottom: 8px; }
.card.flat { box-shadow: none; }
.nowrap { white-space: nowrap; }
#office-stage { position: relative; }

/* ---- Tell the team ------------------------------------------------------------------------------ */
.tell { margin-bottom: 14px; display: grid; gap: 10px; }
.tell-head { display: flex; gap: 10px; align-items: center; }
.tell-head img { width: 38px; height: 38px; object-fit: contain; background: var(--navy); border-radius: 10px; padding: 6px; }
.chat { display: grid; gap: 6px; max-height: 190px; overflow-y: auto; }
.chat:empty { display: none; }
.msg { max-width: 80%; padding: 7px 11px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.msg.you { justify-self: end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.team { justify-self: start; background: #fff4e0; border: 1px solid #f2d3a6; border-bottom-left-radius: 4px; }
.msg.thinking span { animation: glowvu 1s infinite; }
.tell-form { display: flex; gap: 8px; }
.tell-form input { flex: 1; font-size: 15px; padding: 10px 12px; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px dashed #c6cfe0; background: #fff; color: var(--muted); border-radius: 14px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chip-btn:hover { color: var(--blue); border-color: var(--blue); }
@media (max-width: 640px) { .msg { max-width: 95%; } .tell-form { flex-direction: column; } }

/* resting: the page stopped asking for updates (tab hidden or 15 minutes without activity) */
body.resting::after { content: "The office is resting to save credits. Click anywhere to carry on."; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 600; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
