/* Ustigate client portal */
:root {
  --bg: #f4f8fb; --card: #ffffff; --ink: #14212b; --muted: #5d6f7c; --line: #dde7ee;
  --brand: #0b78c2; --brand2: #1aa3e0; --brand-ink: #ffffff; --soft: #e8f3fb; --ok: #1f9d55; --warn: #b7791f;
  --shadow: 0 1px 2px rgba(16, 40, 60, .06), 0 8px 24px rgba(16, 40, 60, .06);
}
:root[data-theme="dark"] {
  --bg: #0b131a; --card: #131e27; --ink: #e6eef4; --muted: #93a6b4; --line: #22313d;
  --brand: #2a9be0; --brand2: #46b6ef; --soft: #15293a; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b131a; --card: #131e27; --ink: #e6eef4; --muted: #93a6b4; --line: #22313d;
    --brand: #2a9be0; --brand2: #46b6ef; --soft: #15293a; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
a { color: var(--brand); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top { background: #fff; border-bottom: 1px solid #e3ebf1; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.top img { height: 30px; width: auto; display: block; }
.theme { border: 1px solid #d6e2ea; background: #f6fafc; color: #1b3a50; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.topbtns { display: flex; gap: 6px; flex-shrink: 0; }
.topbtns .theme { white-space: nowrap; text-decoration: none; }
@media (max-width: 420px) { .top img { height: 22px; } .theme { padding: 5px 10px; font-size: 13px; } }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 20px; font: inherit; font-weight: 600;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: var(--brand-ink); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--soft); color: var(--brand); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
h1, h2, h3 { line-height: 1.2; margin: 0; }

/* login */
.login { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 32px 16px; }
.login .card { width: 100%; max-width: 420px; padding: 32px 28px; text-align: center; }
.login h1 { font-size: 24px; margin-bottom: 6px; }
.login label { display: block; text-align: left; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin: 24px 0 8px; }
.login input { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-align: center; }
.login input:focus { outline: 2px solid var(--brand2); border-color: transparent; }
.login .btn { width: 100%; justify-content: center; margin-top: 16px; }
.err { color: #c0392b; min-height: 22px; margin-top: 10px; font-size: 14px; }

/* project */
.hero { padding: 28px 0 8px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hero h1 { font-size: 28px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--brand); }
.pill.latest { background: var(--brand); color: #fff; }
.versions { display: grid; gap: 18px; padding: 16px 0 48px; }
.ver { padding: 20px; }
.ver-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.ver-head h2 { font-size: 22px; }
.ver-head .date { color: var(--muted); font-size: 14px; }
.ver.old .ver-body { display: none; }
.ver.old.open .ver-body { display: block; }
.toggle { margin-left: auto; background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; }
.ver-body .notes { margin: 0 0 14px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.gallery button { padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--soft); aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.gallery button:hover img { transform: scale(1.03); }
.files { display: grid; gap: 8px; margin-top: 16px; }
.file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.file:hover { border-color: var(--brand2); }
.file .size { color: var(--muted); font-size: 14px; white-space: nowrap; }
.empty { padding: 32px; text-align: center; }
.foot { padding: 24px 0 40px; font-size: 13px; color: var(--muted); text-align: center; }

.apphelp { margin: -4px 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 14px; }
.apphelp b { color: var(--ink); }
.dlbar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 10px; }
.dlbar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .2s; }
#dlmsg { margin-top: 6px; }

/* version picker */
.lead { margin: 10px 0 0; color: var(--muted); }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 600; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; padding: 16px 0 48px; }
.vtile { display: block; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.vtile:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 40, 60, .08), 0 14px 32px rgba(16, 40, 60, .12); }
.vthumb { aspect-ratio: 16 / 9; background: var(--soft); display: grid; place-items: center; color: var(--muted); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vmeta { padding: 16px 18px 18px; display: grid; gap: 6px; }
.vrow { display: flex; align-items: center; gap: 10px; }
.vnum { font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.vnote { color: var(--muted); font-size: 14px; }
.vopen { justify-self: start; margin-top: 8px; padding: 9px 18px; }
.sect { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 20px 0 10px; }

/* lightbox */
.lb { position: fixed; inset: 0; background: rgba(5, 12, 18, .92); display: none; align-items: center; justify-content: center; z-index: 10; }
.lb.on { display: flex; }
.lb img { max-width: 94vw; max-height: 86vh; border-radius: 8px; }
.lb button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 22px; cursor: pointer; }
.lb .x { top: 16px; right: 16px; }
.lb .prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb .next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .hero h1 { font-size: 22px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .lb .prev, .lb .next { top: auto; bottom: 20px; transform: none; }
}
