/*
  Creative Studio v7 — camada visual.
  Mantém o markup e os contratos funcionais do v6; este arquivo só redefine apresentação e responsividade.
*/

:root {
  color-scheme: dark;
  --bg: #080b12;
  --sur: #0d121d;
  --sur2: #141b29;
  --up: #192234;
  --ln: rgba(255, 255, 255, .075);
  --ln2: rgba(255, 255, 255, .14);
  --ink: #f6f8fc;
  --mut: #adb8c8;
  --dim: #76849a;
  --ac: #6c5ce7;
  --aci: #fff;
  --acs: rgba(108, 92, 231, .16);
  --blue-h: #7d6df1;
  --free: #36d38a;
  --paid: #f2b84b;
  --bad: #ff6677;
  --busy: #5aa7ff;
  --free-bg: rgba(54, 211, 138, .12);
  --green-bg: rgba(54, 211, 138, .12);
  --paid-bg: rgba(242, 184, 75, .12);
  --amber-bg: rgba(242, 184, 75, .12);
  --bad-bg: rgba(255, 102, 119, .12);
  --red-bg: rgba(255, 102, 119, .12);
  --busy-bg: rgba(90, 167, 255, .12);
  --w-sidebar: 252px;
  --w-gencol: 372px;
  --v7-radius-sm: 10px;
  --v7-radius: 14px;
  --v7-radius-lg: 20px;
  --v7-shadow: 0 18px 55px rgba(0, 0, 0, .28);
  --v7-shadow-soft: 0 10px 30px rgba(0, 0, 0, .18);
  --v7-gradient: linear-gradient(135deg, #5b7cff 0%, #7658e9 55%, #aa5ce7 115%);
}

*, *::before, *::after { scrollbar-color: #303a4d transparent; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border: 2px solid var(--ac);
  border-radius: 10px;
  background: var(--sur);
  color: var(--ink);
  font-weight: 700;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

::selection { background: rgba(108, 92, 231, .42); color: #fff; }

body {
  font: 400 13px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 68% -15%, rgba(78, 98, 221, .16), transparent 34%),
    radial-gradient(circle at 5% 105%, rgba(126, 69, 186, .09), transparent 30%),
    var(--bg);
  color: var(--ink);
  letter-spacing: -.006em;
}

button, input, select, textarea { font: inherit; }

button, a, input, select, textarea { transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[role="button"]:focus-visible, [role="checkbox"]:focus-visible, [role="tab"]:focus-visible {
  outline: 2px solid rgba(126, 108, 255, .9);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #303a4d; border: 3px solid transparent; border-radius: 999px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #44516a; border: 2px solid transparent; background-clip: padding-box; }

h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.025em; }
h1 { font-size: 22px; font-weight: 720; }
h2 { font-size: 14px; font-weight: 680; }
h3 { font-size: 13px; font-weight: 650; }

.muted { color: var(--mut); }
.mo, .metric .v, .kpi .v, .folder-count, .indef-id { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

/* Controls */
.btn {
  min-height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--ln2);
  background: rgba(255, 255, 255, .025);
  color: #dbe2ee;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 560;
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}

.btn:hover { background: rgba(255, 255, 255, .075); border-color: rgba(255, 255, 255, .2); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 31px; padding: 5px 10px; border-radius: 9px; font-size: 11.5px; }
.btn-primary { border-color: transparent; background: var(--v7-gradient); color: #fff; font-weight: 680; box-shadow: 0 8px 22px rgba(91, 92, 231, .24), inset 0 1px rgba(255, 255, 255, .2); }
.btn-primary:hover { border-color: transparent; background: linear-gradient(135deg, #6685ff, #8065ef 58%, #ad62e9); box-shadow: 0 11px 30px rgba(91, 92, 231, .34); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--mut); box-shadow: none; }
.btn-ghost:hover { border-color: transparent; background: rgba(255, 255, 255, .055); color: #fff; }
.btn-danger { border-color: rgba(255, 102, 119, .38); color: #ff8290; background: rgba(255, 102, 119, .06); }
.btn-danger:hover { border-color: rgba(255, 102, 119, .6); background: rgba(255, 102, 119, .14); color: #ffa0ab; }
.btn-dark, .btn-dark-ghost { background: rgba(255, 255, 255, .04); color: var(--ink); border-color: var(--ln2); }
.btn:disabled { opacity: .38; transform: none; box-shadow: none; }

input, select, textarea {
  background: rgba(4, 7, 13, .46);
  border: 1px solid var(--ln2);
  border-radius: 10px;
  color: var(--ink);
  padding: 8px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .018);
}

input::placeholder, textarea::placeholder { color: #58657a; }
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .22); }
input:focus, select:focus, textarea:focus { outline: none; border-color: #7566ee; box-shadow: 0 0 0 3px rgba(108, 92, 231, .12); }
select { color-scheme: dark; }
textarea { line-height: 1.62; }
input[type=checkbox] { accent-color: #7566ee; }

/* Authentication */
.login-overlay {
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(93, 106, 255, .22), transparent 30%),
    radial-gradient(circle at 86% 84%, rgba(171, 75, 212, .16), transparent 30%),
    linear-gradient(145deg, #070a11 0%, #0b101b 58%, #090c14 100%);
}

.login-overlay::before, .login-overlay::after {
  content: "";
  position: absolute;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: 42%;
  transform: rotate(28deg);
  pointer-events: none;
}

.login-overlay::before { top: -260px; right: -110px; box-shadow: 0 0 120px rgba(96, 76, 255, .1) inset; }
.login-overlay::after { bottom: -300px; left: -100px; width: 520px; height: 520px; }

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 32px));
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(20, 27, 42, .96), rgba(11, 16, 26, .96));
  box-shadow: 0 38px 90px rgba(0, 0, 0, .48), inset 0 1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(22px);
}

.login-card .brand { margin-bottom: 18px; font-size: 18px; }
.login-card .muted { margin: -6px 0 20px; color: var(--mut); }
.login-card input { min-height: 46px; margin: 7px 0; }
.login-card .btn-primary { min-height: 45px; margin-top: 12px; }

.logo-sq {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 11px;
  background: var(--v7-gradient);
  color: transparent;
  box-shadow: 0 9px 24px rgba(85, 85, 228, .28), inset 0 1px rgba(255, 255, 255, .3);
}

.logo-sq::before { content: "✦"; color: #fff; font-size: 16px; line-height: 1; }

/* Application shell */
.layout { background: var(--bg); }

.sidebar {
  position: relative;
  z-index: 6;
  background: linear-gradient(180deg, #0b1019 0%, #090d15 100%);
  border-right: 1px solid var(--ln);
  box-shadow: 12px 0 38px rgba(0, 0, 0, .12);
}

.sidebar .brand {
  position: relative;
  min-height: 78px;
  padding: 20px 18px 22px;
  gap: 11px;
  font-size: 15px;
  font-weight: 740;
}

.sidebar .brand::after {
  content: "AI PRODUCTION SUITE";
  position: absolute;
  left: 63px;
  top: 43px;
  color: #58657b;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: .17em;
}

.sidebar #new-project {
  width: auto;
  min-height: 42px;
  margin: 0 14px 16px;
  border-radius: 12px;
  letter-spacing: .005em;
}

.menu { padding: 0 11px 14px; }
.grp { margin-top: 10px; padding-top: 8px; border-top-color: rgba(255, 255, 255, .055); }
.grp:first-child { padding-top: 0; }
.menu-label { padding: 12px 11px 7px; color: #525f75; font-size: 9px; font-weight: 750; letter-spacing: .18em; }

.menu-item {
  min-height: 41px;
  gap: 11px;
  margin: 2px 0;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #98a5b8;
  font-size: 13px;
  font-weight: 560;
}

.menu-item:hover { background: rgba(255, 255, 255, .045); color: #e9edf5; }
.menu-item.active {
  border-color: rgba(129, 109, 255, .2);
  background: linear-gradient(90deg, rgba(102, 87, 238, .2), rgba(102, 87, 238, .07));
  color: #c4baff;
  box-shadow: inset 3px 0 #7564f2;
}

.menu-item .ic {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: 0;
  opacity: .92;
}

.menu-item .ic svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-item .n { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .045); color: #768398; text-align: center; }
.menu-item.active .n { background: rgba(117, 100, 242, .18); color: #c4baff; }

.folder-item {
  margin: 2px 0;
  padding: 8px 9px 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #8f9caf;
}
.folder-item:hover { background: rgba(255, 255, 255, .04); }
.folder-item.active { border-color: rgba(90, 167, 255, .14); background: rgba(90, 167, 255, .075); color: #e9f1ff; }
.folder-sq { width: 7px; height: 7px; flex-basis: 7px; box-shadow: 0 0 10px currentColor; }
.project-context { margin-top: 10px; padding-top: 8px; border-top-color: rgba(255, 255, 255, .055); }
.project-context .menu-label { padding-top: 5px; color: #6f7c91; }
.sidebar .bar { background: rgba(255, 255, 255, .06); }
.sidebar .bar i { background: linear-gradient(90deg, #5aa7ff, #7564f2); }

.dashboard-recent-work { margin: 16px 0; padding: 17px; }
.dashboard-recent-work .analytics-head { margin-bottom: 13px; }
.dashboard-recent-work h2 { margin-bottom: 4px; }
.dashboard-recent-work p { margin: 0; font-size: 12px; }
.recent-work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.recent-work-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--ln); border-radius: 12px; background: var(--sur2); color: var(--ink); text-align: left; }
.recent-work-item:hover { border-color: rgba(117, 100, 242, .42); background: var(--sur); transform: translateY(-1px); }
.recent-work-copy { min-width: 0; }
.recent-work-copy small,.recent-work-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-work-copy small { color: var(--mut); font-size: 10px; font-weight: 560; }
.recent-work-copy b { margin-top: 3px; font-size: 12.5px; }
.recent-work-arrow { color: var(--dim); font-size: 16px; }

.sidebar-foot {
  padding: 12px 14px;
  border-top-color: rgba(255, 255, 255, .065);
  background: rgba(3, 6, 11, .22);
}
.side-user .who::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--free); box-shadow: 0 0 10px rgba(54, 211, 138, .65); }

/* Generator panel */
.gencol {
  position: relative;
  z-index: 5;
  background: linear-gradient(180deg, #101623, #0d131e);
  border-right: 1px solid var(--ln);
  box-shadow: 14px 0 38px rgba(0, 0, 0, .11);
}

.gencol::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #5f80ff, #7a5bef, transparent 82%); opacity: .85; }
.gencol-head { min-height: 64px; padding: 14px 17px; border-bottom-color: var(--ln); }
.gencol-head h2 { font-size: 15px; font-weight: 710; }
.gencol-alvo { padding: 12px 18px 4px; color: #758298; font-size: 11px; }
.gencol-alvo:not(:empty)::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #5aa7ff; box-shadow: 0 0 9px rgba(90, 167, 255, .62); }
.gencol-body { padding: 17px 18px 22px; }
.gencol-foot { gap: 9px; padding: 14px 18px 17px; border-top-color: var(--ln); background: rgba(5, 8, 14, .26); }
.gencol-foot #add-queue { min-height: 43px; }

.linha { gap: 10px; margin-bottom: 11px; }
.linha .rot { width: 67px; flex-basis: 67px; color: #8390a4; font-size: 11px; font-weight: 560; }
.ctrl { margin-bottom: 18px; }
.ctrl > label, .field-label { color: #7e8ba0; font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }

.pills, .seg {
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 11px;
  background: rgba(3, 6, 12, .4);
}
.pill, .seg button { min-height: 29px; border-radius: 8px; color: #7f8ba0; }
.pill:hover, .seg button:hover:not(.on) { color: #e8ecf4; background: rgba(255, 255, 255, .035); }
.pill.active, .seg button.on {
  background: linear-gradient(180deg, rgba(120, 102, 238, .3), rgba(92, 79, 204, .18));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(151, 135, 255, .2), 0 4px 14px rgba(34, 27, 86, .28);
}

.gencol-prompts .prompts, #mSeq .prompts {
  min-height: 210px;
  border-color: rgba(255, 255, 255, .1);
  background: linear-gradient(180deg, rgba(4, 7, 13, .62), rgba(8, 12, 20, .7));
}
.dica, .sum { border: 1px solid rgba(255, 255, 255, .055); background: rgba(255, 255, 255, .035); }
.sum { padding: 11px 12px; border-radius: 11px; }
.sum-1 { color: #e5eaf2; }
.sum-2 { margin-top: 3px; color: #718097; }
.chk { border-top-color: var(--ln); color: #c8d0dd; }
.ref-card { border-color: var(--ln2); border-radius: 11px; background: var(--sur2); }
.ref-warning, .alert { border-color: rgba(242, 184, 75, .2); }
.gencol-show { border-color: var(--ln2); background: #151c2a; color: #a8b3c5; box-shadow: var(--v7-shadow-soft); }

/* Workspace */
.main { background: linear-gradient(180deg, #0a0e17 0%, #080c14 100%); }
.topbar {
  min-height: 64px;
  flex-basis: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--ln);
  background: rgba(10, 14, 23, .82);
  backdrop-filter: blur(18px);
}
.mobile-menu-toggle,
.mobile-menu-backdrop { display: none; }
.mobile-menu-toggle {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--ln2);
  border-radius: 10px;
  background: var(--sur2);
  color: var(--ink);
}
.mobile-menu-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.crumb { color: #647187; gap: 9px; }
.crumb b { color: #f2f5fa; font-size: 16px; font-weight: 710; }
.kpis { gap: 7px; }
.kpi { min-width: 94px; padding: 7px 12px; border: 1px solid rgba(255, 255, 255, .06); border-radius: 10px; background: rgba(255, 255, 255, .025); text-align: left; }
.kpi .l { font-size: 8px; color: #5f6c81; letter-spacing: .13em; }
.kpi .v { margin-top: 0; color: #dce3ee; font-size: 12px; }
.kpi.hi .v { color: #57dfa0; }
.view { animation: v7-view-in .24s ease-out; }
@keyframes v7-view-in { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.pad { padding: 24px 26px 54px; }

.card {
  border: 1px solid var(--ln);
  border-radius: var(--v7-radius);
  background: linear-gradient(145deg, rgba(20, 27, 41, .96), rgba(13, 18, 29, .96));
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12), inset 0 1px rgba(255, 255, 255, .022);
  padding: 19px 20px;
}
.card h2 { margin-bottom: 15px; color: #f0f3f8; font-size: 13px; }

/* Dashboard */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 15px; }
.metric {
  position: relative;
  min-height: 154px;
  overflow: hidden;
  border: 1px solid var(--ln);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(100, 91, 230, .16), transparent 42%),
    linear-gradient(145deg, #141b29, #0e141f);
  padding: 22px;
  box-shadow: var(--v7-shadow-soft), inset 0 1px rgba(255, 255, 255, .03);
}
.metric::after { content: ""; position: absolute; right: -28px; bottom: -42px; width: 120px; height: 120px; border: 1px solid rgba(255, 255, 255, .04); border-radius: 34px; transform: rotate(25deg); }
.metric .k { position: relative; z-index: 1; color: #6e7b90; font-size: 9px; letter-spacing: .15em; }
.metric .v { position: relative; z-index: 1; margin-top: 18px; color: #f7f9fc; font-size: 34px; font-weight: 720; }
.metric .s { position: relative; z-index: 1; margin-top: 9px; color: #8491a5; }
.metric.save .v { color: #53dda0; }
.metric.warn { border-color: rgba(242, 184, 75, .28); }

/* Projects */
.projects-grid, .pcards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 17px; }
.pgrp { margin-bottom: 34px; }
.pgh { margin-bottom: 15px; }
.pgh h3 { font-size: 16px; }
.pgh .tg2 { padding: 4px 10px; border: 1px solid var(--ln); background: rgba(255, 255, 255, .035); color: #8090a7; }
.pcard {
  border-color: var(--ln);
  border-radius: 17px;
  background: linear-gradient(160deg, #141b29, #0f151f);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .17), inset 0 1px rgba(255, 255, 255, .025);
  transform: translateY(0);
}
.pcard:hover { border-color: rgba(124, 108, 241, .34); box-shadow: 0 19px 42px rgba(0, 0, 0, .26), 0 0 0 1px rgba(111, 93, 235, .08); transform: translateY(-3px); }
.cover { height: 176px; flex-basis: 176px; background: #171e2a; }
.cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(5, 8, 14, .38), transparent 56%); }
.cover .lb { z-index: 1; left: 12px; bottom: 11px; padding: 3px 8px; background: rgba(4, 7, 12, .68); border: 1px solid rgba(255, 255, 255, .09); backdrop-filter: blur(8px); }
.pbody { gap: 8px; padding: 15px 15px 11px; }
.pbody .t { color: #f5f7fb; font-size: 15px; }
.pbody .m { color: #76849a; }
.fli { padding: 6px 7px; border-radius: 8px; color: #c7d0dc; }
.fli:hover { background: rgba(255, 255, 255, .045); }
.pfoot { padding: 11px 15px; border-top-color: var(--ln); background: rgba(4, 7, 12, .17); }
.newcard { min-height: 176px; border-color: rgba(255, 255, 255, .13); border-radius: 17px; background: rgba(255, 255, 255, .012); color: #76849a; }
.newcard:hover { border-color: rgba(124, 108, 241, .62); background: rgba(108, 92, 231, .055); color: #b9afff; }
.projects-stack > .newcard:first-child { min-height: 78px !important; background: linear-gradient(90deg, rgba(108, 92, 231, .045), rgba(255, 255, 255, .012)); }
#projects-empty { max-width: 520px; margin: 16px 0 0; padding: 17px 18px; border: 1px dashed var(--ln2); border-radius: 13px; background: rgba(255, 255, 255, .018); }
.pmenu { border-color: var(--ln2); background: #151c29; box-shadow: var(--v7-shadow); }
.pmenu-item { color: #dbe2ec; }
.pmenu-item:hover { background: rgba(255, 255, 255, .06); }
.xs { border-color: var(--ln2); background: rgba(255, 255, 255, .025); color: #d7dee9; }
.xs:hover { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .055); }
.gh { border-color: transparent; background: transparent; color: #8c99ac; }

/* Folder toolbar and media gallery */
.folder-head {
  min-height: 64px;
  flex-wrap: wrap;
  padding: 11px 24px;
  border-bottom-color: var(--ln);
  background: rgba(13, 18, 29, .8);
  backdrop-filter: blur(16px);
}
.chip { padding: 5px 10px; border-color: var(--ln); background: rgba(255, 255, 255, .025); color: #929fb2; }
.chip.green { background: var(--free-bg); color: #59dfa0; }
.chip.amber { background: var(--paid-bg); color: #f2c05f; }
.chip.red { background: var(--bad-bg); color: #ff8693; }
.search { min-height: 34px; flex-basis: 220px; background: rgba(3, 6, 12, .45); }
.zoom-pills { padding: 3px; border: 1px solid var(--ln); border-radius: 10px; background: rgba(3, 6, 12, .35); }
.zoom-pills button { min-width: 28px; border-radius: 7px; }
.zoom-pills button.active { background: rgba(108, 92, 231, .24); color: #d9d4ff; }
.seq-faixa { gap: 8px; padding: 11px 24px 0; }
.seq-item { border-color: var(--ln); background: rgba(255, 255, 255, .025); }

.gallery { gap: 4px; }
.lote { margin-bottom: 31px; }
.resultados-finais { padding: 15px; border: 1px solid var(--ln); border-radius: 16px; background: rgba(255, 255, 255, .018); }
.montagens-finais { border-color: rgba(82, 217, 154, .22); background: linear-gradient(145deg, rgba(82, 217, 154, .055), rgba(255, 255, 255, .012)); }
.montagens-finais .group-head h3 { color: #72e5ae; }
.exportacoes-finais { border-color: rgba(124, 108, 241, .28); background: linear-gradient(145deg, rgba(124, 108, 241, .07), rgba(255, 255, 255, .012)); }
.exportacoes-finais .group-head h3 { color: #aaa0ff; }
.group-head .cnt.bad { color: #ff8693; }
.group-head { margin-bottom: 11px; }
.group-head h3 { color: #edf1f7; font-size: 13px; }
.group-head .cnt { color: #68768c; }
.group-head .cnt.ok { color: #52d99a; }
.group-head .selgrp { color: #7f8da1; }
.grid { gap: 12px; }
.gallery.z-sm .grid { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); }
.gallery.z-md .grid { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.gallery.z-lg .grid { grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.seqgrid, .gallery.z-sm .grid.seqgrid { grid-template-columns: repeat(auto-fill, 256px); }
.gallery.z-md .grid.seqgrid { grid-template-columns: repeat(auto-fill, 368px); }
.gallery.z-lg .grid.seqgrid { grid-template-columns: repeat(auto-fill, 540px); }
.seqcluster { gap: 7px; }
.seqcluster-head { min-height: 25px; color: #7b899e; }
.seqcluster-head b { color: #dce3ed; }
.seqcluster-cards { gap: 10px; grid-template-columns: repeat(auto-fill, 123px); }
.gallery.z-md .seqcluster-cards { grid-template-columns: repeat(auto-fill, 179px); }
.gallery.z-lg .seqcluster-cards { grid-template-columns: repeat(auto-fill, 259px); }

.gcard {
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 15px;
  background: #151c28;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
  transform: translateY(0) scale(1);
}
.gcard:hover { border-color: rgba(255, 255, 255, .17); box-shadow: 0 17px 38px rgba(0, 0, 0, .3); transform: translateY(-2px); }
.gcard .sh { background: linear-gradient(to top, rgba(3, 5, 10, .9), rgba(3, 5, 10, .05) 55%, transparent); }
.gcard.selected { outline-color: #47d895; box-shadow: 0 0 0 4px rgba(54, 211, 138, .12), 0 16px 35px rgba(0, 0, 0, .28); }
.gcard-bar { left: 10px; right: 10px; bottom: 9px; }
.ck { top: 9px; left: 9px; width: 19px; height: 19px; border-radius: 6px; background: rgba(7, 10, 16, .58); backdrop-filter: blur(6px); }
.gcard.selected .ck { background: #36d38a; border-color: #36d38a; }
.seg-badge, .badge-corner, .vs-badge { top: 9px; padding: 3px 7px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(4, 7, 12, .72); backdrop-filter: blur(8px); }
.seg-badge, .vs-badge { left: 9px; }
.badge-corner { right: 9px; }
.thumb { background: #151c28; }
.thumb.generating { background: linear-gradient(135deg, #141c2b, #1b2538, #141c2b); background-size: 200% 200%; animation: v7-pulse 2s ease-in-out infinite; }
@keyframes v7-pulse { 50% { background-position: 100% 100%; } }
.thumb-prog { height: 4px; background: rgba(255, 255, 255, .08); }
.thumb-prog i { background: linear-gradient(90deg, #5aa7ff, #8062ef); }
.thumb .play { width: 42px; height: 42px; border: 1px solid rgba(255, 255, 255, .28); background: rgba(4, 7, 13, .46); box-shadow: 0 8px 24px rgba(0, 0, 0, .28); backdrop-filter: blur(8px); }
.fx-btn { top: 9px; right: 9px; width: 29px; height: 29px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(5, 8, 14, .62); }
.pool-grid .gcard { box-shadow: none; }

/* Inspector and floating actions */
.insp {
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 380px;
  z-index: 24;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: rgba(15, 21, 32, .96);
  box-shadow: -18px 0 60px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .035);
  backdrop-filter: blur(20px);
}
.insph { min-height: 58px; padding: 14px 17px; border-bottom-color: var(--ln); }
.insph h4 { font-size: 14px; }
.inspb { padding: 16px; }
.inspf { padding: 13px 16px; border-top-color: var(--ln); background: rgba(4, 7, 12, .2); }
.prev { max-height: 340px; border-color: var(--ln); border-radius: 13px; background: #070a10; }
.kv { padding: 9px 2px; border-bottom-color: var(--ln); }
.kv .k { color: #708097; }
.kv .v { color: #e6eaf1; }
.ptx { border-color: var(--ln); background: rgba(3, 6, 12, .45); color: #b8c2d1; }

.selbar {
  bottom: 22px;
  gap: 8px;
  padding: 9px 10px 9px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: rgba(18, 25, 38, .9);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .46);
  backdrop-filter: blur(18px);
}
.selbar #sel-count { margin-right: 5px; color: #dfe5ef; font-weight: 620; }
.selbar .btn-dark { background: rgba(255, 255, 255, .045); border-color: var(--ln2); color: #e5e9f0; }

/* Tables, storage and settings */
.storage-table { overflow: hidden; border-color: var(--ln); border-radius: 12px; background: transparent; }
.storage-table th { padding: 12px 14px; border-bottom-color: var(--ln); background: rgba(3, 6, 11, .28); color: #66758c; }
.storage-table td { padding: 14px; border-bottom-color: var(--ln); color: #a8b2c2; }
.storage-table tbody tr { transition: background .15s ease; }
.storage-table tbody tr:hover { background: rgba(255, 255, 255, .025); }
.bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .065); }
.bar i { border-radius: inherit; background: linear-gradient(90deg, #5aa7ff, #7564f2); }
.quota-row { color: #a0acbd; }
.quota-row b { color: #e7ebf2; }

#view-settings .pad { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: start; max-width: 1320px; }
#view-settings .card { max-width: none; margin: 0; }
#view-settings .card:first-child, #view-settings .card:nth-child(5) { grid-column: 1 / -1; }
#view-settings input[type=password], #view-settings input[type=number], #view-settings select { min-height: 40px; }
.row-inline { gap: 9px; }
.maint-item, .indef-linha, .u-linha { border-color: var(--ln); }
.maint-item.atrasada .maint-nome, .maint-item.atrasada .maint-quando { color: #ff8290; }
.u-nome { color: #edf1f7; }
.u-sub, .u-atividade { color: #96a3b6; }
.segredo { border: 1px solid var(--ln); background: rgba(3, 6, 12, .38); }

/* Editing and montage */
.mt-head { min-height: 66px; padding: 13px 24px; border-bottom-color: var(--ln); background: rgba(13, 18, 29, .84); backdrop-filter: blur(16px); }
.mt-titulo h1 { font-size: 17px; }
.mt-faixa { margin: -24px -26px 20px; padding: 19px 26px; border-bottom-color: var(--ln); background: rgba(255, 255, 255, .018); }
.mt-fila { gap: 10px; min-height: 148px; }
.mt-clip { flex-basis: 88px; height: 136px; border: 1px solid var(--ln); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.mt-cards { gap: 15px; }
.mt-cards .card { min-height: 160px; }
.mt-aviso { border-color: var(--ln); border-radius: 11px; background: rgba(255, 255, 255, .025); }
.mt-rodape { border-color: rgba(124, 108, 241, .18); background: linear-gradient(145deg, rgba(40, 34, 90, .28), rgba(17, 22, 34, .96)); }

/* Dialogs and notices */
.modal-overlay { background: rgba(2, 4, 8, .72); backdrop-filter: blur(9px); }
.modal-box { border-color: rgba(255, 255, 255, .12); border-radius: 18px; background: linear-gradient(150deg, #171f2e, #0f151f); box-shadow: 0 32px 80px rgba(0, 0, 0, .52); }

/* Login do Flow no navegador do servidor. A moldura pertence ao app; os pixels
   do Google chegam pelo VNC privado em loopback e nunca por um iframe externo. */
.flow-login-overlay { z-index: 1000; padding: 22px; }
.flow-login-box { width: min(1180px, calc(100vw - 44px)); max-height: calc(100vh - 44px); display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.flow-login-head, .flow-login-foot, .flow-login-actions { display: flex; align-items: center; gap: 10px; }
.flow-login-head { justify-content: space-between; }
.flow-login-head h3 { margin: 2px 0 0; font-size: 16px; }
.flow-login-copy { margin: -3px 0 0; color: var(--mut); }
.flow-login-status { min-height: 20px; padding: 8px 10px; border: 1px solid var(--ln); border-radius: 10px; background: rgba(255, 255, 255, .025); color: var(--mut); font-size: 12px; }
.flow-login-paste { display: grid; grid-template-columns: auto minmax(240px, 1fr) auto auto; align-items: center; gap: 8px; }
.flow-login-paste label { color: var(--txt); font-size: 12px; font-weight: 700; }
.flow-login-paste-value { min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--ln); border-radius: 9px; background: var(--card); color: var(--txt); }
.flow-login-paste .muted { font-size: 10px; }
.flow-login-screen { position: relative; min-height: 430px; flex: 1 1 auto; overflow: hidden; border: 1px solid var(--ln2); border-radius: 12px; background: #151922; }
/* O noVNC calcula uma unica escala uniforme e grava width/height em pixels no
   proprio canvas. Forcar 100% nos dois eixos distorcia 16:9 para o retangulo
   do modal: a imagem parecia normal o bastante, mas o clique era convertido
   com outra escala e chegava em coordenadas erradas no Chrome remoto. */
.flow-login-screen canvas { display: block; max-width: none; max-height: none; outline: none; }
.flow-login-foot { justify-content: space-between; flex-wrap: wrap; padding-top: 2px; }
.flow-login-foot .muted { font-size: 11px; }
.flow-login-actions { margin-left: auto; }
.flow-login-close, .flow-login-cancel, .flow-login-finish, .flow-login-paste-send { flex: 0 0 auto; }
.flow-login-close { min-width: 32px; padding-inline: 8px; font-size: 16px; line-height: 1; }
.flow-login-finish, .flow-login-paste-send { white-space: nowrap; }
.media-modal { backdrop-filter: blur(8px); }
.mm-backdrop { background: rgba(2, 4, 8, .82); }
.mm-box { border-color: rgba(255, 255, 255, .12); border-radius: 18px; background: #111824; box-shadow: 0 34px 90px rgba(0, 0, 0, .58); }
.mm-media { border-radius: 13px; background: #060910; }
.mm-close, .mm-nav { border-color: var(--ln2); background: rgba(17, 24, 36, .9); color: #fff; backdrop-filter: blur(10px); }
.toast { border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(24, 32, 47, .94); color: #f2f5fa; box-shadow: var(--v7-shadow); backdrop-filter: blur(16px); }
.alert { margin: 10px 18px 0; border-radius: 12px; }

/* Empty states */
.naoimpl-card { position: relative; overflow: hidden; min-height: 190px; display: flex; flex-direction: column; justify-content: center; padding-left: 28px; }
.naoimpl-card::after { content: "✦"; position: absolute; right: 26px; top: 50%; transform: translateY(-50%); color: rgba(124, 108, 241, .14); font-size: 86px; }
.naoimpl-card > * { position: relative; z-index: 1; max-width: 620px; }

/* Dashboard intelligence */
.eyebrow { color: #74839a; font-size: 9px; font-weight: 760; letter-spacing: .16em; text-transform: uppercase; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 19px; }
.dashboard-heading h1 { margin: 4px 0 3px; font-size: 24px; }
.dashboard-heading p { margin: 0; }
.dashboard-range, .settings-load-status { display: inline-flex; align-items: center; gap: 7px; color: #78869a; font-size: 11px; }
.dashboard-range span, .settings-load-status span, .settings-nav-note span { width: 7px; height: 7px; border-radius: 50%; background: var(--free); box-shadow: 0 0 10px rgba(54, 211, 138, .6); }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 15px; margin-top: 15px; }
.analytics-card { min-height: 216px; padding: 20px; }
.analytics-production { grid-row: span 2; min-height: 448px; }
.analytics-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.analytics-head h2 { margin: 3px 0 0; font-size: 14px; }
.chart-legend { display: flex; align-items: center; gap: 13px; color: #8794a7; font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend span::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: #7564f2; }
.chart-legend .legend-image::before { background: #7564f2; }
.chart-legend .legend-video::before { background: #5aa7ff; }
.chart-production { position: relative; height: 335px; display: grid; grid-template-columns: repeat(7, minmax(34px, 1fr)); align-items: end; gap: 12px; padding: 24px 2px 0; border-bottom: 1px solid var(--ln); }
.chart-production::before, .chart-production::after { content: ""; position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255,255,255,.055); }
.chart-production::before { top: 33%; }
.chart-production::after { top: 66%; }
.chart-day { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.chart-stack { width: min(48px, 72%); height: 268px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 8px 8px 3px 3px; overflow: hidden; background: rgba(255,255,255,.025); }
.chart-segment { min-height: 0; transition: height .35s ease; }
.chart-segment.image { height: calc(var(--chart-image) * 1%); background: linear-gradient(180deg, #8a75ff, #6957dc); }
.chart-segment.video { height: calc(var(--chart-video) * 1%); background: linear-gradient(180deg, #65b2ff, #3e82d9); }
.chart-day-total { position: absolute; top: 0; color: #aeb8c8; font: 650 10px/1 "SFMono-Regular", Consolas, monospace; }
.chart-day-label { color: #6f7d92; font-size: 9px; text-transform: uppercase; }
.chart-empty { min-height: 150px; display: grid; place-items: center; color: var(--dim); text-align: center; }
.chart-mix { min-height: 142px; display: flex; align-items: center; gap: 24px; }
.mix-donut { position: relative; width: 122px; height: 122px; flex: 0 0 122px; border-radius: 50%; background: conic-gradient(#7564f2 0 var(--mix-image), #5aa7ff var(--mix-image) 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.mix-donut::after { content: ""; position: absolute; inset: 17px; border-radius: 50%; background: #111824; box-shadow: 0 0 0 1px var(--ln); }
.mix-donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; }
.mix-donut-center b { color: var(--ink); font: 720 23px/1 "SFMono-Regular", Consolas, monospace; }
.mix-donut-center span { margin-top: 5px; color: var(--dim); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.mix-list { flex: 1; display: grid; gap: 12px; }
.mix-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; }
.mix-row span { color: #8a97aa; font-size: 11px; }
.mix-row b { color: #dfe5ee; font-family: "SFMono-Regular", Consolas, monospace; }
.mix-row small { grid-column: 1 / -1; color: #657389; }
.chart-reliability { display: grid; gap: 14px; }
.reliability-row { display: grid; grid-template-columns: 72px 1fr 40px; align-items: center; gap: 10px; }
.reliability-name { color: #9aa6b8; font-size: 11px; }
.reliability-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.055); }
.reliability-fill { height: 100%; width: var(--success-rate); border-radius: inherit; background: linear-gradient(90deg, #32c681, #5ae0a4); }
.reliability-value { color: #cbd4e0; font: 650 10px/1 "SFMono-Regular", Consolas, monospace; text-align: right; }
.reliability-meta { grid-column: 2 / -1; margin-top: -6px; color: #657389; font-size: 9px; }

/* Settings information architecture */
#view-settings .settings-pad { display: block; max-width: 1500px; padding-top: 22px; }
.settings-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 22px; align-items: start; }
.settings-nav { position: sticky; top: 22px; overflow: hidden; border: 1px solid var(--ln); border-radius: 16px; background: rgba(14, 20, 31, .78); box-shadow: var(--v7-shadow-soft); }
.settings-nav-head { padding: 19px 18px 15px; border-bottom: 1px solid var(--ln); }
.settings-nav-head h2 { margin: 4px 0 6px; font-size: 16px; }
.settings-nav-head p { margin: 0; color: #748197; font-size: 11px; line-height: 1.45; }
.settings-nav-item { width: calc(100% - 14px); min-height: 58px; display: flex; align-items: center; gap: 10px; margin: 7px; padding: 9px 10px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #8b98ab; text-align: left; cursor: pointer; }
.settings-nav-item:hover { background: rgba(255,255,255,.035); color: #e4e9f1; }
.settings-nav-item.active { border-color: rgba(121,103,243,.2); background: linear-gradient(90deg, rgba(108,92,231,.18), rgba(108,92,231,.06)); color: #c8c0ff; }
.settings-nav-icon { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.04); font-size: 14px; }
.settings-nav-item.active .settings-nav-icon { background: rgba(121,103,243,.2); }
.settings-nav-item > span:last-child { display: grid; gap: 2px; }
.settings-nav-item b { font-size: 12px; }
.settings-nav-item small { color: #657389; font-size: 9px; }
.settings-nav-item.active small { color: #9288c8; }
.settings-nav-note { display: flex; align-items: flex-start; gap: 8px; margin: 8px 14px 15px; padding-top: 13px; border-top: 1px solid var(--ln); color: #657389; font-size: 9px; line-height: 1.4; }
.settings-nav-note span { flex: 0 0 7px; margin-top: 3px; }
.settings-workspace { min-width: 0; }
.settings-titlebar { min-height: 70px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 15px; padding: 4px 2px 12px; border-bottom: 1px solid var(--ln); }
.settings-titlebar h1 { margin: 3px 0 2px; font-size: 22px; }
.settings-titlebar p { margin: 0; }
.settings-load-status { margin-top: 8px; padding: 7px 10px; border: 1px solid var(--ln); border-radius: 999px; background: rgba(255,255,255,.025); }
.settings-load-status.error { color: var(--bad); }
.settings-load-status.error span { background: var(--bad); box-shadow: 0 0 10px rgba(255,102,119,.55); }
.settings-panel { animation: v7-view-in .2s ease-out; }
.settings-panel[hidden] { display: none !important; }
.settings-hero { padding: 24px; }
.settings-card-intro { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.settings-card-intro h2 { margin: 3px 0 4px; font-size: 16px; }
.settings-card-intro p { margin: 0; color: #78869a; font-size: 11px; }
.settings-card-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: rgba(108,92,231,.14); color: #a497ff; }
.routing-grid, .settings-fields-two, .settings-fields-three { display: grid; gap: 14px; }
.routing-grid, .settings-fields-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-fields-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-field { min-width: 0; display: flex; flex-direction: column; gap: 6px; color: #a9b3c2; font-size: 11px; font-weight: 620; }
.settings-field > span { color: #aeb8c7; }
.settings-field > small { min-height: 16px; color: #68768b; font-size: 9px; font-weight: 450; line-height: 1.4; }
.settings-field input, .settings-field select { width: 100%; min-width: 0 !important; min-height: 42px; }
.settings-inline { display: flex; align-items: center; gap: 7px; }
.settings-inline input { flex: 1; }
.settings-actions { display: flex; align-items: center; gap: 11px; margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--ln); }
.settings-explainer { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.settings-explainer > div { min-height: 86px; display: grid; align-content: center; gap: 5px; padding: 15px 16px; border: 1px solid var(--ln); border-radius: 12px; background: rgba(255,255,255,.018); }
.settings-explainer b { color: #cbd3de; font-size: 11px; }
.settings-explainer span { color: #6d7a8e; font-size: 9px; line-height: 1.45; }
.provider-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.provider-settings-card { min-width: 0; }
.provider-settings-card.provider-paid { grid-column: 1 / -1; }
.provider-settings-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.provider-settings-head h2 { margin: 2px 0 0; font-size: 16px; }
.provider-orb { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(242,184,75,.12); color: #f0bd5a; font-weight: 760; }
.provider-orb.provider-codex { background: rgba(108,92,231,.14); color: #a497ff; }
.provider-orb.provider-flow { background: rgba(90,167,255,.13); color: #72b5fa; }
.provider-orb.provider-grok { background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(139,92,246,.18)); color: #c9b8ff; }
.provider-state { margin-left: auto; padding: 4px 8px; border: 1px solid var(--ln); border-radius: 999px; color: #8090a5; font-size: 9px; }
.provider-copy { margin: -3px 0 17px; color: #758297; font-size: 10px; }
.provider-diagnostic { min-height: 54px; margin: 13px 0; padding: 12px; border: 1px solid var(--ln); border-radius: 10px; background: rgba(3,6,12,.24); color: #9ba7b8; font-size: 10px; }
.settings-tech-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--ln); color: #68768b; font-size: 9px; line-height: 1.5; }
.cadence-card { padding: 24px; }
.cadence-guide { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 17px; }
.cadence-guide span { padding: 5px 9px; border: 1px solid var(--ln); border-radius: 999px; background: rgba(255,255,255,.02); color: #748197; font-size: 9px; }
.cadence-lane { margin-top: 11px; overflow: hidden; border: 1px solid var(--ln); border-radius: 12px; background: rgba(255,255,255,.014); }
.cadence-lane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--ln); background: rgba(255,255,255,.018); }
.cadence-lane-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.cadence-lane-head b { color: #cbd3de; font-size: 11px; }
.cadence-lane-head span { color: #728096; font-size: 9px; }
.cadence-fields { display: grid; grid-template-columns: 1.05fr .8fr 1fr 1fr .9fr; gap: 10px; padding: 13px 14px 15px; align-items: start; }
.cadence-alert, .cadence-progress { padding: 5px 8px; border-radius: 999px; font-size: 9px; white-space: nowrap; }
.cadence-alert { color: var(--paid); background: rgba(255,183,77,.1); }
.cadence-progress { color: var(--free); background: rgba(54,211,138,.09); }
.settings-command { margin: 8px 0 0; padding: 9px 10px; overflow: auto; border: 1px solid var(--ln); border-radius: 8px; background: rgba(0,0,0,.18); color: #b8c2d1; font-size: 10px; }
.system-settings-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(245px, .75fr); gap: 14px; align-items: start; }
.switch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.settings-switch { position: relative; min-height: 70px; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-content: center; gap: 1px 9px; padding: 11px 12px; border: 1px solid var(--ln); border-radius: 11px; background: rgba(255,255,255,.018); cursor: pointer; }
.settings-switch input { position: absolute; opacity: 0; pointer-events: none; }
.settings-switch > span { grid-row: 1 / 3; position: relative; width: 34px; height: 20px; align-self: center; border-radius: 999px; background: rgba(255,255,255,.1); transition: background .18s ease; }
.settings-switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8793a5; transition: transform .18s ease, background .18s ease; }
.settings-switch input:checked + span { background: rgba(54,211,138,.2); }
.settings-switch input:checked + span::after { transform: translateX(14px); background: #41d18e; }
.settings-switch b { color: #c6cfda; font-size: 11px; }
.settings-switch small { color: #68768b; font-size: 9px; }
.worker-card { display: grid; gap: 15px; }
.security-card { display: grid; gap: 15px; }
.reauth-box { width: min(430px, calc(100vw - 28px)); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reauth-box h2 { margin: 4px 0 0; font-size: 20px; }
.mfa-secret { display: block; padding: 10px 12px; border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 10px; word-break: break-all; font: 600 13px/1.5 ui-monospace, monospace; user-select: all; }
.recovery-codes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding: 10px; background: var(--bg2, rgba(127,127,127,.08)); border-radius: 10px; font: 600 13px/1.4 ui-monospace, monospace; user-select: all; }
.worker-warning { padding: 12px; border: 1px solid rgba(242,184,75,.18); border-radius: 10px; background: rgba(242,184,75,.07); color: #b99a5e; font-size: 10px; }

/* Theme control */
.theme-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 5px 11px 5px 7px;
  border: 1px solid var(--ln);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: #b8c2d1;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ln2); background: rgba(255, 255, 255, .075); color: var(--ink); }
.theme-toggle-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: rgba(242, 184, 75, .13); color: #f2c05f; font-size: 13px; }
.theme-toggle-label { min-width: 29px; text-align: left; }
.topbar .kpis { margin-left: 4px; }

/* Light is a designed workspace, not an automatic color inversion. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #edf1f7;
  --sur: #ffffff;
  --sur2: #f3f6fa;
  --up: #e8edf5;
  --ln: rgba(25, 39, 64, .09);
  --ln2: rgba(25, 39, 64, .16);
  --ink: #182237;
  --mut: #5b687c;
  --dim: #606d83;
  --acs: rgba(91, 92, 231, .1);
  --free-bg: rgba(24, 161, 100, .1);
  --green-bg: rgba(24, 161, 100, .1);
  --paid-bg: rgba(204, 132, 18, .11);
  --amber-bg: rgba(204, 132, 18, .11);
  --bad-bg: rgba(215, 62, 82, .1);
  --red-bg: rgba(215, 62, 82, .1);
  --busy-bg: rgba(48, 119, 219, .1);
  --v7-shadow: 0 18px 48px rgba(38, 54, 82, .13);
  --v7-shadow-soft: 0 9px 27px rgba(38, 54, 82, .09);
}
html[data-theme="light"] *, html[data-theme="light"] *::before, html[data-theme="light"] *::after { scrollbar-color: #bdc6d3 transparent; }
html[data-theme="light"] ::selection { background: rgba(91, 92, 231, .2); color: #182237; }
html[data-theme="light"] body {
  background:
    radial-gradient(circle at 73% -8%, rgba(93, 111, 229, .11), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(130, 90, 198, .07), transparent 27%),
    var(--bg);
}
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #bdc6d3; border-color: transparent; }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #9ca9ba; border-color: transparent; }
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea { border-color: var(--ln2); background: #fff; color: var(--ink); }
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #97a2b2; }
html[data-theme="light"] .btn { background: rgba(255, 255, 255, .72); color: #3f4e64; box-shadow: inset 0 1px #fff; }
html[data-theme="light"] .btn:hover { border-color: rgba(31, 47, 74, .22); background: #fff; color: #182237; }
html[data-theme="light"] .btn-primary { border-color: transparent; background: var(--v7-gradient); color: #fff; box-shadow: 0 8px 22px rgba(91, 92, 231, .2), inset 0 1px rgba(255, 255, 255, .22); }
html[data-theme="light"] .btn-primary:hover { border-color: transparent; background: linear-gradient(135deg, #6685ff, #8065ef 58%, #ad62e9); color: #fff; }
html[data-theme="light"] .btn-ghost { border-color: transparent; background: transparent; color: #657388; box-shadow: none; }
html[data-theme="light"] .btn-danger { background: #fff7f7; color: #d43e51; }

html[data-theme="light"] .login-overlay { background: #edf1f7; }
html[data-theme="light"] .login-overlay::before,
html[data-theme="light"] .login-overlay::after { border-color: rgba(75, 93, 125, .08); }
html[data-theme="light"] .login-card { border-color: rgba(33, 48, 73, .1); background: rgba(255, 255, 255, .94); box-shadow: 0 38px 90px rgba(40, 56, 82, .16), inset 0 1px #fff; }

html[data-theme="light"] .layout { background: var(--bg); }
html[data-theme="light"] .sidebar { background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%); box-shadow: 10px 0 34px rgba(35, 51, 77, .06); }
html[data-theme="light"] .sidebar .brand::after,
html[data-theme="light"] .menu-label { color: #8996a8; }
html[data-theme="light"] .grp { border-top-color: rgba(25, 39, 64, .075); }
html[data-theme="light"] .menu-item { color: #66758a; }
html[data-theme="light"] .menu-item:hover { background: rgba(57, 73, 101, .055); color: #25334a; }
html[data-theme="light"] .menu-item.active { border-color: rgba(100, 83, 229, .14); background: linear-gradient(90deg, rgba(102, 87, 238, .13), rgba(102, 87, 238, .035)); color: #5c4bd0; }
html[data-theme="light"] .menu-item .n { background: #edf1f6; color: #77869b; }
html[data-theme="light"] .menu-item.active .n { background: rgba(105, 88, 231, .12); color: #5c4bd0; }
html[data-theme="light"] .folder-item { color: #65748a; }
html[data-theme="light"] .folder-item:hover { background: rgba(57, 73, 101, .05); }
html[data-theme="light"] .folder-item.active { border-color: rgba(48, 119, 219, .12); background: rgba(48, 119, 219, .075); color: #225da8; }
html[data-theme="light"] .project-context { border-top-color: var(--ln); }
html[data-theme="light"] .project-context .menu-label { color: #748399; }
html[data-theme="light"] .sidebar-foot { border-top-color: var(--ln); background: rgba(235, 239, 246, .68); }
html[data-theme="light"] .sidebar .bar { background: #e6ebf2; }

html[data-theme="light"] .gencol { background: linear-gradient(180deg, #f8fafc, #f2f5f9); box-shadow: 12px 0 34px rgba(35, 51, 77, .055); }
html[data-theme="light"] .gencol-alvo,
html[data-theme="light"] .linha .rot,
html[data-theme="light"] .ctrl > label,
html[data-theme="light"] .field-label { color: #738197; }
html[data-theme="light"] .gencol-foot { background: rgba(227, 233, 242, .55); }
html[data-theme="light"] .pills,
html[data-theme="light"] .seg,
html[data-theme="light"] .zoom-pills { border-color: var(--ln); background: #e9eef5; }
html[data-theme="light"] .pill,
html[data-theme="light"] .seg button { color: #69778c; }
html[data-theme="light"] .pill:hover,
html[data-theme="light"] .seg button:hover:not(.on) { background: rgba(255, 255, 255, .72); color: #243249; }
html[data-theme="light"] .pill.active,
html[data-theme="light"] .seg button.on { background: #fff; color: #5d4dd1; box-shadow: 0 4px 13px rgba(47, 61, 87, .1), inset 0 0 0 1px rgba(105, 88, 231, .13); }
html[data-theme="light"] .gencol-prompts .prompts,
html[data-theme="light"] #mSeq .prompts { border-color: var(--ln2); background: #fff; }
html[data-theme="light"] .dica,
html[data-theme="light"] .sum { border-color: var(--ln); background: rgba(255, 255, 255, .75); }
html[data-theme="light"] .sum-1,
html[data-theme="light"] .chk { color: #344258; }
html[data-theme="light"] .sum-2 { color: #7d899c; }
html[data-theme="light"] .gencol-show { background: #fff; color: #5d6a7e; }

html[data-theme="light"] .main { background: linear-gradient(180deg, #f3f6fa 0%, #edf1f7 100%); }
html[data-theme="light"] .topbar { background: rgba(255, 255, 255, .82); box-shadow: 0 1px 0 rgba(25, 39, 64, .035); }
html[data-theme="light"] .crumb { color: #7a8799; }
html[data-theme="light"] .crumb b { color: #1a2539; }
html[data-theme="light"] .theme-toggle { background: #f0f3f8; color: #5c697d; }
html[data-theme="light"] .theme-toggle:hover { background: #e8edf4; color: #26334a; }
html[data-theme="light"] .theme-toggle-icon { background: rgba(91, 92, 231, .11); color: #6555d6; }
html[data-theme="light"] .kpi { border-color: var(--ln); background: rgba(245, 247, 251, .82); }
html[data-theme="light"] .kpi .l { color: #8692a4; }
html[data-theme="light"] .kpi .v { color: #324057; }
html[data-theme="light"] .kpi.hi .v { color: #15965d; }

html[data-theme="light"] .card { background: rgba(255, 255, 255, .9); box-shadow: 0 9px 27px rgba(38, 54, 82, .07), inset 0 1px #fff; }
html[data-theme="light"] .card h2 { color: #202d43; }
html[data-theme="light"] .metric { background: radial-gradient(circle at 100% 0, rgba(100, 91, 230, .1), transparent 42%), linear-gradient(145deg, #ffffff, #f6f8fb); box-shadow: var(--v7-shadow-soft), inset 0 1px #fff; }
html[data-theme="light"] .metric::after { border-color: rgba(47, 61, 87, .055); }
html[data-theme="light"] .metric .k { color: #748198; }
html[data-theme="light"] .metric .v { color: #1c2940; }
html[data-theme="light"] .metric .s { color: #748198; }
html[data-theme="light"] .metric.save .v { color: #15965d; }

html[data-theme="light"] .pgh .tg2 { background: rgba(255, 255, 255, .7); color: #69788e; }
html[data-theme="light"] .pcard { background: #fff; box-shadow: 0 11px 31px rgba(38, 54, 82, .09), inset 0 1px #fff; }
html[data-theme="light"] .pcard:hover { box-shadow: 0 18px 39px rgba(38, 54, 82, .15), 0 0 0 1px rgba(111, 93, 235, .06); }
html[data-theme="light"] .cover { background: #e8edf3; }
html[data-theme="light"] .pbody .t { color: #1e2b41; }
html[data-theme="light"] .pbody .m { color: #7a8799; }
html[data-theme="light"] .fli { color: #4f5e73; }
html[data-theme="light"] .fli:hover { background: #f0f3f7; }
html[data-theme="light"] .pfoot { background: #f8fafc; }
html[data-theme="light"] .newcard { border-color: rgba(34, 50, 77, .15); background: rgba(255, 255, 255, .48); color: #718096; }
html[data-theme="light"] .newcard:hover { background: rgba(108, 92, 231, .07); color: #5b4ac8; }
html[data-theme="light"] .projects-stack > .newcard:first-child { background: linear-gradient(90deg, rgba(108, 92, 231, .065), rgba(255, 255, 255, .45)); }
html[data-theme="light"] #projects-empty { background: rgba(255, 255, 255, .54); }
html[data-theme="light"] .pmenu { background: #fff; }
html[data-theme="light"] .pmenu-item { color: #435167; }
html[data-theme="light"] .pmenu-item:hover { background: #f1f4f8; }
html[data-theme="light"] .xs { background: #fff; color: #4e5d72; }

html[data-theme="light"] .folder-head { background: rgba(255, 255, 255, .8); }
html[data-theme="light"] .chip { background: rgba(255, 255, 255, .72); color: #647389; }
html[data-theme="light"] .chip.green { color: #168c58; }
html[data-theme="light"] .chip.amber { color: #ad7010; }
html[data-theme="light"] .chip.red { color: #cc3e51; }
html[data-theme="light"] .search { background: #fff; }
html[data-theme="light"] .zoom-pills button.active { background: #fff; color: #5c4bd0; box-shadow: 0 3px 10px rgba(38, 54, 82, .09); }
html[data-theme="light"] .seq-item { background: rgba(255, 255, 255, .72); }
html[data-theme="light"] .group-head h3,
html[data-theme="light"] .seqcluster-head b { color: #26344b; }
html[data-theme="light"] .group-head .cnt,
html[data-theme="light"] .seqcluster-head { color: #79869a; }
html[data-theme="light"] .group-head .cnt.ok { color: #15965d; }
html[data-theme="light"] .resultados-finais { background: rgba(255, 255, 255, .72); }
html[data-theme="light"] .montagens-finais { border-color: rgba(20, 151, 94, .22); background: linear-gradient(145deg, rgba(39, 188, 116, .08), rgba(255, 255, 255, .88)); }
html[data-theme="light"] .montagens-finais .group-head h3 { color: #138451; }
html[data-theme="light"] .exportacoes-finais { border-color: rgba(97, 79, 214, .22); background: linear-gradient(145deg, rgba(108, 92, 231, .08), rgba(255, 255, 255, .88)); }
html[data-theme="light"] .exportacoes-finais .group-head h3 { color: #5f50c6; }
html[data-theme="light"] .gcard { border-color: rgba(25, 39, 64, .1); background: #fff; box-shadow: 0 9px 25px rgba(38, 54, 82, .11); }
html[data-theme="light"] .gcard:hover { border-color: rgba(25, 39, 64, .2); box-shadow: 0 15px 35px rgba(38, 54, 82, .17); }
html[data-theme="light"] .thumb { background: #e8edf3; }

html[data-theme="light"] .insp { border-color: rgba(25, 39, 64, .12); background: rgba(255, 255, 255, .97); box-shadow: -18px 0 58px rgba(38, 54, 82, .18), inset 0 1px #fff; }
html[data-theme="light"] .inspf { background: #f5f7fa; }
html[data-theme="light"] .prev { border-color: var(--ln); background: #e7ebf1; }
html[data-theme="light"] .kv .k { color: #7d899b; }
html[data-theme="light"] .kv .v { color: #28364c; }
html[data-theme="light"] .ptx { background: #f6f8fb; color: #4e5c71; }
html[data-theme="light"] .selbar { border-color: rgba(25, 39, 64, .12); background: rgba(255, 255, 255, .94); box-shadow: 0 20px 52px rgba(38, 54, 82, .19); }
html[data-theme="light"] .selbar #sel-count { color: #26344a; }
html[data-theme="light"] .selbar .btn-dark { background: #f2f5f8; color: #3f4e63; }

html[data-theme="light"] .storage-table { background: #fff; }
html[data-theme="light"] .storage-table th { background: #f4f6f9; color: #748196; }
html[data-theme="light"] .storage-table td { color: #4c5b70; }
html[data-theme="light"] .storage-table tbody tr:hover { background: #f7f9fb; }
html[data-theme="light"] .bar { background: #e4e9f0; }
html[data-theme="light"] .quota-row { color: #66748a; }
html[data-theme="light"] .quota-row b,
html[data-theme="light"] .u-nome { color: #243249; }
html[data-theme="light"] .u-sub,
html[data-theme="light"] .u-atividade { color: #778499; }
html[data-theme="light"] .segredo { background: #f6f8fa; }

html[data-theme="light"] .mt-head { background: rgba(255, 255, 255, .86); }
html[data-theme="light"] .mt-faixa { background: rgba(255, 255, 255, .45); }
html[data-theme="light"] .mt-clip { box-shadow: 0 7px 20px rgba(38, 54, 82, .12); }
html[data-theme="light"] .mt-aviso { background: rgba(255, 255, 255, .65); }
html[data-theme="light"] .mt-rodape { border-color: rgba(105, 88, 231, .15); background: linear-gradient(145deg, rgba(228, 224, 255, .76), rgba(255, 255, 255, .94)); }
html[data-theme="light"] .modal-overlay { background: rgba(34, 45, 62, .34); }
html[data-theme="light"] .modal-box { border-color: rgba(25, 39, 64, .12); background: linear-gradient(150deg, #fff, #f5f7fa); box-shadow: 0 30px 75px rgba(38, 54, 82, .22); }
html[data-theme="light"] .flow-login-status { background: rgba(49, 74, 120, .045); }
html[data-theme="light"] .flow-login-screen { border-color: rgba(25, 39, 64, .14); }
@media (max-width: 840px) { .flow-login-paste { grid-template-columns: 1fr auto; } .flow-login-paste label, .flow-login-paste .muted { grid-column: 1 / -1; } }
html[data-theme="light"] .mm-backdrop { background: rgba(34, 45, 62, .65); }
html[data-theme="light"] .mm-box { border-color: rgba(25, 39, 64, .12); background: #fff; box-shadow: 0 34px 85px rgba(27, 39, 58, .28); }
html[data-theme="light"] .toast { border-color: rgba(25, 39, 64, .12); background: rgba(255, 255, 255, .96); color: #26344a; }

html[data-theme="light"] .eyebrow { color: #77859a; }
html[data-theme="light"] .dashboard-range,
html[data-theme="light"] .settings-load-status { color: #6d7b90; }
html[data-theme="light"] .chart-production::before,
html[data-theme="light"] .chart-production::after { border-color: rgba(25,39,64,.08); }
html[data-theme="light"] .chart-stack { background: #edf1f6; }
html[data-theme="light"] .chart-day-total { color: #5f6e84; }
html[data-theme="light"] .chart-day-label { color: #7b889b; }
html[data-theme="light"] .chart-legend { color: #68778d; }
html[data-theme="light"] .mix-donut { box-shadow: inset 0 0 0 1px rgba(25,39,64,.06); }
html[data-theme="light"] .mix-donut::after { background: #fff; }
html[data-theme="light"] .mix-row span { color: #66758a; }
html[data-theme="light"] .mix-row b { color: #25334a; }
html[data-theme="light"] .mix-row small { color: #8692a4; }
html[data-theme="light"] .reliability-name { color: #65748a; }
html[data-theme="light"] .reliability-track { background: #e6ebf2; }
html[data-theme="light"] .reliability-value { color: #35445a; }
html[data-theme="light"] .reliability-meta { color: #8491a4; }

html[data-theme="light"] .settings-nav { background: rgba(255,255,255,.88); box-shadow: var(--v7-shadow-soft); }
html[data-theme="light"] .settings-nav-head p,
html[data-theme="light"] .settings-nav-item small,
html[data-theme="light"] .settings-nav-note { color: #7d899c; }
html[data-theme="light"] .settings-nav-item { color: #617086; }
html[data-theme="light"] .settings-nav-item:hover { background: #f2f5f8; color: #25334a; }
html[data-theme="light"] .settings-nav-item.active { border-color: rgba(100,83,229,.14); background: linear-gradient(90deg, rgba(102,87,238,.12), rgba(102,87,238,.035)); color: #5b4acb; }
html[data-theme="light"] .settings-nav-icon { background: #edf1f6; }
html[data-theme="light"] .settings-nav-item.active .settings-nav-icon { background: rgba(102,87,238,.12); }
html[data-theme="light"] .settings-nav-item.active small { color: #7b70b1; }
html[data-theme="light"] .settings-load-status { background: rgba(255,255,255,.72); }
html[data-theme="light"] .settings-card-intro p,
html[data-theme="light"] .provider-copy { color: #728096; }
html[data-theme="light"] .settings-card-mark { background: rgba(108,92,231,.1); color: #6555d6; }
html[data-theme="light"] .settings-field,
html[data-theme="light"] .settings-field > span { color: #56657b; }
html[data-theme="light"] .settings-field > small,
html[data-theme="light"] .settings-tech-note { color: #7e8b9e; }
html[data-theme="light"] .settings-explainer > div,
html[data-theme="light"] .cadence-guide span,
html[data-theme="light"] .cadence-lane,
html[data-theme="light"] .settings-switch { background: rgba(255,255,255,.62); }
html[data-theme="light"] .settings-explainer b,
html[data-theme="light"] .cadence-lane-head b,
html[data-theme="light"] .settings-switch b { color: #334157; }
html[data-theme="light"] .settings-explainer span,
html[data-theme="light"] .cadence-guide span,
html[data-theme="light"] .cadence-lane-head span,
html[data-theme="light"] .settings-switch small { color: #7b889b; }
html[data-theme="light"] .provider-diagnostic { background: #f5f7fa; color: #59687d; }
html[data-theme="light"] .settings-command { background: #f4f6f9; color: #4e5d72; }
html[data-theme="light"] .provider-state { color: #65748a; }
html[data-theme="light"] .cadence-lane-head { background: #f6f8fa; }
html[data-theme="light"] .settings-switch > span { background: #dce2ea; }
html[data-theme="light"] .settings-switch > span::after { background: #8996a8; }
html[data-theme="light"] .worker-warning { color: #966718; }

/* Responsive desktop behavior */
@media (max-width: 1500px) {
  :root { --w-sidebar: 230px; --w-gencol: 344px; }
  .sidebar .brand { padding-left: 15px; }
  .sidebar .brand::after { left: 60px; }
  .gallery.z-md .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
  .gallery.z-lg .grid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }
  .insp { width: 350px; }
  .settings-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 17px; }
  .analytics-grid { grid-template-columns: minmax(0, 1.45fr) minmax(250px, .8fr); }
}

@media (max-width: 1180px) {
  :root { --w-sidebar: 214px; --w-gencol: 318px; }
  .topbar { padding: 0 17px; }
  .kpi { min-width: 78px; padding: 6px 9px; }
  .pad { padding-left: 18px; padding-right: 18px; }
  .folder-head { padding-left: 18px; padding-right: 18px; }
  .folder-head .search { order: 8; flex: 1 1 180px; }
  .projects-grid, .pcards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  #view-settings .pad { grid-template-columns: 1fr; }
  #view-settings .card:first-child, #view-settings .card:nth-child(5) { grid-column: auto; }
  .analytics-grid { grid-template-columns: 1fr; }
  .analytics-production { grid-row: auto; min-height: 410px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .settings-nav-head { grid-column: 1 / -1; }
  .settings-nav-item { width: auto; }
  .settings-nav-note { grid-column: 1 / -1; }
  .provider-settings-grid, .system-settings-grid { grid-template-columns: 1fr; }
  .provider-settings-card.provider-paid { grid-column: auto; }
  .cadence-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  html, body { overflow: hidden; }
  .layout { min-width: 0; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 45;
    width: min(84vw, 286px);
    flex-basis: min(84vw, 286px);
    transform: translateX(-104%);
    transition: transform .2s ease;
    box-shadow: 20px 0 60px rgba(0, 0, 0, .35);
  }
  .layout.mobile-menu-open .sidebar { transform: translateX(0); }
  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 44;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(3, 6, 12, .62);
    backdrop-filter: blur(3px);
  }
  .mobile-menu-backdrop.hidden { display: none; }
  .mobile-menu-toggle { display: grid; }
  .main { width: 100%; min-width: 0; }
  .topbar { position: sticky; top: 0; z-index: 10; min-height: 58px; flex-basis: 58px; padding: 0 10px; }
  .crumb { min-width: 0; overflow: hidden; }
  .crumb b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  .theme-toggle { padding: 7px 9px; }
  .theme-toggle-label { display: none; }
  .kpis { display: none; }
  .gencol:not(.hidden) {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 43;
    width: min(92vw, 370px);
    flex-basis: min(92vw, 370px);
    box-shadow: 20px 0 60px rgba(0, 0, 0, .38);
  }
  .gencol-show { position: fixed; left: 8px; top: 68px; z-index: 12; }
  .insp { position: fixed; inset: 58px 0 0 0; z-index: 42; width: 100%; }
  .pad { padding: 18px 14px 42px; }
  .folder-head { align-items: flex-start; flex-wrap: wrap; padding: 11px 12px; }
  .folder-head .search { order: 20; flex-basis: 100%; }
  .projects-grid, .pcards { grid-template-columns: 1fr; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .recent-work-grid { grid-template-columns: 1fr; }
  .settings-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .routing-grid, .settings-fields-two, .settings-fields-three, .switch-grid, .settings-explainer { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
