/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Dark blue palette */
  --navy:        #0f1f3d;
  --navy-deep:   #091428;
  --navy-mid:    #152a52;
  --navy-light:  #1e3a6e;
  --blue:        #1d4ed8;
  --blue-hover:  #1e40af;
  --blue-light:  #3b82f6;
  --blue-pale:   #dbeafe;
  --blue-ghost:  #eff6ff;

  /* Whites & greys */
  --white:       #ffffff;
  --off-white:   #f8fafc;
  --grey-100:    #f1f5f9;
  --grey-200:    #e2e8f0;
  --grey-300:    #cbd5e1;
  --grey-400:    #94a3b8;
  --grey-600:    #475569;
  --grey-800:    #1e293b;

  /* UI */
  --border:      #dde3f0;
  --border-dark: #c5cfe8;
  --text:        #0f1f3d;
  --text-mid:    #334155;
  --text-muted:  #64748b;
  --text-dim:    #94a3b8;
  --radius:      25px;
  --radius-sm:   25px;
  --radius-xs:   10px;
  --shadow-sm:   0 1px 3px rgba(15,31,61,0.08), 0 1px 2px rgba(15,31,61,0.06);
  --shadow-md:   0 4px 16px rgba(15,31,61,0.10), 0 2px 6px rgba(15,31,61,0.06);
  --shadow-lg:   0 12px 40px rgba(15,31,61,0.14), 0 4px 12px rgba(15,31,61,0.08);
  --font:        'Poppins', system-ui, sans-serif;
  --font-mono:   'DM Mono', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ── HEADER ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(9, 20, 40, 0.97);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 34px; height: 34px;
  background: var(--blue);
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700; color: #fff;
  box-shadow: 0 2px 8px rgba(29,78,216,0.4);
}
.logo-mark--sm { width: 26px; height: 26px; font-size: 13px; border-radius: 7px; }
.logo-text { font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.header-nav { display: flex; align-items: center; gap: 14px; }
.nav-chip {
  font-size: 11px; color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 4px 10px; border-radius: 20px;
}
.nav-link-ext {
  font-size: 12px; color: #93c5fd; font-weight: 500;
  transition: color .15s;
}
.nav-link-ext:hover { color: #fff; }

/* ── HERO ── */
.hero {
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 50%, var(--navy-light) 100%);
  padding: 130px 0 72px;
  position: relative; overflow: hidden;
}
.hero-bg-pattern {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(29,78,216,0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(59,130,246,0.12) 0%, transparent 45%),
    radial-gradient(circle at 60% 80%, rgba(15,31,61,0.5) 0%, transparent 40%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
  color: #93c5fd; margin-bottom: 22px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  padding: 6px 14px; border-radius: 20px;
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-title {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 700; line-height: 1.1; letter-spacing: -1.5px;
  color: #fff; margin-bottom: 18px;
}
.hero-title-accent {
  background: linear-gradient(90deg, #60a5fa, #93c5fd);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  color: rgba(255,255,255,0.65); max-width: 540px;
  font-size: 15px; line-height: 1.75; margin-bottom: 40px;
}
.hero-sub strong { color: rgba(255,255,255,0.85); }

/* ── SEARCH BOX ── */
.search-box {
  background: var(--white);
  border-radius: 30px;
  padding: 20px;
  max-width: 860px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.06);
}
.search-row {
  display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap;
}

.search-input-wrap {
  flex: 1; min-width: 200px;
  display: flex; align-items: center;
  background: var(--off-white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.search-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}
.search-icon { margin: 0 12px; color: var(--text-dim); flex-shrink: 0; }
.search-input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font); font-size: 14px; color: var(--text);
  padding: 13px 0;
}
.search-input::placeholder { color: var(--text-dim); }
.clear-btn {
  background: none; border: none; padding: 0 12px;
  color: var(--text-dim); cursor: pointer; display: flex; align-items: center;
  transition: color .15s;
}
.clear-btn:hover { color: var(--text); }

.class-wrap {
  width: 240px;
  display: flex; align-items: center;
  background: var(--off-white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.class-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}
.class-icon { margin: 0 12px; color: var(--text-dim); flex-shrink: 0; }
.class-select {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font); font-size: 13px; color: var(--text);
  padding: 13px 12px 13px 0; cursor: pointer;
}
.class-select option { background: var(--white); }

.btn-search {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 13px 22px; font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all .2s;
  box-shadow: 0 2px 8px rgba(29,78,216,0.3);
}
.btn-search:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(29,78,216,0.35); }
.btn-search:active { transform: none; }

.search-meta {
  display: flex; align-items: center; gap: 18px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--grey-200);
  flex-wrap: wrap;
}
.search-tip {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-muted);
}

/* toggle */
.demo-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.demo-toggle input { display: none; }
.toggle-pill {
  width: 38px; height: 22px; background: var(--grey-300);
  border-radius: 11px; position: relative; transition: background .2s;
}
.toggle-pill::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .2s;
}
.demo-toggle input:checked + .toggle-pill { background: var(--blue); }
.demo-toggle input:checked + .toggle-pill::after { transform: translateX(16px); }
.toggle-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ── RESULTS SECTION ── */
.results-section { padding: 40px 0 72px; background: var(--off-white); }

.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.results-info { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.results-heading {
  font-size: 18px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.results-heading em { font-style: normal; color: var(--navy); }
.count-pill {
  background: var(--navy); color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
}
.class-tag {
  font-size: 12px; background: var(--blue-pale); color: var(--blue);
  border: 1px solid #bfdbfe; padding: 2px 9px; border-radius: 5px;
  font-weight: 500;
}

.source-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  border: 1px solid;
}
.source-chip--demo { color: #92400e; border-color: #fcd34d; background: #fef3c7; }
.source-chip--live { color: #065f46; border-color: #6ee7b7; background: #d1fae5; }
.src-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.src-dot--demo { background: #d97706; }
.src-dot--live { background: #10b981; box-shadow: 0 0 5px #10b981; }

.view-source-btn {
  font-size: 12px; font-weight: 500; color: var(--blue);
  border: 1px solid #bfdbfe; padding: 7px 14px; border-radius: var(--radius-sm);
  background: var(--white); transition: all .15s;
  white-space: nowrap;
}
.view-source-btn:hover { background: var(--blue-pale); }

.notice-banner {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 12px; color: #92400e; margin-bottom: 20px;
}

/* ── CONTROLS ── */
.controls-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.fpill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-muted); padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: var(--font); transition: all .15s;
}
.fpill:hover { border-color: var(--blue-light); color: var(--blue); }
.fpill.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.fpill-count {
  background: rgba(255,255,255,0.25); padding: 1px 6px;
  border-radius: 10px; font-size: 10px;
}
.fpill.active .fpill-count { background: rgba(255,255,255,0.2); }

.view-switcher {
  display: flex; background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.vsw {
  background: none; border: none; padding: 7px 11px;
  color: var(--text-muted); cursor: pointer; display: flex; align-items: center;
  transition: all .15s;
}
.vsw.active, .vsw:hover { background: var(--navy); color: #fff; }

/* ── CARDS ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}
.tm-card {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  position: relative;
}
.tm-card:hover {
  border-color: var(--blue-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tm-card.hidden { display: none; }

.card-top {
  padding: 16px 16px 12px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  border-bottom: 1px solid var(--grey-100);
}
.card-head { flex: 1; }
.wordmark-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.wordmark { font-size: 15px; font-weight: 700; color: var(--navy); letter-spacing: 0.3px; }
.wordmark-link { color: inherit; }
.wordmark-link:hover { color: var(--blue); }
.type-chip {
  font-size: 10px; font-weight: 600; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--text-dim); background: var(--grey-100);
  padding: 2px 7px; border-radius: 4px;
}
.proprietor { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.status-lozenge {
  font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 4px 10px; border-radius: 20px; flex-shrink: 0;
}
.status-lozenge--sm { font-size: 10px; padding: 3px 8px; }

.card-mid { padding: 10px 16px; flex: 1; }
.desc-text {
  font-size: 11px; color: var(--text-muted); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-foot { padding: 12px 16px; border-top: 1px solid var(--grey-100); display: flex; flex-direction: column; gap: 8px; }
.meta-row { display: flex; gap: 20px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600; color: var(--text-dim); }
.meta-val { font-size: 12px; color: var(--text-mid); display: flex; align-items: center; gap: 5px; }
.mono { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.cls-badge {
  display: inline-block; background: var(--blue-pale); color: var(--blue);
  border: 1px solid #bfdbfe; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
}
.card-note {
  font-size: 11px; color: #92400e; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: var(--radius-xs);
  padding: 6px 10px; margin-top: 4px;
}

.status-strip { height: 3px; width: 100%; opacity: 0.8; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--white); }
.tm-table { width: 100%; border-collapse: collapse; }
.tm-table th {
  background: var(--navy); color: rgba(255,255,255,0.75);
  padding: 12px 16px; text-align: left; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tm-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--grey-100);
  font-size: 13px; vertical-align: middle;
}
.tm-row:last-child td { border-bottom: none; }
.tm-row:hover td { background: var(--blue-ghost); }
.tm-row.hidden { display: none; }
.fw-600 { font-weight: 600; }
.app-link { color: var(--blue); }
.app-link:hover { text-decoration: underline; }
.cls-name { font-size: 12px; color: var(--text-muted); }
.mono-sm { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* ── EMPTY STATE ── */
.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 72px 20px;
  color: var(--text-muted);
}
.empty-icon { margin: 0 auto 18px; color: var(--grey-300); width: 48px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-sub { font-size: 13px; color: var(--text-muted); }

/* ── PAGINATION ── */
.pagination-bar {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 32px;
}
.page-btn {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--blue); padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; transition: all .15s;
}
.page-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-info { font-size: 13px; color: var(--text-muted); }

/* ── HOW IT WORKS ── */
.how-section { padding: 72px 0 80px; background: var(--white); }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--blue); margin-bottom: 12px;
}
.section-title {
  font-size: 26px; font-weight: 700; letter-spacing: -0.5px;
  color: var(--navy); margin-bottom: 36px;
}
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin-bottom: 60px;
}
.step-card {
  background: var(--off-white); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  transition: border-color .2s, box-shadow .2s;
}
.step-card:hover { border-color: var(--blue-light); box-shadow: var(--shadow-sm); }
.step-num {
  font-size: 36px; font-weight: 800; color: var(--blue);
  opacity: 0.25; margin-bottom: 14px; font-variant-numeric: tabular-nums;
}
.step-card h3 { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.step-card p { color: var(--text-muted); font-size: 13px; line-height: 1.65; }

.popular-classes { margin-top: 8px; }
.class-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cpill {
  background: var(--white); border: 1.5px solid var(--border);
  color: var(--text-muted); padding: 7px 16px; border-radius: 20px;
  font-size: 12px; font-weight: 500; transition: all .15s;
}
.cpill:hover { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ── FOOTER ── */
.site-footer {
  background: var(--navy-deep); border-top: 1px solid rgba(255,255,255,0.06);
  padding: 24px 0;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-brand { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: #fff; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,0.4); }
.footer-copy a { color: rgba(255,255,255,0.6); }
.footer-copy a:hover { color: #fff; }

/* ── UTILITIES ── */
.hidden { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
  .search-row { flex-direction: column; }
  .class-wrap { width: 100%; }
  .cards-grid { grid-template-columns: 1fr; }
  .results-bar { flex-direction: column; align-items: flex-start; }
  .hero { padding-top: 110px; }
  .footer-inner { flex-direction: column; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--off-white); }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--grey-400); }

/* ── LOADING ── */
.btn-search.loading { opacity: .75; pointer-events: none; }
.btn-search.loading svg { display: none; }
.btn-search.loading::before {
  content: ''; display: inline-block; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ERROR BANNER ── */
.error-banner {
  display: flex; align-items: flex-start; gap: 14px;
  background: #fef2f2; border: 1.5px solid #fecaca; border-radius: var(--radius);
  padding: 18px 20px; color: #991b1b; margin-bottom: 24px;
}
.error-banner svg { flex-shrink: 0; margin-top: 2px; }
.error-banner strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.error-banner p { font-size: 12px; color: #b91c1c; line-height: 1.6; margin: 0; }

.empty-state--full {
  text-align: center; padding: 80px 20px;
  display: flex; flex-direction: column; align-items: center;
}

/* ── Card clickable ──────────────────────────────────────────────────────── */
.tm-card { cursor: pointer; }
.tm-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,31,61,.12); }
.tm-card:active { transform: translateY(0); }

/* ── Trademark Detail Modal ──────────────────────────────────────────────── */
.tm-modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(9,20,40,.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tm-modal-overlay.active { display: flex; }

.tm-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(9,20,40,.28);
  position: relative;
  animation: modalIn .22s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* close, header, icon — defined later in file with updated values */
.tm-modal-title-wrap { flex: 1; min-width: 0; }

.tm-modal-title {
  font-size: 20px; font-weight: 700;
  color: var(--navy); line-height: 1.2;
  word-break: break-word;
}

.tm-modal-sub {
  font-size: 13px; color: var(--text-muted); margin-top: 3px;
}

.tm-modal-body { padding: 20px 28px 28px; }

.tm-modal-section { margin-bottom: 22px; }
.tm-modal-section:last-child { margin-bottom: 0; }

.tm-modal-section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: 12px;
}

.tm-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

.tm-modal-field { display: flex; flex-direction: column; gap: 2px; }

.tm-modal-label {
  font-size: 11px; color: var(--text-muted); font-weight: 500;
}

.tm-modal-value {
  font-size: 14px; color: var(--text); font-weight: 500; line-height: 1.5;
}

.tm-modal-value.mono { font-family: var(--font-mono); font-size: 13px; }
.font-mono-sm { font-family: var(--font-mono); font-size: 12px; line-height: 1.6; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .search-row {
    flex-direction: column;
    gap: 10px;
  }
  .class-wrap { width: 100%; }
  .btn-search { width: 100%; justify-content: center; }
  .search-input-wrap { width: 100%; }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .controls-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .filter-pills {
    flex-wrap: wrap;
    gap: 6px;
  }

  .results-bar {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .hero-title { font-size: clamp(28px, 8vw, 52px); }
  .hero-sub { font-size: 14px; }

  .steps-grid { grid-template-columns: 1fr; }

  .table-wrap { overflow-x: auto; }
  .tm-table { min-width: 580px; }

  .tm-modal-header { padding: 20px 20px 16px; }
  .tm-modal-body { padding: 16px 20px 20px; }
  .tm-modal-grid { grid-template-columns: 1fr; }
  .tm-modal-title { font-size: 17px; }

  .header-inner { flex-wrap: wrap; gap: 6px; }
  .nav-chip { font-size: 11px; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .hero-content { padding-top: 20px; }
  .search-box { padding: 16px; }
  .tm-card { border-radius: 12px; }
}

/* ── Card logo ───────────────────────────────────────────────────────────── */
.wordmark-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-logo {
  width: 44px; height: 44px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--grey-200);
  background: var(--grey-100);
  flex-shrink: 0;
}

.card-logo-placeholder {
  width: 44px; height: 44px;
  background: var(--blue-pale);
  color: var(--blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}

/* ── Table logo ──────────────────────────────────────────────────────────── */
.table-logo {
  width: 36px; height: 36px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--grey-200);
  background: var(--grey-100);
  display: block;
}

.table-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--blue-pale); color: var(--blue);
  border-radius: 6px;
  font-size: 14px; font-weight: 700;
}

/* ── Modal: fixed close button (top-LEFT, never overlaps status) ─────────── */
.tm-modal-close {
  position: absolute; top: 14px; left: 14px;
  background: var(--grey-100); border: none;
  border-radius: 8px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  transition: background .15s, color .15s;
  z-index: 2;
}
.tm-modal-close:hover { background: var(--grey-200); color: var(--text); }

/* ── Modal header: logo + title + status on same row ────────────────────── */
.tm-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 18px 56px; /* left pad for close button */
  border-bottom: 1px solid var(--grey-200);
  flex-wrap: wrap;
}

.tm-modal-logo-wrap {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
}

.tm-modal-logo-img {
  width: 52px; height: 52px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--grey-200);
  background: var(--grey-100);
}

.tm-modal-icon {
  width: 52px; height: 52px;
  background: var(--blue-pale); color: var(--blue);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}

.tm-modal-title-wrap {
  flex: 1;
  min-width: 0;
}

.tm-modal-status-badge {
  flex-shrink: 0;
  margin-left: auto;
  align-self: flex-start;
  /* no absolute positioning — sits in normal flow */
}

/* ── Modal extra fields ──────────────────────────────────────────────────── */
.tm-modal-address {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 4px;
}

.fw-600 { font-weight: 600; }

.tm-modal-device-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: var(--grey-100);
  border-radius: 10px;
}

.tm-modal-device-img {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
}

/* ── Responsive modal tweaks ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .tm-modal-header {
    padding: 16px 16px 14px 50px;
    gap: 10px;
  }
  .tm-modal-status-badge {
    margin-left: 0;
    order: 3;
    width: 100%;
  }
}

/* ── Skeleton loaders ────────────────────────────────────────────────────── */
.skeleton-line {
  display: inline-block;
  width: 80%;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  vertical-align: middle;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.docs-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

/* ── Documents table in modal ────────────────────────────────────────────── */
.modal-docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.modal-docs-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--grey-200);
  color: var(--text);
  vertical-align: middle;
}

.modal-docs-table tr:last-child td { border-bottom: none; }

.modal-docs-table .doc-num {
  width: 28px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.modal-docs-table .doc-name {
  font-weight: 500;
}

.modal-docs-table .doc-date {
  width: 100px;
  text-align: right;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
