:root {
  --bg: #05070D;
  --bg2: #07111f;
  --panel: rgba(11, 18, 32, .82);
  --panel-solid: #0B1220;
  --panel2: rgba(16, 26, 46, .76);
  --text: #EAF2FF;
  --muted: #9EB4D0;
  --soft: #C9D9F2;
  --accent: #22D3EE;
  --accent2: #6366F1;
  --border: rgba(79, 116, 166, .24);
  --border2: rgba(34, 211, 238, .20);
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --shadow: 0 20px 60px rgba(0,0,0,.30);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  font-synthesis-weight: none;
  background:
    radial-gradient(circle at 18% -5%, rgba(34,211,238,.16), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(99,102,241,.15), transparent 30%),
    linear-gradient(180deg, #05070D 0%, #06101D 54%, #05070D 100%);
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
.page { width: min(100% - 24px, 1560px); margin: 0 auto; padding: clamp(12px, 2vw, 22px) 0 28px; }
.glass-panel, .panel, .card, .toolbar {
  background: linear-gradient(180deg, rgba(16,26,46,.76), rgba(9,16,29,.76));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.hero {
  border-radius: var(--radius-xl);
  padding: clamp(18px, 2.4vw, 30px);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; opacity: .92; }
.hero h1 { margin: 0; font-size: clamp(28px, 3.4vw, 42px); font-weight: 650; line-height: 1.08; letter-spacing: -.018em; text-shadow: none; }
.subtitle { color: var(--muted); margin: 8px 0 0; line-height: 1.45; font-size: 15px; font-weight: 400; }
.accent-line { color: var(--accent); margin-top: 10px; font-size: 13px; font-weight: 400; }
.user-box { text-align: right; color: var(--muted); line-height: 1.45; min-width: 260px; font-size: 14px; font-weight: 400; }
.user-box b { color: var(--text); font-weight: 600; }
.nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin: 14px 0 0; }
.nav a, .button {
  border: 1px solid var(--border);
  background: rgba(16,26,46,.74);
  color: var(--text);
  border-radius: 16px;
  padding: 10px 15px;
  min-height: 41px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 10px 24px rgba(0,0,0,.16);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.button:hover, .nav a:hover { transform: translateY(-1px); border-color: rgba(34,211,238,.42); background: rgba(22,35,61,.84); }
.button.primary { background: linear-gradient(135deg, var(--accent), #36F2FF); color: #02131A; border-color: rgba(34,211,238,.88); font-weight: 650; }
.button.danger { background: rgba(50,16,26,.78); color: #fecdd3; border-color: #7f1d1d; }
.button.small { padding: 8px 12px; font-size: 12px; min-height: 36px; border-radius: 13px; }
.button.ghost { background: rgba(11,18,32,.38); color: var(--soft); }
.toolbar { border-radius: var(--radius-lg); padding: 14px; margin-top: 14px; }
.period-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input, select {
  background: rgba(5,7,13,.52);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 10px 13px;
  min-height: 42px;
  outline: none;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
}
input:focus, select:focus { border-color: rgba(34,211,238,.55); box-shadow: 0 0 0 3px rgba(34,211,238,.08); }
label { color: var(--muted); font-size: 13px; font-weight: 500; }
.panel { border-radius: var(--radius-xl); padding: clamp(16px, 2vw, 22px); margin-top: 14px; }
.section-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
h2 { margin: 0; font-size: clamp(20px, 2vw, 26px); font-weight: 620; letter-spacing: -.012em; }
.soft-chip { color: var(--soft); border: 1px solid var(--border); border-radius: 999px; padding: 7px 11px; font-size: 12px; background: rgba(5,7,13,.28); white-space: nowrap; font-weight: 400; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 12px; }
.metric { background: rgba(8,14,26,.58); border: 1px solid var(--border); border-radius: 20px; padding: 15px; min-height: 112px; overflow: hidden; }
.metric-glow:nth-child(1), .metric-glow:nth-child(3) { border-color: var(--border2); }
.metric-title { color: var(--soft); font-size: 12px; font-weight: 600; }
.metric-value {
  font-size: clamp(22px, 2.15vw, 30px);
  font-weight: 650;
  margin: 7px 0 6px;
  letter-spacing: -.012em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metric-sub { color: var(--muted); font-size: 12px; line-height: 1.4; font-weight: 400; }
.source-line { color: var(--muted); font-size: 12px; margin: 12px 0 0; line-height: 1.5; font-weight: 400; }
.compact-raw { padding: 12px 14px; box-shadow: 0 12px 36px rgba(0,0,0,.20); }
.compact-raw h2 { font-size: 16px; font-weight: 600; }
.compact-raw .subtitle { font-size: 12px; margin-top: 2px; }
.compact-raw-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.raw-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 9px; }
.raw-pill { border: 1px solid rgba(79,116,166,.18); background: rgba(5,7,13,.30); border-radius: 16px; padding: 9px 11px; min-height: 54px; }
.raw-pill span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.raw-pill b { display: block; color: var(--text); font-size: clamp(13px, 1.1vw, 16px); line-height: 1.25; font-weight: 600; }
.raw-details { margin-top: 10px; padding: 11px 12px; border-radius: 15px; background: rgba(5,7,13,.30); border: 1px solid rgba(79,116,166,.18); color: var(--muted); font-size: 12px; line-height: 1.45; font-weight: 400; }
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: stretch; }
.card { border-radius: 24px; padding: 18px; display: flex; flex-direction: column; min-height: 218px; background: linear-gradient(180deg, rgba(12,20,36,.80), rgba(8,14,26,.75)); }
.card-wide { grid-column: span 2; }
.card-top { display: flex; gap: 13px; align-items: flex-start; }
.badge { min-width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #02131A; font-weight: 650; font-size: 18px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.card h3 { margin: 0; font-size: clamp(18px, 1.55vw, 21px); font-weight: 620; letter-spacing: -.01em; }
.card p { color: var(--muted); line-height: 1.48; margin: 12px 0; font-size: 14px; font-weight: 400; }
.card-actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metal-preview { margin: 6px 0 14px; border: 1px solid rgba(34,211,238,.17); background: rgba(5,7,13,.33); border-radius: 18px; overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid rgba(79,116,166,.20); }
.preview-head b { font-size: 14px; color: var(--text); font-weight: 600; }
.preview-head span { color: var(--muted); font-size: 12px; text-align: right; font-weight: 400; }
.preview-table-wrap { overflow: auto; max-height: 260px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 760px; }
.preview-table td { border-bottom: 1px solid rgba(79,116,166,.16); padding: 8px 10px; color: var(--soft); white-space: nowrap; font-weight: 400; }
.preview-table .head-row td { color: var(--text); font-weight: 600; background: rgba(34,211,238,.05); }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid rgba(79,116,166,.18); }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid rgba(79,116,166,.16); padding: 10px 12px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; background: rgba(5,7,13,.26); font-weight: 600; }
td { color: var(--soft); font-size: 13px; font-weight: 400; }
tr:hover td { background: rgba(34,211,238,.035); }
.status-success { color: var(--success); font-weight: 600; }
.status-error { color: var(--danger); font-weight: 600; }
.status-running, .status-queued { color: var(--warning); font-weight: 600; }
.logbox { background: rgba(3,7,18,.62); border: 1px solid var(--border); border-radius: 18px; padding: 13px; height: 480px; overflow: auto; font-family: Consolas, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; color: var(--soft); font-weight: 400; }
.compact-log { height: 240px; margin-top: 12px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 28px; padding: 30px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.login-card h1 { margin-top: 0; font-weight: 620; }
.form-grid { display: grid; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.message { color: var(--warning); min-height: 20px; }
@media (max-width: 1180px) { .card-wide { grid-column: span 1; } .modules { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); } .metrics-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); } }
@media (max-width: 900px) { .hero { flex-direction: column; align-items: flex-start; } .user-box { text-align: left; min-width: 0; width: 100%; } .nav { justify-content: flex-start; } .section-title-row { flex-direction: column; } .period-row > .button.primary { flex-basis: 100%; } }
@media (max-width: 640px) { .page { width: min(100% - 14px, 1540px); } .modules, .metrics-grid, .raw-strip, .two { grid-template-columns: 1fr; } .hero, .panel, .toolbar { border-radius: 20px; } .card-actions { grid-template-columns: 1fr; } .period-row input, .period-row select, .period-row button { width: 100%; } .soft-chip { white-space: normal; } }
@media (min-width: 1680px) { .page { width: min(100% - 48px, 1680px); } }

/* v0.3.3 safety override: do not allow browser/Inter fallback to make the UI too bold. */
body, button, input, select, textarea, table, th, td, .button, .nav a, .metric, .card, .raw-pill {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
}
.hero h1, h2, h3, .metric-value, .button, .nav a, .metric-title, .badge, .raw-pill b, .preview-head b {
  font-weight: 600 !important;
  text-shadow: none !important;
}
.metric-value {
  font-size: clamp(21px, 2vw, 28px) !important;
}
