:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --bg-deep: #070a0e;
  --surface: #111821;
  --surface-raised: #151e28;
  --surface-soft: #18222d;
  --line: #263240;
  --line-soft: rgba(148, 166, 186, 0.14);
  --text: #f3f7fa;
  --muted: #98a5b4;
  --subtle: #8493a2;
  --accent: #47d7ac;
  --accent-strong: #2fc397;
  --accent-soft: rgba(71, 215, 172, 0.12);
  --accent-glow: rgba(71, 215, 172, 0.24);
  --danger: #ff6b78;
  --danger-soft: rgba(255, 107, 120, 0.12);
  --warning: #f5bc62;
  --warning-soft: rgba(245, 188, 98, 0.12);
  --info: #70a8ff;
  --info-soft: rgba(112, 168, 255, 0.12);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --sidebar-width: 256px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); line-height: 1.5; text-rendering: optimizeLegibility; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: rgba(71, 215, 172, 0.3); color: white; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #334252; border: 2px solid var(--bg-deep); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #455668; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.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: 12px; left: 12px; transform: translateY(-150%); border-radius: 10px; background: var(--accent); color: #06100d; padding: 10px 14px; font-weight: 800; text-decoration: none; }
.skip-link:focus { transform: none; }

.eyebrow { margin: 0; color: var(--accent); font-size: 0.69rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(71, 215, 172, 0.1), 0 0 17px var(--accent); vertical-align: 1px; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; padding: 0 16px; font-size: 0.84rem; font-weight: 750; letter-spacing: -0.01em; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button svg { width: 17px; height: 17px; }
.button-primary { background: var(--accent); color: #071510; box-shadow: 0 8px 28px rgba(71, 215, 172, 0.12); }
.button-primary:hover:not(:disabled) { background: #58e4ba; box-shadow: 0 9px 30px rgba(71, 215, 172, 0.22); }
.button-ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.018); color: var(--text); }
.button-ghost:hover:not(:disabled) { border-color: #405265; background: rgba(255, 255, 255, 0.04); }
.button-archive { border-color: rgba(255,107,122,.34); background: rgba(255,107,122,.07); color: #ffb7c0; }
.button-archive:hover:not(:disabled) { border-color: rgba(255,107,122,.62); background: rgba(255,107,122,.12); }
.button-wide { width: 100%; min-height: 52px; border-radius: 15px; font-size: 0.94rem; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 8px; font-size: 0.8rem; font-weight: 700; }
.text-button:hover { color: var(--accent); }
.icon-button { display: inline-grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.018); color: var(--muted); transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.icon-button:hover:not(:disabled) { border-color: #405265; background: rgba(255, 255, 255, 0.04); color: var(--text); }
.icon-button:active:not(:disabled) { transform: scale(0.96); }

/* Login */
.login-view { position: relative; display: grid; min-height: 100vh; overflow: hidden; place-items: center; background: radial-gradient(circle at 15% 15%, rgba(71, 215, 172, 0.08), transparent 28rem), radial-gradient(circle at 85% 78%, rgba(53, 111, 169, 0.12), transparent 32rem), var(--bg-deep); isolation: isolate; }
.login-view::before { position: absolute; z-index: -2; inset: 0; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 52px 52px; content: ""; mask-image: radial-gradient(circle, black, transparent 75%); }
.ambient { position: absolute; z-index: -1; width: 280px; height: 280px; border-radius: 50%; filter: blur(90px); opacity: 0.13; }
.ambient-one { top: -80px; right: 10%; background: var(--accent); }
.ambient-two { bottom: -120px; left: 8%; background: #4d88db; }
.login-shell { display: grid; width: min(1060px, calc(100% - 40px)); grid-template-columns: minmax(340px, 1.1fr) minmax(360px, 0.8fr); align-items: center; gap: clamp(32px, 7vw, 100px); padding: 50px 0; }
.glass-panel { border: 1px solid rgba(145, 168, 187, 0.18); background: linear-gradient(145deg, rgba(24, 34, 45, 0.9), rgba(13, 19, 26, 0.92)); box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.04); backdrop-filter: blur(24px); }
.login-card { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(28px, 5vw, 48px); }
.login-card::before { position: absolute; top: 0; left: 16%; width: 68%; height: 1px; background: linear-gradient(90deg, transparent, rgba(71, 215, 172, 0.65), transparent); content: ""; }
.brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 60px; }
.brand-lockup img { border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.28); }
.brand-lockup p { margin: 0; }
.brand-name { font-size: 1rem; font-weight: 850; letter-spacing: -0.02em; }
.brand-product { color: var(--muted); font-size: 0.73rem; font-weight: 650; }
.login-card h1 { max-width: 520px; margin: 14px 0 18px; font-size: clamp(2.3rem, 4vw, 3.75rem); line-height: 1.03; letter-spacing: -0.055em; }
.login-card h1 span { color: var(--accent); }
.login-copy { margin: 0 0 32px; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.login-status { min-height: 22px; margin: 12px 0 0; color: var(--danger); font-size: 0.79rem; text-align: center; }
.secure-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; border-top: 1px solid var(--line-soft); padding-top: 20px; color: var(--subtle); font-size: 0.72rem; line-height: 1.55; }
.secure-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--accent); }
.login-visual { position: relative; min-height: 570px; }
.signal-core { position: absolute; z-index: 4; top: 50%; left: 50%; display: grid; width: 128px; height: 128px; transform: translate(-50%, -50%); place-items: center; border: 1px solid rgba(71, 215, 172, 0.36); border-radius: 40px; background: linear-gradient(145deg, rgba(37, 58, 65, 0.84), rgba(14, 21, 28, 0.92)); box-shadow: 0 0 0 16px rgba(71,215,172,.025), 0 0 80px rgba(71,215,172,.16), inset 0 1px rgba(255,255,255,.08); }
.signal-core img { border-radius: 20px; }
.signal-orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(110, 140, 157, 0.16); border-radius: 50%; transform: translate(-50%, -50%); }
.signal-orbit::after { position: absolute; top: 50%; left: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 16px var(--accent); content: ""; }
.orbit-one { width: 260px; height: 260px; animation: orbit 15s linear infinite; }
.orbit-two { width: 390px; height: 390px; animation: orbit 24s linear reverse infinite; }
.orbit-three { width: 525px; height: 525px; border-style: dashed; opacity: 0.55; animation: orbit 36s linear infinite; }
.signal-node { position: absolute; z-index: 5; display: flex; align-items: center; gap: 8px; border: 1px solid rgba(140,160,180,.18); border-radius: 999px; background: rgba(15, 23, 31, .88); box-shadow: 0 15px 35px rgba(0,0,0,.24); padding: 9px 14px; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(10px); }
.signal-node span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.node-one { top: 18%; left: 15%; }
.node-two { top: 36%; right: 3%; }
.node-three { bottom: 16%; left: 20%; }
@keyframes orbit { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Application shell */
.app-view { min-height: 100vh; background: radial-gradient(circle at 88% 2%, rgba(71,215,172,.045), transparent 25rem), var(--bg); }
.sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; display: flex; width: var(--sidebar-width); flex-direction: column; border-right: 1px solid var(--line-soft); background: linear-gradient(180deg, #0e141b 0%, #0a0f14 100%); padding: 24px 16px 18px; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 26px; }
.sidebar-brand img { border-radius: 11px; }
.sidebar-brand div { min-width: 0; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { font-size: 0.94rem; letter-spacing: -0.02em; }
.sidebar-brand span { color: var(--subtle); font-size: 0.7rem; font-weight: 650; }
.sidebar-close { display: none; margin-left: auto; }
.sidebar-nav { display: grid; gap: 5px; }
.nav-label { margin: 14px 11px 8px; color: var(--subtle); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.nav-item { position: relative; display: flex; width: 100%; min-height: 44px; align-items: center; gap: 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #8391a1; padding: 0 12px; font-size: 0.79rem; font-weight: 700; text-align: left; transition: background 160ms ease, color 160ms ease, border-color 160ms ease; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: rgba(255,255,255,.025); color: var(--text); }
.nav-item.is-active { border-color: rgba(71,215,172,.12); background: linear-gradient(90deg, rgba(71,215,172,.12), rgba(71,215,172,.035)); color: var(--accent); }
.nav-item.is-active::before { position: absolute; left: -17px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: var(--accent); box-shadow: 0 0 16px rgba(71,215,172,.52); content: ""; }
.nav-count { min-width: 24px; margin-left: auto; border-radius: 99px; background: rgba(71,215,172,.13); padding: 2px 7px; color: var(--accent); font-size: .68rem; text-align: center; }
.sidebar-footer { margin-top: auto; }
.system-health { border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(255,255,255,.018); padding: 13px; }
.health-title { color: #bac4ce; font-size: .7rem; font-weight: 750; }
.health-row { display: flex; justify-content: space-between; margin-top: 10px; color: var(--subtle); font-size: .68rem; }
.health-row strong { color: #8e9caa; font-weight: 650; }
.sidebar-footer > p { margin: 12px 4px 0; color: var(--subtle); font-size: .68rem; text-align: center; }
.app-content { min-width: 0; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 76px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); background: rgba(11, 15, 20, 0.86); padding: 0 clamp(22px, 3vw, 44px); backdrop-filter: blur(18px); }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title h2 { margin: 2px 0 0; font-size: 1.04rem; letter-spacing: -0.025em; }
.menu-button { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.account-menu-wrap { position: relative; }
.account-button { display: flex; min-width: 178px; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; background: transparent; padding: 5px 8px; text-align: left; }
.account-button:hover, .account-button[aria-expanded="true"] { border-color: var(--line); background: var(--surface); }
.account-button img { border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); object-fit: cover; }
.account-button > span { min-width: 0; flex: 1; }
.account-button strong, .account-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button strong { max-width: 102px; font-size: .75rem; }
.account-button small { color: var(--subtle); font-size: .68rem; }
.account-button > svg { width: 14px; height: 14px; color: var(--subtle); transform: rotate(90deg); }
.account-menu { position: absolute; top: calc(100% + 8px); right: 0; width: 245px; border: 1px solid var(--line); border-radius: 14px; background: #111821; box-shadow: var(--shadow); padding: 8px; }
.account-menu p { overflow: hidden; margin: 4px 8px 10px; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; }
.account-menu button { display: flex; width: 100%; align-items: center; gap: 9px; border: 0; border-radius: 9px; background: transparent; color: #dce3e9; padding: 10px; font-size: .75rem; text-align: left; }
.account-menu button:hover { background: rgba(255,255,255,.04); }
.account-menu svg { width: 16px; height: 16px; color: var(--danger); }

/* Dashboard */
.dashboard { width: min(1500px, 100%); margin: 0 auto; padding: clamp(30px, 4vw, 52px) clamp(20px, 3vw, 44px) 64px; }
.connection-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; border: 1px solid rgba(245,188,98,.3); border-radius: 12px; background: var(--warning-soft); padding: 11px 14px; color: #efca8d; font-size: .78rem; }
.connection-banner svg { width: 18px; height: 18px; }
.analysis-banner { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; margin-bottom: 22px; overflow: hidden; border: 1px solid rgba(73,209,166,.26); border-radius: 14px; background: linear-gradient(120deg, rgba(73,209,166,.1), rgba(14,21,28,.86) 58%, rgba(87,120,255,.08)); padding: 12px 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.analysis-banner::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; transform-origin: left; background: linear-gradient(90deg, transparent, var(--accent), #64a8ff, transparent); content: ""; animation: analysis-scan 2.6s ease-in-out infinite; }
.analysis-banner > div { display: grid; min-width: 0; gap: 2px; }
.analysis-banner strong { color: var(--text); font-size: .76rem; letter-spacing: .01em; }
.analysis-banner > div > span { overflow: hidden; color: var(--muted); font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.analysis-orbit { position: relative; display: inline-grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(73,209,166,.28); border-radius: 50%; background: rgba(73,209,166,.08); }
.analysis-orbit::before { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 13px rgba(73,209,166,.8); content: ""; }
.analysis-orbit i { position: absolute; inset: 3px; border: 1px solid transparent; border-top-color: var(--accent); border-radius: 50%; animation: analysis-spin 1s linear infinite; }
.analysis-banner.is-complete::after { animation: none; background: var(--accent); }
.analysis-banner.is-error { border-color: rgba(255,105,120,.34); background: rgba(255,105,120,.08); }
.analysis-banner.is-error .analysis-orbit { border-color: rgba(255,105,120,.35); background: rgba(255,105,120,.1); }
.analysis-banner.is-error .analysis-orbit::before { background: #ff6978; box-shadow: 0 0 13px rgba(255,105,120,.75); }
.analysis-banner.is-error .analysis-orbit i { border-top-color: #ff6978; }
@keyframes analysis-spin { to { transform: rotate(360deg); } }
@keyframes analysis-scan { 0%,100% { transform: scaleX(.08); opacity: .2; } 50% { transform: scaleX(1); opacity: .95; } }
@keyframes pulse-dot { 0%,100% { opacity: .45; transform: scale(.82); } 50% { opacity: 1; transform: scale(1.12); } }
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 30px; }
.hero-row h1 { margin: 10px 0 12px; font-size: clamp(2.1rem, 4vw, 4rem); line-height: .98; letter-spacing: -.057em; }
.hero-row h1 span { color: var(--accent); }
.hero-row > div:first-child > p:last-child { max-width: 650px; margin: 0; color: var(--muted); font-size: .9rem; }
.hero-time { min-width: 160px; border-left: 1px solid var(--line); padding-left: 20px; text-align: right; }
.hero-time span, .hero-time small { display: block; color: var(--subtle); font-size: .68rem; }
.hero-time strong { display: block; margin: 2px 0; font-size: 1.75rem; letter-spacing: -.05em; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-card, .panel { border: 1px solid var(--line-soft); background: linear-gradient(145deg, rgba(20, 29, 39, .92), rgba(14, 20, 27, .92)); box-shadow: inset 0 1px rgba(255,255,255,.02); }
.metric-card { position: relative; min-height: 160px; overflow: hidden; border-radius: var(--radius); padding: 20px; }
.metric-highlight::after { position: absolute; right: -40px; bottom: -70px; width: 160px; height: 160px; border-radius: 50%; background: var(--accent); content: ""; filter: blur(65px); opacity: .13; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .71rem; font-weight: 700; }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.metric-icon svg { width: 16px; height: 16px; }
.metric-icon.alert { background: var(--danger-soft); color: var(--danger); }
.metric-icon.success { background: var(--info-soft); color: var(--info); }
.metric-card > strong { display: block; margin-top: 12px; font-size: 2rem; line-height: 1; letter-spacing: -.055em; }
.metric-card > p { margin: 8px 0 0; color: var(--subtle); font-size: .7rem; }
.metric-track { height: 3px; margin-top: 19px; overflow: hidden; border-radius: 99px; background: #26303a; }
.metric-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 500ms ease; }
.metric-spark { position: absolute; right: 17px; bottom: 15px; left: 17px; display: flex; height: 30px; align-items: end; justify-content: flex-end; gap: 5px; opacity: .6; }
.metric-spark i { width: 7%; min-width: 8px; border-radius: 3px 3px 0 0; background: var(--accent); }
.metric-spark i:nth-child(1) { height: 23%; }.metric-spark i:nth-child(2) { height: 40%; }.metric-spark i:nth-child(3) { height: 32%; }.metric-spark i:nth-child(4) { height: 68%; }.metric-spark i:nth-child(5) { height: 52%; }.metric-spark i:nth-child(6) { height: 84%; }.metric-spark i:nth-child(7) { height: 72%; }
.insights-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); gap: 13px; margin-top: 13px; }
.panel { border-radius: var(--radius); padding: 21px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 3px 0 0; font-size: 1rem; letter-spacing: -.025em; }
.soft-badge { display: inline-flex; min-height: 26px; align-items: center; border: 1px solid var(--line); border-radius: 99px; background: rgba(255,255,255,.02); padding: 0 9px; color: var(--muted); font-size: .68rem; font-weight: 700; white-space: nowrap; }
.volume-chart { display: flex; height: 130px; align-items: end; gap: clamp(9px, 2.3vw, 26px); margin-top: 22px; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 32px, rgba(255,255,255,.035) 33px); padding: 0 clamp(8px, 2vw, 20px); }
.chart-bar { position: relative; min-width: 16px; max-width: 38px; height: var(--bar-height); flex: 1; border-radius: 5px 5px 1px 1px; background: linear-gradient(180deg, #56e5b9, rgba(71,215,172,.3)); box-shadow: 0 -8px 24px rgba(71,215,172,.08); transition: height 500ms ease; }
.chart-bar:hover { background: var(--accent); }
.chart-bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: .68rem; font-weight: 700; opacity: 0; transition: opacity 150ms ease; }
.chart-bar:hover span { opacity: 1; }
.chart-labels { display: flex; gap: clamp(9px, 2.3vw, 26px); padding: 7px clamp(8px, 2vw, 20px) 0; }
.chart-labels span { min-width: 16px; max-width: 38px; flex: 1; color: var(--subtle); font-size: .68rem; text-align: center; }
.origin-content { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 170px; padding-top: 10px; }
.donut { display: grid; width: 114px; height: 114px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) var(--app-share, 70%), #506175 0); box-shadow: 0 0 35px rgba(71,215,172,.07); }
.donut::before { position: absolute; width: 78px; height: 78px; border-radius: 50%; background: #111820; content: ""; }
.donut > div { z-index: 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 1.3rem; letter-spacing: -.04em; }.donut span { color: var(--subtle); font-size: .68rem; text-transform: uppercase; }
.origin-legend { display: grid; min-width: 0; gap: 12px; }
.origin-legend > div { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; align-items: center; gap: 7px; }
.origin-legend i { width: 7px; height: 7px; border-radius: 50%; }.app-color { background: var(--accent); }.manual-color { background: #506175; }
.origin-legend span { color: var(--muted); font-size: .68rem; }.origin-legend strong { font-size: .7rem; }
.tickets-panel { margin-top: 13px; padding: 0; overflow: hidden; }
.tickets-heading { padding: 21px; }
.results-count { color: var(--subtle); font-size: .7rem; }
.filters { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(520px, 2fr) auto; align-items: end; gap: 12px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: rgba(0,0,0,.09); padding: 14px 21px; }
.search-field { position: relative; display: block; }
.search-field svg { position: absolute; top: 50%; left: 12px; width: 17px; height: 17px; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.search-field input { width: 100%; padding-left: 38px; }
.filter-fields { display: grid; grid-template-columns: repeat(5, minmax(100px,1fr)); gap: 7px; }
.filters label > span, .control-grid label > span, .tags-field > span, .form-grid label > span { display: block; margin: 0 0 5px 2px; color: var(--subtle); font-size: .68rem; font-weight: 750; letter-spacing: .02em; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #0d131a; padding: 0 11px; color: var(--text); font-size: .75rem; transition: border-color 150ms ease, box-shadow 150ms ease; }
input, select { height: 39px; }
textarea { resize: vertical; padding-top: 10px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--subtle); }
input:focus, select:focus, textarea:focus { border-color: rgba(71,215,172,.68); box-shadow: 0 0 0 3px rgba(71,215,172,.08); }
.filter-actions { display: flex; align-items: center; gap: 3px; }
#toggle-filters { display: none; }
.table-wrap { position: relative; min-height: 230px; overflow-x: auto; }
.tickets-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.tickets-table th { border-bottom: 1px solid var(--line-soft); background: rgba(8,12,16,.4); padding: 10px 14px; color: var(--subtle); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.tickets-table td { border-bottom: 1px solid rgba(140,160,180,.08); padding: 14px; vertical-align: middle; }
.tickets-table tbody tr { cursor: pointer; transition: background 150ms ease; }
.tickets-table tbody tr:hover { background: rgba(71,215,172,.027); }
.tickets-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ticket-cell-id strong, .requester-cell strong, .diagnosis-cell strong { display: block; color: #dce4ea; font-size: .7rem; }
.ticket-cell-id span, .requester-cell span, .diagnosis-cell span { display: block; max-width: 230px; overflow: hidden; margin-top: 3px; color: var(--subtle); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.diagnosis-cell.is-pending strong { color: #8fe2c4; }
.diagnosis-cell.is-pending span::before { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(73,209,166,.65); content: ""; animation: pulse-dot 1.6s ease-in-out infinite; }
.ticket-cell-id strong { color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.requester-cell { display: flex; align-items: center; gap: 9px; }
.device-mini { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: rgba(255,255,255,.035); color: #8fa0af; }.device-mini svg { width: 15px; height: 15px; }
.badge { display: inline-flex; min-height: 23px; align-items: center; gap: 5px; border: 1px solid transparent; border-radius: 99px; padding: 0 8px; font-size: .68rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-novo { background: var(--accent-soft); color: var(--accent); }.status-triagem { background: var(--info-soft); color: #87b6ff; }.status-em_analise { background: var(--warning-soft); color: var(--warning); }.status-aguardando { background: rgba(178,139,255,.11); color: #bc9cff; }.status-resolvido { background: rgba(92,170,126,.12); color: #79d59f; }.status-arquivado { background: rgba(148,160,175,.1); color: #9aa6b4; }
.priority-critica { background: var(--danger-soft); color: #ff8993; }.priority-alta { background: var(--warning-soft); color: var(--warning); }.priority-media { background: var(--info-soft); color: #8ab7fb; }.priority-baixa { background: rgba(148,160,175,.1); color: #99a6b4; }
.source-badge { display: inline-flex; min-height: 22px; align-items: center; border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; color: var(--muted); font-size: .68rem; font-weight: 750; }
.row-open { color: var(--subtle); }.row-open svg { width: 15px; height: 15px; }
.received-cell { min-width: 100px; color: var(--muted); font-size: .68rem; white-space: nowrap; }
.table-state { position: absolute; inset: 41px 0 0; display: grid; place-content: center; justify-items: center; background: rgba(12,17,23,.94); text-align: center; }
.table-state strong { margin-top: 12px; font-size: .8rem; }.table-state p { margin: 5px 0 0; color: var(--subtle); font-size: .68rem; }
.loader { display: inline-block; width: 27px; height: 27px; border: 2px solid #2d3b49; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.empty-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }.empty-icon svg { width: 20px; height: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; min-height: 62px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); padding: 10px 21px; }
.pagination p, .pagination span { color: var(--subtle); font-size: .68rem; }
.pagination > div { display: flex; align-items: center; gap: 10px; }
.pagination .icon-button { width: 34px; height: 34px; flex-basis: 34px; }.pagination svg { width: 15px; height: 15px; }.pagination svg.back { transform: rotate(180deg); }

/* Dialogs */
dialog { max-width: none; max-height: none; border: 0; background: transparent; color: var(--text); padding: 0; }
dialog::backdrop { background: rgba(3, 6, 9, .74); backdrop-filter: blur(5px); }
.drawer-dialog { width: min(820px, 100%); height: 100%; margin: 0 0 0 auto; overflow: visible; }
.drawer-shell { height: 100%; overflow-y: auto; border-left: 1px solid var(--line); background: #0d131a; box-shadow: -30px 0 80px rgba(0,0,0,.35); }
.drawer-header { position: sticky; z-index: 5; top: 0; display: grid; min-height: 74px; grid-template-columns: auto 1fr; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); background: rgba(13,19,26,.93); padding: 11px 22px; backdrop-filter: blur(16px); }
.drawer-header h2 { margin: 1px 0 0; font-size: 1rem; }
.drawer-loading { display: grid; min-height: calc(100vh - 75px); place-content: center; justify-items: center; color: var(--muted); font-size: .75rem; }
.drawer-content { padding-bottom: 50px; }
.ticket-identity { padding: 27px; background: radial-gradient(circle at 85% 0, rgba(71,215,172,.1), transparent 20rem); }
.ticket-identity > div:first-child { display: flex; align-items: center; gap: 9px; }
.ticket-id { color: var(--accent); font-size: .73rem; font-weight: 850; letter-spacing: .08em; }
.ticket-identity h3 { margin: 13px 0 7px; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.04em; }
.ticket-identity > p { max-width: 680px; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.ticket-meta-line { display: flex; flex-wrap: wrap; gap: 7px 19px !important; margin-top: 16px; color: var(--subtle); font-size: .68rem; }
.ticket-meta-line span { position: relative; }.ticket-meta-line span+span::before { position: absolute; top: 50%; left: -11px; width: 3px; height: 3px; border-radius: 50%; background: #506071; content: ""; }
.drawer-section { border-top: 1px solid var(--line-soft); padding: 24px 27px; }
.section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }.section-title svg { width: 17px; height: 17px; color: var(--accent); }.section-title h3 { margin: 0; font-size: .84rem; letter-spacing: -.02em; }
.section-title-row { justify-content: space-between; }.section-title-row > div { display: flex; align-items: center; gap: 9px; }
.control-section { background: rgba(255,255,255,.012); }
.control-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.tags-field { display: block; margin-top: 10px; }.tags-field small { color: var(--subtle); font-weight: 500; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.archived-notice { display: grid; gap: 3px; margin-top: 13px; border: 1px solid rgba(255,190,85,.3); border-radius: 12px; background: rgba(255,190,85,.07); padding: 12px 14px; color: #e7d8b7; }
.archived-notice strong { color: #ffd38c; font-size: .72rem; }.archived-notice span { color: #b7ad9a; font-size: .68rem; line-height: 1.5; }
.smart-summary { border: 1px solid rgba(71,215,172,.18); border-radius: 14px; background: linear-gradient(135deg, rgba(71,215,172,.08), rgba(71,215,172,.025)); padding: 16px; }
.smart-summary.is-danger { border-color: rgba(255,107,122,.26); background: linear-gradient(135deg, rgba(255,107,122,.09), rgba(255,107,122,.025)); }
.smart-summary.is-warning { border-color: rgba(255,190,85,.25); background: linear-gradient(135deg, rgba(255,190,85,.08), rgba(255,190,85,.022)); }
.smart-summary.is-info { border-color: rgba(107,167,255,.24); background: linear-gradient(135deg, rgba(107,167,255,.08), rgba(107,167,255,.022)); }
.verdict-eyebrow { display: block; margin-bottom: 8px; color: var(--accent); font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.verdict-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.verdict-heading strong { color: #edf4f7; font-size: .88rem; line-height: 1.35; }
.verdict-badge { flex: 0 0 auto; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(255,255,255,.04); padding: 4px 8px; color: #c8d3dc; font-size: .61rem; font-weight: 800; white-space: nowrap; }
.smart-summary.is-danger .verdict-badge { border-color: rgba(255,107,122,.25); color: #ffabb5; }.smart-summary.is-warning .verdict-badge { border-color: rgba(255,190,85,.25); color: #ffd38c; }.smart-summary.is-success .verdict-badge { border-color: rgba(71,215,172,.25); color: var(--accent); }
.smart-summary p { margin: 8px 0 0; color: #c5ced6; font-size: .76rem; line-height: 1.65; }
.findings-list { display: grid; gap: 8px; margin-top: 11px; }
.finding { display: grid; grid-template-columns: auto 1fr; gap: 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,.015); padding: 12px; }
.finding-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: var(--warning-soft); color: var(--warning); }.finding-icon svg { width: 13px; height: 13px; }
.finding.is-positive .finding-icon { background: var(--accent-soft); color: var(--accent); }.finding.is-danger .finding-icon { background: var(--danger-soft); color: var(--danger); }
.finding strong { display: block; font-size: .69rem; }.finding p { margin: 3px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.55; }
.split-details { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; }
.detail-list { display: grid; gap: 9px; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(90px,.7fr) 1.3fr; gap: 10px; border-bottom: 1px solid rgba(140,160,180,.07); padding-bottom: 8px; }
.detail-list dt { color: var(--subtle); font-size: .68rem; }.detail-list dd { overflow-wrap: anywhere; margin: 0; color: #c9d1d8; font-size: .68rem; text-align: right; }
.event-counts { display: grid; grid-template-columns: repeat(auto-fit,minmax(90px,1fr)); gap: 7px; margin-bottom: 20px; }
.event-count { border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255,255,255,.014); padding: 10px; }.event-count strong, .event-count span { display: block; }.event-count strong { color: var(--accent); font-size: 1rem; }.event-count span { margin-top: 2px; color: var(--subtle); font-size: .68rem; }
.action-outcomes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.action-outcome { min-height: 78px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,.014); padding: 13px; }
.action-outcome strong,.action-outcome span { display: block; }.action-outcome strong { color: #dce5eb; font-size: 1.15rem; line-height: 1; }.action-outcome span { margin-top: 8px; color: var(--muted); font-size: .69rem; line-height: 1.4; }
.action-outcome.is-success { border-color: rgba(71,215,172,.2); background: rgba(71,215,172,.045); }.action-outcome.is-success strong { color: var(--accent); }
.action-outcome.is-danger { border-color: rgba(255,107,122,.25); background: rgba(255,107,122,.045); }.action-outcome.is-danger strong { color: #ff8997; }
.action-outcome.is-warning { border-color: rgba(255,190,85,.24); background: rgba(255,190,85,.04); }.action-outcome.is-warning strong { color: #ffd38c; }
.timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline::before { position: absolute; top: 9px; bottom: 10px; left: 6px; width: 1px; background: var(--line); content: ""; }
.timeline-item { position: relative; display: grid; grid-template-columns: 14px 65px 1fr; gap: 9px; padding: 0 0 16px; }
.timeline-dot { z-index: 1; width: 9px; height: 9px; margin-top: 4px; border: 2px solid #0d131a; border-radius: 50%; background: #647588; box-shadow: 0 0 0 1px #647588; }.timeline-dot.error { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }.timeline-dot.success { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }.timeline-dot.warning { background: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.timeline-time { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .68rem; }
.timeline-content strong { display: block; color: #d0d8df; font-size: .69rem; }.timeline-content p { margin: 2px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.section-helper { margin: -7px 0 12px; color: var(--subtle); font-size: .68rem; }
.log-view { max-height: 360px; overflow: auto; margin: 0; border: 1px solid #202c37; border-radius: 12px; background: #070b0f; padding: 15px; color: #9eb0bd; font: .68rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-form { display: flex; align-items: flex-end; gap: 9px; }.note-form label { flex: 1; }.note-form textarea { min-height: 80px; }
.notes-list { display: grid; gap: 9px; margin: 17px 0 0; padding: 0; list-style: none; }
.note { border-left: 2px solid var(--accent); border-radius: 0 10px 10px 0; background: rgba(255,255,255,.02); padding: 11px 13px; }.note-header { display: flex; justify-content: space-between; gap: 10px; color: var(--subtle); font-size: .68rem; }.note-header strong { color: #cbd4dc; font-size: .68rem; }.note p { margin: 6px 0 0; color: var(--muted); font-size: .69rem; white-space: pre-wrap; }

.modal-dialog { width: min(980px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #0e151c; box-shadow: var(--shadow); }
.modal-shell { max-height: calc(100vh - 34px); overflow-y: auto; }
.modal-header { position: sticky; z-index: 4; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line-soft); background: rgba(14,21,28,.94); padding: 22px 25px; backdrop-filter: blur(16px); }.modal-header h2 { margin: 4px 0; font-size: 1.35rem; letter-spacing: -.035em; }.modal-header p:last-child { margin: 0; color: var(--muted); font-size: .72rem; }
.upload-grid { display: grid; grid-template-columns: .84fr 1.16fr; gap: 22px; padding: 25px; }
.upload-step { min-width: 0; }
.step-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 15px; }.step-heading > span { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(71,215,172,.3); border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: .68rem; font-weight: 850; }.step-heading h3 { margin: 0; font-size: .82rem; }.step-heading p { margin: 3px 0 0; color: var(--subtle); font-size: .68rem; }
.drop-zone { display: grid; min-height: 270px; place-content: center; justify-items: center; border: 1px dashed #3a4b5b; border-radius: 16px; background: rgba(255,255,255,.013); padding: 22px; cursor: pointer; text-align: center; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }.drop-zone:focus-within { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(71,215,172,.2); }.drop-zone.has-file { border-style: solid; border-color: rgba(71,215,172,.42); }.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }.drop-zone input:focus-visible { outline: none; }.drop-icon { display: grid; width: 48px; height: 48px; margin-bottom: 12px; place-items: center; border-radius: 15px; background: var(--accent-soft); color: var(--accent); }.drop-icon svg { width: 22px; height: 22px; }.drop-zone strong { font-size: .79rem; }.drop-zone > span:not(.drop-icon) { margin-top: 4px; color: var(--muted); font-size: .7rem; }.drop-zone small { display: block; max-width: 280px; overflow: hidden; margin-top: 14px; color: var(--accent); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.field-error { min-height: 20px; margin: 5px 2px 0; color: var(--danger); font-size: .68rem; }
.autofill-status { margin: -4px 0 12px; border: 1px solid rgba(71,215,172,.25); border-radius: 10px; background: rgba(71,215,172,.07); color: #a8c8bd; padding: 9px 10px; font-size: .67rem; line-height: 1.45; }.autofill-status.is-error { border-color: rgba(255,107,122,.35); background: rgba(255,107,122,.08); color: #ffd8dd; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.form-grid .span-two { grid-column: span 2; }.form-grid label { position: relative; }.form-grid label > small { position: absolute; right: 7px; bottom: 5px; color: var(--subtle); font-size: .68rem; }.form-grid textarea { min-height: 86px; padding-bottom: 22px; }
.upload-preview { margin: 0 25px 25px; border: 1px solid var(--line-soft); border-radius: 14px; background: rgba(0,0,0,.12); padding: 15px; }.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 11px; }.preview-heading h3 { margin: 2px 0 0; font-size: .77rem; }.upload-preview pre { max-height: 185px; overflow: auto; margin: 0; border-radius: 9px; background: #080c10; padding: 12px; color: #8fa2b0; font: .68rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.upload-processing { display: grid; gap: 12px; margin: -7px 25px 25px; border: 1px solid rgba(73,209,166,.25); border-radius: 14px; background: linear-gradient(120deg, rgba(73,209,166,.09), rgba(12,18,24,.78)); padding: 14px 15px; }
.upload-processing-copy { display: flex; align-items: center; gap: 12px; }
.upload-processing-copy > div { display: grid; gap: 2px; }
.upload-processing-copy strong { color: var(--text); font-size: .76rem; }
.upload-processing-copy span { color: var(--muted); font-size: .69rem; }
.upload-modal-error { margin: -7px 25px 25px; border: 1px solid rgba(255,107,122,.42); border-radius: 14px; background: rgba(255,107,122,.1); color: #ffd8dd; padding: 12px 14px; font-size: .76rem; line-height: 1.5; }
.upload-progress-track { height: 3px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.065); }
.upload-progress-track i { display: block; width: 12%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #6aa6ff); box-shadow: 0 0 12px rgba(73,209,166,.45); transition: width .35s ease; }
.modal-footer { position: sticky; z-index: 4; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line-soft); background: rgba(14,21,28,.95); padding: 16px 25px; backdrop-filter: blur(16px); }.modal-footer > p { display: flex; max-width: 420px; align-items: center; gap: 8px; margin: 0; color: var(--subtle); font-size: .68rem; }.modal-footer > p svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--accent); }.modal-footer > div { display: flex; gap: 8px; }

.toast-region { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: grid; width: min(370px, calc(100% - 44px)); gap: 8px; pointer-events: none; }
.toast { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(19,28,37,.96); box-shadow: 0 18px 50px rgba(0,0,0,.35); padding: 12px 13px; animation: toast-in 220ms ease both; backdrop-filter: blur(18px); }.toast > svg { width: 18px; height: 18px; color: var(--accent); }.toast.is-error > svg { color: var(--danger); }.toast div strong, .toast div span { display: block; }.toast div strong { font-size: .7rem; }.toast div span { margin-top: 2px; color: var(--muted); font-size: .68rem; }.toast button { border: 0; background: transparent; color: var(--subtle); pointer-events: auto; }.toast button svg { width: 14px; height: 14px; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: minmax(260px, 1fr) auto; }
  .filter-fields { display: none; grid-column: 1 / -1; grid-row: 2; }
  .filters.is-expanded .filter-fields { display: grid; }
  #toggle-filters { display: inline-flex; }
  .filter-actions { justify-content: flex-end; }
}

@media (max-width: 920px) {
  :root { --sidebar-width: 0px; }
  .sidebar { width: 268px; transform: translateX(-105%); box-shadow: 22px 0 60px rgba(0,0,0,.4); transition: transform 220ms ease; }
  .sidebar.is-open { transform: none; }
  .sidebar-scrim { position: fixed; z-index: 29; inset: 0; display: block; background: rgba(3,6,9,.64); backdrop-filter: blur(3px); }
  .sidebar-close, .menu-button { display: inline-grid; }
  .insights-grid { grid-template-columns: 1fr; }
  .origin-content { justify-content: flex-start; }
  .upload-grid { grid-template-columns: 1fr; }
  .drop-zone { min-height: 190px; }
}

@media (max-width: 720px) {
  .login-view { overflow-y: auto; }
  .login-shell { width: min(100% - 28px, 480px); grid-template-columns: 1fr; padding: 22px 0; }
  .login-visual { display: none; }
  .login-card { padding: 26px 22px; }
  .brand-lockup { margin-bottom: 42px; }
  .login-card h1 { font-size: clamp(2.25rem, 12vw, 3.15rem); }
  .login-copy { margin-bottom: 26px; }
  .topbar { min-height: 68px; padding: 0 14px; }
  .topbar-title .eyebrow, .topbar-title h2, .account-button > span, .account-button > svg, #refresh-button { display: none; }
  .account-button { min-width: 0; padding: 3px; }.account-button img { width: 36px; height: 36px; }
  #open-upload span { display: none; }.topbar-actions { gap: 7px; }
  .dashboard { padding: 28px 14px 45px; }
  .hero-row { align-items: flex-start; margin-bottom: 24px; }
  .hero-time { display: none; }
  .hero-row h1 { font-size: clamp(2.15rem, 11vw, 3.1rem); }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 145px; padding: 15px; }.metric-card > strong { font-size: 1.7rem; }.metric-top > span:first-child { font-size: .68rem; }.metric-icon { width: 28px; height: 28px; }
  .panel { padding: 17px; }
  .tickets-panel { padding: 0; }
  .tickets-heading { padding: 18px 16px; }
  .filters { display: flex; flex-wrap: wrap; padding: 12px 16px; }.search-field { width: 100%; }.filter-fields { width: 100%; grid-template-columns: 1fr 1fr; }.filter-actions { width: 100%; justify-content: space-between; }
  .tickets-table, .tickets-table tbody, .tickets-table tr, .tickets-table td { display: block; }
  .tickets-table thead { display: none; }
  .tickets-table tbody { padding: 5px 13px; }
  .tickets-table tbody tr { position: relative; margin: 8px 0; border: 1px solid var(--line-soft); border-radius: 13px; background: rgba(255,255,255,.012); padding: 12px; }
  .tickets-table td { border: 0; padding: 4px 0; }
  .tickets-table td:nth-child(1) { padding-right: 100px; }.tickets-table td:nth-child(2) { margin-top: 9px; }.tickets-table td:nth-child(3) { margin-top: 7px; }.tickets-table td:nth-child(4) { position: absolute; top: 11px; right: 11px; }.tickets-table td:nth-child(5) { display: inline-block; margin-top: 7px; }.tickets-table td:nth-child(6) { display: inline-block; margin: 7px 0 0 8px; }.tickets-table td:last-child { position: absolute; right: 11px; bottom: 13px; }
  .table-state { inset: 0; min-height: 260px; }
  .pagination { padding: 10px 16px; }.pagination p { display: none; }
  .pagination > div { width: 100%; justify-content: space-between; }
  .drawer-dialog { width: 100%; }
  .drawer-header { padding: 10px 14px; }.ticket-identity, .drawer-section { padding: 21px 16px; }
  .control-grid { grid-template-columns: 1fr 1fr; }
  .ticket-actions .button { flex: 1 1 180px; }
  .split-details { grid-template-columns: 1fr; gap: 26px; }
  .action-outcomes { grid-template-columns: 1fr 1fr; }
  .note-form { align-items: stretch; flex-direction: column; }
  .modal-dialog { width: 100%; max-height: 100%; border-radius: 0; }.modal-shell { max-height: 100vh; }.modal-header, .upload-grid { padding: 19px 16px; }.upload-preview { margin: 0 16px 18px; }.upload-processing, .upload-modal-error { margin: -3px 16px 18px; }.modal-footer { align-items: stretch; flex-direction: column; padding: 14px 16px; }.modal-footer > div { display: grid; grid-template-columns: 1fr 1fr; }.modal-footer .button { width: 100%; }
}

@media (max-width: 470px) {
  .analysis-banner { grid-template-columns: auto minmax(0,1fr); }
  .analysis-banner > .soft-badge { grid-column: 2; justify-self: start; }
  .analysis-banner > div > span { white-space: normal; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 130px; }
  .origin-content { align-items: flex-start; flex-direction: column; }
  .filter-fields, .control-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: auto; }
  .ticket-meta-line span+span::before { display: none; }
  .verdict-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .filters, .pagination, .button, .icon-button { display: none !important; }
  .app-content { margin: 0; }.dashboard { padding: 0; }.panel, .metric-card { break-inside: avoid; border-color: #ccc; background: white; color: black; }
}
