/* Palette drawn from Sitara's set: lapis and turquoise tilework, gilt lettering, a saffron accent. */
:root {
  --ink: #14213d;
  --ink-2: #4a5878;
  --lapis: #2b4c9b;
  --lapis-deep: #1b3170;
  --turq: #1f8a8a;
  --turq-soft: #d8efee;
  --saffron: #e8892b;
  --gilt: #c9a35b;
  --paper: #f5f7fb;
  --card: #ffffff;
  --line: #dbe1ec;
  --danger: #b4282e;
  --r-sm: 8px;
  --r-lg: 18px;
  font-family: Sora, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* class rules like .loader { display: flex } must not override the hidden attribute */
body { margin: 0; font-size: 15px; line-height: 1.55; }
h1, h2 { line-height: 1.2; margin: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
a { color: var(--lapis); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.muted, .hint { color: var(--ink-2); }
.hint { font-size: 13px; margin: 6px 0 0; }
.lede { color: var(--ink-2); max-width: 62ch; margin: 8px 0 0; }

.shell { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
.shell > *, .job-grid > * { min-width: 0; }  /* let grid columns shrink instead of overflowing on phones */

/* Sidebar: deep lapis, like the tile panel behind Sitara */
.side { background: var(--lapis-deep); color: #e8edf8; padding: 24px 18px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }  /* stays in view, so sign-out and the credit are always visible */
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font-weight: 600; font-size: 17px; }
.brand-mark { width: 30px; height: 30px; background: var(--gilt);
  clip-path: polygon(50% 0, 63% 25%, 92% 15%, 80% 42%, 100% 50%, 80% 58%, 92% 85%, 63% 75%, 50% 100%, 37% 75%, 8% 85%, 20% 58%, 0 50%, 20% 42%, 8% 15%, 37% 25%); }
.side-h { font-size: 13px; font-weight: 500; color: #aebbd9; margin-top: 10px; }
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.jobs a { display: block; padding: 10px 12px; border-radius: var(--r-sm); color: #e8edf8; text-decoration: none; }
.jobs a:hover { background: rgba(255, 255, 255, 0.07); }
.jobs a[aria-current="page"] { background: rgba(255, 255, 255, 0.13); }
.jobs .t { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobs .s { display: block; font-size: 12px; color: #aebbd9; }
.jobs .s.attn { color: #ffc98f; }
.jobs .muted { color: #aebbd9; padding: 8px 12px; }

.main { padding: 40px 48px 64px; max-width: 1240px; outline: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.btn-primary:hover { background: var(--lapis-deep); border-color: var(--lapis-deep); }
.btn-saffron { background: var(--saffron); border-color: var(--saffron); color: #1d1206; }
.btn-saffron:hover { background: #d4761b; border-color: #d4761b; }
.btn-lg { padding: 14px 26px; font-size: 15px; margin-top: 8px; align-self: flex-start; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.new-btn { width: 100%; }

/* Compose */
.compose { max-width: 760px; }
.compose form { margin-top: 28px; display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-weight: 600; font-size: 14px; }
input[type="text"], input[type="password"], input:not([type]), textarea {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px 14px; width: 100%; }
textarea { resize: vertical; line-height: 1.6; min-height: 260px; }
input:focus, textarea:focus { border-color: var(--lapis); outline: none; box-shadow: 0 0 0 3px rgba(43, 76, 155, 0.18); }
.drop { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px; border: 1.5px dashed #aab6cf;
  border-radius: var(--r-sm); background: var(--card); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--turq); background: #f2fafa; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop small { color: var(--ink-2); }
.thumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 6px; display: block; }
.form-error { color: var(--danger); font-weight: 500; margin: 0; }

/* Progress: a strip of star tiles that fill turquoise as stages finish. This is the page's one bold element. */
.tiles { list-style: none; display: flex; gap: 6px; padding: 0; margin: 26px 0 30px; flex-wrap: wrap; }
.tiles li { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 104px; text-align: center; font-size: 12px; color: var(--ink-2); }
.tile { width: 44px; height: 44px; background: var(--line);
  clip-path: polygon(50% 0, 63% 25%, 92% 15%, 80% 42%, 100% 50%, 80% 58%, 92% 85%, 63% 75%, 50% 100%, 37% 75%, 8% 85%, 20% 58%, 0 50%, 20% 42%, 8% 15%, 37% 25%); }
.tiles .done .tile { background: var(--turq); }
.tiles .done { color: var(--ink); }
.tiles .now .tile { background: var(--saffron); animation: turn 3.2s linear infinite; }
.tiles .now { color: var(--ink); font-weight: 600; }
.tiles .fail .tile { background: var(--danger); }
.tiles .now.gate .tile { background: var(--saffron); animation: none; }  /* waiting for the user: lit, not spinning */
@keyframes turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tiles .now .tile { animation: none; } }

.job-grid { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 40px; align-items: start; }
.phone { aspect-ratio: 9 / 16; border-radius: 28px; background: var(--ink); border: 8px solid var(--ink); overflow: hidden;
  display: flex; align-items: center; justify-content: center; position: sticky; top: 24px; }
.phone video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* Loader inside the phone frame: a turning gilt star over a lapis tile, a progress bar, and a rotating fact */
.loader { width: 100%; height: 100%; padding: 28px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #dbe4f7;
  background: radial-gradient(circle at 50% 32%, #22408a 0, var(--ink) 70%); }
.loader-star { position: relative; width: 92px; height: 92px; margin-bottom: 22px; }
.loader-star span { position: absolute; inset: 0; background: var(--gilt);
  clip-path: polygon(50% 0, 63% 25%, 92% 15%, 80% 42%, 100% 50%, 80% 58%, 92% 85%, 63% 75%, 50% 100%, 37% 75%, 8% 85%, 20% 58%, 0 50%, 20% 42%, 8% 15%, 37% 25%);
  animation: turn 6s linear infinite; }
.loader-star span + span { inset: 22px; background: var(--turq); animation-direction: reverse; animation-duration: 4s; }
.loader-step { font-weight: 600; color: #fff; margin: 0 0 14px; font-size: 15px; }
.loader-bar { width: 100%; max-width: 240px; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--turq), var(--saffron)); transition: width 0.9s linear; }
.loader-time { font-size: 13px; color: #aebbd9; margin: 10px 0 0; min-height: 1.5em; font-variant-numeric: tabular-nums; }
.fact { margin: 26px 0 0; padding: 16px 16px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(201, 163, 91, 0.35); max-width: 290px; }
.fact figcaption { font-size: 12px; font-weight: 600; color: var(--gilt); margin-bottom: 6px; }
.fact blockquote { margin: 0; font-size: 13.5px; line-height: 1.55; color: #e8edf8; min-height: 6.2em; transition: opacity 0.5s; }
.fact blockquote.fade { opacity: 0; }
.loader.idle .loader-star span { animation: none; }
.loader.idle .loader-bar, .loader.idle .loader-time { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .loader-star span { animation: none; } .fact blockquote { transition: none; } }

.panel { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--turq); border-radius: var(--r-sm); padding: 20px 22px; }
.panel h2 { font-size: 18px; margin-bottom: 6px; }
.panel p { margin: 0 0 14px; color: var(--ink-2); }
.panel .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.panel.wait { border-left-color: var(--saffron); }
.panel.fail { border-left-color: var(--danger); }
.panel.ok { border-left-color: var(--lapis); }

.sec-h { font-size: 18px; margin: 32px 0 4px; }
.lines { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; }
.lines li { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.lang { font-size: 12px; font-weight: 600; text-align: center; padding: 3px 0; border-radius: 6px; height: fit-content; }
.lang.en { background: #e3e9f7; color: var(--lapis-deep); }
.lang.uz { background: var(--turq-soft); color: #11605f; }
.lines p { margin: 0; max-width: 70ch; }
.lines .scene { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

dialog { border: none; border-radius: var(--r-lg); padding: 28px; max-width: 460px; color: var(--ink); box-shadow: 0 24px 60px rgba(20, 33, 61, 0.3); }
dialog::backdrop { background: rgba(20, 33, 61, 0.45); }
dialog h2 { font-size: 20px; margin-bottom: 10px; }
dialog p { color: var(--ink-2); margin: 0 0 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Sign-in: lapis panel with the gilt star, the form on paper */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(90deg, var(--lapis-deep) 0 38%, var(--paper) 38%); }
.login { width: 100%; max-width: 420px; background: var(--card); border-radius: var(--r-lg); padding: 36px;
  box-shadow: 0 24px 60px rgba(20, 33, 61, 0.18); }
.login form { display: flex; flex-direction: column; gap: 18px; margin: 26px 0 8px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--lapis-deep); margin-bottom: 26px; }

/* Sidebar account block */
.account { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.account .who { font-size: 13px; color: #aebbd9; }
.account .who strong { color: #fff; font-weight: 600; }
.account a, .account button { color: #e8edf8; background: none; border: none; font: inherit; font-size: 14px; padding: 6px 0; text-align: left;
  cursor: pointer; text-decoration: none; }
.account a:hover, .account button:hover { text-decoration: underline; }

/* Low-credit warnings in the sidebar (admins only) */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { border-radius: var(--r-sm); padding: 10px 12px; font-size: 12.5px; line-height: 1.45; display: flex; flex-direction: column; gap: 2px; }
.alert strong { font-size: 13px; }
.alert.warn { background: #fff2dc; color: #6b3d06; }
.alert.critical { background: #fde3e4; color: #8a1c21; }

/* Monthly video allowance */
.account .usage { display: block; margin-top: 2px; font-size: 12px; }
.quota { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.quota.full { color: var(--danger); font-weight: 600; background: #fdeeee; border: 1px solid #f3c4c6; border-radius: var(--r-sm); padding: 12px 14px; }

/* Developer credit at the foot of the sidebar and the sign-in card */
.credit { font-size: 12px; line-height: 1.5; margin: 6px 0 0; color: #aebbd9; }
.credit a { color: var(--gilt); font-weight: 500; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.login .credit { color: var(--ink-2); margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.login .credit a { color: var(--lapis); }

@media (max-width: 900px) {
  .login-page { background: var(--paper); }
  .shell { grid-template-columns: 1fr; }
  .side { padding: 16px; position: static; height: auto; }
  .jobs { max-height: 180px; }
  .main { padding: 24px 16px 48px; }
  .job-grid { grid-template-columns: 1fr; }
  .phone { position: static; max-width: 360px; width: 100%; margin: 0 auto; }
  .tiles { gap: 4px 2px; }
  .tiles li { width: calc((100% - 8px) / 5); font-size: 11px; }
  .tiles .tile { width: 34px; height: 34px; }
  h1 { font-size: 24px; overflow-wrap: anywhere; }
}

/* editing a line before approval */
.btn-sm { padding: 6px 12px; font-size: 13px; }
.lines .edit-btn { margin-top: 8px; }
.lines li.changed { background: linear-gradient(90deg, rgba(232, 137, 43, 0.08), transparent 70%); }
.chip { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--saffron); color: #1d1206; font-size: 11px; font-weight: 600; }
.edit-form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.edit-form textarea { min-height: 84px; }
.edit-field { display: flex; flex-direction: column; gap: 6px; }
.edit-field > span { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13px; }
.edit-field small { color: var(--ink-2); font-size: 12px; }
.edit-field select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); color: var(--ink); }
.edit-fields { display: flex; flex-direction: column; gap: 10px; }
.edit-fields:empty { display: none; }
.edit-h { margin: 4px 0 0; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.count { font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.count.over { color: var(--danger); }
.edit-form .actions { display: flex; gap: 10px; flex-wrap: wrap; }
