/* HozeScan Glass: shared visual values from Presentation/Glass.xaml.
   Source-backed override; the previous application stylesheet stays intact. */
:root {
  --glass-edge: rgba(175,210,224,.22); --glass-panel: rgba(19,36,49,.82);
  --glass-solid: #152936; --glass-wash: #0c1a25; --glass-shadow: 0 18px 60px #030c1833;
  --color-bg: #0c1a25; --color-surface: rgba(19,36,49,.82); --color-surface-2: rgba(36,56,72,.66);
  --color-surface-3: #233d4c; --color-border: rgba(159,198,216,.22);
  --color-text: #e4f0f5; --color-text-muted: #abc0cc; --color-text-faint: #91aab9;
  --color-primary: #79d8da; --color-primary-hover: #a1e9e8;
  --radius-md: 12px; --radius-lg: 22px; --radius-xl: 26px;
  --font-display: 'Satoshi','Segoe UI',sans-serif; --font-body: 'Satoshi','Segoe UI',sans-serif;
  --shadow-cyan: 0 8px 28px #087e8b12; --shadow-cyan-strong: 0 16px 45px #087e8b20;
  --text-xs: .8125rem; --text-sm: .9375rem; --transition: .2s ease;
  color-scheme: dark;
}
html.light {
  --background: 218 37% 93%; --foreground: 202 43% 16%; --card: 0 0% 100%; --card-foreground: 202 43% 16%;
  --popover: 215 40% 98%; --popover-foreground: 202 43% 16%; --primary: 186 89% 29%; --primary-foreground: 0 0% 100%;
  --secondary: 208 29% 89%; --secondary-foreground: 202 30% 28%; --muted: 210 26% 91%; --muted-foreground: 205 19% 39%;
  --accent: 186 89% 29%; --accent-foreground: 0 0% 100%; --input: 209 22% 79%; --border: 209 22% 79%;
  --glass-edge: rgba(255,255,255,.88); --glass-panel: rgba(255,255,255,.67); --glass-solid: #f4f8fb;
  --glass-wash: #e7ecf4; --glass-shadow: 0 16px 55px #2546590d, inset 0 1px 0 #ffffffd9;
  --color-bg: #e7ecf4; --color-surface: rgba(255,255,255,.67); --color-surface-2: rgba(255,255,255,.50);
  --color-surface-3: #dde7ef; --color-border: rgba(97,130,151,.23); --color-border-glow: #087e8b25;
  --color-text: #182f3c; --color-text-muted: #506576; --color-text-faint: #5e7281;
  --color-primary: #087e8b; --color-primary-hover: #0a6472; --color-primary-glow: #087e8b12;
  --color-success: #147456; --color-warning: #936012; --color-danger: #b63752;
  --shadow-md: 0 8px 28px #25465910; --shadow-lg: 0 20px 60px #25465918;
  color-scheme: light;
}
body {
  background: radial-gradient(ellipse at 10% 5%,#8ab8cb24,transparent 45%), radial-gradient(ellipse at 90% 75%,#8a9acb18,transparent 50%), var(--glass-wash);
  background-attachment: fixed; color: var(--color-text); font-size: 16px; -webkit-font-smoothing: antialiased;
}
body :is(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
body :is(button,input,select,textarea) { font-family: var(--font-body); }
body :is(button,a) { -webkit-tap-highlight-color: transparent; }
body :is(button,a):not(:disabled) { transition: background-color .18s, border-color .18s, box-shadow .18s, transform .18s; }
.card-glow {
  border: 1px solid var(--glass-edge); border-bottom-color: var(--color-border);
  background: linear-gradient(135deg,var(--glass-panel),var(--color-surface-2));
  border-radius: 22px; box-shadow: var(--glass-shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.card-glow:hover { border-color: var(--color-border); box-shadow: 0 12px 38px #25465914, inset 0 1px 0 var(--glass-edge); }
.btn-primary,.hgc-primary {
  background: linear-gradient(135deg,#168d95,#0a6472); color: #fff; border: 1px solid #087e8b40;
  box-shadow: 0 5px 14px #087e8b20,inset 0 1px 0 #ffffff30; border-radius: 12px;
}
.btn-primary:hover,.hgc-primary:hover { background: linear-gradient(135deg,#1a9da5,#087481); color: #fff; }
.btn-ghost { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; }
.text-gradient { background-image: linear-gradient(125deg,#087e8b,#0e657b); }
html:not(.light) .text-gradient { background-image: linear-gradient(125deg,#79d8da,#98cfea); }
/* Target the actual existing dashboard structure without replacing React nodes. */
body div:has(> aside [data-testid="sidebar-server-info"]) { background: transparent !important; }
body aside:has([data-testid="sidebar-server-info"]) {
  left: 16px !important; top: 52px !important; bottom: 16px !important; width: 224px !important;
  border: 1px solid var(--glass-edge) !important; border-radius: 24px;
  background: var(--glass-panel) !important; box-shadow: var(--glass-shadow); backdrop-filter: blur(24px);
}
body [data-testid="sidebar-server-info"] { border-radius: 16px !important; padding: 17px !important; }
body:has([data-testid="sidebar-server-info"]) main { margin-left: 252px !important; padding: 34px clamp(20px,3vw,48px) !important; }
body:has([data-testid="sidebar-server-info"]) main > div:first-child { gap: 16px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--color-border); }
body:has([data-testid="sidebar-server-info"]) main > div:first-child > div:last-child { flex-wrap: wrap; }
body:has([data-testid="sidebar-server-info"]) main h1 { font-size: clamp(1.6rem,2.4vw,2rem) !important; font-weight: 700 !important; letter-spacing: -.04em; }
body [data-testid^="sidebar-"]:is(button) { min-height: 46px; border-radius: 13px !important; margin-bottom: 6px !important; }
body [data-testid^="sidebar-"]:is(button):hover { background: var(--color-surface-2) !important; }
body [data-testid="btn-logout"] { min-height: 46px; }
body [data-testid="credits-balance-card"] { min-height: 128px; }
body [data-testid="text-credits-balance"] { font-size: 2.5rem !important; font-weight: 600 !important; }
/* Credit manager: native dialog provides focus containment and Escape handling. */
.hgc-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); color: var(--color-text); font: 600 .875rem/1.4 var(--font-body); cursor: pointer; white-space: nowrap; }
.hgc-button.hgc-primary { background: linear-gradient(135deg,#168d95,#0a6472); color: white; }
.hgc-button:disabled { opacity: .5; cursor: not-allowed; }
.hgc-entry { padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hgc-entry h2 { margin: 6px 0 8px; font-size: 1.25rem; font-weight: 700; }
.hgc-entry p:not(.hgc-eyebrow) { color: var(--color-text-muted); font-size: .9375rem; max-width: 560px; margin: 0; }
.hgc-eyebrow { color: var(--color-primary); font-size: .75rem; font-weight: 800; letter-spacing: .1em; margin: 0 0 8px; }
.hgc-dialog { width: min(680px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--glass-edge); border-radius: 26px; background: var(--glass-solid); color: var(--color-text); box-shadow: 0 30px 100px #0c28383d; font: 400 1rem/1.5 var(--font-body); }
.hgc-dialog[open] { animation: hoze-glass-in .2s ease-out; }
.hgc-dialog::backdrop { background: #182f3c55; backdrop-filter: blur(9px); }
.hgc-dialog * { box-sizing: border-box; }
.hgc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 26px 30px 23px; background: var(--glass-panel); border-bottom: 1px solid var(--color-border); }
.hgc-header h2 { margin: 0; font-size: 1.75rem; font-weight: 700; letter-spacing: -.04em; }
.hgc-close { width: 38px; height: 38px; flex-shrink: 0; background: var(--color-surface-2); color: var(--color-text-muted); border: 1px solid var(--color-border); border-radius: 11px; font-size: 25px; cursor: pointer; }
.hgc-body { padding: 24px 30px 30px; }
.hgc-intro { color: var(--color-text-muted); font-size: .9375rem; margin: 0 0 22px; }
.hgc-form label:not(.hgc-consent) { display: block; margin: 16px 0 8px; font-size: .875rem; font-weight: 650; }
.hgc-form :is(input:not([type="checkbox"]),select) { width: 100%; min-height: 46px; padding: 10px 13px; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: 12px; font: inherit; }
.hgc-form select { text-overflow: ellipsis; }
.hgc-form input::placeholder { color: var(--color-text-faint); opacity: 1; }
.hgc-help { color: var(--color-text-muted); margin: 8px 0 0; font-size: .8125rem; overflow-wrap: anywhere; }
.hgc-balances { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; padding: 22px; margin-top: 20px; border: 1px solid var(--color-border); background: var(--glass-panel); border-radius: 18px; }
.hgc-balances div { display: flex; flex-direction: column; gap: 8px; }.hgc-balances span { color: var(--color-text-muted); font-size: .8125rem; }.hgc-balances strong { font-size: 1.3rem; font-weight: 650; }.hgc-balances div:last-child strong { color: var(--color-primary); }
.hgc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }#hgc-code { font-family: var(--font-mono); letter-spacing: .2em; }
.hgc-consent { display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; margin-top: 22px; }.hgc-consent input { width: 19px; height: 19px; flex-shrink: 0; margin-top: 2px; accent-color: var(--color-primary); }
.hgc-message { min-height: 24px; margin: 18px 0 0; color: var(--color-text-muted); font-size: .875rem; }.hgc-error { color: var(--color-danger); }.hgc-success { color: var(--color-success); }
.hgc-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.hgc-history { border-top: 1px solid var(--color-border); margin-top: 26px; padding-top: 22px; }.hgc-history h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.hgc-history ol { padding: 0; list-style: none; margin: 14px 0 0; }.hgc-history li { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--color-border); font-size: .875rem; }
.hgc-history li div { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }.hgc-history li div:last-child { text-align: right; }.hgc-history :is(span,time) { color: var(--color-text-muted); font-size: .8125rem; }.hgc-history li div:last-child strong { color: var(--color-success); }
/* Existing report/request dialogs receive the same light surface and readable evidence. */
html.light :is(.hoze-report-viewer,.hoze-scan-request) { background: var(--glass-solid); color: var(--color-text); border-color: var(--glass-edge); box-shadow: 0 30px 100px #0c28383d; color-scheme: light; }
html.light :is(.hrv-subtitle,.hrv-explanation,.hrv-metric dt,.hrv-dates dd,.hsr-subtitle,.hsr-consent,.hsr-footer>span,.hsr-result p) { color: var(--color-text-muted); }
html.light :is(.hrv-metric dd,.hrv-finding-title,.hrv-finding-detail,.hrv-section-title) { color: var(--color-text); }
html.light :is(.hrv-eyebrow,.hsr-status) { color: var(--color-primary); }
html.light :is(.hrv-button,.hrv-close,.hsr-close,.hsr-button,.hsr-field input,.hsr-field select,.hsr-result textarea) { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
html.light :is(.hrv-primary,.hsr-primary) { background: #087e8b; color: white; }
html.light :is(.hrv-flagged,.hrv-critical,.hrv-high,.hrv-error) { color: #a12b45; }
html.light :is(.hrv-medium,.hrv-inconclusive,.hrv-coverage,.hrv-notice) { color: #77500c; }
html.light .hrv-clean { color: #147456; }html.light :is(.hrv-low,.hrv-running,.hrv-cancelled,.hrv-abandoned) { color: #506576; }
html.light .hoze-report-viewer :is(pre,details,summary) { color: var(--color-text); background: #e8f0f5; border-color: var(--color-border); }
@keyframes hoze-glass-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 800px) {
  body aside:has([data-testid="sidebar-server-info"]) { position: relative !important; inset: auto !important; width: auto !important; margin: 16px; padding: 18px 0 !important; }
  body div:has(> aside [data-testid="sidebar-server-info"]) { display: block !important; }
  body aside:has([data-testid="sidebar-server-info"]) nav { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
  body aside:has([data-testid="sidebar-server-info"]) > div:first-child { margin-bottom: 18px !important; }
  body [data-testid="sidebar-server-info"] { margin-bottom: 14px !important; }
  body:has([data-testid="sidebar-server-info"]) main { margin-left: 0 !important; padding: 12px 16px 28px !important; }
  body [data-testid^="sidebar-"]:is(button) { font-size: .875rem !important; padding: 10px !important; gap: 6px !important; }
}
@media (max-width: 520px) {
  .hgc-entry { flex-direction: column; align-items: flex-start; gap: 16px; }.hgc-header,.hgc-body { padding: 22px 19px; }.hgc-header h2 { font-size: 1.5rem; }
  .hgc-fields { grid-template-columns: 1fr; gap: 0; }.hgc-balances { gap: 10px; padding: 16px; }.hgc-balances strong { font-size: 1.05rem; }
  .hgc-dialog { max-height: calc(100dvh - 20px); }.hgc-footer { flex-wrap: wrap; }.hgc-history li { flex-wrap: wrap; }
  body aside:has([data-testid="sidebar-server-info"]) nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@supports not (backdrop-filter: blur(1px)) { .card-glow,body aside:has([data-testid="sidebar-server-info"]) { background: var(--glass-solid) !important; } }
