/* Atlante Quadri — Editorial Tecnico EU (Mobile-First 390x844) */
:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F7FA;
  --bg-dark: #0F172A;
  --text-primary: #111827;
  --text-secondary: #475569;
  --brand: #0B3B6E;
  --brand-hover: #082B52;
  --amber: #D97706;
  --amber-soft: #FEF3C7;
  --amber-text: #92400E;
  --green: #15803D;
  --green-hover: #166534;
  --green-soft: #ECFDF5;
  --red: #B91C1C;
  --red-soft: #FEF2F2;
  --border: #CBD5E1;
  --border-light: #E2E8F0;
  --radius-sm: 6px;
  --radius-md: 8px;
  --font-display: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --header-h: 56px;
  --nav-h: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: var(--font-mono);
}

/* App Shell */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-secondary);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-dark);
  color: var(--bg-primary);
  border-bottom: 2px solid var(--brand);
  height: var(--header-h);
}

.header-inner {
  height: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #CBD5E1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.net-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
}

.net-pill.net-offline {
  background: rgba(217, 119, 6, 0.22);
  border-color: var(--amber);
  color: #FDE68A;
}

.net-pill.net-offline .net-dot {
  background: var(--amber);
}

/* Main Area */
.app-main {
  flex: 1;
  padding: 14px 14px calc(var(--nav-h) + 22px + env(safe-area-inset-bottom, 0px));
  min-width: 0;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.tab-panel.active {
  display: flex;
}

/* Toast */
.toast {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 28px);
  max-width: 480px;
  z-index: 90;
  background: var(--bg-dark);
  color: #FFFFFF;
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.26);
}

.toast.toast-amber {
  border-left-color: var(--amber);
}

/* Cards & Typography */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  min-width: 0;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 7px;
  border-radius: 4px;
  margin-bottom: 7px;
  max-width: 100%;
}

.tag-green {
  background: var(--green-soft);
  color: var(--green-hover);
  border: 1px solid #86EFAC;
}

.tag-blue {
  background: #EFF6FF;
  color: var(--brand);
  border: 1px solid #BFDBFE;
}

.tag-amber {
  background: var(--amber-soft);
  color: var(--amber-text);
  border: 1px solid #FCD34D;
}

.tag-dark {
  background: var(--bg-dark);
  color: #FFFFFF;
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
  margin: 0 0 5px;
  color: var(--text-primary);
}

.card-title-sm {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.card-sub {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin: 0;
  color: var(--text-primary);
}

.count-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #E2E8F0;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  min-height: 44px;
}

.btn-lg {
  padding: 12px 16px;
  font-size: 14.5px;
  min-height: 48px;
}

.btn-sm {
  padding: 8px 11px;
  font-size: 13px;
  min-height: 38px;
}

.btn-xs {
  padding: 6px 10px;
  font-size: 12px;
  min-height: 32px;
}

.btn-block {
  width: 100%;
}

.btn-green {
  background: var(--green);
  color: #FFFFFF;
}

.btn-green:hover, .btn-green:active {
  background: var(--green-hover);
}

.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
}

.btn-primary:hover, .btn-primary:active {
  background: var(--brand-hover);
}

.btn-outline {
  background: var(--bg-primary);
  color: var(--brand);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--brand);
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
  padding: 4px 2px;
  cursor: pointer;
}

/* Rotating 24h PRO Banner */
.promo-banner {
  background: var(--bg-dark);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid #1E293B;
  border-left: 4px solid var(--amber);
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.promo-banner[hidden] {
  display: none !important;
}

.promo-copy {
  min-width: 0;
  flex: 1;
}

.promo-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: #FCD34D;
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.promo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  line-height: 1.25;
  color: #FFFFFF;
  margin: 0 0 2px;
}

.promo-meta {
  font-size: 12px;
  color: #CBD5E1;
  margin: 0;
}

.promo-cta {
  flex-shrink: 0;
  background: var(--amber);
  color: #0F172A;
  font-weight: 700;
  font-size: 12px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-height: 36px;
  cursor: pointer;
  white-space: nowrap;
}

/* Hero PDF Card */
.hero-pdf-card {
  border-color: #94A3B8;
  border-top: 3px solid var(--brand);
}

.hero-pdf-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 13px;
  min-width: 0;
}

.hero-cover-thumb {
  width: 72px;
  height: 98px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.hero-pdf-info {
  min-width: 0;
  flex: 1;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16.5px;
  line-height: 1.22;
  margin: 0 0 5px;
  color: var(--text-primary);
}

.hero-meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Install Guide */
.install-card {
  background: #FFFFFF;
}

.install-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.install-step {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
}

.step-badge {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--brand);
  color: #FFFFFF;
}

/* Home Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mod-tile {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mod-tile:hover, .mod-tile:active {
  border-color: var(--brand);
  background: #F8FAFC;
}

.mod-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mod-code {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--brand);
  padding: 2px 6px;
  border-radius: 4px;
}

.mod-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.mod-name {
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mod-range {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

/* Favorites List */
.fav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  background: var(--bg-primary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* TAB 2: SCHEMI */
.schemi-controls {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-ico {
  position: absolute;
  left: 11px;
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14.5px;
}

.search-input:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: var(--brand);
}

.search-clear {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
}

.chip.active {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
}

.subfilter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.rcd-filter-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mini-chip {
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}

.mini-chip.active {
  background: var(--bg-dark);
  color: #FFFFFF;
  border-color: var(--bg-dark);
}

.mini-chip.fav-toggle.active {
  background: var(--amber);
  color: #0F172A;
  border-color: var(--amber);
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.schemi-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.plate-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.plate-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plate-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

.code-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg-dark);
  color: #FFFFFF;
  padding: 2px 7px;
  border-radius: 4px;
}

.mod-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: #EFF6FF;
  color: var(--brand);
  border: 1px solid #BFDBFE;
  padding: 2px 6px;
  border-radius: 4px;
}

.rcd-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  background: var(--amber-soft);
  color: var(--amber-text);
  padding: 2px 6px;
  border-radius: 4px;
}

.star-btn {
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.star-btn.is-fav {
  background: var(--amber-soft);
  border-color: var(--amber);
  color: var(--amber);
}

.plate-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
  margin: 0;
  color: var(--text-primary);
}

.plate-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.plate-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.plate-norm {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* TAB 3: CALCOLATORI */
.calc-subnav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.calc-tab {
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 9px 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  min-height: 40px;
}

.calc-tab.active {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
}

.calc-pane {
  display: none;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.calc-pane.active {
  display: flex;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.input-ctrl {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
}

.input-ctrl:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
  border-color: var(--brand);
}

.field-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.result-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-banner {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.status-ok {
  background: var(--green-soft);
  color: var(--green-hover);
  border: 1px solid #86EFAC;
}

.status-warn {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #FCA5A5;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kpi-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  min-width: 0;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.kpi-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-val.accent-blue { color: var(--brand); }
.kpi-val.accent-green { color: var(--green); }
.kpi-val.accent-red { color: var(--red); }

.tech-note {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

/* RCD Load Selector */
.load-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-bottom: 12px;
}

.load-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}

.load-btn.active {
  border-color: var(--brand);
  background: #EFF6FF;
}

.load-btn-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-primary);
}

.load-btn-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-dark);
  color: #FFFFFF;
  flex-shrink: 0;
}

/* DiCo Checklist */
.dico-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.progress-wrap {
  margin: 8px 0 14px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.progress-track {
  height: 8px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--green);
  transition: width 0.2s ease;
}

.dico-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dico-group-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 6px;
}

.dico-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
}

.dico-item.checked {
  background: var(--green-soft);
  border-color: #86EFAC;
}

.dico-item input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--green);
  flex-shrink: 0;
}

.dico-item-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
}

/* TAB 4: PDF A4 */
.pdf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdf-row {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.pdf-row-info {
  min-width: 0;
  flex: 1;
}

.pdf-row-title {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.pdf-row-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* TAB 5: PRO */
.unlock-form {
  display: flex;
  gap: 8px;
}

.unlock-form .input-ctrl {
  flex: 1;
}

.unlock-form .btn {
  flex-shrink: 0;
}

.unlock-feedback {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.unlock-feedback.ok { color: var(--green); }
.unlock-feedback.err { color: var(--red); }

.pro-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pro-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pro-card.is-unlocked {
  border-color: var(--green);
  border-top: 3px solid var(--green);
}

.pro-card.is-locked {
  border-top: 3px solid var(--amber);
}

.pro-head {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.pro-cover {
  width: 68px;
  height: 92px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.pro-head-info {
  min-width: 0;
  flex: 1;
}

.pro-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.pro-price {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.pro-price-note {
  font-size: 12px;
  color: var(--text-secondary);
}

.pro-thumbs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pro-thumb-btn {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 6px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.pro-thumb-btn img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: #FFFFFF;
}

.pro-thumb-cap {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pro-tool-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.prompt-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prompt-text {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
}

.diag-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.diag-branch {
  background: var(--bg-secondary);
  border-left: 3px solid var(--brand);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.45;
}

.diag-branch.branch-yes { border-left-color: var(--green); }
.diag-branch.branch-no { border-left-color: var(--amber); }

.diag-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.kit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 680px;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  z-index: 45;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  min-width: 0;
}

.nav-btn.active {
  color: var(--brand);
  position: relative;
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16%;
  right: 16%;
  height: 3px;
  background: var(--brand);
  border-radius: 0 0 3px 3px;
}

/* Plate Viewer Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.78);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-sheet {
  width: 100%;
  max-width: 720px;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  background: var(--bg-dark);
  color: #FFFFFF;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.modal-code-badge {
  background: var(--amber);
  color: #0F172A;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn.is-fav {
  background: var(--amber);
  color: #0F172A;
  border-color: var(--amber);
}

.zoom-toolbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.zoom-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 2px;
}

.zoom-btn {
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 32px;
}

.zoom-btn.active {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.plate-viewport {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #E2E8F0;
  border-bottom: 1px solid var(--border);
  max-height: 56vh;
  padding: 8px;
}

.plate-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  transition: width 0.15s ease;
}

.modal-meta {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.meta-cell {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
}

.meta-cell-k {
  font-size: 10.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.meta-cell-v {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.meta-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--text-primary);
}

.meta-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--brand);
  margin: 0 0 6px;
}

.breakers-table {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.breaker-row {
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--brand);
  border-radius: 4px;
  padding: 7px 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-word;
}
