/* ═══════════════════════════════════════════════════════════════
   TOOLSTACK — PREMIUM APP STORE  |  assets/style.css
═══════════════════════════════════════════════════════════════ */

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

:root {
  --bg:           #0d0d12;
  --bg2:          #13131a;
  --bg3:          #1a1a24;
  --surface:      #1e1e2a;
  --surface2:     #252533;
  --border:       rgba(255,255,255,.07);
  --border-hover: rgba(255,255,255,.14);
  --text:         #f0f0f5;
  --text-2:       #a0a0b8;
  --text-3:       #606078;
  --accent:       #7c6cfc;
  --accent-soft:  rgba(124,108,252,.18);
  --accent-mid:   rgba(124,108,252,.35);
  --green:        #22c55e;
  --green-soft:   rgba(34,197,94,.15);
  --amber:        #f59e0b;
  --amber-soft:   rgba(245,158,11,.15);
  --purple-soft:  rgba(168,85,247,.15);
  --purple:       #a855f7;
  --radius-card:  16px;
  --radius-sm:    8px;
  --header-h:     64px;
  --shadow-card:  0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  --shadow-hover: 0 2px 6px rgba(0,0,0,.5), 0 16px 40px rgba(0,0,0,.4);
  --transition:   .18s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  background:  var(--bg);
  color:       var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  min-height:  100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--surface2); border-radius: 4px; }

/* ════════════════════════════════════════════════════════════
   HEADER
════════════════════════════════════════════════════════════ */
.header {
  position:      sticky;
  top:           0;
  z-index:       200;
  height:        var(--header-h);
  background:    rgba(13,13,18,.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width:   1280px;
  margin:      0 auto;
  height:      100%;
  display:     flex;
  align-items: center;
  gap:         32px;
  padding:     0 24px;
}

.brand {
  display:         flex;
  align-items:     center;
  gap:             9px;
  text-decoration: none;
  color:           var(--text);
  font-weight:     800;
  font-size:       17px;
  letter-spacing:  -.3px;
  flex-shrink:     0;
}

.brand-icon {
  width:         34px;
  height:        34px;
  background:    var(--accent);
  border-radius: 9px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  color:         #fff;
}

.header-nav {
  display: flex;
  gap:     4px;
}

.nav-link {
  background:    transparent;
  border:        none;
  cursor:        pointer;
  font-family:   inherit;
  font-size:     14px;
  font-weight:   600;
  color:         var(--text-2);
  padding:       6px 14px;
  border-radius: 8px;
  transition:    color var(--transition), background var(--transition);
}

.nav-link:hover  { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--text); background: var(--surface); }

.header-right {
  margin-left: auto;
  display:     flex;
  align-items: center;
  gap:         12px;
}

.search-wrap {
  position:      relative;
  display:       flex;
  align-items:   center;
}

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

#search-input {
  width:         260px;
  height:        36px;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: 10px;
  padding:       0 40px 0 34px;
  font-size:     13.5px;
  font-family:   inherit;
  color:         var(--text);
  outline:       none;
  transition:    border-color var(--transition), width var(--transition);
}

#search-input::placeholder { color: var(--text-3); }
#search-input:focus         { border-color: var(--accent); width: 300px; }

.search-kbd {
  position:       absolute;
  right:          9px;
  font-size:      10px;
  font-family:    inherit;
  background:     var(--surface2);
  color:          var(--text-3);
  border:         1px solid var(--border);
  border-radius:  4px;
  padding:        1px 5px;
  pointer-events: none;
}

#search-input:focus ~ .search-kbd { opacity: 0; }

.burger-btn {
  display:         none;
  background:      var(--surface);
  border:          1px solid var(--border);
  border-radius:   var(--radius-sm);
  cursor:          pointer;
  color:           var(--text);
  padding:         7px;
  align-items:     center;
  justify-content: center;
}

/* ════════════════════════════════════════════════════════════
   OVERLAYS  (generic — used for mobile nav, modals, panels)
════════════════════════════════════════════════════════════ */
.overlay {
  display:          none;
  position:         fixed;
  inset:            0;
  background:       rgba(0,0,0,.7);
  z-index:          500;
  backdrop-filter:  blur(6px);
}
.overlay.open { display: block; }

/* Mobile overlay sits behind the nav drawer */
#mobile-overlay {
  z-index:    300;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

/* ════════════════════════════════════════════════════════════
   MOBILE NAV
════════════════════════════════════════════════════════════ */
.mobile-nav {
  position:    fixed;
  top:         0;
  right:       -100%;
  width:       300px;
  height:      100vh;
  background:  var(--bg2);
  border-left: 1px solid var(--border);
  z-index:     400;
  padding:     24px 20px;
  overflow-y:  auto;
  transition:  right .25s cubic-bezier(.4,0,.2,1);
}
.mobile-nav.open { right: 0; }

.mobile-nav-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   20px;
}

.mobile-nav-header button {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor:        pointer;
  color:         var(--text-2);
  padding:       6px;
}

.brand-text { font-weight: 800; font-size: 16px; }

.mobile-search-row {
  display:       flex;
  align-items:   center;
  gap:           8px;
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  padding:       0 12px;
  margin-bottom: 24px;
  color:         var(--text-3);
}

#mobile-search {
  flex:        1;
  height:      38px;
  background:  transparent;
  border:      none;
  font-size:   14px;
  font-family: inherit;
  color:       var(--text);
  outline:     none;
}

#mobile-search::placeholder { color: var(--text-3); }

.mobile-cat-label {
  font-size:      10px;
  font-weight:    700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color:          var(--text-3);
  margin-bottom:  10px;
}

/* ════════════════════════════════════════════════════════════
   HERO
════════════════════════════════════════════════════════════ */
.hero {
  background:    var(--bg2);
  border-bottom: 1px solid var(--border);
  padding:       56px 0 0;
  overflow:      hidden;
}

.hero-inner {
  max-width:  1280px;
  margin:     0 auto;
  padding:    0 24px 48px;
}

.hero-pill {
  display:        inline-flex;
  align-items:    center;
  gap:            7px;
  font-size:      12px;
  font-weight:    700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color:          var(--accent);
  background:     var(--accent-soft);
  border:         1px solid var(--accent-mid);
  border-radius:  20px;
  padding:        5px 12px;
  margin-bottom:  20px;
}

.hero-pill-dot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    var(--accent);
  animation:     pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.4); }
}

.hero-title {
  font-size:      52px;
  font-weight:    800;
  letter-spacing: -1.5px;
  line-height:    1.1;
  margin-bottom:  16px;
  background:     linear-gradient(135deg, #fff 30%, #a0a0c8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size:     16px;
  color:         var(--text-2);
  max-width:     500px;
  line-height:   1.65;
  margin-bottom: 36px;
}

.hero-stats {
  display:     flex;
  align-items: center;
  gap:         28px;
}

.hero-stat {
  display:        flex;
  flex-direction: column;
  gap:            2px;
}

.stat-n {
  font-size:      24px;
  font-weight:    800;
  letter-spacing: -0.5px;
  color:          var(--text);
}

.stat-l {
  font-size:   12px;
  color:       var(--text-3);
  font-weight: 500;
}

.hero-divider {
  width:      1px;
  height:     32px;
  background: var(--border);
}

/* ── Featured strip ── */
.featured-strip {
  border-top: 1px solid var(--border);
  overflow:   hidden;
  padding:    32px 0;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
}

.featured-track {
  display:             flex;
  gap:                 20px;
  padding:             0 24px;
  max-width:           1280px;
  margin:              0 auto;
  overflow-x:          auto;
  scrollbar-width:     none;
  -ms-overflow-style:  none;
}
.featured-track::-webkit-scrollbar { display: none; }

.featured-card {
  flex-shrink:   0;
  width:         340px;
  border-radius: 20px;
  padding:       26px;
  cursor:        pointer;
  position:      relative;
  overflow:      hidden;
  transition:    transform var(--transition), box-shadow var(--transition);
  border:        1px solid rgba(255,255,255,.08);
}

.featured-card:hover {
  transform:  translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.featured-card::before {
  content:        '';
  position:       absolute;
  inset:          0;
  background:     linear-gradient(135deg, rgba(255,255,255,.05) 0%, transparent 60%);
  pointer-events: none;
}

.featured-eyebrow {
  font-size:      10px;
  font-weight:    700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity:        .7;
  margin-bottom:  14px;
}

.featured-icon {
  width:           52px;
  height:          52px;
  border-radius:   14px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       26px;
  margin-bottom:   14px;
  background:      rgba(255,255,255,.12);
}

.featured-name {
  font-size:      20px;
  font-weight:    800;
  letter-spacing: -.3px;
  margin-bottom:  6px;
}

.featured-desc {
  font-size:     13px;
  line-height:   1.55;
  opacity:       .75;
  margin-bottom: 20px;
}

.featured-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
}

/* ════════════════════════════════════════════════════════════
   PAGE WRAP
════════════════════════════════════════════════════════════ */
.page-wrap {
  max-width: 1280px;
  margin:    0 auto;
  padding:   0 24px 80px;
}

/* ════════════════════════════════════════════════════════════
   CATEGORY TABS
════════════════════════════════════════════════════════════ */
.cat-tabs-wrap {
  position:         sticky;
  top:              var(--header-h);
  z-index:          100;
  background:       rgba(13,13,18,.9);
  backdrop-filter:  blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom:    1px solid var(--border);
  margin:           0 -24px;
  padding:          0 24px;
}

.cat-tabs {
  display:         flex;
  gap:             4px;
  overflow-x:      auto;
  padding:         12px 0;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink:   0;
  display:       inline-flex;
  align-items:   center;
  gap:           6px;
  padding:       6px 14px;
  border-radius: 20px;
  font-size:     13px;
  font-weight:   600;
  font-family:   inherit;
  cursor:        pointer;
  border:        1px solid var(--border);
  background:    transparent;
  color:         var(--text-2);
  transition:    all var(--transition);
  white-space:   nowrap;
}

.cat-tab:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface); }

.cat-tab.active {
  background:   var(--accent);
  border-color: var(--accent);
  color:        #fff;
}

.cat-tab .tab-count {
  font-size:     11px;
  font-weight:   700;
  background:    rgba(255,255,255,.2);
  border-radius: 20px;
  padding:       0 6px;
  min-width:     20px;
  text-align:    center;
  line-height:   1.6;
}

.cat-tab.active .tab-count { background: rgba(255,255,255,.3); }

/* ════════════════════════════════════════════════════════════
   TOOLBAR
════════════════════════════════════════════════════════════ */
.toolbar {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         28px 0 18px;
}

.toolbar-left  { display: flex; align-items: baseline; gap: 10px; }
.toolbar-right { display: flex; align-items: center; }

.toolbar-title {
  font-size:      22px;
  font-weight:    800;
  letter-spacing: -.4px;
}

.toolbar-count {
  font-size:   13px;
  color:       var(--text-3);
  font-weight: 500;
}

.sort-sel {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  color:         var(--text-2);
  font-family:   inherit;
  font-size:     13px;
  font-weight:   600;
  padding:       7px 12px;
  cursor:        pointer;
  outline:       none;
  transition:    border-color var(--transition);
}

.sort-sel:focus  { border-color: var(--accent); }
.sort-sel option { background: var(--bg2); }

/* ════════════════════════════════════════════════════════════
   TOOL GRID
════════════════════════════════════════════════════════════ */
.tool-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap:                   16px;
}

/* ════════════════════════════════════════════════════════════
   TOOL CARD
════════════════════════════════════════════════════════════ */
.tool-card {
  background:     var(--surface);
  border:         1px solid var(--border);
  border-radius:  var(--radius-card);
  padding:        22px;
  display:        flex;
  flex-direction: column;
  gap:            14px;
  cursor:         pointer;
  transition:     border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position:       relative;
  overflow:       hidden;
}

.tool-card::after {
  content:        '';
  position:       absolute;
  top:            0;
  left:           0;
  right:          0;
  height:         1px;
  background:     linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  pointer-events: none;
}

.tool-card:hover {
  border-color: var(--border-hover);
  box-shadow:   var(--shadow-hover);
  transform:    translateY(-2px);
}

.card-top {
  display:     flex;
  align-items: flex-start;
  gap:         14px;
}

.card-icon {
  width:           52px;
  height:          52px;
  border-radius:   14px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       24px;
  flex-shrink:     0;
  border:          1px solid rgba(255,255,255,.06);
}

.card-meta { flex: 1; min-width: 0; }

.card-name {
  font-size:      15px;
  font-weight:    700;
  letter-spacing: -.2px;
  margin-bottom:  3px;
  white-space:    nowrap;
  overflow:       hidden;
  text-overflow:  ellipsis;
}

.card-cat {
  font-size:   12px;
  color:       var(--text-3);
  font-weight: 500;
}

/* Rating stars */
.card-rating {
  display:     flex;
  align-items: center;
  gap:         4px;
  margin-top:  5px;
}

.stars      { color: var(--amber); font-size: 11px; letter-spacing: .5px; }
.rating-num { font-size: 11px; color: var(--text-3); font-weight: 600; }

.card-desc {
  font-size:              13.5px;
  line-height:            1.6;
  color:                  var(--text-2);
  flex:                   1;
  display:                -webkit-box;
  -webkit-line-clamp:     2;
  -webkit-box-orient:     vertical;
  overflow:               hidden;
}

.card-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding-top:     14px;
  border-top:      1px solid var(--border);
  margin-top:      auto;
}

/* Pricing badges */
.badge {
  font-size:      11px;
  font-weight:    700;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius:  6px;
  padding:        4px 9px;
}

.badge-free     { background: var(--green-soft);  color: var(--green);  }
.badge-paid     { background: var(--amber-soft);  color: var(--amber);  }
.badge-freemium { background: var(--purple-soft); color: var(--purple); }

/* Get / Visit button */
.btn-get {
  display:         inline-flex;
  align-items:     center;
  gap:             5px;
  padding:         7px 16px;
  font-size:       12.5px;
  font-weight:     700;
  font-family:     inherit;
  border-radius:   20px;
  border:          none;
  cursor:          pointer;
  text-decoration: none;
  transition:      opacity var(--transition), transform var(--transition);
}

.btn-get:hover  { opacity: .85; transform: scale(.97); }
.btn-get:active { transform: scale(.93); }

.btn-get-free     { background: var(--accent); color: #fff; }
.btn-get-paid     { background: var(--surface2); color: var(--text-2); border: 1px solid var(--border-hover); }
.btn-get-freemium { background: linear-gradient(135deg, var(--accent), var(--purple)); color: #fff; }

/* Editor's choice star */
.editors-badge {
  position:        absolute;
  top:             14px;
  right:           14px;
  width:           24px;
  height:          24px;
  background:      linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius:   50%;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       12px;
}

/* ════════════════════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════════════════════ */
.empty-state {
  display:        none;
  flex-direction: column;
  align-items:    center;
  padding:        100px 20px;
  text-align:     center;
}

.empty-icon  { font-size: 52px; margin-bottom: 16px; opacity: .4; }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-sub   { font-size: 14px; color: var(--text-3); margin-bottom: 20px; }

.empty-reset-btn {
  background:    var(--accent);
  color:         #fff;
  border:        none;
  border-radius: 20px;
  padding:       9px 20px;
  font-size:     13px;
  font-weight:   700;
  font-family:   inherit;
  cursor:        pointer;
  transition:    opacity var(--transition);
}
.empty-reset-btn:hover { opacity: .85; }

/* ════════════════════════════════════════════════════════════
   MODAL  (shared base — detail + form)
════════════════════════════════════════════════════════════ */
.modal {
  position:       fixed;
  top:            50%;
  left:           50%;
  transform:      translate(-50%, -50%) scale(.95);
  z-index:        600;
  width:          min(540px, 94vw);
  max-height:     80vh;
  overflow-y:     auto;
  background:     var(--bg2);
  border:         1px solid var(--border-hover);
  border-radius:  24px;
  padding:        32px;
  opacity:        0;
  pointer-events: none;
  transition:     opacity .22s ease, transform .22s ease;
}

.modal.open {
  opacity:        1;
  pointer-events: auto;
  transform:      translate(-50%, -50%) scale(1);
}

.modal-x {
  position:        absolute;
  top:             16px;
  right:           16px;
  background:      var(--surface2);
  border:          1px solid var(--border);
  border-radius:   50%;
  width:           32px;
  height:          32px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  cursor:          pointer;
  color:           var(--text-2);
  transition:      background var(--transition);
}
.modal-x:hover { background: var(--surface); color: var(--text); }

/* Inside flex headers the close button participates in flow, not absolute */
.form-header .modal-x,
.sp-header   .modal-x {
  position:   static;
  flex-shrink: 0;
}

/* Detail modal content */
.modal-icon {
  width:           72px;
  height:          72px;
  border-radius:   20px;
  display:         flex;
  align-items:     center;
  justify-content: center;
  font-size:       36px;
  margin-bottom:   20px;
  border:          1px solid rgba(255,255,255,.06);
}

.modal-name {
  font-size:      26px;
  font-weight:    800;
  letter-spacing: -.5px;
  margin-bottom:  4px;
}

.modal-cat {
  font-size:     13px;
  color:         var(--text-3);
  margin-bottom: 16px;
  font-weight:   500;
}

.modal-desc {
  font-size:     15px;
  line-height:   1.7;
  color:         var(--text-2);
  margin-bottom: 24px;
}

.modal-meta {
  display:       grid;
  grid-template-columns: 1fr 1fr;
  gap:           10px;
  margin-bottom: 24px;
}

.modal-meta-item {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: 12px;
  padding:       14px;
}

.modal-meta-label {
  font-size:      11px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color:          var(--text-3);
  margin-bottom:  4px;
}

.modal-meta-value { font-size: 15px; font-weight: 700; }

.modal-actions { display: flex; gap: 10px; }

.modal-btn-primary {
  flex:            1;
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             7px;
  padding:         13px 20px;
  background:      var(--accent);
  color:           #fff;
  border:          none;
  border-radius:   12px;
  font-size:       14px;
  font-weight:     700;
  font-family:     inherit;
  text-decoration: none;
  cursor:          pointer;
  transition:      opacity var(--transition);
}
.modal-btn-primary:hover { opacity: .85; }

.modal-btn-secondary {
  padding:       13px 18px;
  background:    var(--surface);
  border:        1px solid var(--border-hover);
  border-radius: 12px;
  font-size:     14px;
  font-weight:   700;
  font-family:   inherit;
  color:         var(--text-2);
  cursor:        pointer;
  transition:    background var(--transition), color var(--transition);
}
.modal-btn-secondary:hover { background: var(--surface2); color: var(--text); }

/* ════════════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding:    20px 24px;
}

.footer-inner {
  max-width:       1280px;
  margin:          0 auto;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             12px;
}

.footer-brand { font-weight: 800; font-size: 14px; letter-spacing: -.2px; }
.footer-copy  { font-size: 13px; color: var(--text-3); }

/* ════════════════════════════════════════════════════════════
   MOBILE CATEGORY BUTTONS (inside mobile nav)
════════════════════════════════════════════════════════════ */
.mob-cat-btn {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  width:           100%;
  padding:         9px 12px;
  border-radius:   var(--radius-sm);
  font-size:       14px;
  font-weight:     600;
  font-family:     inherit;
  cursor:          pointer;
  border:          none;
  background:      transparent;
  color:           var(--text-2);
  transition:      background var(--transition), color var(--transition);
  text-align:      left;
  margin-bottom:   2px;
}

.mob-cat-btn:hover  { background: var(--surface); color: var(--text); }
.mob-cat-btn.active { background: var(--accent-soft); color: var(--accent); }

.mob-cat-count {
  font-size:     11px;
  font-weight:   700;
  background:    var(--surface2);
  border-radius: 20px;
  padding:       1px 7px;
  color:         var(--text-3);
}

.mob-cat-btn.active .mob-cat-count { background: var(--accent-mid); color: var(--accent); }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .header-nav  { display: none; }
  .search-wrap { display: none; }
  .burger-btn  { display: flex; }
  .hero-title  { font-size: 38px; }
  .featured-card { width: 300px; }
}

@media (max-width: 600px) {
  .hero-title     { font-size: 30px; }
  .hero-sub       { font-size: 14px; }
  .hero-stats     { gap: 16px; }
  .stat-n         { font-size: 20px; }
  .tool-grid      { grid-template-columns: 1fr; }
  .page-wrap      { padding: 0 16px 60px; }
  .cat-tabs-wrap  { margin: 0 -16px; padding: 0 16px; }
  .modal          { padding: 24px; }
  .modal-meta     { grid-template-columns: 1fr; }
  .toolbar        { padding: 20px 0 14px; }
  .toolbar-title  { font-size: 18px; }
  .hero-inner     { padding: 0 16px 36px; }
  .featured-strip { padding: 24px 0; }
  .featured-track { padding: 0 16px; }
  .footer-copy    { display: none; }
}

@media (max-width: 400px) {
  .hero-title { font-size: 26px; letter-spacing: -.5px; }
}

/* ════════════════════════════════════════════════════════════
   EDIT MODE — HEADER BUTTON
════════════════════════════════════════════════════════════ */
.btn-edit {
  display:      inline-flex;
  align-items:  center;
  gap:          6px;
  padding:      7px 14px;
  font-size:    13px;
  font-weight:  700;
  font-family:  inherit;
  color:        var(--text-2);
  background:   var(--surface);
  border:       1px solid var(--border);
  border-radius: 8px;
  cursor:       pointer;
  transition:   all var(--transition);
  white-space:  nowrap;
}

.btn-edit:hover {
  color:        var(--text);
  border-color: var(--border-hover);
  background:   var(--surface2);
}

.btn-edit.active {
  background:   var(--amber-soft);
  border-color: var(--amber);
  color:        var(--amber);
}

/* ════════════════════════════════════════════════════════════
   EDIT MODE — TOP BANNER
════════════════════════════════════════════════════════════ */
.edit-banner {
  display:        none;
  background:     linear-gradient(90deg, rgba(245,158,11,.12), rgba(245,158,11,.06));
  border-bottom:  1px solid rgba(245,158,11,.25);
}

.edit-banner.visible { display: block; }

.edit-banner-inner {
  max-width:       1280px;
  margin:          0 auto;
  padding:         10px 24px;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             16px;
  flex-wrap:       wrap;
}

.edit-banner-left {
  display:     flex;
  align-items: center;
  gap:         9px;
  font-size:   13.5px;
  color:       var(--amber);
}

.edit-banner-left strong { font-weight: 700; }

.edit-banner-dot {
  width:         8px;
  height:        8px;
  border-radius: 50%;
  background:    var(--amber);
  flex-shrink:   0;
  animation:     pulse 2s ease-in-out infinite;
}

.edit-banner-right {
  display:     flex;
  align-items: center;
  gap:         8px;
}

.edit-banner-add {
  display:      inline-flex;
  align-items:  center;
  gap:          6px;
  padding:      7px 14px;
  font-size:    13px;
  font-weight:  700;
  font-family:  inherit;
  background:   var(--amber);
  color:        #000;
  border:       none;
  border-radius: 8px;
  cursor:       pointer;
  transition:   opacity var(--transition);
}
.edit-banner-add:hover { opacity: .85; }

.edit-banner-reset {
  padding:       7px 14px;
  font-size:     13px;
  font-weight:   600;
  font-family:   inherit;
  background:    transparent;
  color:         var(--text-3);
  border:        1px solid var(--border-hover);
  border-radius: 8px;
  cursor:        pointer;
  transition:    color var(--transition), border-color var(--transition);
}
.edit-banner-reset:hover { color: var(--text-2); border-color: var(--text-3); }

/* ════════════════════════════════════════════════════════════
   EDIT MODE — CARD OVERLAY
════════════════════════════════════════════════════════════ */
body.edit-mode .tool-card {
  cursor:       default;
  border-color: rgba(245,158,11,.2);
}

body.edit-mode .tool-card:hover {
  border-color: var(--amber);
  box-shadow:   0 0 0 2px rgba(245,158,11,.15), var(--shadow-hover);
}

.card-edit-overlay {
  display:         none;
  align-items:     center;
  justify-content: flex-end;
  gap:             6px;
  padding-top:     10px;
  margin-top:      2px;
  border-top:      1px dashed rgba(245,158,11,.3);
}

body.edit-mode .card-edit-overlay { display: flex; }

.card-edit-btn {
  display:      inline-flex;
  align-items:  center;
  gap:          5px;
  padding:      6px 12px;
  font-size:    12px;
  font-weight:  700;
  font-family:  inherit;
  border-radius: 7px;
  border:       none;
  cursor:       pointer;
  transition:   opacity var(--transition);
}
.card-edit-btn:hover { opacity: .8; }

.card-edit-btn-edit {
  background: var(--amber-soft);
  color:      var(--amber);
  border:     1px solid rgba(245,158,11,.3);
}

.card-edit-btn-del {
  background: rgba(239,68,68,.12);
  color:      #f87171;
  border:     1px solid rgba(239,68,68,.25);
}

/* ════════════════════════════════════════════════════════════
   EDITOR FORM MODAL
════════════════════════════════════════════════════════════ */
.form-modal {
  width:      min(640px, 96vw);
  max-height: 88vh;
  padding:    28px 28px 24px;
}

.form-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   22px;
}

.form-header h2 {
  font-size:      20px;
  font-weight:    800;
  letter-spacing: -.3px;
}

/* Form layout */
.f-row2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.f-row3 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr 1fr; }

.f-field {
  display:        flex;
  flex-direction: column;
  gap:            6px;
  margin-bottom:  14px;
}

.f-label {
  font-size:      12px;
  font-weight:    700;
  color:          var(--text-2);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.f-req { color: #f87171; }

.f-input {
  background:    var(--surface2);
  border:        1px solid var(--border);
  border-radius: 8px;
  color:         var(--text);
  font-family:   inherit;
  font-size:     14px;
  padding:       9px 12px;
  outline:       none;
  transition:    border-color var(--transition);
  width:         100%;
}

.f-input:focus        { border-color: var(--accent); }
.f-input::placeholder { color: var(--text-3); }

.f-textarea {
  resize:      vertical;
  min-height:  80px;
  line-height: 1.55;
}

.f-select { cursor: pointer; }
.f-select option { background: var(--bg2); }

.f-emoji { font-size: 22px; text-align: center; padding: 6px; }

.f-color-row {
  display:     flex;
  align-items: center;
  gap:         8px;
}

.f-color-txt  { flex: 1; min-width: 0; }

.f-color-pick {
  width:         38px;
  height:        38px;
  border:        1px solid var(--border);
  border-radius: 8px;
  background:    var(--surface2);
  padding:       3px;
  cursor:        pointer;
  flex-shrink:   0;
}

.f-checks {
  display:        flex;
  flex-direction: column;
  gap:            8px;
}

.f-check {
  display:     flex;
  align-items: center;
  gap:         8px;
  font-size:   13.5px;
  color:       var(--text-2);
  cursor:      pointer;
  user-select: none;
}

.f-check input[type="checkbox"] {
  width:        16px;
  height:       16px;
  accent-color: var(--accent);
  cursor:       pointer;
  flex-shrink:  0;
}

.f-error {
  font-size:     13px;
  color:         #f87171;
  background:    rgba(239,68,68,.1);
  border:        1px solid rgba(239,68,68,.25);
  border-radius: 8px;
  padding:       9px 12px;
  margin-bottom: 14px;
  display:       none;
}

.f-actions {
  display:      flex;
  align-items:  center;
  gap:          10px;
  padding-top:  4px;
  border-top:   1px solid var(--border);
  margin-top:   6px;
}

.f-btn-save {
  flex:          1;
  padding:       11px 20px;
  background:    var(--accent);
  color:         #fff;
  border:        none;
  border-radius: 9px;
  font-size:     14px;
  font-weight:   700;
  font-family:   inherit;
  cursor:        pointer;
  transition:    opacity var(--transition);
}
.f-btn-save:hover { opacity: .85; }

.f-btn-cancel {
  padding:       11px 16px;
  background:    var(--surface2);
  color:         var(--text-2);
  border:        1px solid var(--border-hover);
  border-radius: 9px;
  font-size:     14px;
  font-weight:   700;
  font-family:   inherit;
  cursor:        pointer;
  transition:    background var(--transition);
}
.f-btn-cancel:hover { background: var(--surface); }

.f-btn-delete {
  display:       none;
  align-items:   center;
  gap:           6px;
  padding:       11px 14px;
  background:    rgba(239,68,68,.1);
  color:         #f87171;
  border:        1px solid rgba(239,68,68,.25);
  border-radius: 9px;
  font-size:     13px;
  font-weight:   700;
  font-family:   inherit;
  cursor:        pointer;
  margin-left:   auto;
  transition:    background var(--transition);
}
.f-btn-delete:hover { background: rgba(239,68,68,.18); }

/* ── Responsive editor form ── */
@media (max-width: 600px) {
  .f-row2 { grid-template-columns: 1fr; }
  .f-row3 { grid-template-columns: 1fr 1fr; }
  .form-modal { padding: 20px 16px 18px; }
  .edit-banner-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 900px) {
  .btn-edit span { display: none; }
  .btn-edit      { padding: 7px 10px; }
}

/* ════════════════════════════════════════════════════════════
   ROLE BADGE (shown in header when logged in)
════════════════════════════════════════════════════════════ */
.role-badge {
  display:      none;
  align-items:  center;
  gap:          6px;
  font-size:    12px;
  font-weight:  700;
  color:        var(--amber);
  background:   var(--amber-soft);
  border:       1px solid rgba(245,158,11,.3);
  border-radius: 20px;
  padding:      4px 10px 4px 8px;
  white-space:  nowrap;
}

.role-badge.visible { display: inline-flex; }

.role-dot {
  width:         6px;
  height:        6px;
  background:    var(--amber);
  border-radius: 50%;
  flex-shrink:   0;
}

.role-logout-btn {
  margin-left:  4px;
  background:   none;
  border:       none;
  cursor:       pointer;
  color:        var(--amber);
  opacity:      .6;
  padding:      0;
  line-height:  1;
  font-size:    14px;
  transition:   opacity var(--transition);
}
.role-logout-btn:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════════
   ADMIN LOGIN MODAL
════════════════════════════════════════════════════════════ */
.login-modal {
  width:    min(400px, 94vw);
  padding:  0;
  overflow: hidden;
}

.login-top {
  padding:       32px 32px 24px;
  text-align:    center;
  border-bottom: 1px solid var(--border);
}

.login-icon-wrap {
  width:           52px;
  height:          52px;
  background:      var(--surface2);
  border:          1px solid var(--border-hover);
  border-radius:   16px;
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  color:           var(--text-2);
  margin-bottom:   16px;
}

.login-title {
  font-size:      20px;
  font-weight:    800;
  letter-spacing: -.3px;
  margin-bottom:  6px;
}

.login-sub { font-size: 13.5px; color: var(--text-3); line-height: 1.5; }

.login-form { padding: 24px 32px 28px; }

.login-field { margin-bottom: 20px; }

.login-label {
  display:        block;
  font-size:      12px;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color:          var(--text-2);
  margin-bottom:  8px;
}

.login-input-row { position: relative; }

.login-input {
  width:          100%;
  height:         44px;
  background:     var(--surface2);
  border:         1.5px solid var(--border);
  border-radius:  10px;
  color:          var(--text);
  font-family:    inherit;
  font-size:      15px;
  padding:        0 42px 0 14px;
  outline:        none;
  transition:     border-color var(--transition), box-shadow var(--transition);
  letter-spacing: .05em;
}

.login-input:focus {
  border-color: var(--accent);
  box-shadow:   0 0 0 3px var(--accent-soft);
}

.login-input.error {
  border-color: #f87171;
  box-shadow:   0 0 0 3px rgba(239,68,68,.15);
}

.login-input::placeholder { color: var(--text-3); letter-spacing: normal; }

.login-eye {
  position:   absolute;
  right:      12px;
  top:        50%;
  transform:  translateY(-50%);
  background: none;
  border:     none;
  cursor:     pointer;
  color:      var(--text-3);
  padding:    4px;
  display:    flex;
  transition: color var(--transition);
}
.login-eye:hover { color: var(--text-2); }

.login-error {
  display:     none;
  font-size:   12.5px;
  color:       #f87171;
  margin-top:  8px;
  font-weight: 500;
}
.login-error.visible { display: block; }

.login-submit {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  width:           100%;
  height:          44px;
  background:      var(--accent);
  color:           #fff;
  border:          none;
  border-radius:   10px;
  font-size:       14.5px;
  font-weight:     700;
  font-family:     inherit;
  cursor:          pointer;
  transition:      opacity var(--transition), transform var(--transition);
  margin-bottom:   10px;
}
.login-submit:hover  { opacity: .88; }
.login-submit:active { transform: scale(.98); }
.login-submit.loading { opacity: .6; pointer-events: none; }

.login-cancel {
  width:         100%;
  height:        40px;
  background:    transparent;
  border:        1px solid var(--border);
  border-radius: 10px;
  font-size:     14px;
  font-weight:   600;
  font-family:   inherit;
  color:         var(--text-3);
  cursor:        pointer;
  transition:    border-color var(--transition), color var(--transition);
}
.login-cancel:hover { border-color: var(--border-hover); color: var(--text-2); }

/* shake animation on wrong password */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

.login-input.shake { animation: shake .4s ease; }

@media (max-width: 440px) {
  .login-top  { padding: 24px 20px 18px; }
  .login-form { padding: 18px 20px 22px; }
  .role-badge span { display: none; }
}

/* ════════════════════════════════════════════════════════════
   SUPER ADMIN BADGE VARIANT
════════════════════════════════════════════════════════════ */
.role-badge.super {
  background:   linear-gradient(135deg, rgba(251,191,36,.15), rgba(249,115,22,.12));
  border-color: rgba(251,191,36,.4);
  color:        #fbbf24;
}

.role-badge.super .role-dot {
  background: linear-gradient(135deg, #fbbf24, #f97316);
}

.role-settings-btn {
  background:  none;
  border:      none;
  cursor:      pointer;
  color:       inherit;
  opacity:     .65;
  padding:     0 2px;
  line-height: 1;
  transition:  opacity var(--transition), transform var(--transition);
  display:     inline-flex;
  align-items: center;
}
.role-settings-btn:hover { opacity: 1; transform: rotate(45deg); }

/* ════════════════════════════════════════════════════════════
   SUPER ADMIN PANEL  (slide-in from right)
════════════════════════════════════════════════════════════ */
.super-panel {
  position:       fixed;
  top:            0;
  right:          -100%;
  width:          min(420px, 100vw);
  height:         100vh;
  background:     var(--bg2);
  border-left:    1px solid var(--border-hover);
  z-index:        700;
  overflow-y:     auto;
  transition:     right .28s cubic-bezier(.4,0,.2,1);
  display:        flex;
  flex-direction: column;
}

.super-panel.open { right: 0; }

/* Header */
.sp-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         22px 24px;
  border-bottom:   1px solid var(--border);
  background:      linear-gradient(135deg, rgba(251,191,36,.08), rgba(249,115,22,.05));
  flex-shrink:     0;
}

.sp-title-row {
  display:     flex;
  align-items: center;
  gap:         12px;
}

.sp-crown    { font-size: 26px; line-height: 1; }
.sp-title    { font-size: 17px; font-weight: 800; letter-spacing: -.2px; color: #fbbf24; }
.sp-sub      { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Stats strip */
.sp-stats {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   1px;
  background:            var(--border);
  border-bottom:         1px solid var(--border);
  flex-shrink:           0;
}

.super-stat-item {
  background:  var(--bg2);
  padding:     14px 16px;
  text-align:  center;
}

.super-stat-n {
  font-size:      22px;
  font-weight:    800;
  letter-spacing: -.3px;
  color:          var(--text);
}

.super-stat-l { font-size: 11px; color: var(--text-3); margin-top: 2px; font-weight: 500; }

/* Sections */
.sp-section {
  padding:       22px 24px;
  border-bottom: 1px solid var(--border);
}

.sp-section-label {
  display:        flex;
  align-items:    center;
  gap:            7px;
  font-size:      12px;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color:          var(--text-3);
  margin-bottom:  14px;
}

/* Forms */
.sp-form {
  display:        flex;
  flex-direction: column;
  gap:            10px;
}

.sp-input {
  width:         100%;
  height:        40px;
  background:    var(--surface2);
  border:        1px solid var(--border);
  border-radius: 8px;
  color:         var(--text);
  font-family:   inherit;
  font-size:     14px;
  padding:       0 12px;
  outline:       none;
  transition:    border-color var(--transition);
}
.sp-input:focus        { border-color: var(--accent); }
.sp-input::placeholder { color: var(--text-3); }

.sp-err { font-size: 12.5px; color: #f87171; font-weight: 500; min-height: 18px; }

.sp-btn {
  height:        38px;
  background:    var(--accent);
  color:         #fff;
  border:        none;
  border-radius: 8px;
  font-size:     13px;
  font-weight:   700;
  font-family:   inherit;
  cursor:        pointer;
  transition:    opacity var(--transition);
}
.sp-btn:hover { opacity: .85; }

/* Danger zone */
.sp-danger { border-bottom: none; }

.sp-danger-label { color: #f87171; }

.sp-danger-btn {
  display:       block;
  width:         100%;
  height:        38px;
  background:    rgba(239,68,68,.1);
  color:         #f87171;
  border:        1px solid rgba(239,68,68,.25);
  border-radius: 8px;
  font-size:     13px;
  font-weight:   700;
  font-family:   inherit;
  cursor:        pointer;
  transition:    background var(--transition);
  margin-bottom: 8px;
}
.sp-danger-btn:hover { background: rgba(239,68,68,.18); }

/* Success toast */
.toast {
  position:       fixed;
  bottom:         24px;
  left:           50%;
  transform:      translateX(-50%) translateY(80px);
  background:     #166534;
  color:          #dcfce7;
  border:         1px solid #22c55e;
  border-radius:  10px;
  padding:        12px 20px;
  font-size:      13.5px;
  font-weight:    600;
  z-index:        900;
  opacity:        0;
  transition:     transform .25s ease, opacity .25s ease;
  white-space:    nowrap;
  pointer-events: none;
}

.toast.show {
  opacity:   1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
  .sp-header  { padding: 16px 18px; }
  .sp-section { padding: 18px; }
}
