/* ============================================================
   IPSWDL — macOS Sonoma / iOS 17 Design System
   Inspired by OSpress Windows-style architecture.
   All values match the guide specification exactly.
   ============================================================ */

/* ── CSS Custom Properties ──────────────────────────────── */
:root {
  /* Font Families */
  --font-sans:    -apple-system, BlinkMacSystemFont, "SF Pro Text", ui-rounded, system-ui, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, ui-rounded, system-ui, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "Menlo", monospace;

  /* ── LIGHT THEME (default) ─────────────────────────────── */
  --bg:        #f2f2f7;
  --surface-1: #ffffff;   /* card / grouped surface */
  --surface-2: #e5e5ea;   /* inputs, dropdowns */
  --surface-3: #d1d1d6;   /* context menus, tooltips */

  /* Text hierarchy */
  --text-primary:   rgba(0, 0, 0, 1.00);
  --text-secondary: rgba(60, 60, 67, 0.60);
  --text-tertiary:  rgba(48, 48, 56, 0.3);
  --text-disabled:  rgba(60, 60, 67, 0.18);

  /* System accent palette */
  --blue:   #007aff;
  --green:  #34c759;
  --red:    #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --purple: #af52de;

  /* Borders */
  --border:        rgba(60, 60, 67, 0.29);
  --border-subtle: rgba(60, 60, 67, 0.12);

  /* Tool-page variable aliases */
  --text-1:       rgba(0, 0, 0, 1.00);
  --text-2:       rgba(60, 60, 67, 0.60);
  --text-3:       rgba(60, 60, 67, 0.30);
  --bg-surface:   #ffffff;
  --bg-raised:    #e5e5ea;
  --border-light: rgba(60, 60, 67, 0.12);
  --blue-bg:      rgba(0, 122, 255, 0.10);
  --blue-border:  rgba(0, 122, 255, 0.25);

  /* Chrome surface backgrounds (blur layers) */
  --chrome-bg:    rgba(240, 240, 245, 0.88);
  --sidebar-bg:   rgba(242, 242, 247, 0.90);
  --mobile-bar-bg: rgba(249, 249, 249, 0.92);
  --toolbar-bg:   rgba(236, 236, 241, 0.95);

  /* Layout dimensions */
  --menubar-h:   24px;
  --sidebar-w:   260px;
  --statusbar-h: 22px;
  --toolbar-h:   44px;
  --inspector-w: 280px;
}

/* ── DARK THEME override ────────────────────────────────── */
[data-theme="dark"] {
  --bg:        #000000;
  --surface-1: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;

  --text-primary:   rgba(255, 255, 255, 1.00);
  --text-secondary: rgba(235, 235, 245, 0.60);
  --text-tertiary:  rgba(235, 235, 245, 0.30);
  --text-disabled:  rgba(235, 235, 245, 0.16);

  --blue:   #0a84ff;
  --green:  #30d158;
  --red:    #ff453a;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --purple: #bf5af2;

  --border:        rgba(84, 84, 88, 0.65);
  --border-subtle: rgba(84, 84, 88, 0.28);

  --text-1:       rgba(255, 255, 255, 1.00);
  --text-2:       rgba(235, 235, 245, 0.60);
  --text-3:       rgba(235, 235, 245, 0.30);
  --bg-surface:   #1c1c1e;
  --bg-raised:    #2c2c2e;
  --border-light: rgba(84, 84, 88, 0.28);
  --blue-bg:      rgba(10, 132, 255, 0.12);
  --blue-border:  rgba(10, 132, 255, 0.30);

  /* Chrome surface backgrounds (blur layers) */
  --chrome-bg:    rgba(28, 28, 28, 0.90);
  --sidebar-bg:   rgba(22, 22, 24, 0.85);
  --mobile-bar-bg: rgba(18, 18, 20, 0.90);
  --toolbar-bg:   rgba(37, 37, 37, 0.95);
}

/* ── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 13px;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-sans); cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }

/* ============================================================
   macOS MENU BAR
   ============================================================ */
.macos-menubar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--menubar-h);
  z-index: 9999;
  background: var(--chrome-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 4px;
  font-size: 13px;
  color: var(--text-primary);
  user-select: none;
}

.macos-menubar__left {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

.macos-menubar__apple {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: var(--menubar-h);
  border-radius: 4px;
  cursor: default;
  flex-shrink: 0;
  transition: background 0.1s;
}
.macos-menubar__apple:hover { background: rgba(10, 132, 255, 0.75); }

.macos-menubar__appname {
  font-weight: 600;
  font-size: 13px;
  padding: 0 8px;
  height: var(--menubar-h);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.macos-menubar__item {
  padding: 0 8px;
  height: var(--menubar-h);
  display: flex;
  align-items: center;
  border-radius: 4px;
  cursor: default;
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.1s;
  white-space: nowrap;
  text-decoration: none;
}
.macos-menubar__item:hover { background: rgba(10, 132, 255, 0.75); }

.macos-menubar__right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding-right: 4px;
}

.macos-menubar__clock {
  font-size: 13px;
  color: var(--text-primary);
  padding: 0 8px;
  white-space: nowrap;
}

.macos-menubar__status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: var(--menubar-h);
  color: var(--text-primary);
  font-size: 14px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.1s;
}
.macos-menubar__status-icon:hover { background: rgba(120, 120, 128, 0.14); }

/* ============================================================
   SIDEBAR — Finder style
   ============================================================ */
.macos-sidebar {
  position: fixed;
  top: var(--menubar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-right: 0.5px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 calc(var(--statusbar-h) + 8px);
  z-index: 100;
}
.macos-sidebar::-webkit-scrollbar { width: 0; }

.macos-sidebar__section {
  padding: 12px 0 2px;
}

.macos-sidebar__section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 0 16px;
  margin-bottom: 4px;
}

.macos-sidebar__item {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  padding: 0 8px;
  margin: 1px 8px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: default;
  text-decoration: none;
  transition: background 0.1s;
}
.macos-sidebar__item:hover              { background: rgba(120, 120, 128, 0.14); }
.macos-sidebar__item.is-active          { background: rgba(10, 132, 255, 0.20); color: var(--blue); }
.macos-sidebar__item.is-active svg      { color: var(--blue); }

.macos-sidebar__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.macos-sidebar__tag-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.macos-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--menubar-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.macos-content__page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.macos-content__scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--statusbar-h) + 8px);
}
.macos-content__scroll::-webkit-scrollbar { width: 8px; }
.macos-content__scroll::-webkit-scrollbar-track { background: transparent; }
.macos-content__scroll::-webkit-scrollbar-thumb { background: rgba(84,84,88,0.35); border-radius: 4px; }
.macos-content__scroll::-webkit-scrollbar-thumb:hover { background: rgba(84,84,88,0.55); }

/* ============================================================
   FINDER TOOLBAR
   ============================================================ */
.macos-toolbar {
  height: var(--toolbar-h);
  background: var(--toolbar-bg);
  border-bottom: 0.5px solid rgba(84, 84, 88, 0.65);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.macos-toolbar__nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.macos-toolbar__nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  transition: background 0.1s, color 0.1s;
  cursor: pointer;
}
.macos-toolbar__nav-btn:hover {
  background: rgba(120, 120, 128, 0.14);
  color: var(--text-primary);
}
.macos-toolbar__nav-btn:disabled {
  color: var(--text-disabled);
  pointer-events: none;
}

.macos-toolbar__breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.macos-toolbar__breadcrumb a { color: var(--blue); }
.macos-toolbar__breadcrumb .sep { color: var(--text-tertiary); }

.macos-toolbar__spacer { flex: 1; }

/* View segmented control */
.macos-toolbar__view-ctrl {
  display: flex;
  background: rgba(120, 120, 128, 0.10);
  border: 0.5px solid var(--border-subtle);
  border-radius: 7px;
  padding: 2px;
  gap: 1px;
}

.macos-toolbar__view-btn {
  width: 28px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  text-decoration: none;
}
.macos-toolbar__view-btn:hover {
  background: rgba(120, 120, 128, 0.20);
  color: var(--text-primary);
}
.macos-toolbar__view-btn.is-active {
  background: var(--surface-2);
  color: var(--text-primary);
}

/* Search field */
.macos-toolbar__search {
  position: relative;
  flex-shrink: 0;
}
.macos-toolbar__search svg {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  width: 13px;
  height: 13px;
}
.macos-toolbar__search input {
  width: 200px;
  height: 28px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  padding: 0 12px 0 26px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s, width 0.2s;
  display: block;
}
.macos-toolbar__search input::placeholder { color: var(--text-tertiary); }
.macos-toolbar__search input:focus {
  border-color: var(--blue);
  width: 240px;
}

/* ============================================================
   STATUS BAR
   ============================================================ */
.macos-statusbar {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--statusbar-h);
  background: #1e1e1e;
  border-top: 0.5px solid rgba(84, 84, 88, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 11px;
  color: var(--surface-1);
  z-index: 100;
  user-select: none;
}

/* ============================================================
   GRID VIEW — Finder icon grid
   ============================================================ */
.macos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px;
  padding: 12px;
}

.macos-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.12s, border-color 0.12s;
  border: 1px solid transparent;
  text-align: center;
  position: relative;
}
.macos-card:hover {
  background: rgba(10, 132, 255, 0.15);
  border-color: rgba(10, 132, 255, 0.50);
}
.macos-card:active { opacity: 0.8; }

.macos-card__icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 8px;
}
.macos-card__icon--placeholder {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: 14px;
}

.macos-card__name {
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 3px;
  word-break: break-word;
}
.macos-card__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

/* ============================================================
   LIST VIEW — Finder table
   ============================================================ */
.macos-list {
  width: 100%;
}

.macos-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.macos-list-table thead tr {
  background: var(--surface-2);
}
.macos-list-table th {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 6px 12px;
  text-align: left;
  border-bottom: 0.5px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.macos-list-table td {
  padding: 5px 12px;
  border-bottom: 0.5px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
  height: 28px;
  white-space: nowrap;
}
.macos-list-table tbody tr:hover td {
  background: rgba(120, 120, 128, 0.08);
}
.macos-list-table a { color: inherit; text-decoration: none; }

.col-thumb { width: 64px; padding-right: 0; }
.col-thumb img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; }

/* ============================================================
   COLUMN VIEW
   ============================================================ */
.macos-columns {
  display: flex;
  min-height: 100%;
}
.macos-column {
  flex: 0 0 280px;
  border-right: 0.5px solid var(--border);
  overflow-y: auto;
  max-height: 500px;
}
.macos-column::-webkit-scrollbar { width: 0; }
.macos-column--main { flex: 1; }

/* Mobile responsive layout */
@media (max-width: 768px) {
  .macos-columns {
    flex-direction: column;
    min-height: auto;
  }
  .macos-column {
    flex: none;
    max-height: 200px;
    border-right: none;
    border-bottom: 0.5px solid var(--border);
  }
  .macos-column--main {
    flex: none;
    min-height: 300px;
    padding: 0;
  }
  #col-detail {
    padding: 16px !important;
  }
}

.macos-column-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 0.5px solid var(--border-subtle);
  transition: background 0.1s;
}
.macos-column-item:hover             { background: rgba(120, 120, 128, 0.08); }
.macos-column-item.is-active         { background: rgba(10, 132, 255, 0.20); color: var(--blue); }
.macos-column-item .chev             { margin-left: auto; color: var(--text-tertiary); font-size: 11px; }
button.macos-column-item             { width: 100%; background: none; border: none; text-align: left; cursor: pointer; font-family: var(--font-sans); }

/* Column detail panel (right pane populated by JS) */
.col-detail__img     { display: block; width: 64px; height: 64px; object-fit: contain; margin-bottom: 14px; }
.col-detail__name    { font-family: var(--font-display); font-size: 17px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.col-detail__id      { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.col-detail__sub     { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.col-detail__stats   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.col-detail__stat    { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; }
.col-detail__stat-num { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.col-detail__stat-label { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.col-detail__loading { color: var(--text-secondary); font-size: 13px; font-style: italic; }
.col-detail__actions { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.col-detail__btn-ota { background: rgba(120,120,128,.16) !important; color: var(--text-primary) !important; border: 0.5px solid var(--border) !important; }

/* ============================================================
   BADGES & STATUS PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 980px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 8px;
  font-family: var(--font-sans);
  border: 0.5px solid;
  white-space: nowrap;
}

.badge-signed { color: var(--green); background: rgba(48, 209, 88, 0.14); border: 2px solid rgba(48, 209, 88, 0.30); border-radius: 4px; /* Optional: adds rounded corners */ padding: 4px 8px; /* Optional: adds some spacing inside the badge */ display: inline-block; /* Optional: makes it behave like a badge */ }
.badge-unsigned { color: var(--red); background: rgba(255, 59, 48, 0.14); border: 2px solid rgba(255, 59, 48, 0.30); border-radius: 4px; /* Optional: adds rounded corners */ padding: 4px 8px; /* Optional: adds some spacing inside the badge */ display: inline-block; /* Optional: makes it behave like a badge */ }
.badge-beta     { color: var(--orange); background: rgba(255, 159, 10,  0.14); border-color: rgba(255, 159, 10,  0.30); }
.badge-mono     { font-family: var(--font-mono); font-size: 11px; }

/* ============================================================
   DETAIL PAGE — Inspector panel
   ============================================================ */
.macos-detail-layout {
  display: flex;
  min-height: 100%;
}
.macos-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.macos-detail-body::-webkit-scrollbar { width: 8px; }
.macos-detail-body::-webkit-scrollbar-thumb { background: rgba(84,84,88,0.35); border-radius: 4px; }

.macos-inspector {
  width: var(--inspector-w);
  flex-shrink: 0;
  background: var(--surface-1);
  border-left: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px 16px;
  overflow-y: auto;
  gap: 0;
}
.macos-inspector::-webkit-scrollbar { width: 0; }

.macos-inspector__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  word-break: break-word;
}

.macos-inspector__divider {
  height: 0.5px;
  background: var(--border);
  margin: 12px 0;
}

.macos-inspector__row {
  margin-bottom: 14px;
}
.macos-inspector__label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}
.macos-inspector__value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  word-break: break-all;
  line-height: 1.5;
}
.macos-inspector__value--normal {
  font-family: var(--font-sans);
  font-size: 13px;
}

.macos-inspector__spacer { flex: 1; }

.macos-inspector__download-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.15s;
  margin-top: 16px;
}
.macos-inspector__download-btn:hover { opacity: 0.88; }
.macos-inspector__download-btn:active { opacity: 0.74; }

/* ============================================================
   IOS-STYLE GROUPED LIST (detail & tool pages)
   ============================================================ */
.ios-group-header {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 16px 16px 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 12px;
}
.ios-group {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 13px;
  overflow: hidden;
  margin: 0 16px 12px;
}
.ios-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border-subtle);
  font-size: 15px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.1s;
  gap: 12px;
}
.ios-row:last-child { border-bottom: none; }
.ios-row:hover      { background: rgba(120, 120, 128, 0.08); }
.ios-row__icon  { width: 32px; height: 32px; flex-shrink: 0; }
.ios-row__label { flex: 1; }
.ios-row__value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  text-align: right;
}
.ios-row__chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ============================================================
   SECTION TITLE (page headings inside content)
   ============================================================ */
.macos-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 16px 16px 4px;
}
.macos-section-sub {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 0 16px 12px;
}

/* ============================================================
   HERO BANNER (home page)
   ============================================================ */
.macos-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 32px 24px 24px;
  border-bottom: 0.5px solid var(--border-subtle);
}
.macos-hero__text { flex: 1; min-width: 0; }
.macos-hero__headline {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 10px;
}
.macos-hero__sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 540px;
}
.macos-hero__art { flex-shrink: 0; }
.macos-hero__art img { width: 180px; height: auto; }

.macos-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity 0.15s;
}
.macos-btn:hover { opacity: 0.88; }
.macos-btn--blue   { background: var(--blue);   color: #fff; }
.macos-btn--plain  { background: var(--surface-2); color: var(--text-primary); }
.macos-btn-group   { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   SEARCH BAR (standalone, inside pages)
   ============================================================ */
.macos-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--border-subtle);
}
.macos-search-bar form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.macos-search-bar input[type="text"],
.macos-search-bar select {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
}
.macos-search-bar input[type="text"] { flex: 1; }
.macos-search-bar input::placeholder { color: var(--text-tertiary); }
.macos-search-bar input:focus,
.macos-search-bar select:focus { border-color: var(--blue); }
.macos-search-bar select option { background: var(--surface-2); }

/* ============================================================
   DEVICE HEADER (above content on listing pages)
   ============================================================ */
.macos-device-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border-subtle);
}
.macos-device-header__img { width: 48px; height: 48px; object-fit: contain; }
.macos-device-header__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.macos-device-header__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.macos-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 12px;
  color: var(--text-secondary);
  text-align: center;
}
.macos-empty svg { opacity: 0.35; }
.macos-empty p { font-size: 15px; color: var(--text-secondary); }

/* ============================================================
   SPINNER / LOADING
   ============================================================ */
.macos-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   UTILITY
   ============================================================ */
.mono    { font-family: var(--font-mono); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-secondary); }
.text-blue  { color: var(--blue); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-orange { color: var(--orange); }

/* ============================================================
   MOBILE — iOS 17 look (< 768px)
   Desktop chrome is completely hidden; iOS chrome shown
   ============================================================ */
@media (max-width: 767px) {
  /* Hide all desktop chrome */
  .macos-menubar  { display: none !important; }
  .macos-sidebar  { display: none !important; }
  .macos-statusbar { display: none !important; }
  .macos-toolbar  { display: none !important; }

  /* Reset content area */
  .macos-content {
    margin-left: 0;
    padding-top: 0;
  }
  .macos-content__scroll {
    padding-bottom: calc(49px + env(safe-area-inset-bottom) + 8px);
  }

  /* iOS Navigation Bar */
  .ios-navbar {
    position: sticky;
    top: 0;
    height: calc(44px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: var(--mobile-bar-bg);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    border-bottom: 0.5px solid var(--border);
    z-index: 200;
    display: flex;
    align-items: flex-end;
  }

  .ios-navbar__inner {
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px;
    padding: 0 16px;
    position: relative;
  }

  .ios-navbar__back {
    color: var(--blue);
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    z-index: 1;
  }

  .ios-navbar__action {
    margin-left: auto;
    color: var(--blue);
    font-size: 17px;
    z-index: 1;
    text-decoration: none;
  }

  /* iOS Tab Bar */
  .ios-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(49px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--mobile-bar-bg);
    backdrop-filter: blur(26px) saturate(180%);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    border-top: 0.5px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: flex-start;
    padding-top: 8px;
    z-index: 200;
  }

  .ios-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 500;
    padding: 0 2px;
    transition: color 0.1s;
  }
  .ios-tab.is-active { color: var(--blue); }
  .ios-tab svg { width: 24px; height: 24px; }

  /* Collapsible hero on mobile */
  .macos-hero {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }
  .macos-hero__art { display: none; }
  .macos-hero__headline { font-size: 22px; }

  /* Grid — 2 cols on mobile */
  .macos-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  /* Inspector becomes full page section on mobile */
  .macos-detail-layout { flex-direction: column; }
  .macos-inspector {
    width: 100%;
    border-left: none;
    border-top: 0.5px solid var(--border);
  }
}

/* Desktop — hide iOS chrome */
@media (min-width: 768px) {
  .ios-navbar             { display: none; }
  .ios-tabbar             { display: none; }
  .ios-mobile-view-ctrl   { display: none !important; }
  .macos-search-overlay   { display: none !important; }
}

/* ============================================================
   iOS Navbar: favicon + brand name
   ============================================================ */
.ios-navbar__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.ios-navbar__favicon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
  flex-shrink: 0;
}
.ios-navbar__title span {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.ios-navbar__action {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

/* ============================================================
   Mobile View Toggle strip  (below ios-navbar, mobile only)
   ============================================================ */
.ios-mobile-view-ctrl {
  display: none;
  background: var(--surface-1);
  border-bottom: 0.5px solid var(--border);
  padding: 7px 16px;
}
.ios-mobile-view-ctrl__inner {
  display: flex;
  background: var(--surface-3);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
  width: fit-content;
  margin: 0 auto;
}
.ios-view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 18px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.ios-view-btn:hover   { color: var(--text-primary); }
.ios-view-btn.is-active {
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

@media (max-width: 767px) {
  .ios-mobile-view-ctrl { display: block; }
}

/* ============================================================
   Desktop AJAX Search dropdown
   ============================================================ */
.macos-toolbar__search { position: relative; }

.macos-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 300px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  z-index: 1000;
  -webkit-overflow-scrolling: touch;
}
.macos-search-dropdown.is-open { display: block; }

.macos-search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  border-bottom: 0.5px solid var(--border-subtle);
  transition: background 0.1s;
}
.macos-search-result-item:last-child { border-bottom: none; }
.macos-search-result-item:hover     { background: rgba(120, 120, 128, 0.16); }
.macos-search-result__name {
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.macos-search-result__id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ============================================================
   Mobile search overlay  (full-screen)
   ============================================================ */
.macos-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--bg);
  flex-direction: column;
}
.macos-search-overlay.is-open { display: flex; }

.macos-search-overlay__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface-1);
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.macos-search-overlay__input-wrap {
  flex: 1;
  position: relative;
}
.macos-search-overlay__input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}
#macos-search-overlay-input {
  width: 100%;
  height: 38px;
  background: var(--surface-3);
  border: none;
  border-radius: 10px;
  padding: 0 12px 0 34px;
  font-family: var(--font-sans);
  font-size: 16px; /* 16px prevents iOS zoom */
  color: var(--text-primary);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
#macos-search-overlay-input::placeholder { color: var(--text-tertiary); }

.macos-search-overlay__close {
  background: none;
  border: none;
  color: var(--blue);
  font-family: var(--font-sans);
  font-size: 17px;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.macos-search-overlay__results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.macos-search-overlay__results .macos-search-result-item {
  padding: 14px 20px;
  font-size: 15px;
  border-bottom: 0.5px solid var(--border-subtle);
}
.macos-search-no-results {
  text-align: center;
  color: var(--text-secondary);
  font-size: 15px;
  padding: 40px 20px;
}

/* ============================================================
   TOOL PAGES — Shared Design System
   ios-signing-status-checker, ios-build-number-decoder,
   jailbreak-compatibility-checker, max-version-checker
   ============================================================ */

/* ── Utility helpers ─────────────────────────────────── */
.flex   { display: flex; }
.flex-1 { flex: 1; min-width: 0; }
.c-green  { color: var(--green)  !important; }
.c-red    { color: var(--red)    !important; }
.gold     { color: var(--yellow) !important; }
.red      { color: var(--red)    !important; }
.signed   { color: var(--green); }
.unsigned { color: var(--red);   }
.accent {
  background: linear-gradient(135deg, var(--blue), #5ac8fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout wrappers ─────────────────────────────────── */
.wrap {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.wrap-alt { background: rgba(0,0,0,0.02); }
.c { max-width: 900px; margin: 0 auto; }

/* ── Hero Section ────────────────────────────────────── */
.hero, .hero-simple {
  position: relative;
  padding: 4rem 1.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}
/* max-version-checker uses .hero as flex row (text + visual) */
.hero:has(.hero-visual) {
  display: flex;
  align-items: center;
  gap: 3rem;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(84,84,88,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84,84,88,.15) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(10,132,255,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10,132,255,.12);
  border: 0.5px solid rgba(10,132,255,.3);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
.hero-eyebrow svg { width: 14px; height: 14px; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.03em;
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.03em;
  margin-bottom: 1rem;
}
.hero-title .line-plain  { display: block; color: var(--text-primary); }
.hero-title .line-outline {
  display: block;
  -webkit-text-stroke: 1px var(--text-secondary);
  color: transparent;
}
.hero-title .line-fill {
  display: block;
  background: linear-gradient(135deg, var(--blue) 0%, #5ac8fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle, .hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 560px;
  margin-bottom: 2rem;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.hero-stat-item { display: flex; flex-direction: column; }
.hero-stat-num  { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.hero-stat-label { font-size: 11px; color: var(--text-secondary); letter-spacing: .04em; }
.hero-visual { flex-shrink: 0; }

/* Orbit animation (max-version-checker hero) */
.device-orbit { position: relative; width: 140px; height: 140px; }
.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(84,84,88,.5);
  border-radius: 50%;
}
.orbit-ring:nth-child(2) { inset: 16px; }
.orbit-ring:nth-child(3) { inset: 32px; }
.orbit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 12px var(--blue);
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
}
.orbit-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* Compact Hero Variant */
.hero-compact {
  padding: 2.5rem 1rem 2rem 1.5rem !important;
  gap: 3rem !important;
}
.hero-compact .hero-visual {
  margin-right: 0.5rem;
}
.hero-compact h1 {
  font-size: clamp(2rem, 4vw, 3.2rem) !important;
  margin-bottom: 0.8rem !important;
}
.hero-compact .hero-sub {
  font-size: 1rem !important;
  margin-bottom: 1.5rem !important;
  max-width: 480px !important;
}
.hero-compact .hero-stats {
  gap: 1rem !important;
  margin-top: 1rem !important;
}
.orbit-compact {
  width: 100px !important;
  height: 100px !important;
}
.orbit-compact .orbit-ring:nth-child(2) { inset: 12px; }
.orbit-compact .orbit-dot {
  width: 6px;
  height: 6px;
  top: -3px;
}
.orbit-compact .orbit-center {
  font-size: 1.8rem;
}

/* Stats bar */
.stats-bar {
  display: flex;
  margin-top: 2rem;
  border-top: 0.5px solid var(--border);
  padding-top: 1.5rem;
  flex-wrap: wrap;
  gap: 0;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 90px;
  padding: 0 1.5rem;
  border-right: 0.5px solid var(--border-subtle);
}
.stat-item:first-child { padding-left: 0; }
.stat-item:last-child  { border-right: none; }
.stat-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}
.stat-label { font-size: 11px; color: var(--text-secondary); letter-spacing: .04em; }

/* ── Section headers ─────────────────────────────────── */
.sec-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .75rem;
}
.sec-tag svg { width: 14px; height: 14px; }
.sec-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: 2rem;
}
.sec-body { font-size: .95rem; color: var(--text-secondary); line-height: 1.6; }
.section-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: .5rem;
}

/* ── Steps grid ──────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.step-card {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color .2s;
}
.step-card:hover { border-color: rgba(10,132,255,.4); }
.step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: .08em;
  margin-bottom: .75rem;
}
.step-icon-wrap {
  width: 36px;
  height: 36px;
  background: rgba(10,132,255,.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .75rem;
  color: var(--blue);
}
.step-icon-wrap svg { width: 18px; height: 18px; }
.step-title { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.step-desc  { font-size: .82rem; color: var(--text-secondary); line-height: 1.6; }
.step-desc code {
  font-family: var(--font-mono);
  background: rgba(120,120,128,.2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .78rem;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg    { width: 16px; height: 16px; flex-shrink: 0; }
.btn-blue    { background: var(--blue); color: #fff; }
.btn-blue:hover  { opacity: .85; }
.btn-ghost   { background: rgba(120,120,128,.16); border: 0.5px solid var(--border); color: var(--text-primary); }
.btn-ghost:hover { background: rgba(120,120,128,.24); }
.btn-gold    { background: var(--yellow); color: #000; }
.btn-gold:hover  { opacity: .85; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-row, .action-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Checker card (macOS window style) ───────────────── */
.checker-card {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.chrome-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 0.5px solid var(--border);
}
.chrome-dots { display: flex; gap: 6px; }
.chrome-dot  { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); }
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }
.chrome-title { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); margin: 0 auto; }
.checker-body { padding: 1.5rem; }

/* ── Tabs ────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tab-btn svg { width: 14px; height: 14px; }
.tab-btn:hover { color: var(--text-primary); background: rgba(120,120,128,.16); }
.tab-btn.tab-active {
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.type-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.type-tab {
  padding: 5px 12px;
  background: rgba(120,120,128,.12);
  border: 0.5px solid var(--border-subtle);
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all .15s;
}
.type-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Form elements ───────────────────────────────────── */
.field-label, .field {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .04em;
  margin-bottom: .4rem;
}
.cyber-input, .cyber-select, .inp {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.cyber-input:focus, .cyber-select:focus, .inp:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,132,255,.2);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
  font-size: 12px;
}
.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(10,132,255,.08);
  border: 0.5px solid rgba(10,132,255,.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.info-banner svg { width: 16px; height: 16px; color: var(--blue); flex-shrink: 0; margin-top: 1px; }
.input-hint { font-size: .75rem; color: var(--text-tertiary); margin-top: 8px; }
.input-hint code {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: rgba(120,120,128,.2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .72rem;
}
.input-row { display: flex; gap: 0; }
.hint { font-size: .78rem; color: var(--text-tertiary); margin-top: 5px; }

/* ── Badges / chips ──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green  { background: rgba(48,209,88,.12);  color: var(--green);  border: 0.5px solid rgba(48,209,88,.3); }
.badge-red    { background: rgba(255,69,58,.12);  color: var(--red);    border: 0.5px solid rgba(255,69,58,.3); }
.badge-amber  { background: rgba(255,159,10,.12); color: var(--orange); border: 0.5px solid rgba(255,159,10,.3); }
.badge-blue   { background: rgba(10,132,255,.12); color: var(--blue);   border: 0.5px solid rgba(10,132,255,.3); }
.badge-new    { background: rgba(48,209,88,.1);   color: var(--green);  border: 0.5px solid rgba(48,209,88,.25); }

/* Signing status */
.sb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
}
.sb-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sb-signed   { background: rgba(48,209,88,.12);  color: var(--green);  border: 0.5px solid rgba(48,209,88,.3); }
.sb-unsigned { background: rgba(255,69,58,.12);  color: var(--red);    border: 0.5px solid rgba(255,69,58,.3); }
.sb-partial  { background: rgba(255,159,10,.12); color: var(--orange); border: 0.5px solid rgba(255,159,10,.3); }
.sb-unknown  { background: rgba(120,120,128,.12); color: var(--text-secondary); border: 0.5px solid var(--border); }

/* Platform badges */
.pb { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: .7rem; font-weight: 600; }
.pb-ios     { background: rgba(10,132,255,.15);  color: var(--blue); }
.pb-macos   { background: rgba(191,90,242,.15);  color: var(--purple); }
.pb-watchos { background: rgba(48,209,88,.15);   color: var(--green); }
.pb-tvos    { background: rgba(255,159,10,.15);  color: var(--orange); }
.pb-homepod { background: rgba(255,69,58,.15);   color: var(--red); }

/* Chip pills */
.chip-pills, .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(120,120,128,.15);
  border: 0.5px solid var(--border-subtle);
  border-radius: 100px;
  font-size: .72rem;
  color: var(--text-secondary);
}
.chip-mono { font-family: var(--font-mono); color: var(--text-primary); }
.chip-lime { background: rgba(48,209,88,.12); color: var(--green); border-color: rgba(48,209,88,.3); }

/* Version chips */
.version-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.version-chip {
  padding: 4px 10px;
  background: rgba(120,120,128,.15);
  border: 0.5px solid var(--border);
  border-radius: 100px;
  font-size: .75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--font-mono);
}
.version-chip:hover { background: rgba(10,132,255,.15); color: var(--blue); border-color: rgba(10,132,255,.3); }

/* ── Loading / error states ──────────────────────────── */
.loading-box, .error-box, .state-box, .err-box {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: .88rem;
}
.loading-box.visible, .error-box.visible, .state-box.visible { display: flex; }
.error-box svg, .err-icon { width: 28px; height: 28px; color: var(--red); }
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(120,120,128,.3);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: tp-spin .75s linear infinite;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }
.err-content { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 2rem; text-align: center; color: var(--text-secondary); }

/* ── Result areas ────────────────────────────────────── */
.result-area {
  display: none;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}
.result-area.visible { display: flex; }
.result-panel { display: none; }
.result-panel.visible { display: block; }

/* Device header in result */
.device-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface-2);
  border-radius: 10px;
  flex-wrap: wrap;
}
.device-image-box {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(120,120,128,.1);
  border-radius: 8px;
  overflow: hidden;
}
.device-image-box img { width: 100%; height: 100%; object-fit: contain; }
.device-image-box svg { width: 28px; height: 28px; color: var(--text-tertiary); }
.device-meta { flex: 1; min-width: 0; }
.device-name-large {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-id-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.device-id-chip {
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: 2px 8px;
  background: rgba(120,120,128,.2);
  border-radius: 6px;
  color: var(--text-secondary);
}
.signed-summary { font-size: .8rem; color: var(--text-secondary); }
.signed-count   { font-weight: 600; }

/* Firmware table */
.fw-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 0.5px solid var(--border);
}
.fw-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.fw-table thead tr { background: var(--surface-2); border-bottom: 0.5px solid var(--border); }
.fw-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.fw-table td { padding: 10px 12px; border-bottom: 0.5px solid var(--border-subtle); }
.fw-table tr:last-child td { border-bottom: none; }
.fw-table tr:hover td { background: rgba(120,120,128,.06); }
.fw-table .build-id { font-family: var(--font-mono); font-size: .78rem; color: var(--text-secondary); }
.fw-table .fw-link  { color: var(--blue); }
.fw-table .fw-link-dl { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-size: .78rem; }
.compact-table-wrap { overflow-x: auto; }
.compact-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.compact-table th, .compact-table td { padding: 8px 12px; border-bottom: 0.5px solid var(--border-subtle); text-align: left; }
.compact-table th { font-size: .72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }

/* Version result hero */
.version-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.vh-version { font-size: 2rem; font-weight: 800; font-family: var(--font-display); margin-bottom: 4px; }
.vh-build   { font-family: var(--font-mono); font-size: .75rem; color: var(--text-secondary); }
.vh-stats   { display: flex; gap: 1.5rem; }
.vh-stat-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vh-stat-num  { font-size: 1.4rem; font-weight: 700; font-family: var(--font-display); }
.vh-stat-label { font-size: .7rem; color: var(--text-secondary); letter-spacing: .04em; }
.version-device-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.vd-device-img { width: 48px; height: 48px; object-fit: contain; display: block; margin: 0 auto .5rem; }
.vd-name  { font-size: .8rem; font-weight: 600; text-align: center; }
.vd-id    { font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary); text-align: center; }
.vd-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 600;
  margin-top: 4px;
}

/* ── Terminal card ───────────────────────────────────── */
.terminal-card {
  background: #0d1117;
  border: 0.5px solid rgba(84,84,88,.4);
  border-radius: 12px;
  overflow: hidden;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #161b22;
  border-bottom: 0.5px solid rgba(84,84,88,.3);
}
.bar-dots { display: flex; gap: 5px; }
.bar-status-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(120,120,128,.3); }
.bar-label    { font-family: var(--font-mono); font-size: 11px; color: rgba(235,235,245,.4); margin: 0 auto; }
.terminal-body {
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.9;
  overflow-x: auto;
  white-space: pre-line;
}
.t-prompt { color: #8b949e; }
.t-cmd    { color: #79c0ff; }
.t-ok     { color: #3fb950; }
.t-err    { color: #f85149; }
.t-out    { color: #e6edf3; }
.t-warn   { color: #d29922; }
.cursor   { display: inline-block; width: 7px; height: 13px; background: #79c0ff; animation: tp-blink 1s step-end infinite; vertical-align: text-bottom; }
.t-cursor-wrap { display: inline-flex; align-items: center; }
@keyframes tp-blink { 50% { opacity: 0; } }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

/* Very thin scrollbar for modal card */
.modal-card::-webkit-scrollbar {
  width: 3px;
}

.modal-card::-webkit-scrollbar-track {
  background: transparent;
}

.modal-card::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 2px;
}

.modal-card::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-4);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--border);
}
.modal-title { font-size: .95rem; font-weight: 700; }
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
}
.modal-close svg { width: 16px; height: 16px; }
.modal-body     { padding: 16px 20px; }
.modal-loading  { display: flex; justify-content: center; padding: 2rem; }
.modal-actions  {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-top: 0.5px solid var(--border);
}
.modal-dl-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 9px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity .15s;
}
.modal-dl-btn:hover { opacity: .85; }
.modal-dl-btn-primary   { background: var(--blue); color: #fff; }
.modal-dl-btn-secondary { background: rgba(120,120,128,.2); color: var(--text-primary); border: 0.5px solid var(--border); }

/* ── FAQ accordion ───────────────────────────────────── */
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.faq-item { background: var(--surface-1); }
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  border-bottom: 0.5px solid var(--border-subtle);
  transition: background .15s;
}
.faq-question:hover { background: rgba(120,120,128,.06); }
.faq-q-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background: rgba(10,132,255,.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}
.faq-q-icon svg { width: 14px; height: 14px; }
.faq-q-text  { flex: 1; }
.faq-chevron { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-secondary); transition: transform .25s; }
.faq-question.open .faq-chevron { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-answer.open { max-height: 800px; }
.faq-answer-inner { padding: 14px 20px 14px 58px; font-size: .85rem; color: var(--text-secondary); line-height: 1.7; }
.faq-q { padding: 14px 20px; cursor: pointer; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a.open { max-height: 800px; }
.faq-a-inner { padding: 12px 20px 16px; font-size: .85rem; color: var(--text-secondary); line-height: 1.7; }

/* ── About grid ──────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1.25rem; padding: 1rem; }
.about-block {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.about-block-header { display: flex; align-items: center; gap: 10px; margin-bottom: .75rem; }
.about-icon-box {
  width: 36px;
  height: 36px;
  background: rgba(10,132,255,.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
}
.about-icon-box svg { width: 18px; height: 18px; }
.about-block-title { font-weight: 700; font-size: .95rem; }
.about-block-text  { font-size: .82rem; color: var(--text-secondary); line-height: 1.6; }
.about-stats-row {
  display: flex;
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.about-stat { flex: 1; padding: 1.25rem; text-align: center; border-right: 0.5px solid var(--border-subtle); }
.about-stat:last-child { border-right: none; }
.about-stat-num   { font-size: 1.5rem; font-weight: 800; font-family: var(--font-display); margin-bottom: 4px; }
.about-stat-label { font-size: .72rem; color: var(--text-secondary); }

/* ── Blob / SHSH sections ────────────────────────────── */
.blob-hero-banner {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.blob-hero-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; }
.blob-hero-sub   { font-size: .85rem; color: var(--text-secondary); line-height: 1.6; }
.blob-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255,159,10,.08);
  border: 0.5px solid rgba(255,159,10,.3);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: .85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.blob-warning-box svg { width: 18px; height: 18px; color: var(--orange); flex-shrink: 0; margin-top: 1px; }
.blob-steps-row {
  display: grid;
  grid-template-columns: repeat(1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
.blob-step { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.blob-step-num   { font-family: var(--font-mono); font-size: .7rem; color: var(--blue); font-weight: 700; margin-bottom: .5rem; }
.blob-step-title { font-weight: 600; font-size: .88rem; margin-bottom: .5rem; }
.blob-step-desc  { font-size: .8rem; color: var(--text-secondary); line-height: 1.6; }
.blob-tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.blob-tool-card {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.blob-tool-header { display: flex; align-items: center; gap: 12px; }
.blob-tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.blob-tool-icon svg { width: 20px; height: 20px; }
.blob-tool-name { font-weight: 700; font-size: .95rem; }
.blob-tool-type { font-size: .72rem; color: var(--text-secondary); }
.blob-tool-body { display: none;  }  /* body revealed by JS if needed */
.blob-tool-desc { font-size: .82rem; color: var(--text-secondary); line-height: 1.6; }
.blob-tool-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.blob-tool-tag  {
  padding: 2px 8px;
  background: rgba(120,120,128,.15);
  border: 0.5px solid var(--border-subtle);
  border-radius: 100px;
  font-size: .68rem;
  color: var(--text-secondary);
}
.blob-tool-footer { display: flex; gap: 8px; margin-top: auto; padding-top: .5rem; }
.blob-tool-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity .15s;
  white-space: nowrap;
}
.blob-tool-btn-primary   { background: var(--blue);   color: #fff; }
.blob-tool-btn-secondary { background: rgba(120,120,128,.15); color: var(--text-primary); border: 0.5px solid var(--border); }
.blob-tool-btn-green     { background: var(--green); color: #000; }
.blob-tss-feature-row    { display: flex; flex-direction: column; gap: .75rem; margin-top: .5rem; }
.blob-tss-feature        { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: rgba(120,120,128,.06); border-radius: 8px; }
.blob-tss-feature-icon   { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; margin-top: 1px; }
.blob-tss-feature-title  { font-size: .82rem; font-weight: 600; margin-bottom: 2px; }
.blob-tss-feature-desc   { font-size: .78rem; color: var(--text-secondary); line-height: 1.5; }

/* ── Tool cards (more-tools / link sections) ─────────── */
.tools-grid, .tools-section-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1.25rem; }
.tool-card {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s;
}
.tool-card:hover { border-color: rgba(10,132,255,.4); }
.tool-card-top, .tool-card-preview { background: var(--surface-2); padding: 1.5rem; position: relative; overflow: hidden; }
.tool-card-preview-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 100%, rgba(10,132,255,.1) 0%, transparent 70%); }
.tool-card-content, .tool-card-body { padding: 1.25rem; flex: 1; }

.tool-card-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--green);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-card-eyebrow svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
}
.tool-card-name    { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.tool-card-desc    { font-size: .82rem; color: var(--text-secondary); line-height: 1.6; }
.tool-card-features { display: flex; flex-direction: column; gap: 6px; margin-top: .75rem; }
.tool-card-feature  { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-secondary); }
.tool-card-feature::before { content: '✓'; color: var(--green); font-size: .7rem; flex-shrink: 0; }
.tool-card-footer, .tool-card-cta { padding: 12px 1.25rem; border-top: 0.5px solid var(--border-subtle); display: flex; gap: 8px; }
.tool-feature-card { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.tool-preview-mockup { background: var(--surface-2); border-radius: 8px; padding: 10px; margin-bottom: .75rem; }
.tool-preview-row   { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 0.5px solid var(--border-subtle); }
.tool-preview-row:last-child { border-bottom: none; }
.tool-preview-label { font-size: .72rem; color: var(--text-secondary); flex: 1; }
.tool-preview-value { font-size: .72rem; font-family: var(--font-mono); }
.tool-preview-badge-a { padding: 1px 6px; border-radius: 4px; font-size: .65rem; font-weight: 600; background: rgba(48,209,88,.15);  color: var(--green); }
.tool-preview-badge-b { padding: 1px 6px; border-radius: 4px; font-size: .65rem; font-weight: 600; background: rgba(255,69,58,.15);  color: var(--red); }
.tool-preview-badge-g { padding: 1px 6px; border-radius: 4px; font-size: .65rem; font-weight: 600; background: rgba(255,159,10,.15); color: var(--orange); }
.tool-preview-dot   { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.tool-icon-box { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(10,132,255,.12); color: var(--blue); margin-bottom: .75rem; }
.tool-icon-box svg { width: 22px; height: 22px; }
.tool-name { font-weight: 700; font-size: .95rem; margin-bottom: .25rem; }
.tool-desc { font-size: .82rem; color: var(--text-secondary); line-height: 1.6; }
.tool-type-badge { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: .68rem; font-weight: 600; background: rgba(10,132,255,.1); color: var(--blue); margin-bottom: .5rem; }
.tool-compat { font-size: .75rem; color: var(--text-secondary); }
.tool-tag    { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: .68rem; background: rgba(120,120,128,.15); color: var(--text-secondary); }
.tool-links  { display: flex; gap: 6px; flex-wrap: wrap; }
.tool-link, .tool-link-gh, .tool-link-blog {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(120,120,128,.15);
  border: 0.5px solid var(--border);
  transition: background .15s;
}
.tool-link:hover, .tool-link-gh:hover, .tool-link-blog:hover { background: rgba(120,120,128,.25); }

/* ── Jailbreak checker ───────────────────────────────── */
.name-results-list { margin-top: .75rem; border: 0.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.name-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 0.5px solid var(--border-subtle);
  transition: background .1s;
}
.name-result-row:last-child { border-bottom: none; }
.name-result-row:hover      { background: rgba(120,120,128,.08); }
.name-result-row svg        { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-secondary); }
.name-result-label  { font-weight: 600; flex: 1; font-size: .88rem; }
.name-result-ids    { font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary); }
.result-device-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.device-icon-box {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(120,120,128,.1);
  border-radius: 10px;
  flex-shrink: 0;
}
.device-icon-box svg { width: 32px; height: 32px; color: var(--text-secondary); }
.device-icon-box img { width: 100%; height: 100%; object-fit: contain; }
.result-device-name { font-size: 1.1rem; font-weight: 700; }
.result-identifiers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.result-table-wrap { overflow-x: auto; border-radius: 10px; border: 0.5px solid var(--border); }
.result-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.result-table th { padding: 8px 12px; text-align: left; font-size: .72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); border-bottom: 0.5px solid var(--border); }
.result-table td { padding: 11px 12px; border-bottom: 0.5px solid var(--border-subtle); }
.result-table tr:last-child td { border-bottom: none; }
.result-table tr:hover td { background: rgba(120,120,128,.05); }
.multi-device-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface-2); border-radius: 8px; margin-bottom: .5rem; cursor: pointer; transition: background .15s; }
.multi-device-header:hover { background: rgba(120,120,128,.25); }
.multi-device-icon { width: 40px; height: 40px; object-fit: contain; }
.multi-device-name { font-weight: 700; font-size: .9rem; }
.multi-device-ids  { font-size: .72rem; font-family: var(--font-mono); color: var(--text-secondary); margin-top: 2px; }

/* ── Build decoder specific ──────────────────────────── */
.decode-card { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: 14px; overflow: hidden; max-width: 640px; margin: 0 auto; }
.decode-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.decode-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.decode-btn:hover { opacity: .85; }
.build-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: .08em;
  outline: none;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.build-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,132,255,.2); }
.anatomy { display: flex; gap: 2px; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.an-seg  { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.an-c    { font-family: var(--font-mono); font-size: 1.2rem; font-weight: 800; padding: 6px 10px; border-radius: 8px; }
.an-label { font-size: .65rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.an-desc  { font-size: .6rem; color: var(--text-tertiary); }

/* Result/stat grids */
.res-grid, .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 1rem 0; }
.stat-tile { 
  background: var(--surface-1); 
  border: 0.5px solid var(--border-subtle);
  border-radius: 12px; 
  padding: 16px; 
  transition: all 0.1s ease;
}
.stat-tile:hover {
  background: var(--surface-2);
  border-color: var(--border);
}
.stat-tile .stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
  margin-bottom: 0.25rem;
}
.stat-tile .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.stat-build { 
  font-family: var(--font-mono); 
  font-size: 0.7rem; 
  color: var(--text-secondary);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.stat-sub { 
  font-size: 0.7rem; 
  color: var(--text-tertiary); 
  margin-top: 4px; 
  line-height: 1.3;
}

/* Checksum rows */
.ck-row   { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 0.5px solid var(--border-subtle); }
.ck-row:last-child { border-bottom: none; }
.ck-algo  { font-size: .78rem; font-weight: 700; color: var(--text-secondary); min-width: 48px; }
.ck-hash  { font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary); flex: 1; word-break: break-all; }
.ck-copy  { background: none; border: none; color: var(--blue); font-size: .72rem; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.ck-copy:hover { background: rgba(10,132,255,.12); }
.ck-header, .ck-title { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-secondary); padding-bottom: 6px; }

/* Device table */
.device-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.device-table-header { font-size: .72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; background: var(--surface-2); border-bottom: 0.5px solid var(--border); }
.device-table-container { overflow-x: auto; border-radius: 8px; border: 0.5px solid var(--border); }
.device-link { color: var(--blue); font-size: .78rem; }
.device-id   { font-family: var(--font-mono); font-size: .75rem; color: var(--text-secondary); }

/* Download buttons */
.dl-btn, .dl-btn-direct {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: opacity .15s;
  white-space: nowrap;
}
.dl-btn-direct { background: var(--blue); color: #fff; }
.dl-btn        { background: rgba(120,120,128,.2); color: var(--text-primary); border: 0.5px solid var(--border); }

/* Note / info boxes */
.note-box {
  background: rgba(120,120,128,.08);
  border: 0.5px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.info-section {
  background: var(--surface-1);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.warning-box { background: rgba(255,159,10,.08); border: 0.5px solid rgba(255,159,10,.3); border-radius: 10px; padding: 14px 16px; font-size: .85rem; }
.warning-header     { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: .5rem; color: var(--orange); }
.warning-title      { font-weight: 700; }
.warning-items      { display: flex; flex-direction: column; gap: 8px; margin-top: .5rem; }
.warning-item       { display: flex; align-items: flex-start; gap: 8px; }
.warning-item-icon  { flex-shrink: 0; color: var(--orange); margin-top: 1px; }
.warning-item-title { font-weight: 600; font-size: .82rem; }
.warning-item-text  { font-size: .8rem; color: var(--text-secondary); line-height: 1.5; }

/* Empty / not-found states */
.not-found, .empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-secondary); font-size: .88rem; }
.empty-hint       { font-size: .78rem; color: var(--text-tertiary); margin-top: 6px; }
.placeholder-panel { text-align: center; padding: 3rem 1rem; }
.placeholder-icon  { font-size: 2.5rem; margin-bottom: .75rem; }
.placeholder-title { font-weight: 700; font-size: 1rem; margin-bottom: .5rem; }
.placeholder-sub   { font-size: .85rem; color: var(--text-secondary); }

/* ── Detail / inspector grid ─────────────────────────── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-key  { font-size: .72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.detail-val  { font-size: .88rem; font-family: var(--font-mono); }

/* Panel widget */
.panel { background: var(--surface-1); border: 0.5px solid var(--border); border-radius: 12px; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-bottom: 0.5px solid var(--border); }
.panel-head-dot   { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.panel-head-title { font-size: .78rem; font-weight: 700; }
.panel-body { padding: 12px 14px; }

/* App wrapper (max-version-checker) */
.app { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
.card-bar  { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--surface-2); border-bottom: 0.5px solid var(--border); }
.card-body { padding: 1.25rem; }

/* Results banner */
.results-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(48,209,88,.08);
  border: 0.5px solid rgba(48,209,88,.25);
  border-radius: 8px;
  font-size: .82rem;
  color: var(--green);
  margin-bottom: 1rem;
}

/* Skeleton loading */
.skeleton-wrap, .sk-row { display: flex; flex-direction: column; gap: 8px; }
.sk-cell { height: 14px; background: rgba(120,120,128,.15); border-radius: 4px; animation: tp-sk-pulse 1.5s ease-in-out infinite; }

/* ── Enhanced Results Panel ─────────────────────────── */
.results-panel .panel-body { padding: 0; }

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.results-actions {
  display: flex;
  gap: 0.5rem;
}

.device-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 0.5px solid var(--border);
}
.device-info .device-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.device-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--text-secondary);
}

.firmware-stats {
  padding: 1.5rem 1.25rem;
  border-bottom: 0.5px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 0;
}

.firmware-section {
  padding: 1.25rem;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.section-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}
.toggle-input {
  display: none;
}
.toggle-slider {
  width: 32px;
  height: 18px;
  background: var(--surface-3);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-input:checked + .toggle-slider,
.filter-toggle.on .toggle-slider {
  background: var(--blue);
}
.toggle-input:checked + .toggle-slider::before,
.filter-toggle.on .toggle-slider::before {
  transform: translateX(14px);
}
.toggle-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.loading-state {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.loading-state.visible {
  display: flex;
}
.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--surface-3);
  border-top: 2px solid var(--blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loading-text {
  text-align: center;
}
.loading-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.loading-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.firmware-table-container {
  display: none;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.firmware-table-container.visible {
  display: block;
}
.table-wrapper {
  overflow-x: auto;
}
.firmware-table {
  width: 100%;
  border-collapse: collapse;
}
.firmware-table th {
  background: var(--surface-2);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 0.5px solid var(--border);
}
.firmware-table th.sortable {
  cursor: pointer;
  transition: background 0.1s;
}
.firmware-table th.sortable:hover {
  background: var(--surface-3);
}
.th-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sort-icon {
  opacity: 0.4;
  transition: opacity 0.1s;
}
.firmware-table th.sortable:hover .sort-icon {
  opacity: 0.7;
}
.firmware-table td {
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border-subtle);
  font-size: 0.85rem;
}
.firmware-table tbody tr:hover {
  background: var(--surface-2);
}

.empty-state, .error-state {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.empty-state.visible, .error-state.visible {
  display: flex;
}
.empty-content, .error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  max-width: 320px;
}
.empty-icon, .error-icon {
  opacity: 0.6;
  color: var(--text-secondary);
}
.error-icon {
  color: var(--red);
}
.empty-title, .error-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.empty-sub, .error-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.error-message {
  color: var(--red);
}
@keyframes tp-sk-pulse { 50% { opacity: .5; } }

/* Timeline */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 0.5px solid var(--border-subtle); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot  { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); flex-shrink: 0; margin-top: 4px; }
.timeline-label { font-size: .78rem; font-weight: 700; margin-bottom: 2px; }
.timeline-text  { font-size: .78rem; color: var(--text-secondary); line-height: 1.5; }

/* Toggle / map grid */
.toggle-pill { display: inline-flex; border: 0.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.mg-cell  { background: var(--surface-1); border-radius: 6px; padding: 6px; text-align: center; border: 0.5px solid var(--border-subtle); }
.mg-ver   { font-size: .72rem; font-weight: 700; margin-bottom: 2px; }
.mg-num   { font-size: .65rem; color: var(--text-secondary); }

/* Live pill */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  background: rgba(48,209,88,.12);
  border: 0.5px solid rgba(48,209,88,.3);
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 1rem;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: tp-live-pulse 2s ease-in-out infinite;
}
@keyframes tp-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(48,209,88,.5); }
  50%       { box-shadow: 0 0 0 4px rgba(48,209,88,0); }
}

/* Misc fw fields */
.fw        { display: flex; flex-direction: column; gap: 4px; }
.fw-wrap   { overflow-x: auto; }
.fw-version { font-weight: 700; font-size: .9rem; }
.fw-build  { font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary); }
.fw-date   { font-size: .75rem; color: var(--text-secondary); }
.fw-size   { font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary); }
.hash      { font-family: var(--font-mono); font-size: .72rem; word-break: break-all; color: var(--text-secondary); }
.date-col  { font-size: .78rem; color: var(--text-secondary); }
.meta-row, .device-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.device-name  { font-weight: 700; }
.device-title { font-size: 1rem; font-weight: 700; }
.leg       { display: flex; flex-direction: column; gap: 6px; }
.leg-item  { display: flex; align-items: center; gap: 8px; }
.leg-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.leg-title { font-size: .8rem; font-weight: 600; }
.leg-desc  { font-size: .75rem; color: var(--text-secondary); }
.bar-status    { display: flex; align-items: center; gap: 5px; }
.bd, .bb       { display: flex; gap: 5px; flex-wrap: wrap; }
.bd-g, .bb-c1  { background: rgba(48,209,88,.15);  color: var(--green); }
.bd-r, .bb-c2  { background: rgba(255,69,58,.15);  color: var(--red); }
.bd-y, .bb-c3  { background: rgba(255,206,0,.15);  color: var(--yellow); }
.bb-c4         { background: rgba(120,120,128,.15); color: var(--text-secondary); }
.cta-blue  { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; text-decoration: none; color: var(--blue);   }
.cta-green { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; text-decoration: none; color: var(--green);  }
.cta-gold  { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; text-decoration: none; color: var(--yellow); }
.cta-blue svg, .cta-green svg, .cta-gold svg { width: 14px; height: 14px; flex-shrink: 0; }
.tool-card-cta svg { width: 15px; height: 15px; flex-shrink: 0; }
.pill-dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); display: inline-block; }

/* ── Tool page responsive ────────────────────────────── */
@media (max-width: 767px) {
  .hero, .hero-simple { padding: 2.5rem 1rem 2rem; }
  .wrap  { padding: 2.5rem 1rem; }
  .hero:has(.hero-visual) { flex-direction: column; }
  .hero-visual { display: none; }
  .hero-title  { font-size: 2.2rem; }
  .stats-bar   { gap: 0; }
  .stat-item   { padding: 0 .75rem; }
  .steps-grid   { grid-template-columns: 1fr; }
  .blob-tools-grid  { grid-template-columns: 1fr; }
  .about-grid       { grid-template-columns: 1fr; }
  .tools-grid, .tools-section-grid { grid-template-columns: 1fr; }
  .checker-body { padding: 1rem; }
  .tab-btn      { padding: 6px 10px; font-size: .78rem; }
  .version-device-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-card   { border-radius: 16px 16px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: none; max-height: 90vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .about-stats-row { flex-direction: column; }
  
  /* Firmware stats responsive */
  .firmware-stats { padding: 1rem; }
  .firmware-stats .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
  }
  .stat-tile { padding: 12px 14px; }
  .stat-tile .stat-value { font-size: 1rem; }
}

@media (max-width: 480px) {
  .firmware-stats .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .stat-tile { padding: 12px; }
}

/* ============================================================
   iOS BOTTOM-SHEET MODAL  (.ios-sheet)
   ============================================================ */

/* Tab button reset (for tools/more tabs that open modals) */
.ios-tab[data-open-modal] {
  background: none;
  border: none;
  font-family: var(--font-sans);
  cursor: pointer;
  padding: 0 2px;
  width: 100%;
}

/* Sheet backdrop (full-screen scrim) */
.ios-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
}
.ios-sheet.is-open {
  display: block;
}
.ios-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  animation: ios-sheet-fade-in 0.22s ease;
}
[data-theme="dark"] .ios-sheet__backdrop {
  background: rgba(0, 0, 0, 0.65);
}

/* Sheet panel (slides up from bottom) */
.ios-sheet__panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-1);
  border-radius: 14px 14px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-height: 82vh;
  overflow-y: auto;
  animation: ios-sheet-slide-up 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.ios-sheet__handle {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  margin: 10px auto 0;
}

.ios-sheet__header {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  padding: 14px 16px 10px;
  border-bottom: 0.5px solid var(--border-subtle);
}

.ios-sheet__list {
  padding: 8px 0 8px;
}

.ios-sheet__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.12s;
  border-bottom: 0.5px solid var(--border-subtle);
}
.ios-sheet__item:last-child { border-bottom: none; }
.ios-sheet__item:active,
.ios-sheet__item:hover { background: var(--surface-2); }

.ios-sheet__item-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--blue);
}

.ios-sheet__item-text {
  flex: 1;
  min-width: 0;
}
.ios-sheet__item-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.ios-sheet__item-sub {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.ios-sheet__item-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-tertiary);
}

/* Firmware modal: 2-up principal buttons */
.ios-sheet__btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--border-subtle);
}
.ios-sheet__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 16px 10px;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.12s;
}
.ios-sheet__btn:active,
.ios-sheet__btn:hover { background: var(--surface-3); }
.ios-sheet__btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ios-sheet__btn-icon svg { width: 18px; height: 18px; }
.ios-sheet__btn-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.ios-sheet__btn-sub {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}

/* Animations */
@keyframes ios-sheet-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ios-sheet-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Terminal title */
.terminal-title {
color: var(--bg-surface);
}
