/* ==========================================================================
   TachoCockpit — Design System v9
   Exact implementation of React reference design
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@300;400;500&display=swap');

:root {
  --bg:      #07070A;
  --surface: #0F0F14;
  --card:    #131318;
  --card2:   #18181F;
  --elevated:#1E1E27;
  --border:  rgba(255,255,255,0.055);
  --border2: rgba(255,255,255,0.10);
  --green:   #00E87A;
  --green-dim: rgba(0,232,122,0.10);
  --amber:   #FF9F0A;
  --amber-dim: rgba(255,159,10,0.10);
  --red:     #FF453A;
  --red-dim: rgba(255,69,58,0.12);
  --blue:    #0A84FF;
  --text:    #F0F0F5;
  --text2:   #8A8A96;
  --text3:   #44444E;
  --df: 'Syne', sans-serif;
  --dm: 'DM Mono', monospace;
  --db: 'Plus Jakarta Sans', sans-serif;

  /* compat aliases */
  --bg-app: var(--bg);
  --bg-card: var(--card);
  --bg-elevated: var(--elevated);
  --border-subtle: var(--border);
  --text-primary: var(--text);
  --text-secondary: var(--text2);
  --accent-success: var(--green);
  --accent-warning: var(--amber);
  --accent-danger:  var(--red);
  --radius: 20px;
  --spacing: 14px;
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { background: #000; }

body {
  background: #000;
  font-family: var(--db);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */
.app-shell {
  width: 100%;
  max-width: 430px;
  background: var(--bg);
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* green glow top radial */
.app-shell::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(0,232,122,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* grid background */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   STATUS BAR
   ========================================================================== */
.sbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px 8px;
  position: relative;
  z-index: 5;
}

.sbar-l {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-family: var(--db);
}

.badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--green-dim);
  border: 1px solid rgba(0,232,122,0.18);
  border-radius: 20px;
  padding: 4px 11px 4px 8px;
  font-family: var(--df);
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: glow 2s infinite;
  flex-shrink: 0;
}

@keyframes glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50% { opacity: 0.5; box-shadow: 0 0 3px var(--green); }
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 16px 14px 22px;
  position: relative;
  z-index: 5;
}

.hdr-main { flex: 1; }

.hdr-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  align-self: center;
}
.hdr-btn:hover { background: var(--elevated); color: var(--text1); }

.hdr-sub {
  font-family: var(--df);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 1px;
}

.hdr-t {
  font-family: var(--df);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text);
}

/* last-update compat */
.last-update {
  font-size: 9px;
  color: var(--text3);
  opacity: 0;
  transition: opacity 0.3s;
  font-family: var(--dm);
}
.last-update.visible { opacity: 1; }

/* compat ids */
#app-header { display: none; } /* replaced by .sbar + .hdr */
#offline-banner { display: none; } /* handled by .offline-banner below */

/* ==========================================================================
   OFFLINE BANNER
   ========================================================================== */
.offline-banner {
  display: none;
  margin: 0 14px 8px;
  background: var(--red-dim);
  border: 1px solid rgba(255,69,58,0.25);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 12px;
  color: var(--red);
  text-align: center;
  font-weight: 600;
  font-family: var(--dm);
  letter-spacing: 0.04em;
  position: relative;
  z-index: 5;
}

.offline-banner.show { display: block; }

.cached-badge {
  display: inline-block;
  background: var(--amber-dim);
  color: var(--amber);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 8px;
  text-transform: uppercase;
  font-family: var(--dm);
}

/* ==========================================================================
   SCREEN BODY
   ========================================================================== */
.body, .screen-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 14px 8px;
  position: relative;
  z-index: 1;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  min-height: 0; /* allow flex shrink */
}

.body::-webkit-scrollbar,
.screen-container::-webkit-scrollbar { display: none; }

/* ==========================================================================
   BOTTOM NAV
   ========================================================================== */
.bnav, .bottom-nav {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 10px 6px 26px;
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, rgba(7,7,10,0.98), rgba(15,15,20,0.95));
  position: relative;
  z-index: 10;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.ni, .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 14px;
  transition: all 0.15s;
  border: none;
  background: none;
  min-width: 58px;
  position: relative;
}

.ni.on, .nav-item.active {
  background: rgba(0,232,122,0.07);
}

.ni-ic, .nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
}
.ni-ic svg, .nav-icon svg { width: 100%; height: 100%; }

.ni.on .ni-ic,
.nav-item.active .nav-icon {
  color: var(--green);
}

.ni-lb, .nav-label {
  font-family: var(--df);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  transition: color 0.2s;
  text-align: center;
  white-space: nowrap;
}

.ni.on .ni-lb,
.nav-item.active .nav-label {
  color: var(--green);
}

.ni-pip {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 5px var(--green);
  margin-top: 1px;
}

/* nav badge (infractions) */
.nav-badge {
  position: absolute;
  top: 3px;
  right: 8px;
  background: var(--red);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  font-family: var(--dm);
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}

/* ==========================================================================
   CARD BASE
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

/* inner top highlight */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
}

.card.g {
  border-color: rgba(0,232,122,0.18);
}
.card.g::before {
  background: linear-gradient(90deg, transparent, rgba(0,232,122,0.25), transparent);
}

.card.r {
  border-color: rgba(255,69,58,0.22);
}

.clbl {
  font-family: var(--df);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 6px;
}

/* ==========================================================================
   T-20: HOJE
   ========================================================================== */
.screen-today { padding-bottom: 8px; }

/* START/STOP button */
.sbtn, .btn-session {
  width: 100%;
  height: 66px;
  background: linear-gradient(145deg, #00E87A, #00CB68);
  border: none;
  border-radius: 20px;
  font-family: var(--df);
  font-size: 22px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,232,122,0.28), 0 2px 6px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  transition: all 0.15s;
}

.sbtn::before, .btn-session::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 55%);
}

.sbtn:active, .btn-session:active {
  transform: scale(0.98);
}

.sbtn.stop, .btn-stop {
  background: linear-gradient(145deg, #FF453A, #C8302A);
  box-shadow: 0 8px 30px rgba(255,69,58,0.28), 0 2px 6px rgba(0,0,0,0.4);
}

/* session info text */
.session-block { display: contents; }
.session-info {
  display: none; /* hidden per design — not in reference */
}

/* Risk Gauge card */
.risk-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--card);
  border: 1px solid rgba(0,232,122,0.18);
  border-radius: 20px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.risk-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,232,122,0.25), transparent);
}

/* right-side text block in risk row */
.rs-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.g-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.risk-gauge-ring, .g-wrap { /* compat */ }

.g-svg, .risk-gauge-svg {
  width: 88px;
  height: 88px;
  transform: rotate(-90deg);
}

.g-track, .risk-gauge-track {
  fill: none;
  stroke: var(--elevated);
  stroke-width: 6;
  stroke-linecap: round;
}

.g-fill, .risk-gauge-fill {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
}

.g-c, .risk-gauge-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.g-num, .risk-gauge-number {
  font-family: var(--dm);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.g-unit, .risk-gauge-number-label {
  font-size: 9px;
  color: var(--text3);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.rs-lb, .risk-gauge-label {
  font-family: var(--df);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 3px;
}

.rs-v, .risk-gauge-status {
  font-family: var(--df);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.rs-v.s { color: var(--green); text-shadow: 0 0 18px rgba(0,232,122,0.35); }
.rs-v.w { color: var(--amber); text-shadow: 0 0 18px rgba(255,159,10,0.35); }
.rs-v.d { color: var(--red);   text-shadow: 0 0 18px rgba(255,69,58,0.35); }

.rs-sub, .risk-gauge-desc {
  font-size: 13px;
  color: var(--text2);
  margin-top: 4px;
  font-family: var(--db);
}

/* risk-gauge-card is the card wrapping risk-row */
.risk-gauge-card {
  background: var(--card);
  border: 1px solid rgba(0,232,122,0.18);
  border-radius: 20px;
  padding: 0;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.risk-gauge-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,232,122,0.25), transparent);
}

/* 2x2 metric grid */
.mgrid, .counters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 10px;
}

.mc, .counter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.mc::before, .counter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.055), transparent);
}

/* colored dot */
.mdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: absolute;
  top: 14px;
  right: 14px;
}

.mdot.g, .counter-card-driving::after  { background: var(--green); box-shadow: 0 0 7px var(--green); }
.mdot.a, .counter-card-amplitude::after{ background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.mdot.b, .counter-card-break::after    { background: var(--blue);  box-shadow: 0 0 7px var(--blue); }
.mdot.x, .counter-card-weekly::after   { background: var(--text3); }

/* remove old ::before dot from previous implementation */
.counter-card-driving::before,
.counter-card-break::before,
.counter-card-amplitude::before,
.counter-card-weekly::before {
  /* override old design - handled by .mc::before gradient */
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.055), transparent) !important;
  width: auto !important;
  height: 1px !important;
  top: 0 !important;
  right: auto !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.counter-card::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  position: absolute;
  top: 14px;
  right: 14px;
}

.counter-card-driving::after  { background: var(--green); box-shadow: 0 0 7px var(--green); }
.counter-card-break::after    { background: var(--blue);  box-shadow: 0 0 7px var(--blue); }
.counter-card-amplitude::after{ background: var(--amber); box-shadow: 0 0 7px var(--amber); }
.counter-card-weekly::after   { background: var(--text3); }

.ml, .counter-label {
  font-family: var(--df);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 7px;
  line-height: 1;
}

.mv, .counter-value {
  font-family: var(--dm);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.mv.e, .counter-value {
  color: var(--text3);
  font-size: 18px;
}

.counter-value-md {
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms, .counter-sub {
  font-size: 11px;
  color: var(--text2);
  margin-top: 3px;
  font-family: var(--db);
}

/* warning state */
.counter-card.counter-card-warning {
  border-color: rgba(255,159,10,0.3);
}

/* break alert banner */
.break-alert-banner {
  display: none;
  background: var(--amber-dim);
  border: 1px solid rgba(255,159,10,0.25);
  border-radius: 12px;
  padding: 11px 14px;
  font-family: var(--df);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--amber);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 10px;
  animation: pulse-banner 1.5s ease infinite;
}

@keyframes pulse-banner {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* "Ver timeline" link button */
.lbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  padding: 10px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  transition: color 0.2s;
  font-family: var(--db);
}

.lbtn:active { color: var(--text); }

/* infractions block on today dashboard */
.today-infractions-block {
  display: none;
  background: var(--amber-dim);
  border: 1px solid rgba(255,159,10,0.25);
  border-radius: 16px;
  padding: 13px 15px;
  margin-bottom: 10px;
  gap: 10px;
  flex-direction: column;
}

.today-infractions-block.today-infractions-critical {
  background: var(--red-dim);
  border-color: rgba(255,69,58,0.25);
}

.today-inf-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.today-inf-icon { font-size: 18px; line-height: 1; }

.today-inf-title {
  flex: 1;
  font-family: var(--df);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--amber);
}

.today-infractions-critical .today-inf-title { color: var(--red); }

.today-inf-link {
  background: none;
  border: 1px solid var(--border2);
  font-family: var(--dm);
  font-size: 10px;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.today-inf-summary {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* severity badges */
.inf-badge-msi, .inf-badge-vsi, .inf-badge-si, .inf-badge-mi {
  font-family: var(--dm);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.inf-badge-msi { background: rgba(255,69,58,0.18); color: var(--red); }
.inf-badge-vsi { background: rgba(255,69,58,0.13); color: #FF7B72; }
.inf-badge-si  { background: rgba(255,159,10,0.13); color: var(--amber); }
.inf-badge-mi  { background: rgba(255,255,255,0.06); color: var(--text2); }

.today-footer { text-align: center; padding: 4px 0 8px; }

/* ==========================================================================
   T-50: COPILOT
   ========================================================================== */
.screen-copilot {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.copilot-alerts {
  background: var(--amber-dim);
  border: 1px solid rgba(255,159,10,0.2);
  border-radius: 12px;
  padding: 11px 14px;
  margin: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.copilot-alerts.hidden { display: none; }

.copilot-alert-item {
  font-size: 13px;
  color: var(--amber);
  line-height: 1.4;
  font-family: var(--db);
}

/* quick chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 14px 12px;
}

.copilot-chips-row { /* compat */
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 0 12px;
}

.chip, .copilot-chip {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-family: var(--db);
  transition: border-color 0.15s, color 0.15s;
}

.chip:active, .copilot-chip:active {
  border-color: rgba(0,232,122,0.3);
  color: var(--green);
}

/* chat */
.chat-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.chat-body, .copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 12px;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.chat-body::-webkit-scrollbar,
.copilot-messages::-webkit-scrollbar { display: none; }

.chat-area { display: flex; flex-direction: column; gap: 11px; }

.msg, .copilot-message {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.msg.u, .copilot-message-user {
  flex-direction: row-reverse;
}

.av, .copilot-avatar, .copilot-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--elevated);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.bub, .copilot-bubble {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 4px;
  padding: 12px 14px;
  max-width: 280px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  font-family: var(--db);
}

.copilot-welcome {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.copilot-bubble-assistant {
  border-radius: 18px 18px 18px 4px;
}

.msg.u .bub,
.copilot-bubble-user {
  background: rgba(0,232,122,0.08);
  border-color: rgba(0,232,122,0.18);
  border-radius: 18px 18px 4px 18px;
  color: var(--text);
}

.copilot-bubble-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  font-family: var(--db);
}

.copilot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.copilot-action-btn {
  background: rgba(0,232,122,0.08);
  border: 1px solid rgba(0,232,122,0.18);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  font-family: var(--db);
  transition: background 0.15s;
}

.copilot-action-btn:active { background: rgba(0,232,122,0.15); }

/* input area */
.cin-row, .copilot-input-area {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 5;
}

.copilot-input-row {
  display: flex;
  gap: 9px;
  align-items: center;
  width: 100%;
}

.cin, .copilot-input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 15px;
  color: var(--text);
  font-family: var(--db);
  outline: none;
  resize: none;
  min-height: unset;
}

.cin::placeholder, .copilot-input::placeholder { color: var(--text3); }

.csnd, .copilot-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,232,122,0.28);
  transition: opacity 0.2s;
}

.csnd:disabled, .copilot-send-btn:disabled { opacity: 0.5; }
.csnd:active, .copilot-send-btn:active { opacity: 0.8; }

/* --------------------------------------------------------------------------
   Copilot V2 — Modern chat UI additions
   -------------------------------------------------------------------------- */

/* Chat header */
.copilot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.copilot-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,232,122,0.15), rgba(0,232,122,0.05));
  border: 1px solid rgba(0,232,122,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.copilot-header-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--db);
}

.copilot-header-status {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.copilot-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: copilot-pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes copilot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Message rows — proper alignment */
.copilot-row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
  padding: 0 2px;
}

.copilot-row-user {
  flex-direction: row-reverse;
}

.copilot-row-assistant {
  flex-direction: row;
}

.copilot-avatar-wrap {
  flex-shrink: 0;
  margin-bottom: 2px;
}

/* Bubble time */
.copilot-bubble-time {
  font-size: 11px;
  color: var(--text3);
  margin-top: 5px;
  text-align: right;
  opacity: 0.7;
}

.copilot-row-assistant .copilot-bubble-time {
  text-align: left;
}

/* Chips wrap */
.copilot-chips-wrap {
  padding: 8px 14px 0;
  flex-shrink: 0;
}

.copilot-chips-label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 7px;
  font-family: var(--db);
}

/* Typing indicator */
.copilot-bubble-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  min-width: 56px;
}

.copilot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  display: inline-block;
  animation: copilot-bounce 1.2s infinite;
}

.copilot-dot:nth-child(2) { animation-delay: 0.2s; }
.copilot-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes copilot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Infraction code badge inline */
.copilot-code-badge {
  display: inline-block;
  background: rgba(0,232,122,0.1);
  border: 1px solid rgba(0,232,122,0.2);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  font-family: monospace;
  letter-spacing: 0.03em;
}

/* Send button spinner animation */
.copilot-spinner {
  animation: copilot-spin 0.9s linear infinite;
  color: white;
}

@keyframes copilot-spin {
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   T-40 v10: SINCRONIZAR — sy-* componentes (Hub USB & Upload)
   ========================================================================== */
.screen-sync { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sy-section-label { font-size: 11px; font-weight: 700; color: var(--text3); letter-spacing: 0.05em; margin-left: 4px; margin-bottom: -4px; }
.sy-card { background: var(--elevated); border: 1px solid var(--border2); border-radius: 16px; padding: 16px; display: flex; align-items: center; gap: 14px; transition: transform 0.15s, border-color 0.15s, background 0.15s; }
.sy-card--active { cursor: pointer; }
.sy-card--active:active { transform: scale(0.98); border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.03); }
.sy-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sy-icon--green { background: rgba(16,185,129,0.12); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.sy-icon--dim { background: rgba(255,255,255,0.04); color: var(--text3); border: 1px solid var(--border2); }
.sy-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sy-title { font-size: 16px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.sy-desc { font-size: 13px; color: var(--text2); line-height: 1.4; }
.sy-badge { background: rgba(255,255,255,0.1); color: var(--text2); font-size: 10px; font-weight: 700; letter-spacing: 0.03em; padding: 2px 6px; border-radius: 5px; text-transform: uppercase; }
.sy-chevron { color: var(--text3); display: flex; align-items: center; justify-content: center; }
.sy-card--usb { position: relative; overflow: hidden; }
.sy-usb-state { position: absolute; top: 18px; right: 18px; }
.sy-usb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); transition: background 0.3s; }
.sy-usb-dot--reading { background: var(--blue); animation: usb-pulse-blue 1.5s infinite; }
.sy-usb-dot--done { background: var(--green); }
@keyframes usb-pulse-blue { 0% { box-shadow: 0 0 0 0 rgba(10,132,255,0.4); } 70% { box-shadow: 0 0 0 6px rgba(10,132,255,0); } 100% { box-shadow: 0 0 0 0 rgba(10,132,255,0); } }
.sy-usb-reading, .sy-usb-done { position: absolute; inset: 0; background: var(--elevated); display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 16px; animation: fadeIn 0.3s ease; }
.sy-spinner-ring { width: 22px; height: 22px; border: 2.5px solid rgba(10,132,255,0.2); border-top-color: var(--blue); border-radius: 50%; animation: usb-spin 0.8s linear infinite; }
@keyframes usb-spin { to { transform: rotate(360deg); } }
.sy-usb-reading-text { font-size: 15px; font-weight: 600; color: var(--blue); }
.sy-usb-done-icon { width: 24px; height: 24px; color: var(--green); display: flex; align-items: center; justify-content: center; }
.sy-usb-done-text { font-size: 15px; font-weight: 600; color: var(--green); }
.sy-info-box { background: rgba(10,132,255,0.06); border: 1px dashed rgba(10,132,255,0.3); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; margin-top: 4px; }
.sy-info-box-icon { color: var(--blue); flex-shrink: 0; padding-top: 2px; }
.sy-info-box-text { font-size: 12px; line-height: 1.5; color: var(--text2); }
.sy-info-box-text strong { color: var(--text); }
.sy-info-box-text code { background: rgba(255,255,255,0.1); padding: 1px 4px; border-radius: 4px; font-family: monospace; font-size: 11px; }

/* ==========================================================================
   T-41: UPLOAD DE FICHEIRO DDD
   ========================================================================== */
.screen-upload { padding-bottom: 8px; }
.upload-zone { border: 2px dashed rgba(255,255,255,0.15); border-radius: 16px; text-align: center; padding: 40px 20px; margin-bottom: 20px; cursor: pointer; transition: border-color 0.2s, background 0.2s; background: rgba(255,255,255,0.02); }
.upload-zone:hover, .upload-zone.drag-over { border-color: rgba(16,185,129, 0.5); background: rgba(16,185,129, 0.05); }
.upload-icon { font-size: 32px; margin-bottom: 12px; }
.upload-label { font-weight: 600; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.upload-progress { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; background: rgba(255,255,255,0.03); border-radius: 12px; color: var(--text2); font-size: 14px; }
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--green); border-radius: 50%; animation: s-spin 0.8s linear infinite; }
@keyframes s-spin { to { transform: rotate(360deg); } }
.driver-preview { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-top: 16px; animation: scin 0.3s ease; }
.preview-title { font-size: 13px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 12px; }
.preview-grid { display: flex; flex-direction: column; gap: 8px; }
.preview-row { display: flex; justify-content: space-between; font-size: 14px; }
.preview-lbl { color: var(--text2); }
.preview-val { color: var(--text); font-weight: 600; font-family: var(--dm, monospace); }
.analysis-result, .upload-error { text-align: center; padding: 24px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-top: 16px; animation: scin 0.3s ease; }
.result-icon, .error-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; min-height: 40px; }
.result-message { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.result-details { font-size: 14px; color: var(--text2); margin-bottom: 20px; }
.result-actions { display: flex; flex-direction: column; gap: 12px; }

/* Upload utility classes */
.btn-primary { width: 100%; padding: 14px; background: var(--blue); color: #fff; font-weight: 600; border-radius: 10px; border: none; cursor: pointer; }
.btn-secondary { width: 100%; padding: 14px; background: rgba(255,255,255,0.1); color: var(--text); font-weight: 600; border-radius: 10px; border: none; cursor: pointer; }
.btn-danger { width: 100%; padding: 14px; background: var(--red); color: #fff; font-weight: 600; border-radius: 10px; border: none; cursor: pointer; }
.btn-link { background: none; border: none; color: var(--blue); font-weight: 500; font-size: 14px; cursor: pointer; padding: 4px; }
/* ==========================================================================
T-41: UPLOAD
   ========================================================================== */
.screen-upload { padding-bottom: 8px; }

.udz, .upload-zone {
  background: var(--card);
  border: 1.5px dashed var(--border2);
  border-radius: 20px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 10px;
}

.udz.err {
  border-color: rgba(255,69,58,0.35);
  background: var(--red-dim);
}

.udz:active, .upload-zone:active { border-color: rgba(0,232,122,0.4); }
.udz.drag-over, .upload-zone.drag-over { border-color: rgba(0,232,122,0.4); background: var(--green-dim); }

.ui, .upload-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 11px;
  color: var(--text3);
}

.ut, .upload-label {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  font-family: var(--db);
}

.us, .upload-hint {
  font-size: 13px;
  color: var(--text2);
  font-family: var(--db);
}

.ue {
  font-size: 14px;
  color: var(--red);
  font-weight: 500;
  margin-bottom: 5px;
  font-family: var(--db);
}

.rbtn {
  background: var(--elevated);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  font-family: var(--db);
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 10px;
}

.upload-progress span {
  font-size: 13px;
  color: var(--text2);
  font-family: var(--db);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.driver-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.driver-preview::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,232,122,0.25), transparent);
}

.preview-title {
  font-family: var(--df);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 10px;
}

.preview-grid { display: flex; flex-direction: column; gap: 8px; }

.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-lbl {
  font-family: var(--dm);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.06em;
}

.preview-val {
  font-family: var(--dm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
}

.analysis-result {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 10px;
}

.result-icon { display: flex; align-items: center; justify-content: center; }

.result-message {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  font-family: var(--db);
}

.result-details { width: 100%; text-align: left; }

.result-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.upload-error {
  background: var(--red-dim);
  border: 1px solid rgba(255,69,58,0.22);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  margin-bottom: 10px;
}

.error-icon { display: flex; align-items: center; justify-content: center; color: var(--red); }

.upload-error div, .upload-error #error-message {
  font-size: 14px;
  color: var(--red);
  font-weight: 500;
  line-height: 1.5;
  font-family: var(--db);
}

/* infraction list in result */
.infraction-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.infraction-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card2);
  border-radius: 10px;
  border-left: 3px solid var(--border);
  font-size: 12px;
}

.infraction-item.severity-msi { border-left-color: var(--red); }
.infraction-item.severity-vsi { border-left-color: #FF7B72; }
.infraction-item.severity-si  { border-left-color: var(--amber); }
.infraction-item.severity-mi  { border-left-color: var(--text3); }

.infraction-code {
  font-family: var(--dm);
  font-size: 10px;
  font-weight: 700;
  background: var(--elevated);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--text3);
  flex-shrink: 0;
}

.infraction-desc {
  font-size: 12px;
  color: var(--text);
  line-height: 1.3;
  font-family: var(--db);
}

.infraction-more {
  font-family: var(--dm);
  font-size: 11px;
  color: var(--text2);
  text-align: center;
  padding: 4px;
}

/* ==========================================================================
   T-30: HISTÓRICO
   ========================================================================== */
.screen-history { padding-bottom: 8px; }

/* section header with week label */
.hwh {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 2px 11px;
}

.wl {
  font-family: var(--df);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
}

.wr {
  font-size: 13px;
  color: var(--text2);
  font-family: var(--dm);
}

/* day row with bar */
.drow {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 5px;
}

.dd {
  font-family: var(--dm);
  font-size: 11px;
  color: var(--text3);
  width: 46px;
  flex-shrink: 0;
}

.dbw {
  flex: 1;
  height: 3px;
  background: var(--elevated);
  border-radius: 2px;
}

.db {
  height: 3px;
  border-radius: 2px;
}

.db.s { background: var(--green); }
.db.w { background: var(--amber); }
.db.d { background: var(--red); }

.dt {
  font-family: var(--dm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  width: 46px;
  text-align: right;
  flex-shrink: 0;
}

/* infraction count box */
.ib {
  background: rgba(255,69,58,0.10);
  border: 1px solid rgba(255,69,58,0.2);
  border-radius: 16px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}

.ib-n {
  background: var(--red);
  color: #fff;
  font-family: var(--dm);
  font-size: 14px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ib-t {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  font-family: var(--db);
}

.ib-s {
  font-size: 12px;
  color: var(--text2);
  margin-top: 2px;
  font-family: var(--db);
}

/* infraction row */
.irow {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 5px;
}

.sp {
  font-family: var(--df);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.sp.v  { background: rgba(255,69,58,0.18);  color: var(--red); }
.sp.si { background: rgba(255,159,10,0.13); color: var(--amber); }

.ir-c {
  font-family: var(--dm);
  font-size: 10px;
  color: var(--text3);
}

.ir-d {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  font-family: var(--db);
}

/* compat for old history styles */
.history-summary-card,
.history-cta-card {
  display: none; /* replaced by .mgrid + .ib + .hwh + .drow etc */
}

/* ==========================================================================
   T-70: DEFINIÇÕES
   ========================================================================== */
.screen-settings { padding-bottom: 28px; }

.slbl {
  font-family: var(--df);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 14px 3px 7px;
}

/* setting field */
.sfield {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 6px;
}

.sfield label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
  font-family: var(--db);
}

.sinput, .settings-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  font-family: var(--db);
}

/* language grid — 2 columns */
.lgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0;
}

/* compat old lang-grid */
.lang-grid { display: none; }
.settings-section { display: none; }
.settings-actions { display: none; }

.lbtn2 {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--db);
  transition: all 0.15s;
}

.lbtn2.on {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.lbtn2.full { grid-column: 1 / -1; }

.lbtn2:active { opacity: 0.8; }

/* save button */
.svbtn {
  width: 100%;
  height: 52px;
  background: linear-gradient(145deg, #00E87A, #00CB68);
  border: none;
  border-radius: 14px;
  font-family: var(--df);
  font-size: 18px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0,232,122,0.22);
  margin-top: 14px;
  transition: opacity 0.15s;
}

.svbtn:active { opacity: 0.9; }

/* about rows */
.arow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.arow:last-child { border-bottom: none; }

.albl { font-size: 14px; color: var(--text2); font-family: var(--db); }

.aval {
  font-family: var(--dm);
  font-size: 13px;
  color: var(--green);
}

/* ==========================================================================
   T-60: INFRAÇÕES
   ========================================================================== */
.screen-infractions { padding-bottom: 8px; }

.infractions-empty,
.infractions-clean {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 10px;
}

.empty-icon, .clean-icon { font-size: 40px; }

.empty-title, .clean-title {
  font-family: var(--df);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.empty-desc, .clean-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  font-family: var(--db);
}

.clean-message {
  font-family: var(--dm);
  font-size: 11px;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(0,232,122,0.15);
  border-radius: 20px;
  padding: 5px 14px;
  letter-spacing: 0.04em;
}

.infraction-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.sev-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-top: 3px solid var(--sev-color, var(--border));
}

.sev-count {
  font-family: var(--dm);
  font-size: 24px;
  font-weight: 700;
  color: var(--sev-color, var(--text));
  line-height: 1;
}

.sev-code {
  font-family: var(--dm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sev-color, var(--text2));
}

.sev-label {
  font-size: 9px;
  color: var(--text3);
  text-align: center;
  line-height: 1.3;
  font-family: var(--db);
}

.infraction-context-msg {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
  font-family: var(--db);
}

.msg-critical {
  background: var(--red-dim);
  border: 1px solid rgba(255,69,58,0.18);
  color: var(--red);
}

.msg-warning {
  background: var(--amber-dim);
  border: 1px solid rgba(255,159,10,0.18);
  color: var(--amber);
}

.infraction-list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--df);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 8px 2px 4px;
}

.infraction-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 5px;
}

.infraction-card-msi { border-left: 3px solid var(--red); }
.infraction-card-vsi { border-left: 3px solid #FF7B72; }
.infraction-card-si  { border-left: 3px solid var(--amber); }
.infraction-card-mi  { border-left: 3px solid var(--text3); }

.infraction-card-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.infraction-num {
  font-family: var(--dm);
  font-size: 10px;
  color: var(--text3);
}

.infraction-code-big {
  font-family: var(--dm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.infraction-sev-badge {
  font-family: var(--df);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #000;
  padding: 3px 8px;
  border-radius: 6px;
}

.infraction-card-desc {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  font-family: var(--db);
}

.infraction-card-period {
  font-family: var(--dm);
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.04em;
}

.infraction-card-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-item {
  background: var(--elevated);
  border-radius: 8px;
  padding: 5px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-lbl {
  font-family: var(--dm);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
}

.metric-val {
  font-family: var(--dm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.metric-excess .metric-val { color: var(--red); }

.infraction-card-legal {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.4;
  font-family: var(--db);
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 2px;
}

.infraction-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 8px;
}

/* ==========================================================================
   INFRACTION POPUP OVERLAY
   ========================================================================== */
.infraction-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  padding: 0 0 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.infraction-popup-overlay.visible { opacity: 1; }

.infraction-popup {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 22px 22px 18px 18px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(40px);
  transition: transform 0.3s ease;
}

.infraction-popup-overlay.visible .infraction-popup { transform: translateY(0); }

.infraction-popup-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: shake 0.5s ease 0.3s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.infraction-popup-title {
  font-family: var(--df);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--red);
  text-align: center;
  text-transform: uppercase;
}

.infraction-popup-subtitle {
  font-size: 14px;
  color: var(--text2);
  text-align: center;
  line-height: 1.5;
  font-family: var(--db);
}

.infraction-popup-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.popup-infraction-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.popup-sev-msi, .popup-sev-vsi { border-left: 3px solid var(--red); }
.popup-sev-si { border-left: 3px solid var(--amber); }
.popup-sev-mi { border-left: 3px solid var(--text3); }

.popup-sev-badge {
  font-family: var(--dm);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--elevated);
  color: var(--text2);
}

.popup-sev-msi .popup-sev-badge,
.popup-sev-vsi .popup-sev-badge { background: rgba(255,69,58,0.18); color: var(--red); }
.popup-sev-si .popup-sev-badge  { background: rgba(255,159,10,0.13); color: var(--amber); }

.popup-inf-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
  font-family: var(--db);
}

.popup-infraction-more {
  font-family: var(--dm);
  font-size: 11px;
  color: var(--text2);
  text-align: center;
  padding: 4px;
}

.infraction-popup-message {
  font-size: 12px;
  color: var(--text2);
  text-align: center;
  line-height: 1.5;
  font-family: var(--db);
}

.infraction-popup-actions { display: flex; flex-direction: column; gap: 7px; }

.btn-popup-detail {
  background: rgba(255,69,58,0.12) !important;
  border: 1px solid rgba(255,69,58,0.25) !important;
  color: var(--red) !important;
  font-family: var(--db) !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 14px !important;
  padding: 14px !important;
}

.btn-popup-close {
  background: var(--elevated) !important;
  border: 1px solid var(--border2) !important;
  color: var(--text2) !important;
  font-family: var(--db) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border-radius: 14px !important;
  padding: 14px !important;
}

/* ==========================================================================
   BUTTONS (global)
   ========================================================================== */
button { cursor: pointer; outline: none; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(145deg, #00E87A, #00CB68);
  color: #000;
  font-family: var(--df);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 14px;
  border: none;
  width: 100%;
  box-shadow: 0 6px 22px rgba(0,232,122,0.22);
  transition: opacity 0.15s;
  margin-bottom: 8px;
}

.btn-primary:active { opacity: 0.88; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--elevated);
  color: var(--text);
  font-family: var(--db);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid var(--border2);
  width: 100%;
  transition: opacity 0.15s;
  margin-bottom: 8px;
}

.btn-secondary:active { opacity: 0.8; }

.btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  padding: 10px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  transition: color 0.2s;
  font-family: var(--db);
}

.btn-link:active { color: var(--text); }

/* CTA button (action solid white) */
.ctabtn {
  background: var(--text);
  color: #000;
  border: none;
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--db);
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  transition: opacity 0.15s;
}

.ctabtn:active { opacity: 0.88; }

/* ==========================================================================
   ONBOARDING
   ========================================================================== */
.screen-onboarding {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 28px;
}

.onboarding-hero {
  text-align: center;
  padding: 16px 0 8px;
}

.onboarding-hero-icon { font-size: 56px; line-height: 1; margin-bottom: 14px; display: block; }

.onboarding-hero-title {
  font-family: var(--df);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.onboarding-hero-sub {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  font-family: var(--db);
}

.onboarding-form { display: flex; flex-direction: column; gap: 12px; }

.onboarding-field { display: flex; flex-direction: column; gap: 5px; }

.onboarding-field label {
  font-family: var(--dm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
}

.onboarding-input {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  width: 100%;
  outline: none;
  font-family: var(--db);
  transition: border-color 0.2s;
}

.onboarding-input:focus { border-color: rgba(0,232,122,0.35); }
.onboarding-input::placeholder { color: var(--text3); }

.onboarding-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.onboarding-lang-btn {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--db);
  transition: all 0.15s;
}

.onboarding-lang-btn.active {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-dim);
}

.onboarding-footer {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  line-height: 1.5;
  font-family: var(--db);
}

/* ==========================================================================
   T-42: USB SCREEN — Leitor de Cartão
   ========================================================================== */

/* Shell */
.screen-usb { display: flex; flex-direction: column; height: 100%; padding-bottom: 0; }
.screen-usb .screen-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px; gap: 8px;
}
.usb-back-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--elevated); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; line-height: 1; flex-shrink: 0;
}
.usb-back-btn:active { opacity: 0.7; }
.screen-usb .screen-title {
  font-family: var(--df); font-size: 18px; font-weight: 700;
  color: var(--text); flex: 1; text-align: center;
}

/* Platform banner */
.usb-platform-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,159,10,0.08); border: 1px solid rgba(255,159,10,0.25);
  border-radius: 12px; padding: 10px 14px; margin: 4px 0 12px; font-size: 13px;
  color: var(--amber); line-height: 1.4;
}
.usb-platform-icon { display: flex; flex-shrink: 0; color: var(--amber); }

/* Stage + action area */
.usb-stage { flex: 1; min-height: 0; max-height: 320px; display: flex; align-items: center; justify-content: center; padding: 8px 0; }
.usb-action-area { padding: 12px 0 16px; display: flex; flex-direction: column; gap: 8px; }

/* State wrapper */
.usb-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; width: 100%; }
.usb-state-label { font-family: var(--df); font-size: 20px; font-weight: 700; color: var(--text); }
.usb-state-desc  { font-size: 14px; color: var(--text2); line-height: 1.5; max-width: 240px; }

/* ── CABLE ANIMATION (CONNECT state) ─────────────────────────── */
.usb-animation { position: relative; display: flex; align-items: center; justify-content: center; }
.usb-cable-anim { flex-direction: row; gap: 0; height: 80px; width: 240px; }

.usb-cable-plug { display: flex; flex-direction: row; align-items: center; }
.usb-plug-body { width: 28px; height: 18px; background: var(--text2); border-radius: 3px; }
.usb-plug-prongs { display: flex; flex-direction: column; justify-content: space-around; height: 12px; gap: 3px; margin-left: -1px; }
.usb-prong { width: 8px; height: 2px; background: var(--text3); border-radius: 1px; }

.usb-cable-wire { flex: 1; height: 4px; background: var(--border2); border-radius: 2px; position: relative; overflow: hidden; }
.usb-signal-dot {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: usbSignal 1.8s linear infinite; opacity: 0;
}
.usb-dot-1 { animation-delay: 0s; }
.usb-dot-2 { animation-delay: 0.6s; }
.usb-dot-3 { animation-delay: 1.2s; }
@keyframes usbSignal {
  0%   { left: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.usb-phone-port { display: flex; align-items: center; }
.usb-port-body {
  width: 20px; height: 28px; border: 2.5px solid var(--text2);
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
}
.usb-port-body::after { content: ''; width: 8px; height: 4px; background: var(--text3); border-radius: 1px; }

/* ── CARD READER ANIMATION (INSERT + READING states) ────────── */
.usb-card-anim { flex-direction: column; align-items: center; gap: 12px; }
.usb-reader-body {
  width: 90px; height: 56px; background: var(--elevated);
  border: 1.5px solid var(--border); border-radius: 10px;
  position: relative; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.3s;
}
.usb-reader-active { border-color: var(--green); box-shadow: 0 0 12px rgba(0,232,122,0.2); }
.usb-reader-slot {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 52px; height: 6px; background: var(--bg);
  border-radius: 3px; border: 1px solid var(--border2);
}
.usb-reader-led { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--text3); }
.usb-led-blink  { animation: usbLedBlink 0.9s ease-in-out infinite; }
.usb-led-green  { background: var(--green); }
@keyframes usbLedBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }

.usb-card {
  width: 56px; height: 34px;
  background: linear-gradient(135deg, var(--elevated) 0%, var(--card) 100%);
  border: 1px solid var(--border); border-radius: 5px; position: relative; overflow: hidden;
}
.usb-card-sliding  { animation: usbCardSlide 1.4s ease-in-out infinite alternate; }
.usb-card-inserted { animation: none; transform: translateY(-14px); }
@keyframes usbCardSlide { from { transform: translateY(0); } to { transform: translateY(-6px); } }
.usb-card-chip { position: absolute; top: 6px; left: 8px; width: 14px; height: 10px; background: var(--amber); border-radius: 2px; opacity: 0.6; }
.usb-chip-active { opacity: 1; animation: chipPulse 0.6s ease infinite alternate; }
@keyframes chipPulse { from { box-shadow: 0 0 4px rgba(255,159,10,0.4); } to { box-shadow: 0 0 10px rgba(255,159,10,0.8); } }
.usb-card-stripe { position: absolute; bottom: 6px; left: 0; right: 0; height: 7px; background: rgba(255,255,255,0.06); }

/* ── PROGRESS BAR (READING state) ───────────────────────────── */
.usb-progress-wrap { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.usb-progress-bar  { width: 100%; height: 6px; background: var(--border2); border-radius: 3px; overflow: hidden; }
.usb-progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.15s ease; width: 0%; }
.usb-progress-pct  { font-family: var(--dm); font-size: 12px; color: var(--text2); }

/* ── DONE STATE ─────────────────────────────────────────────── */
.usb-card-info { width: 100%; background: var(--elevated); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.usb-info-row  { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.usb-info-row:last-child { border-bottom: none; }
.usb-info-label { font-size: 13px; color: var(--text2); }
.usb-info-value { font-size: 14px; font-weight: 600; color: var(--text); }
.usb-info-mono  { font-family: var(--dm); font-size: 13px; letter-spacing: 0.04em; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn-usb-action {
  width: 100%; padding: 16px; border-radius: 14px; border: none; cursor: pointer;
  font-family: var(--df); font-size: 17px; font-weight: 700; letter-spacing: 0.3px;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity 0.15s;
}
.btn-usb-action:active { opacity: 0.8; }
.btn-usb-primary   { background: var(--green); color: #022c22; }
.btn-usb-secondary { background: var(--elevated); color: var(--text); border: 1px solid var(--border); }
.btn-usb-disabled  { background: var(--elevated); color: var(--text3); cursor: not-allowed; }
.btn-usb-disabled:active { opacity: 1; }
.btn-usb-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  background: rgba(255,255,255,0.12); color: var(--text2);
  border-radius: 4px; padding: 2px 6px; margin-left: 4px;
}
.usb-demo-hint { font-size: 12px; color: var(--text3); text-align: center; margin: 0; }
.btn-usb-demo {
  background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--green); padding: 8px; text-align: center; width: 100%;
}
.btn-usb-link {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--text2); padding: 10px; text-align: center; width: 100%;
}

/* ==========================================================================
   LOADING
   ========================================================================== */
.screen-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

/* ==========================================================================
   EMPTY / ERROR STATES
   ========================================================================== */
.empty-state, .error-state {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 10px;
}

.empty-icon { font-size: 40px; }

.empty-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  font-family: var(--db);
}

.error-state p {
  font-size: 13px;
  color: var(--red);
  font-family: var(--db);
}

.screen-error {
  padding: 20px;
  color: var(--red);
  font-size: 14px;
  text-align: center;
  font-family: var(--db);
}

/* ==========================================================================
   SCREEN HEADER (compat — hidden by new design)
   ========================================================================== */
.screen-header { display: none; }

/* ==========================================================================
   SCREEN ENTRY ANIMATION
   ========================================================================== */
@keyframes scin {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-today,
.screen-copilot,
.screen-sync,
.screen-upload,
.screen-history,
.screen-settings,
.screen-infractions {
  animation: scin 0.18s ease;
}

/* ==========================================================================
   UPLOAD RESULT MODAL — 10A.2 (URM v10 Premium)
   ========================================================================== */
.upload-result-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 24px; }
.urm-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.urm-card { position: relative; background: var(--card); border: 1px solid var(--border2); border-radius: 24px; padding: 32px 24px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.5); animation: urmSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.urm-card--warn { border-color: rgba(255, 69, 58, 0.4); background: linear-gradient(180deg, rgba(255,69,58,0.05) 0%, var(--card) 40%); }
@keyframes urmSlideUp { from { opacity: 0; transform: translateY(30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.urm-icon { width: 72px; height: 72px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.urm-icon--success { background: rgba(16,185,129,0.1); border: 2px solid rgba(16,185,129,0.3); }
.urm-icon--warn { background: rgba(255,69,58,0.1); border: 2px solid rgba(255,69,58,0.3); }
.urm-title { font-size: 22px; font-weight: 800; color: #fff; margin: 0 0 8px; letter-spacing: -0.01em; }
.urm-body { color: var(--text2); line-height: 1.5; margin: 0 0 20px; font-size: 14px; }
.urm-body--edu { font-size: 12px; margin-top: 12px; opacity: 0.7; }
.urm-list { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; }
.urm-infraction { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.urm-code { font-family: var(--dm); font-size: 12px; font-weight: 700; color: var(--red); background: rgba(255,69,58,0.12); border: 1px solid rgba(255,69,58,0.25); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.urm-inf-desc { color: var(--text); font-weight: 500; }
.urm-more { color: var(--text3); font-size: 13px; font-weight: 600; padding: 8px 0 0; list-style: none; text-align: center; }
.urm-cta { width: 100%; padding: 16px; border-radius: 14px; font-weight: 700; font-size: 16px; cursor: pointer; border: none; margin-top: 8px; transition: transform 0.1s, opacity 0.1s; background: var(--green); color: #022c22; }
.urm-card--warn .urm-cta { background: var(--red); color: #fff; }
.urm-cta:active { transform: scale(0.97); opacity: 0.9; }
.urm-dismiss { font-size: 13px; font-weight: 600; color: var(--text3); margin: 20px 0 0; cursor: pointer; }
.urm-ici { display: inline-flex; flex-direction: column; border: 1px solid var(--border2); padding: 4px 10px; border-radius: 8px; margin-bottom: 16px; background: rgba(255,255,255,0.03); }
.urm-ici-score { font-size: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.urm-ici-level { font-family: var(--dm); font-size: 15px; font-weight: 800; color: #fff; line-height: 1.1; margin-top: 2px; }
.urm-ici--excellent .urm-ici-level { color: var(--green); }
.urm-ici--good .urm-ici-level { color: var(--blue); }
.urm-ici--attention .urm-ici-level { color: var(--amber); }
.urm-ici--risk .urm-ici-level { color: var(--red); }
.urm-ici--critical .urm-ici-level { color: #fff; text-shadow: 0 0 10px var(--red); }

/* ==========================================================================
/* ==========================================================================
   AUDIO PLAYER — TachoAudioPlayer component
   ========================================================================== */
.audio-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  margin: 0.6rem 0;
}
.ap-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--blue, #0A84FF);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ap-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.10);
  border-radius: 2px;
  overflow: hidden;
}
.ap-bar {
  height: 100%;
  background: var(--blue, #0A84FF);
  border-radius: 2px;
  transition: width 0.2s linear;
}
.ap-time  { font-family: var(--dm, monospace); font-size: 0.72rem; color: var(--text2, #8A8A96); white-space: nowrap; }
.ap-label { font-size: 0.72rem; color: var(--text2, #8A8A96); white-space: nowrap; }

/* ==========================================================================
   TODAY BLOCK — generic card container (10B)
   ========================================================================== */
.today-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1rem 0.85rem;
  margin: 0.75rem 0;
}
.today-block.tblock--warning { border-color: var(--amber); }
.today-block.tblock--critical { border-color: var(--red); }

.tblock-title {
  font-family: var(--df);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 0.5rem;
}
.tblock-value {
  font-family: var(--df);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.tblock-sub {
  font-size: 0.78rem;
  color: var(--text2);
}
.tblock-debt {
  font-size: 0.78rem;
  color: var(--amber);
  margin-top: 0.4rem;
}

/* Block 3 — Balance bars */
.bal-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.bal-label {
  font-size: 0.72rem;
  color: var(--text2);
  width: 100px;
  flex-shrink: 0;
}
.bal-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.bal-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.bal-bar--safe    { background: var(--green); }
.bal-bar--warning { background: var(--amber); }
.bal-bar--danger  { background: var(--red); }
.bal-value {
  font-family: var(--dm);
  font-size: 0.68rem;
  color: var(--text2);
  width: 64px;
  text-align: right;
  flex-shrink: 0;
}
.bal-value--warning { color: var(--amber); }
.bal-value--danger  { color: var(--red); }

/* ==========================================================================
   DATA ANCHOR BAR — DDD sync status indicator (10A.3)
   ========================================================================== */
.data-anchor-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  margin: 0.5rem 0 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.78rem;
  color: var(--text2);
}
.dab-icon  { font-size: 0.75rem; flex-shrink: 0; }
.dab-label { line-height: 1.2; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (min-width: 430px) {
  .bnav, .bottom-nav {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ==========================================================================
   T-20 v10: DASHBOARD HOJE
   ========================================================================== */
.screen-today { padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: 100vh; padding-bottom: 100px; }

.td-card-header { display: flex; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.td-card-info { display: flex; align-items: center; gap: 12px; }
.td-card-indicator { width: 10px; height: 10px; border-radius: 50%; background: var(--text3); box-shadow: 0 0 8px rgba(0,0,0,0.5); }
.td-card-indicator.active { background: var(--green); box-shadow: 0 0 12px rgba(16,185,129,0.5); }
.td-card-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.td-card-sub { font-size: 12px; color: var(--text3); }

.ici-wrap { position: relative; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.ici-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ici-track { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 6; }
.ici-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s ease-out; }
.ici-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ici-num { font-size: 18px; font-weight: 800; font-family: var(--dm, sans-serif); line-height: 1; }
.ici-label { font-size: 9px; font-weight: 700; color: var(--text3); margin-top: 1px; }

.td-alert-banner { display: flex; align-items: center; gap: 10px; background: rgba(239, 68, 68, 0.1); border: 1px solid var(--red); color: var(--red); padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; animation: pulse-alert 2s infinite; }
@keyframes pulse-alert { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } 50% { box-shadow: 0 0 0 4px rgba(239,68,68,0.2); } }

.td-session-btn { width: 100%; height: 60px; border-radius: 16px; font-size: 16px; font-weight: 800; text-transform: uppercase; font-family: var(--dm, sans-serif); border: none; cursor: pointer; transition: transform 0.1s, opacity 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 16px rgba(0,0,0,0.2); }
.td-session-btn:active { transform: scale(0.97); }
.td-session-btn.inactive { background: var(--green); color: #000; box-shadow: 0 8px 24px rgba(16,185,129,0.2); }
.td-session-btn.active { background: transparent; border: 2px solid var(--red); color: var(--red); }

.td-metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.td-mc { background: var(--elevated); border-radius: 16px; padding: 16px; position: relative; display: flex; flex-direction: column; border: 1px solid var(--border2); }
.td-mc-dot { position: absolute; top: 16px; right: 16px; width: 6px; height: 6px; border-radius: 50%; }
.td-mc-dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.td-mc-dot-amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.td-mc-dot-blue { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.td-mc-dot-grey { background: var(--text3); }
.td-mc-label { font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: 0.05em; margin-bottom: 8px; font-family: var(--dm, sans-serif); text-transform: uppercase; }
.td-mc-clock { font-size: 28px; font-weight: 800; font-family: var(--dm, sans-serif); color: var(--text); margin-bottom: 4px; line-height: 1; letter-spacing: -0.02em; }
.td-mc-clock--sm { font-size: 20px; }
.td-mc-sub { font-size: 11px; color: var(--text2); }

/* metric card warn state (break < 30min) */
.td-mc--warn {
  border-color: rgba(239,68,68,0.32);
  background: rgba(239,68,68,0.04);
}
.td-mc--warn .td-mc-clock { color: var(--red); }

/* session button — bump min-height, Inter font */
.td-session-btn {
  min-height: 56px;
  height: 60px;
  font-family: 'Inter', var(--dm, sans-serif);
  font-size: 15px;
  letter-spacing: 0.08em;
}
.td-session-btn.inactive {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 8px 28px rgba(16,185,129,0.25);
}
.td-session-btn.active {
  background: rgba(239,68,68,0.06);
  border: 1.5px solid var(--red);
  color: var(--red);
  box-shadow: 0 0 0 0 rgba(239,68,68,0);
}

/* ── Saldos da Semana ──────────────────────────────────────────────────── */
.td-balances {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 16px 4px;
}

.td-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-family: 'Inter', sans-serif;
}

.td-bal-row { margin-bottom: 12px; }

.td-bal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.td-bal-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.td-bal-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  font-family: var(--dm, 'JetBrains Mono', monospace);
}
.td-bal-value--danger  { color: var(--red);   }
.td-bal-value--warning { color: var(--amber); }

/* barra grossa arredondada */
.td-bal-track {
  height: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}

.td-bal-bar {
  height: 100%;
  border-radius: 10px;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.td-bal-bar--safe    { background: linear-gradient(90deg, #10B981, #059669); }
.td-bal-bar--warning { background: linear-gradient(90deg, #F59E0B, #D97706); }
.td-bal-bar--danger  { background: linear-gradient(90deg, #EF4444, #DC2626); }

/* ── Infrações ─────────────────────────────────────────────────────────── */
.td-infractions {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.22);
  border-radius: 16px;
  padding: 14px 16px;
}

.td-infractions--critical {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.22);
}

.td-inf-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.td-inf-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245,158,11,0.12);
  color: var(--amber);
  flex-shrink: 0;
}

.td-infractions--critical .td-inf-icon-wrap {
  background: rgba(239,68,68,0.12);
  color: var(--red);
}

.td-inf-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
  font-family: 'Inter', sans-serif;
}

.td-infractions--critical .td-inf-title { color: var(--red); }

.td-inf-link {
  background: none;
  border: 1px solid var(--border2);
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s, border-color 0.15s;
  font-family: 'Inter', sans-serif;
}
.td-inf-link:active { color: var(--text); border-color: var(--border2); }

.td-inf-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ── Repouso Semanal ───────────────────────────────────────────────────── */
.td-rest-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.td-rest-block--warning  { border-color: rgba(245,158,11,0.30); }
.td-rest-block--critical {
  border-color: rgba(239,68,68,0.32);
  background: rgba(239,68,68,0.04);
}

.td-rest-deadline {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-family: 'Inter', sans-serif;
}

.td-rest-type {
  font-size: 12px;
  color: var(--text2);
  font-weight: 400;
}

.td-rest-debt {
  font-size: 12px;
  color: var(--amber);
  font-weight: 600;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(245,158,11,0.08);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
}

/* ── Data Anchor Bar ───────────────────────────────────────────────────── */
.td-anchor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.td-anchor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.td-anchor-label {
  flex: 1;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}

.td-anchor-sync {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.td-anchor-sync:active { color: var(--text); }

/* ── Feedback do Dia ───────────────────────────────────────────────────── */
.td-feedback {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.td-feedback-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text2);
  font-weight: 400;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}

/* nav labels — minúsculas e subtis (Inter) */
.ni-lb, .nav-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: lowercase;
}

/* ==========================================================================
   T-30 v10: COPILOT CONVERSACIONA
   ========================================================================== */
/* screen-copilot: fill screen-container exactly, clip overflow so messages div scrolls */
.screen-copilot { display: flex; flex-direction: column; height: 100%; overflow: hidden; padding-bottom: 0; }
/* screen-container must not scroll when copilot is active — messages div handles scroll */
.screen-container:has(.screen-copilot) { overflow: hidden; padding: 0; }

.cp-header { padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); background: rgba(18,18,18,0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.cp-avatar-header { width: 40px; height: 40px; border-radius: 50%; background: var(--elevated); display: flex; align-items: center; justify-content: center; color: var(--green); border: 1px solid var(--border2); }
.cp-header-info { display: flex; flex-direction: column; gap: 2px; }
.cp-header-name { font-size: 16px; font-weight: 700; color: var(--text); font-family: var(--db, sans-serif); }
.cp-header-status { font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 6px; }
.cp-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: copilot-pulse 2s infinite; }
@keyframes copilot-pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); } 50% { opacity: 0.4; box-shadow: 0 0 0 transparent; } }

.copilot-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; justify-content: flex-end; }

.cp-row { display: flex; gap: 10px; align-items: flex-end; width: 100%; }
.cp-row-user { flex-direction: row-reverse; }
.cp-row-assistant { flex-direction: row; }

.cp-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--elevated); display: flex; align-items: center; justify-content: center; color: var(--green); border: 1px solid var(--border2); flex-shrink: 0; margin-bottom: 18px; }

.cp-bubble { max-width: 80%; padding: 14px 16px; border-radius: 20px; font-size: 15px; line-height: 1.5; color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,0.1); position: relative; }
.cp-bubble-assistant { background: var(--elevated); border-bottom-left-radius: 4px; border: 1px solid var(--border2); }
.cp-bubble-user { background: var(--green); color: #022c22; border-bottom-right-radius: 4px; font-weight: 500; }

.cp-bubble-text strong { font-weight: 700; }
.cp-code-badge { background: rgba(255,255,255,0.1); padding: 2px 6px; border-radius: 6px; font-family: var(--dm, monospace); font-size: 12px; font-weight: 700; border: 1px solid rgba(255,255,255,0.2); vertical-align: baseline; }
.cp-bubble-user .cp-code-badge { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.2); color: #000; }

.cp-bubble-time { font-size: 10px; color: var(--text3); margin-top: 6px; text-align: right; opacity: 0.7; }
.cp-bubble-user .cp-bubble-time { color: rgba(2, 44, 34, 0.6); }
.cp-row-assistant .cp-bubble-time { text-align: left; }

.copilot-input-area { padding: 12px 16px; background: rgba(18,18,18,0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }

.cp-chips-wrap { display: flex; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -ms-overflow-style: none; }
.cp-chips-wrap::-webkit-scrollbar { display: none; }
.cp-chips-row { display: flex; gap: 8px; padding-right: 20px; }
.cp-chip { background: transparent; border: 1px solid var(--border2); color: var(--text2); padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: all 0.2s; }
.cp-chip:active { transform: scale(0.95); background: rgba(255,255,255,0.05); }

/* ── Formatting badges inside Copilot bubbles ──────────────────────────── */

/* Infraction codes: WRD_01, BRK_01 */
.cp-code-badge {
  display: inline-block;
  background: rgba(239,68,68,0.12);
  color: var(--red);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--dm, 'JetBrains Mono', monospace);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(239,68,68,0.25);
  vertical-align: baseline;
  letter-spacing: 0.03em;
}

/* Article refs: Art. 7, Art. 8(1) */
.cp-law-badge {
  display: inline-block;
  background: rgba(16,185,129,0.10);
  color: var(--green);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--dm, 'JetBrains Mono', monospace);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(16,185,129,0.22);
  vertical-align: baseline;
}

/* CE regulation refs: CE 561/2006 */
.cp-reg-badge {
  display: inline-block;
  background: rgba(59,130,246,0.10);
  color: var(--blue);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--dm, 'JetBrains Mono', monospace);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(59,130,246,0.22);
  vertical-align: baseline;
}

/* Action buttons inside assistant bubble */
.cp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cp-action-btn {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.22);
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.cp-action-btn:active { background: rgba(16,185,129,0.16); }

/* user bubble: code badges inherit dark style */
.cp-bubble-user .cp-code-badge {
  background: rgba(0,0,0,0.12);
  border-color: rgba(0,0,0,0.18);
  color: #022c22;
}

.copilot-input-row { display: flex; align-items: flex-end; gap: 10px; background: var(--elevated); border: 1px solid var(--border2); border-radius: 24px; padding: 4px 4px 4px 16px; transition: border-color 0.2s; }
.copilot-input-row:focus-within { border-color: rgba(16,185,129,0.5); }
.copilot-input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 15px; padding: 12px 0; resize: none; max-height: 120px; outline: none; line-height: 1.4; }
.copilot-input::placeholder { color: var(--text3); }
.copilot-send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #022c22; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.1s; flex-shrink: 0; }
.copilot-send-btn:active { transform: scale(0.9); }
.copilot-send-btn:disabled { background: var(--border2); color: var(--text3); cursor: not-allowed; }

.copilot-alerts { padding: 12px 20px 0; display: flex; flex-direction: column; gap: 8px; }
.cp-alert-banner { display: flex; align-items: center; gap: 12px; background: rgba(239, 68, 68, 0.1); border: 1px solid var(--red); color: var(--red); padding: 12px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cp-alert-banner span { flex: 1; }

/* ==========================================================================
   INFRACTIONS v10 — Modern Spatial Dark UI
   ========================================================================== */

/* ── Empty & Clean States ─────────────────────────────────────────────────── */
.inf-empty, .inf-clean {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 48px 24px 32px;
}
.inf-empty-icon, .inf-clean-icon {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.inf-empty-icon { background: rgba(255,255,255,0.04); color: var(--text3); border: 1px solid var(--border2); }
.inf-clean-icon  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(16,185,129,0.22); }
.inf-empty-title, .inf-clean-title {
  font-size: 20px; font-weight: 800; color: var(--text);
  font-family: var(--df, sans-serif); margin-bottom: 8px;
}
.inf-clean-title { color: var(--green); }
.inf-empty-desc, .inf-clean-body {
  font-size: 14px; color: var(--text2); line-height: 1.6; max-width: 280px;
}
.inf-clean-meta { font-size: 12px; color: var(--text3); margin-bottom: 12px; }
.inf-clean-badge {
  margin-top: 16px; padding: 8px 16px;
  background: var(--green-dim); border: 1px solid rgba(16,185,129,0.22);
  border-radius: 20px; font-size: 13px; font-weight: 600; color: var(--green);
}

/* ── CTA Buttons ──────────────────────────────────────────────────────────── */
.inf-footer { display: flex; flex-direction: column; gap: 8px; padding: 16px 0 8px; }
.inf-cta-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #022c22;
  border: none; border-radius: 14px; padding: 0 20px; height: 52px;
  font-family: var(--df, sans-serif); font-size: 15px; font-weight: 700;
  letter-spacing: 0.04em; cursor: pointer;
  transition: opacity 0.15s; width: 100%;
}
.inf-cta-btn:active { opacity: 0.82; }
.inf-cta-icon { display: flex; align-items: center; }
.inf-ghost-btn {
  background: transparent; border: 1px solid var(--border2); color: var(--text2);
  border-radius: 14px; padding: 13px; font-family: var(--df, sans-serif);
  font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
  transition: border-color 0.15s;
}
.inf-ghost-btn:active { border-color: var(--border2); background: rgba(255,255,255,0.03); }

/* ── Meta Row ─────────────────────────────────────────────────────────────── */
.inf-meta-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 0 12px; font-size: 12px; color: var(--text2);
}
.inf-meta-name { font-weight: 700; color: var(--text); }
.inf-meta-sep  { color: var(--text3); }
.inf-meta-days, .inf-meta-date { color: var(--text2); }

/* ── Period Filter ────────────────────────────────────────────────────────── */
.inf-filter-row {
  display: flex; gap: 6px; margin-bottom: 14px;
  overflow-x: auto; padding-bottom: 2px; scrollbar-width: none;
}
.inf-filter-row::-webkit-scrollbar { display: none; }
.inf-filter-btn {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text2); cursor: pointer;
  font-family: var(--df, sans-serif); font-size: 13px; font-weight: 700;
  letter-spacing: 0.03em; transition: all 0.2s; white-space: nowrap;
}
.inf-filter-btn--on { background: var(--green); border-color: var(--green); color: #022c22; }
.inf-filter-sub { font-size: 9px; opacity: 0.7; margin-left: 4px; }

/* ── Progress Card ────────────────────────────────────────────────────────── */
.inf-prog-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 12px;
}
.inf-prog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.inf-prog-label  { font-family: var(--df, sans-serif); font-size: 11px; letter-spacing: 1.5px; color: var(--text2); }
.inf-prog-value  { font-family: var(--dm, monospace); font-size: 13px; }
.inf-prog-value.inf-prog--danger { color: var(--red); }
.inf-prog-value.inf-prog--warn   { color: var(--amber); }
.inf-prog-value.inf-prog--safe   { color: var(--green); }
.inf-prog-track  { height: 6px; background: var(--elevated); border-radius: 3px; overflow: hidden; }
.inf-prog-bar    { height: 100%; border-radius: 3px; transition: width 0.5s cubic-bezier(0.4,0,0.2,1); }
.inf-prog-bar.inf-prog--danger { background: var(--red); }
.inf-prog-bar.inf-prog--warn   { background: var(--amber); }
.inf-prog-bar.inf-prog--safe   { background: var(--green); }
.inf-prog-footer { display: flex; justify-content: space-between; margin-top: 5px; font-size: 11px; color: var(--text2); }

/* ── Risk Card ────────────────────────────────────────────────────────────── */
.inf-risk-card {
  background: rgba(239,68,68,0.07); border: 1px solid rgba(239,68,68,0.25);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 14px;
}
.inf-risk-amount { text-align: center; min-width: 80px; }
.inf-risk-lbl    { font-size: 9px; color: var(--text2); letter-spacing: 1px; margin-bottom: 2px; text-transform: uppercase; }
.inf-risk-val    { font-family: var(--dm, monospace); font-size: 18px; font-weight: 700; color: var(--red); }
.inf-risk-desc   { font-size: 12px; color: var(--text2); line-height: 1.5; flex: 1; }

/* ── Contextual Message ───────────────────────────────────────────────────── */
.inf-context-msg {
  display: flex; align-items: flex-start; gap: 10px;
  border-left: 3px solid; border-radius: 0 12px 12px 0;
  padding: 10px 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--text); line-height: 1.5;
}
.inf-context-msg--critical { background: rgba(239,68,68,0.07); border-color: var(--red); }
.inf-context-msg--warn     { background: rgba(245,158,11,0.07); border-color: var(--amber); }
.inf-context-icon { display: flex; align-items: center; margin-top: 1px; flex-shrink: 0; }
.inf-context-msg--critical .inf-context-icon { color: var(--red); }
.inf-context-msg--warn     .inf-context-icon { color: var(--amber); }

/* ── Infraction Card inline icons ─────────────────────────────────────────── */
.infraction-card-period, .infraction-card-legal {
  display: flex; align-items: center; gap: 5px;
}
.inf-ic-icon { display: flex; align-items: center; opacity: 0.55; }

/* ── screen-infractions padding ──────────────────────────────────────────── */
.screen-infractions { padding: 16px; display: flex; flex-direction: column; gap: 0; }

/* ==========================================================================
   T-30: HISTÓRICO — hs-* helpers
   ========================================================================== */

/* Infraction count card — column layout variant */
.ib--col        { flex-direction: column; align-items: stretch; }
.ib-header      { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ib-badges      { display: flex; gap: 6px; flex-wrap: wrap; }
.ml-auto        { margin-left: auto; }

/* Stat card — danger value */
.mv--danger     { color: var(--red); }

/* Day-bars section separator */
.hwh--sep       { margin-top: 18px; }

/* Infraction row inner layout */
.irow-body      { display: flex; align-items: center; gap: 10px; }

/* Empty state icon */
.hs-empty-icon  { color: var(--text3); margin-bottom: 16px; display: flex; }
.hs-empty-p     { color: var(--text3); font-size: 13px; margin: 8px 0 16px; line-height: 1.5; }

/* Sync CTA card */
.hs-cta-box     { flex-direction: column; align-items: center; padding: 24px !important; text-align: center; }
.hs-cta-icon    { color: var(--text3); margin-bottom: 8px; display: flex; }
.hs-cta-desc    { color: var(--text2); font-size: 14px; margin-bottom: 16px; line-height: 1.5; }
.hs-cta-btn     {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #022c22; border: none;
  border-radius: 14px; padding: 0 20px; height: 52px;
  font-size: 16px; font-weight: 700; cursor: pointer; width: 100%;
}

/* Error state override */
.hs-err         { padding: 40px; text-align: center; color: var(--text2); }

/* ==========================================================================
   T-41: UPLOAD — wow-* popup + up-* helpers
   ========================================================================== */

/* Upload progress separator */
.up-progress--sep { margin-top: 12px; }

/* WOW Popup overlay (replaces overlay.style.cssText) */
.wow-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.4s ease;
}

/* WOW popup card */
.wow-popup {
  width: 100%; max-width: 400px;
  background: linear-gradient(160deg,#1a0005 0%,#0F0F14 60%);
  border: 1.5px solid rgba(255,69,58,0.6);
  border-radius: 24px; padding: 28px 22px 22px;
  box-shadow: 0 0 60px rgba(255,69,58,0.3), 0 0 120px rgba(255,69,58,0.1);
  transform: scale(0.88); transition: transform 0.4s cubic-bezier(.34,1.56,.64,1);
}

/* Icon */
.wow-icon-center { text-align: center; margin-bottom: 4px; }
.wow-icon-ring {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(255,69,58,0.15); border: 2px solid rgba(255,69,58,0.5);
  color: var(--red);
  animation: wowPulse 1s ease-in-out infinite;
}
@keyframes wowPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,69,58,0.4); }
  50%      { box-shadow: 0 0 0 12px rgba(255,69,58,0); }
}

/* Title block */
.wow-title-block { text-align: center; margin: 14px 0 6px; }
.wow-eyebrow     { font-family: var(--df); font-size: 13px; letter-spacing: 3px; color: var(--red); font-weight: 700; margin-bottom: 6px; }
.wow-name        { font-family: var(--df); font-size: 28px; font-weight: 900; color: #fff; line-height: 1.1; }
.wow-count       { font-family: var(--df); font-size: 52px; font-weight: 900; color: var(--red); line-height: 1; margin: 4px 0; }
.wow-inf-label   { font-family: var(--df); font-size: 22px; font-weight: 700; color: #fff; opacity: 0.85; }

/* Severity bar */
.wow-sev-bar        { display: flex; gap: 8px; margin: 16px 0; justify-content: center; flex-wrap: wrap; }
.wow-sev-badge      { border-radius: 10px; padding: 6px 14px; text-align: center; }
.wow-sev-badge--msi { background: rgba(255,69,58,0.2);   border: 1px solid var(--red); }
.wow-sev-badge--vsi { background: rgba(255,159,10,0.15); border: 1px solid var(--amber); }
.wow-sev-badge--si  { background: rgba(255,204,0,0.1);   border: 1px solid #FFCC00; }
.wow-sev-num        { font-size: 20px; font-weight: 900; }
.wow-sev-badge--msi .wow-sev-num { color: var(--red); }
.wow-sev-badge--vsi .wow-sev-num { color: var(--amber); }
.wow-sev-badge--si  .wow-sev-num { color: #FFCC00; }
.wow-sev-code       { font-size: 10px; letter-spacing: 1px; }
.wow-sev-badge--msi .wow-sev-code { color: var(--red); }
.wow-sev-badge--vsi .wow-sev-code { color: var(--amber); }
.wow-sev-badge--si  .wow-sev-code { color: #FFCC00; }
.wow-sev-sublabel   { font-size: 9px; color: var(--text2); }

/* Fine estimate */
.wow-fine-box    { background: rgba(255,69,58,0.08); border: 1px solid rgba(255,69,58,0.3); border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; text-align: center; }
.wow-fine-label  { font-size: 11px; color: var(--text2); letter-spacing: 1px; margin-bottom: 4px; }
.wow-fine-amount { font-family: var(--dm); font-size: 28px; font-weight: 700; color: var(--red); }
.wow-fine-basis  { font-size: 11px; color: var(--text2); margin-top: 2px; }

/* Urgency message */
.wow-urgency      { background: rgba(255,159,10,0.08); border-left: 3px solid var(--amber); border-radius: 0 10px 10px 0; padding: 10px 14px; margin-bottom: 18px; }
.wow-urgency-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.wow-urgency-icon { display: inline-flex; vertical-align: middle; margin-right: 4px; color: var(--amber); }
.wow-urgency-strong { color: var(--amber); }

/* CTA buttons */
.wow-btn-primary {
  width: 100%; padding: 16px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--red); color: #fff;
  font-family: var(--df); font-size: 18px; font-weight: 800; letter-spacing: 1px;
  margin-bottom: 10px; box-shadow: 0 4px 20px rgba(255,69,58,0.5);
}
.wow-btn-secondary {
  width: 100%; padding: 12px; border-radius: 14px;
  border: 1px solid var(--border2); cursor: pointer;
  background: transparent; color: var(--text2);
  font-family: var(--df); font-size: 15px; font-weight: 600;
}

/* T-40: SYNC — section label spacing */
.sy-section-label--mt { margin-top: 18px; }

/* T-42: USB — header spacer and SVG icon helpers */
.usb-header-spacer { width: 32px; flex-shrink: 0; }
.usb-done-icon     { display: flex; align-items: center; justify-content: center; color: var(--green); margin-bottom: 12px; }
.usb-btn-icon      { display: inline-flex; vertical-align: middle; margin-right: 6px; }

/* T-70: SETTINGS — spacing and separator helpers */
.sfield--mb   { margin-bottom: 8px; }
.slbl--mt10   { margin-top: 10px; }
.slbl--mt20   { margin-top: 20px; }
.svbtn--mt    { margin-top: 14px; }
.arow--sep    { border-bottom: 1px solid var(--border); }

/* T-60: INFRACTIONS — empty period state and detail label */
.inf-empty-period       { text-align: center; padding: 30px; background: var(--card); border-radius: 16px; color: var(--text2); }
.inf-empty-period-icon  { display: flex; align-items: center; justify-content: center; margin-bottom: 8px; color: var(--green); }
.inf-empty-period-title { font-family: var(--df); font-size: 16px; font-weight: 700; color: var(--green); }
.inf-empty-period-meta  { font-size: 13px; margin-top: 6px; }
.inf-detail-label       { font-family: var(--df); font-size: 11px; letter-spacing: 1.5px; color: var(--text2); margin-bottom: 8px; }

/* ==========================================================================
   ONBOARDING PREMIUM — T-01/T-04
   Tunnel mode, carrossel de valor, idioma auto-advance, saudação live
   ========================================================================== */

/* ── Tunnel mode: oculta shell durante o onboarding ──────────────────────── */
body.ob-tunnel-active #sbar,
body.ob-tunnel-active #app-hdr,
body.ob-tunnel-active #bottom-nav { display: none !important; }

body.ob-tunnel-active .screen-container {
  height: 100svh;
  max-height: 100svh;
  overflow-y: auto;
}

/* ── Animação de entrada por ecrã ────────────────────────────────────────── */
.ob-step-wrap { height: 100%; }

.ob-step-enter {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.ob-step-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Base do ecrã ─────────────────────────────────────────────────────────── */
.ob-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 0 24px 28px;
  background: #09090b; /* zinc-950 sólido */
  box-sizing: border-box;
}

/* ── Tipografia partilhada ────────────────────────────────────────────────── */
.ob-title {
  font-family: var(--df);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 10px;
}
.ob-sub {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.55;
  max-width: 260px;
  margin: 0;
}
.ob-sub--wide { max-width: 300px; }

/* ── Step dots (progresso entre ecrãs) ───────────────────────────────────── */
.ob-step-indicator {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}
.ob-sdot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #333;
  transition: all 0.25s ease;
}
.ob-sdot--active {
  width: 18px;
  border-radius: 3px;
  background: var(--green);
}
.ob-sdot--done { background: rgba(0,232,122,0.35); }

/* ── ECRÃ 1 — IDIOMA ──────────────────────────────────────────────────────── */
.ob-screen--lang {
  justify-content: space-between;
  padding-top: 64px;
}
.ob-lang-top { margin-bottom: 36px; }

.ob-wordmark {
  font-family: var(--df);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  opacity: 0.8;
  margin-bottom: 24px;
}

.ob-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
}

.ob-lang-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px;
  background: #111113;
  border: 1.5px solid #222;
  border-radius: 18px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  -webkit-user-select: none;
  user-select: none;
}
.ob-lang-btn:active { transform: scale(0.96); }
.ob-lang-flag { font-size: 28px; line-height: 1; }
.ob-lang-label {
  font-family: var(--df);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  transition: color 0.2s;
}
.ob-lang-btn--active {
  border-color: var(--green);
  background: rgba(0,232,122,0.06);
}
.ob-lang-btn--active .ob-lang-label { color: var(--green); }

/* Flash de seleção */
@keyframes obLangFlash {
  0%   { box-shadow: 0 0 0 0 rgba(0,232,122,0.5); }
  60%  { box-shadow: 0 0 0 10px rgba(0,232,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,232,122,0); }
}
.ob-lang-btn--flash { animation: obLangFlash 0.45s ease-out forwards; }

/* ── ECRÃ 2 — CARROSSEL ───────────────────────────────────────────────────── */
.ob-screen--carousel {
  padding: 0;
  justify-content: space-between;
  overflow: hidden;
}

.ob-carousel {
  flex: 1;
  overflow: hidden;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}
.ob-carousel:active { cursor: grabbing; }

.ob-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.ob-slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 32px 32px 16px;
  text-align: center;
  box-sizing: border-box;
}

.ob-slide-art {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ob-slide-copy { max-width: 300px; }

.ob-slide-title {
  font-family: var(--df);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.ob-slide-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
}

/* Dots do carrossel */
.ob-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.ob-cdot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  transition: all 0.25s ease;
}
.ob-cdot--active {
  width: 22px;
  border-radius: 3.5px;
  background: var(--green);
}

/* Botão COMEÇAR */
.ob-start-btn {
  width: calc(100% - 48px);
  margin: 0 24px;
  padding: 18px;
  border-radius: 16px;
  border: none;
  font-family: var(--df);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.15s, background 0.3s, box-shadow 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-start-btn--locked {
  background: #222;
  color: #444;
  pointer-events: none;
  box-shadow: none;
}
.ob-start-btn--ready {
  background: var(--green);
  color: #000;
  box-shadow: 0 4px 24px rgba(0,232,122,0.35);
  pointer-events: auto;
}
.ob-start-btn--ready:active { transform: scale(0.97); }

.ob-carousel-footer {
  padding: 0 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ── ECRÃ 3 — PERFIL ──────────────────────────────────────────────────────── */
.ob-screen--profile {
  padding-top: 56px;
  justify-content: space-between;
}
.ob-profile-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.ob-input-wrap { margin-top: 28px; }
.ob-input {
  width: 100%;
  padding: 18px 20px;
  background: #111113;
  border: 1.5px solid #2a2a2e;
  border-radius: 16px;
  font-family: var(--df);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.25s;
  caret-color: var(--green);
}
.ob-input::placeholder { color: #3a3a44; }
.ob-input:focus { border-color: rgba(0,232,122,0.4); }

.ob-greeting {
  font-family: var(--df);
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  margin-top: 16px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  min-height: 32px;
}
.ob-greeting--visible { opacity: 1; transform: translateY(0); }

.ob-profile-footer { padding-bottom: 4px; }

/* ── ECRÃ 4 — NOTIFICAÇÕES ────────────────────────────────────────────────── */
.ob-screen--notif {
  padding-top: 52px;
  align-items: center;
  text-align: center;
  justify-content: space-between;
}
.ob-notif-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.ob-notif-art { margin-bottom: 4px; }

.ob-notif-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ── Botões partilhados ────────────────────────────────────────────────────── */
.ob-primary-btn {
  width: 100%;
  padding: 18px;
  border-radius: 16px;
  border: none;
  background: var(--green);
  color: #000;
  font-family: var(--df);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0,232,122,0.3);
}
.ob-primary-btn:active { transform: scale(0.97); }

.ob-primary-btn--amber {
  background: var(--amber);
  color: #000;
  box-shadow: 0 4px 20px rgba(255,159,10,0.3);
}

.ob-btn-icon {
  display: flex;
  align-items: center;
}

.ob-skip-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-family: var(--db);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s;
}
.ob-skip-btn:hover { color: var(--text2); }

/* ── TODAY: Directed empty state (primeira visita após onboarding) ─────────── */
.td-first-cta {
  background: linear-gradient(135deg, rgba(0,232,122,0.06) 0%, rgba(0,232,122,0.02) 100%);
  border: 1px solid rgba(0,232,122,0.2);
  border-radius: 20px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 16px;
}
.td-first-cta-title {
  font-family: var(--df);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.td-first-cta-sub {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  max-width: 240px;
}
.td-first-cta-btn {
  margin-top: 8px;
  padding: 14px 28px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 14px;
  font-family: var(--df);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s;
}
.td-first-cta-btn:active { transform: scale(0.96); }

/* Animação de pulsar */
@keyframes obPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,232,122,0.4); }
  50%       { box-shadow: 0 0 0 10px rgba(0,232,122,0); }
}
.td-first-cta-btn { animation: obPulse 2s ease-in-out infinite; }

/* ==========================================================================
   FISCAL VIRTUAL — T-80
   ========================================================================== */
.td-fiscal {
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.td-fiscal--clear       { background: rgba(0,232,122,0.06);  border-color: rgba(0,232,122,0.18); }
.td-fiscal--warn        { background: rgba(255,159,10,0.06); border-color: rgba(255,159,10,0.18); }
.td-fiscal--risk        { background: rgba(255,69,58,0.06);  border-color: rgba(255,69,58,0.18); }

.fiscal-header          { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.fiscal-titles          { flex: 1; }
.fiscal-label           { font-family: var(--df); font-size: 11px; font-weight: 600;
                          letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3);
                          margin-bottom: 4px; }
.fiscal-verdict         { font-size: 13px; color: var(--text); line-height: 1.45; }

.fiscal-finding         { display: flex; gap: 8px; font-size: 12px; padding: 6px 0;
                          border-bottom: 1px solid var(--border); }
.fiscal-finding:last-child { border-bottom: none; }
.finding-icon           { font-family: var(--dm); font-weight: 700; width: 14px; flex-shrink: 0; }
.finding--ok .finding-icon        { color: var(--green); }
.finding--explain .finding-icon   { color: var(--amber); }
.finding--violation .finding-icon { color: var(--red); }


/* ==========================================================================
   REPORTS SCREEN — T-60
   ========================================================================== */
.screen-reports     { display: flex; flex-direction: column; gap: 0; padding: 0; }

.rp-tabs            { display: flex; gap: 8px; padding: 0 16px 16px; }
.rp-tab             { flex: 1; padding: 8px 0; border-radius: 12px; border: 1.5px solid var(--border2);
                      background: var(--card); color: var(--text2); font-family: var(--df);
                      font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
                      text-transform: uppercase; cursor: pointer; transition: all 0.15s; }
.rp-tab--active     { background: var(--elevated); border-color: var(--green);
                      color: var(--text); }

.rp-content         { padding: 0 16px 28px; }

.rp-summary         { display: flex; align-items: center; gap: 10px;
                      background: var(--card); border-radius: 14px;
                      padding: 14px 16px; margin-bottom: 12px; }
.rp-avg             { font-size: 13px; color: var(--text2); flex: 1; }
.rp-avg strong      { color: var(--text); font-family: var(--df); font-size: 20px; font-weight: 700; }
.rp-trend           { font-family: var(--dm); font-size: 18px; font-weight: 700; }
.rp-trend--up       { color: var(--green); }
.rp-trend--down     { color: var(--red); }
.rp-trend--stable   { color: var(--text3); }

.rp-days            { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.rp-day             { display: flex; align-items: center; gap: 10px;
                      padding: 10px 14px; background: var(--card); border-radius: 12px;
                      font-size: 13px; }
.rp-day--empty      { opacity: 0.45; }
.rp-day-date        { font-family: var(--dm); font-size: 12px; color: var(--text2); width: 36px; flex-shrink: 0; }
.rp-day-clean       { font-size: 12px; color: var(--green); margin-left: auto; }
.rp-day-inf         { font-size: 12px; color: var(--amber); margin-left: auto; }
.rp-day-nodata      { font-size: 12px; color: var(--text3); margin-left: auto; }
.rp-day-audio       { font-size: 14px; flex-shrink: 0; }

/* ICI badges — reuse existing ici-badge but also provide rp-specific if needed */
.ici-badge          { font-family: var(--dm); font-size: 11px; font-weight: 600;
                      padding: 2px 8px; border-radius: 6px; flex-shrink: 0; }
.ici-badge--excellent { background: rgba(0,232,122,0.12); color: var(--green); }
.ici-badge--good      { background: rgba(0,232,122,0.08); color: var(--green); }
.ici-badge--attention { background: rgba(255,159,10,0.12); color: var(--amber); }
.ici-badge--risk      { background: rgba(255,69,58,0.10); color: var(--red); }
.ici-badge--critical  { background: rgba(255,69,58,0.18); color: var(--red); }

.rp-section-label   { font-family: var(--df); font-size: 11px; font-weight: 600;
                      letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3);
                      margin-bottom: 10px; }
.rp-fb-section      { margin-top: 8px; }
.rp-fb-item         { background: var(--card); border-radius: 14px; padding: 14px;
                      margin-bottom: 8px; }
.rp-fb-meta         { display: flex; justify-content: space-between; margin-bottom: 8px; }
.rp-fb-type         { font-family: var(--df); font-size: 11px; font-weight: 600; color: var(--green);
                      text-transform: uppercase; letter-spacing: 0.05em; }
.rp-fb-date         { font-family: var(--dm); font-size: 11px; color: var(--text3); }
.rp-fb-text         { font-size: 13px; color: var(--text2); line-height: 1.55; margin: 0; }
.rp-audio-player    { margin-top: 4px; }

.rp-empty           { text-align: center; padding: 24px; color: var(--text3); font-size: 13px; }

/* ==========================================================================
   LOGIN SCREEN — Passwordless OTP Flow
   ========================================================================== */
.lg-screen {
  min-height: 100dvh;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090B;
  padding: 24px 16px;
  box-sizing: border-box;
}

.lg-card {
  width: 100%;
  max-width: 400px;
  background: #18181B;
  border-radius: 16px;
  border: 1px solid #27272A;
  padding: 40px 32px 36px;
  box-sizing: border-box;
}

/* -- Logo -------------------------------------------------------------------- */
.lg-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}

.lg-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(16, 185, 129, 0.10);
  border-radius: 10px;
  flex-shrink: 0;
}

.lg-logo-name {
  font-size: 18px;
  font-weight: 700;
  color: #F4F4F5;
  letter-spacing: -0.01em;
}

/* -- Typography -------------------------------------------------------------- */
.lg-title {
  font-size: 22px;
  font-weight: 700;
  color: #F4F4F5;
  margin: 0 0 8px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.lg-subtitle {
  font-size: 14px;
  color: #A1A1AA;
  margin: 0 0 28px;
  line-height: 1.55;
}

.lg-subtitle strong {
  color: #D4D4D8;
  font-weight: 600;
}

/* -- Form -------------------------------------------------------------------- */
.lg-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lg-input {
  width: 100%;
  background: #09090B;
  border: 1.5px solid #3F3F46;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  color: #F4F4F5;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.lg-input::placeholder { color: #52525B; }

.lg-input:focus {
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.lg-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* OTP input — large monospace, centred digits */
.lg-input--otp {
  font-family: var(--dm, 'DM Mono', 'Courier New', monospace);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 18px 16px;
  color: #10B981;
  caret-color: #10B981;
}

/* -- Buttons ----------------------------------------------------------------- */
.lg-btn {
  width: 100%;
  padding: 15px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  outline: none;
  box-sizing: border-box;
}

.lg-btn--primary {
  background: #10B981;
  color: #052e16;
  margin-top: 4px;
}

.lg-btn--primary:hover:not(:disabled) { background: #0db577; }
.lg-btn--primary:active:not(:disabled) { background: #0a9e68; }
.lg-btn--primary:disabled { opacity: 0.6; cursor: not-allowed; }

.lg-btn--ghost {
  background: transparent;
  color: #71717A;
  font-size: 13px;
  font-weight: 500;
  padding: 10px;
  margin-top: 6px;
}

.lg-btn--ghost:hover:not(:disabled) { color: #A1A1AA; }
.lg-btn--ghost:disabled { opacity: 0.5; cursor: not-allowed; }

/* -- Loading spinner --------------------------------------------------------- */
.lg-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(5, 46, 22, 0.35);
  border-top-color: #052e16;
  border-radius: 50%;
  animation: lg-spin 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes lg-spin { to { transform: rotate(360deg); } }

/* -- Alerts ------------------------------------------------------------------ */
.lg-alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 6px;
}

.lg-alert--error {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #FCA5A5;
}

/* -- Responsive -------------------------------------------------------------- */
@media (max-width: 420px) {
  .lg-card { padding: 32px 20px 28px; }
  .lg-title { font-size: 20px; }
  .lg-input--otp { font-size: 26px; letter-spacing: 0.2em; }
}
