/* TII AI Trust Passport — Demo Platform
   White · clean · trustworthy · navy text · cyan accents */

:root {
  --navy: #001D4A;
  --ink: #0B1F3A;
  --royal: #0047AB;
  --cyan: #00A8CC;
  --cyan-bright: #00C4E8;
  --white: #FFFFFF;
  --bg: #F7F9FC;
  --muted: #5B6B86;
  --line: #E5EAF0;
  --panel: #FFFFFF;
  --sky: #E8F0FE;
  --allow: #0B7A3E;
  --allow-bg: #E6F6EC;
  --deny: #C1121F;
  --deny-bg: #FDE8EA;
  --warn: #B45309;
  --warn-bg: #FEF3C7;
  /* Trust ★ gradient: low = red → high = green */
  --trust-0: #B71C1C;
  --trust-0-bg: #FDE8EA;
  --trust-1: #E53935;
  --trust-1-bg: #FFEBEE;
  --trust-2: #FB8C00;
  --trust-2-bg: #FFF3E0;
  --trust-3: #F9A825;
  --trust-3-bg: #FFFDE7;
  --trust-4: #7CB342;
  --trust-4-bg: #F1F8E9;
  --trust-5: #2E7D32;
  --trust-5-bg: #E8F5E9;
  --radius: 12px;
  --font-display: "Outfit", "Sarabun", "Noto Sans SC", "Noto Sans Arabic", sans-serif;
  --font-body: "Sarabun", "Noto Sans SC", "Noto Sans Arabic", "Outfit", sans-serif;
  --sidebar: 280px;
  --shadow: 0 4px 18px rgba(11, 31, 58, 0.06);
  --shadow-card: 0 6px 24px rgba(11, 31, 58, 0.08);
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
}

body { min-height: 100dvh; }

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

img { max-width: 100%; height: auto; display: block; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100dvh;
}

/* ——— Language switcher ——— */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.lang-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s ease;
  line-height: 1;
}

.lang-btn:hover {
  background: var(--sky);
  color: var(--navy);
}

.lang-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  box-shadow: 0 2px 8px rgba(0, 29, 74, 0.18);
}

.lang-flag { font-size: 0.78rem; line-height: 1; }
.lang-code {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ——— Sidebar ——— */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 1.1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.brand-logo-wrap {
  background: var(--navy);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  max-width: 230px;
  height: auto;
  display: block;
  border-radius: 6px;
}

.brand-product {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.15rem;
}

.brand-product-en {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--navy);
}

.brand-product-th {
  font-size: 0.82rem;
  color: var(--cyan);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.nav-item {
  text-align: start;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: 0.18s ease;
}

.nav-item:hover {
  color: var(--navy);
  background: var(--sky);
  border-color: var(--line);
}

.nav-item.active {
  color: var(--white);
  background: var(--navy);
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 29, 74, 0.18);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.slogan {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--royal);
}

.role-note {
  margin: 0.4rem 0 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.skills-dl-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0.65rem 0 0.35rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.skills-dl-link + .skills-dl-link {
  margin-top: 0.35rem;
}

.skills-dl-link:hover {
  color: var(--royal);
  border-color: var(--royal);
  text-decoration: none;
}

.skills-dl-link:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 2px;
}

.skills-dl-icon {
  flex-shrink: 0;
}

.pitch-link {
  display: block;
  font-size: 0.8rem;
  color: var(--royal);
  text-decoration: none;
}

.pitch-link:hover { color: var(--cyan); text-decoration: underline; }

/* ——— Main ——— */
.main {
  padding: 1.25rem 1.5rem 2rem;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.topbar-start {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-titles { min-width: 0; }

.nav-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--royal);
  background: var(--sky);
  outline: none;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

body.nav-open .nav-toggle-bars {
  background: transparent;
}

body.nav-open .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

body.nav-open .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-overlay {
  display: none;
}

.topbar-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 700;
  color: var(--navy);
}

.muted { color: var(--muted); margin: 0.25rem 0 0; font-size: 0.9rem; }

.topbar-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.badge {
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge.cyan {
  background: rgba(0, 168, 204, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0, 168, 204, 0.35);
}

.badge.navy {
  background: var(--sky);
  color: var(--navy);
  border: 1px solid var(--line);
}

.view { display: none; animation: fadeIn 0.28s ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.panel-head h2 { margin: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 0.85rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card .num {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--royal);
  line-height: 1.1;
}

.stat-card .label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.principle-list {
  margin: 0;
  padding-inline-start: 1.1rem;
  color: var(--ink);
  line-height: 1.55;
  font-size: 0.9rem;
}

.principle-list li { margin-bottom: 0.45rem; }

.store-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.store-split ul {
  margin: 0.4rem 0 0;
  padding-inline-start: 1.05rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.allow-label { color: var(--allow); margin: 0; font-size: 0.85rem; }
.deny-label { color: var(--deny); margin: 0; font-size: 0.85rem; }

.clock-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.clock-card {
  background: var(--bg);
  border-radius: 10px;
  padding: 0.85rem;
  border: 1px solid var(--line);
}

.clock-card .hrs {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--royal);
}

.clock-card p {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  text-align: start;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td { color: var(--ink); }

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
}

.status-pill.ALLOW,
.status-pill.ACTIVE { background: var(--allow-bg); color: var(--allow); }
.status-pill.DENY,
.status-pill.REVOKED { background: var(--deny-bg); color: var(--deny); }
.status-pill.SUSPENDED { background: var(--warn-bg); color: var(--warn); }

.stars { letter-spacing: 0.05em; font-weight: 600; color: var(--muted); }
.stars.trust-lvl-0 { color: var(--trust-0); }
.stars.trust-lvl-1 { color: var(--trust-1); }
.stars.trust-lvl-2 { color: var(--trust-2); }
.stars.trust-lvl-3 { color: var(--trust-3); }
.stars.trust-lvl-4 { color: var(--trust-4); }
.stars.trust-lvl-5 { color: var(--trust-5); }

/* Passport */
.passport-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: start;
}

.passport-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 70vh;
  overflow-y: auto;
}

.passport-item {
  text-align: start;
  background: var(--bg);
  border: 1px solid transparent;
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s ease;
}

.passport-item:hover,
.passport-item.active {
  border-color: rgba(0, 71, 171, 0.35);
  background: var(--sky);
  box-shadow: var(--shadow);
}

.passport-item .id {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--royal);
  font-weight: 600;
}

.passport-item .name { font-size: 0.9rem; margin-top: 0.15rem; }
.passport-item .meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }

.passport-card {
  min-height: 360px;
  background:
    linear-gradient(135deg, rgba(0, 168, 204, 0.08) 0%, transparent 42%),
    linear-gradient(160deg, #FFFFFF 0%, #F3F7FC 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.35rem 1.4rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.passport-card.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.passport-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/tii-logo.png") right -20px bottom -30px / 220px no-repeat;
  opacity: 0.06;
  pointer-events: none;
}

.passport-card-inner { position: relative; z-index: 1; }

.pc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.pc-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--navy);
}

.pc-header .sub {
  margin: 0.25rem 0 0;
  color: var(--cyan);
  font-size: 0.85rem;
}

.pc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
}

.pc-field label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-family: var(--font-display);
}

.pc-field span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.92rem;
  color: var(--ink);
  word-break: break-all;
}

.pc-footer {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Issue / Verify */
.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
}

.tab.active {
  background: var(--navy);
  color: var(--white);
  border-color: transparent;
  font-weight: 700;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.scenario-btns {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.scenario-btn {
  text-align: start;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
}

.scenario-btn.active {
  border-color: var(--royal);
  background: var(--sky);
  box-shadow: 0 0 0 1px rgba(0, 71, 171, 0.2);
}

.verify-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.15rem;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  font-size: 0.9rem;
}

.btn.primary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(0, 29, 74, 0.18);
}

.btn.primary:hover { background: var(--royal); }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--royal);
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.verify-checklist {
  margin: 0;
  padding: 0;
  list-style: none;
}

.verify-checklist li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  opacity: 0.45;
  transition: 0.2s ease;
}

.verify-checklist li.run { opacity: 1; }

.verify-checklist .mark {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--bg);
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.verify-checklist li.pass .mark { background: var(--allow-bg); color: var(--allow); border-color: transparent; }
.verify-checklist li.fail .mark { background: var(--deny-bg); color: var(--deny); border-color: transparent; }

.verify-result, .issue-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-align: center;
}

.verify-result.ALLOW, .issue-result.ok {
  background: var(--allow-bg);
  color: var(--allow);
  border: 1px solid rgba(11, 122, 62, 0.25);
}

.verify-result.DENY {
  background: var(--deny-bg);
  color: var(--deny);
  border: 1px solid rgba(193, 18, 31, 0.25);
}

.issue-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.issue-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.issue-form input,
.issue-form select {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.issue-form input:focus,
.issue-form select:focus {
  outline: 2px solid rgba(0, 71, 171, 0.25);
  border-color: var(--royal);
}

.issue-form button { grid-column: 1 / -1; justify-self: start; margin-top: 0.35rem; }

.filters { display: flex; gap: 0.35rem; }

.chip {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.75rem;
}

.chip.active {
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  border-color: transparent;
}

.trust-levels { display: flex; flex-direction: column; gap: 0.45rem; }

.trust-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
}

.trust-row .label { font-family: var(--font-display); font-weight: 600; }
.trust-row .action { color: var(--muted); }
.trust-row .star-mark { font-weight: 700; letter-spacing: 0.04em; }
.trust-row.deny,
.trust-row.trust-lvl-0 {
  background: var(--trust-0-bg);
  border-color: #ef9a9a;
}
.trust-row.trust-lvl-1 { background: var(--trust-1-bg); border-color: #ef9a9a; }
.trust-row.trust-lvl-2 { background: var(--trust-2-bg); border-color: #ffcc80; }
.trust-row.trust-lvl-3 { background: var(--trust-3-bg); border-color: #ffe082; }
.trust-row.trust-lvl-4 { background: var(--trust-4-bg); border-color: #c5e1a5; }
.trust-row.trust-lvl-5 { background: var(--trust-5-bg); border-color: #a5d6a7; }
.trust-row.deny .label,
.trust-row.deny .action,
.trust-row.deny .star-mark,
.trust-row.trust-lvl-0 .label,
.trust-row.trust-lvl-0 .action,
.trust-row.trust-lvl-0 .star-mark { color: var(--trust-0); }
.trust-row.trust-lvl-1 .label,
.trust-row.trust-lvl-1 .star-mark { color: var(--trust-1); }
.trust-row.trust-lvl-2 .label,
.trust-row.trust-lvl-2 .star-mark { color: var(--trust-2); }
.trust-row.trust-lvl-3 .label,
.trust-row.trust-lvl-3 .star-mark { color: var(--trust-3); }
.trust-row.trust-lvl-4 .label,
.trust-row.trust-lvl-4 .star-mark { color: var(--trust-4); }
.trust-row.trust-lvl-5 .label,
.trust-row.trust-lvl-5 .star-mark { color: var(--trust-5); }

.trust-board {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trust-board-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.crypto-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.crypto-pill {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
}

.crypto-pill.ok {
  background: var(--allow-bg);
  color: var(--allow);
  border: 1px solid rgba(11, 122, 62, 0.25);
}

.crypto-pill.bad {
  background: var(--deny-bg);
  color: var(--deny);
  border: 1px solid rgba(193, 18, 31, 0.25);
  text-decoration: line-through;
  opacity: 0.85;
}

.dpia-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.dpia-step {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  position: relative;
}

.dpia-step .n {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.dpia-step h3 {
  margin: 0.35rem 0;
  font-size: 1rem;
  font-family: var(--font-display);
  color: var(--navy);
}

.dpia-step p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.dpia-step .tii {
  margin-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--royal);
}

.bullet-rich {
  margin: 0;
  padding-inline-start: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink);
}

.bullet-rich li { margin-bottom: 0.45rem; }

.dpia-passports {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dpia-passports .row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}

/* ——— Quiz / Cert ——— */
.quiz-warn {
  border-left: 4px solid var(--warn);
  background: linear-gradient(90deg, var(--warn-bg), var(--panel));
}

.quiz-warn p {
  margin: 0.4rem 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
}

.quiz-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.85rem 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

.quiz-field input[type="text"],
.quiz-field input:not([type]),
.quiz-field input[type="file"] {
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.quiz-score-box,
.quiz-process-status {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.9rem;
  background: var(--bg);
}

.quiz-score-box.ok,
.quiz-process-status.ok {
  background: var(--allow-bg);
  border-color: #b7e4c7;
  color: var(--allow);
}

.quiz-score-box.fail,
.quiz-process-status.fail {
  background: var(--deny-bg);
  border-color: #f5c2c7;
  color: var(--deny);
}

.quiz-form {
  max-height: 52vh;
  overflow: auto;
  padding-right: 0.25rem;
}

.quiz-q {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem 0.9rem;
  margin: 0 0 0.75rem;
  background: var(--bg);
}

.quiz-q legend {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--royal);
  padding: 0 0.35rem;
}

.quiz-q p {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 400;
  font-size: 0.86rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
}

.quiz-opt:hover {
  background: var(--sky);
}

.quiz-opt input {
  margin-top: 0.2rem;
}

.quiz-hash-block {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.quiz-hash-block h3 {
  margin: 0.65rem 0 0.25rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.quiz-hash-block code {
  display: block;
  word-break: break-all;
  font-size: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
}

/* RTL */
[dir="rtl"] .topbar-end { align-items: flex-start; }
[dir="rtl"] .topbar-badges { justify-content: flex-start; }
[dir="rtl"] .brand-logo-wrap { direction: ltr; }

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .dpia-steps { grid-template-columns: 1fr 1fr; }
  .passport-layout { grid-template-columns: 1fr; }
  .passport-list { max-height: none; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-flex; }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 16, 40, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.nav-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(var(--sidebar), 86vw);
    max-width: 320px;
    height: 100dvh;
    z-index: 100;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    border-right: 1px solid var(--line);
    border-bottom: none;
    box-shadow: 8px 0 28px rgba(11, 31, 58, 0.12);
  }

  [dir="rtl"] .sidebar {
    transform: translateX(105%);
    box-shadow: -8px 0 28px rgba(11, 31, 58, 0.12);
  }

  body.nav-open .sidebar,
  body.nav-open[dir="rtl"] .sidebar {
    transform: translateX(0);
  }

  .nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 44px;
    font-size: 0.9rem;
  }

  .skills-dl-link {
    min-height: 44px;
    padding: 0.55rem 0.75rem;
  }

  .main {
    width: 100%;
    padding: 1rem 1rem 1.75rem;
  }

  .grid-2,
  .store-split,
  .clock-row,
  .issue-form,
  .pc-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dpia-steps { grid-template-columns: 1fr; }

  .trust-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .topbar-end {
    align-items: stretch;
    width: 100%;
  }

  .topbar-badges { justify-content: flex-start; }

  .lang-switch {
    align-self: flex-start;
  }

  .lang-btn {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 44px;
    min-height: 44px;
  }

  .btn.primary,
  .tab,
  .chip,
  .scenario-btn {
    min-height: 44px;
  }

  .quiz-actions .btn,
  .quiz-actions .btn.ghost {
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
  }

  .quiz-opt {
    min-height: 44px;
    padding: 0.55rem 0.65rem;
  }

  .quiz-form {
    max-height: none;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 520px;
  }
}

@media (max-width: 600px) {
  .main {
    padding: 0.75rem 0.75rem 1.5rem;
  }

  .panel {
    padding: 0.9rem 0.85rem;
  }

  .topbar {
    gap: 0.65rem;
    margin-bottom: 0.9rem;
  }

  .topbar h1 {
    font-size: 1.2rem;
  }

  .topbar-badges .badge {
    font-size: 0.65rem;
    padding: 0.28rem 0.55rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .stat-card .num { font-size: 1.3rem; }

  .pc-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .passport-card {
    padding: 1rem;
    min-height: 0;
  }

  .filters {
    flex-wrap: wrap;
  }

  .tabs {
    flex-direction: column;
  }

  .tab {
    width: 100%;
    text-align: center;
  }
}
