/* VetXpert Attorney - hosted shell and sign-in. Dark operations look around the program's own light theme. */
:root {
  --bg: #050a14;
  --bg2: #091224;
  --panel: rgba(11, 19, 36, .90);
  --panel-solid: #0b1324;
  --line: rgba(140, 168, 255, .15);
  --line2: rgba(140, 168, 255, .30);
  --text: #e8eefc;
  --muted: #95a5c6;
  --dim: #5e6d8d;
  --accent: #7c95ff;
  --accent2: #33dfc0;
  --warn: #ffb648;
  --bad: #ff5c75;
  --ok: #33dfc0;
  --font: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line2); cursor: pointer; font-weight: 600; letter-spacing: .01em;
  background: linear-gradient(180deg, rgba(124, 149, 255, .20), rgba(124, 149, 255, .06)); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 149, 255, .16); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #7c95ff 0%, #33dfc0 100%); color: #041022; border: 0; }
.btn.primary:hover { box-shadow: 0 6px 24px rgba(51, 223, 192, .28); }
.btn.ghost { background: transparent; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.wide { width: 100%; height: 46px; font-size: 15px; border-radius: 12px; }
.i { width: 19px; height: 19px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--muted);
  font: 600 11px/17px var(--font); cursor: help; padding: 0; flex: none; }
.i:hover, .i:focus-visible { color: var(--text); border-color: var(--accent); outline: none; }
.x { background: transparent; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; padding: 6px; border-radius: 8px; }
.x:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.kicker { display: inline-block; font: 700 11px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--accent2); }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .mark { width: 28px; height: 28px; filter: drop-shadow(0 0 10px rgba(51, 223, 192, .35)); }
.brand .word { font-size: 17px; letter-spacing: .01em; white-space: nowrap; }
.brand .word b { font-weight: 800; background: linear-gradient(90deg, #a9bbff, #33dfc0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .tag { color: var(--dim); font-size: 12px; border-left: 1px solid var(--line); padding-left: 10px; white-space: nowrap; }
.brand.big .mark { width: 46px; height: 46px; }
.brand.big .word { font-size: 26px; }

/* ---------- sign-in ---------- */
body.login { min-height: 100%; overflow-x: hidden; background: radial-gradient(1200px 700px at 15% -10%, #0c1a38 0%, var(--bg) 60%); }
.grid-bg { position: fixed; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(124, 149, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(124, 149, 255, .07) 1px, transparent 1px);
  background-size: 46px 46px; -webkit-mask-image: radial-gradient(ellipse at 35% 40%, #000 25%, transparent 72%); mask-image: radial-gradient(ellipse at 35% 40%, #000 25%, transparent 72%); }
.glow { position: fixed; width: 820px; height: 820px; left: -260px; top: -320px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 149, 255, .30), transparent 62%); animation: drift 22s ease-in-out infinite alternate; }
.glow.two { left: auto; right: -320px; top: 40%; width: 700px; height: 700px; background: radial-gradient(circle, rgba(51, 223, 192, .16), transparent 62%); animation-duration: 28s; }
@keyframes drift { to { transform: translate(140px, 90px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .glow { animation: none; } }
.hero { position: relative; z-index: 1; max-width: 1180px; min-height: calc(100vh - 56px); margin: 0 auto; padding: 56px 32px 32px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 64px; align-items: center; }
.pitch .kicker { margin-top: 34px; }
.pitch h1 { margin: 14px 0 18px; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.05; letter-spacing: -.02em; font-weight: 800; }
.grad { background: linear-gradient(90deg, #9fb2ff 0%, #33dfc0 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { color: var(--muted); font-size: 16.5px; max-width: 590px; margin: 0 0 30px; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 600px; }
.facts li { display: grid; grid-template-columns: 210px 1fr; gap: 14px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 14px; background: linear-gradient(90deg, rgba(124, 149, 255, .08), rgba(124, 149, 255, .01)); }
.facts b { font-weight: 700; }
.facts span { color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line2); border-radius: 20px; padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04); backdrop-filter: blur(14px); }
.signin { display: grid; gap: 16px; position: relative; overflow: hidden; }
.signin::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent); }
.card-head h2 { margin: 8px 0 2px; font-size: 24px; letter-spacing: -.01em; }
.signin label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.signin input { height: 44px; border-radius: 11px; border: 1px solid var(--line2); background: rgba(3, 8, 18, .7); padding: 0 13px; color: var(--text); font-size: 15px; }
.signin input:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(51, 223, 192, .16); }
.fine { margin: 2px 0 0; color: var(--dim); font-size: 12px; }
.msg { padding: 11px 13px; border-radius: 11px; font-size: 13.5px; border: 1px solid; }
.msg.bad { color: #ffd0d8; border-color: rgba(255, 92, 117, .45); background: rgba(255, 92, 117, .10); }
.msg.warn { color: #ffe3b8; border-color: rgba(255, 182, 72, .45); background: rgba(255, 182, 72, .10); }
.msg.ok { color: #c8fff3; border-color: rgba(51, 223, 192, .45); background: rgba(51, 223, 192, .10); }
.foot { position: relative; z-index: 1; height: 56px; display: flex; gap: 10px; align-items: center; justify-content: center; color: var(--dim); font-size: 12px; }
.foot .sep { opacity: .5; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 32px; } .facts li { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- the hosted program ---------- */
body.app { display: flex; flex-direction: column; overflow: hidden; }
.bar { position: relative; z-index: 8; height: 54px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 14px 0 16px;
  background: linear-gradient(180deg, #0b1528, #070f1f); border-bottom: 1px solid var(--line); }
.bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), var(--accent2), transparent); opacity: .6; }
.spacer { flex: 1; }
.status, .viewers { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(255, 182, 72, .6); animation: pulse 1.6s infinite; }
.status[data-state="live"] { color: var(--text); border-color: rgba(51, 223, 192, .35); }
.status[data-state="live"] .dot { background: var(--ok); animation: pulse-ok 2.4s infinite; }
.status[data-state="off"] .dot { background: var(--bad); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 182, 72, .55); } 100% { box-shadow: 0 0 0 9px rgba(255, 182, 72, 0); } }
@keyframes pulse-ok { 0% { box-shadow: 0 0 0 0 rgba(51, 223, 192, .55); } 100% { box-shadow: 0 0 0 9px rgba(51, 223, 192, 0); } }
.actions { display: flex; align-items: center; gap: 12px; }
.grp { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.who { color: var(--dim); font-size: 12.5px; padding: 0 2px 0 6px; border-left: 1px solid var(--line); white-space: nowrap; }
.who b { color: var(--muted); font-weight: 600; }
#btn-files[aria-expanded="true"] { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(51, 223, 192, .14); }
#stage { position: relative; flex: 1; min-height: 0; background: #03070e; }
#screen { position: absolute; inset: 0; }
#screen > div { background: #03070e !important; }
@media (max-width: 1100px) { .brand .tag, .who { display: none; } }

#drop { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(3, 8, 18, .72); backdrop-filter: blur(3px); }
.drop-card { display: grid; gap: 6px; text-align: center; padding: 34px 44px; border-radius: 22px; border: 2px dashed var(--accent2); background: rgba(11, 19, 36, .92); }
.drop-card b { font-size: 20px; }
.drop-card span { color: var(--muted); }
#overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(3, 8, 18, .82); backdrop-filter: blur(5px); }
#overlay .card { max-width: 440px; text-align: center; display: grid; gap: 10px; justify-items: center; }
#overlay h2 { margin: 2px 0; font-size: 24px; }
#overlay p { color: var(--muted); margin: 0 0 8px; }

/* ---------- Files ---------- */
#drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100%); z-index: 10; display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line2); backdrop-filter: blur(16px); box-shadow: -30px 0 80px rgba(0, 0, 0, .45);
  transform: translateX(104%); transition: transform .22s ease; }
#drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; align-items: center; gap: 6px; }
.tab { height: 32px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-color: var(--line2); background: rgba(124, 149, 255, .14); }
.tabs .i { margin-right: 8px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 10px 16px 4px; font-size: 12.5px; color: var(--dim); min-height: 34px; }
.crumbs button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 2px 4px; border-radius: 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs button:hover { background: rgba(124, 149, 255, .12); }
.crumbs .here { color: var(--text); padding: 2px 4px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 16px 10px; align-items: center; }
.mkdir { display: flex; gap: 6px; width: 100%; }
.mkdir input { flex: 1; height: 30px; border-radius: 9px; border: 1px solid var(--line2); background: rgba(3, 8, 18, .7); padding: 0 10px; }
.progress { position: relative; margin: 0 16px 8px; height: 24px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: rgba(3, 8, 18, .6); }
.progress .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, rgba(124, 149, 255, .55), rgba(51, 223, 192, .55)); transition: width .15s; }
.progress .label { position: relative; display: block; font-size: 12px; line-height: 22px; padding: 0 10px; }
.list { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; }
.row:hover { background: rgba(124, 149, 255, .08); }
.ico { width: 26px; height: 30px; border-radius: 6px; display: grid; place-items: center; font: 800 8.5px/1 var(--font); letter-spacing: .04em; color: #041022; background: #9fb2ff; }
.ico.dir { background: linear-gradient(160deg, #ffcf6e, #ffb648); border-radius: 5px 9px 6px 6px; height: 22px; }
.ico.pdf { background: #ff8c9e; }
.ico.doc { background: #8ab4ff; }
.ico.img { background: #7fe7c4; }
.ico.txt { background: #c9d3ea; }
.nm { min-width: 0; display: grid; }
.nm .name { text-align: left; background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.is-dir .nm .name:hover, .nm .name:hover { color: var(--accent2); }
.nm .meta { color: var(--dim); font-size: 12px; }
.acts { display: flex; gap: 4px; }
.act { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); cursor: pointer; color: var(--muted); font-weight: 700; }
.act:hover { color: var(--text); border-color: var(--accent); }
.act.del:hover { border-color: var(--bad); color: #ffc2cc; }
.confirm { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: #ffc2cc; }
.empty { color: var(--dim); padding: 24px 12px; text-align: center; }
.empty.bad { color: #ffc2cc; }
.hint { margin: 0; padding: 10px 16px 14px; color: var(--dim); font-size: 12px; border-top: 1px solid var(--line); }

/* ---------- help, toasts, clipboard ---------- */
.popover { position: fixed; z-index: 60; width: 320px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line2);
  background: #0d1730; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); font-size: 13px; color: var(--muted); }
.popover b { display: block; color: var(--text); margin-bottom: 4px; font-size: 13.5px; }
.popover p { margin: 0; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 10px; width: min(380px, calc(100% - 32px)); }
.toast { position: relative; padding: 13px 40px 13px 15px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(13, 23, 48, .97);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .5); animation: rise .18s ease-out; }
.toast::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent2); }
.toast.warn::before { background: var(--warn); }
.toast.bad::before { background: var(--bad); }
.toast b { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.toast p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.toast .x { position: absolute; right: 6px; top: 6px; }
.toast-acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.clip { width: min(860px, calc(100% - 40px)); padding: 0; border-radius: 18px; border: 1px solid var(--line2); background: var(--panel-solid); color: var(--text); box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
.clip::backdrop { background: rgba(3, 8, 18, .7); backdrop-filter: blur(3px); }
.clip-body { padding: 22px; display: grid; gap: 16px; }
.clip-head { display: flex; justify-content: space-between; align-items: flex-start; }
.clip-head h2 { margin: 6px 0 0; font-size: 19px; }
.clip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.clip-cols label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.clip-cols textarea { resize: vertical; min-height: 150px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(3, 8, 18, .7); padding: 10px 12px; font: 13px/1.45 var(--mono); color: var(--text); }
@media (max-width: 760px) { .clip-cols { grid-template-columns: 1fr; } }

/* ---------- 2.0: runs, tokens, Buy runs, every screen in use ---------- */
.runs { display: flex; align-items: center; gap: 8px; margin-left: 14px; }
.runs-n { font-weight: 700; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line2); color: var(--accent2); white-space: nowrap; }
.runs-n.low { color: var(--warn); border-color: var(--warn); }
.dim { color: var(--muted); font-weight: 400; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; margin: 6px 0; }
.field input { height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); padding: 0 12px; font: 600 15px/1 var(--mono); letter-spacing: .04em; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.pack { display: grid; gap: 4px; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg2); color: var(--text); cursor: pointer; font: inherit; }
.pack:hover { border-color: var(--accent); }
.pack b { font-size: 15px; } .pack .price { color: var(--accent2); font-weight: 700; font-size: 16px; }
.overlay-full { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 10, 20, .82); z-index: 6; }
.overlay-full[hidden] { display: none; }
.overlay-full .card { max-width: 460px; background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 16px; padding: 22px; }

/* 2.0: the bar also holds the runs box - as the window narrows, the least needed parts go first, so nothing overlaps.
   The firm and email stay one hover away (the Sign out button's tooltip) when the "Signed in as" text is hidden. */
.bar > * { flex: none; }
.bar > .spacer { flex: 1 1 0; min-width: 0; }
@media (max-width: 1820px) { .who { display: none; } }
@media (max-width: 1640px) { .brand .tag { display: none; } }
@media (max-width: 1520px) { .viewers { display: none; } }
@media (max-width: 1300px) { #status-text { display: none; } .status { padding: 0 6px 0 9px; } .runs { margin-left: 0; } .bar { gap: 10px; } .actions { gap: 8px; } }
@media (max-width: 1120px) { .bar .grp .i, .runs .i, .status .i { display: none; } }
@media (max-width: 960px) { .brand .word { display: none; } #btn-clip { display: none; } }
