/* ==========================================================================
   TallyCounter Pro — Luxury Dark Grey, Black Obsidian & Radiant Gold Theme
   - Page Background: Dark Grey (#18191c)
   - Tool Container: Pure Black (#000000)
   - Inside Lines / Dividers / Borders: Elegant Gold (#d4af37 / #ffd700)
   - Digits & Numbers: Radiant Golden Glow (#ffd700) for maximum clarity & contrast
   ========================================================================== */

:root {
  /* Radiant Gold Tokens */
  --gold-primary: #d4af37;
  --gold-bright: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.65);
  --gold-line: #d4af37;
  --gold-border: rgba(212, 175, 55, 0.45);
  --gold-border-subtle: rgba(212, 175, 55, 0.25);
  --gold-bg-subtle: rgba(212, 175, 55, 0.08);

  --primary: #d4af37;
  --primary-hover: #e5b842;
  --primary-light: rgba(212, 175, 55, 0.15);
  --secondary: #e2e8f0;
  --danger: #ef4444;
  --danger-hover: #dc2626;

  /* Surfaces: Dark Grey Background, Pitch Black Tool Surfaces */
  --bg-main: #18191c;
  --bg-header: #111215;
  --bg-capsule: #000000;
  --bg-card: #000000;
  --bg-card-alt: #0a0a0d;
  --bg-display: #000000;
  --bg-navy-lcd: #000000;
  --bg-navy-lcd-dark: #000000;
  --bg-footer: #0c0d10;
  --border-color: rgba(212, 175, 55, 0.4);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-title: #ffffff;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-gold: #ffd700;
  --counter-num-color: #ffd700;
  --counter-num-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 0 0 50px rgba(212, 175, 55, 0.35);

  /* Buttons */
  --btn-minus-bg: #222328;
  --btn-minus-hover: #2d2e35;
  --btn-plus-bg: #d4af37;
  --btn-plus-hover: #e5b842;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.9);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(212, 175, 55, 0.15);
  --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.15);
  --shadow-footer: 0 -4px 20px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.45);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg-main: #18191c;
  --bg-header: #111215;
  --bg-capsule: #000000;
  --bg-card: #000000;
  --bg-card-alt: #0a0a0d;
  --bg-display: #000000;
  --bg-navy-lcd: #000000;
  --bg-navy-lcd-dark: #000000;
  --bg-footer: #0c0d10;
  --border-color: rgba(212, 175, 55, 0.4);

  --text-main: #f8fafc;
  --text-title: #ffffff;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --text-gold: #ffd700;
  --counter-num-color: #ffd700;
  --counter-num-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 0 0 50px rgba(212, 175, 55, 0.35);

  --btn-minus-bg: #222328;
  --btn-minus-hover: #2d2e35;

  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(212, 175, 55, 0.15);
  --shadow-header: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.15);
  --shadow-footer: 0 -4px 20px rgba(0, 0, 0, 0.7);
}

[data-theme="light"] {
  /* Crisp, Luxury Light Palette with Radiant Gold Trim */
  --bg-main: #f8fafc;
  --bg-header: #ffffff;
  --bg-capsule: #ffffff;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --bg-display: #f8fafc;
  --bg-navy-lcd: #f8fafc;
  --bg-navy-lcd-dark: #f1f5f9;
  --bg-footer: #ffffff;
  --border-color: rgba(212, 175, 55, 0.45);

  --text-main: #1e293b;
  --text-title: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-gold: #b45309;
  --counter-num-color: #b45309;
  --counter-num-shadow: 0 2px 14px rgba(212, 175, 55, 0.35);

  --btn-minus-bg: #e2e8f0;
  --btn-minus-hover: #cbd5e1;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.06), 0 0 20px rgba(212, 175, 55, 0.12);
  --shadow-header: 0 2px 16px rgba(0, 0, 0, 0.05), 0 0 12px rgba(212, 175, 55, 0.1);
  --shadow-footer: 0 -2px 16px rgba(0, 0, 0, 0.05);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.25);
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
}

.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(14px, 3vw, 24px);
  padding-right: clamp(14px, 3vw, 24px);
}

/* ==========================================================================
   Header: Sleek Charcoal Dark Header with Golden Border
   ========================================================================== */
.site-header {
  background: var(--bg-header);
  border-bottom: 2px solid var(--gold-primary);
  box-shadow: var(--shadow-header);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-title);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}

/* Fix double logo: Only show one logo at a time based on active theme */
.logo-light-version {
  display: none !important;
}

.logo-dark-version {
  display: block !important;
}

[data-theme="light"] .logo-light-version {
  display: block !important;
}

[data-theme="light"] .logo-dark-version {
  display: none !important;
}

.brand-icon-hand {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--gold-bright);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav-link {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-bright);
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  color: #b45309;
}

/* Header Right Block: Capsule with Gold Border */
.header-right-capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-capsule);
  border: 1px solid var(--gold-primary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
  transition: background-color 0.2s ease;
}

.header-right-capsule a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.header-right-capsule a:hover {
  color: var(--gold-bright);
}

[data-theme="light"] .header-right-capsule a:hover {
  color: #b45309;
}

.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--gold-bright);
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.15);
}

/* Single icon visibility depending on theme */
.theme-toggle-btn .theme-icon-light {
  display: block !important;
  color: var(--gold-bright);
}
.theme-toggle-btn .theme-icon-dark {
  display: none !important;
}

[data-theme="light"] .theme-toggle-btn .theme-icon-light {
  display: none !important;
}
[data-theme="light"] .theme-toggle-btn .theme-icon-dark {
  display: block !important;
  color: #b45309;
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--gold-bright);
  cursor: pointer;
}

.mobile-nav-drawer {
  display: none;
  background: var(--bg-card);
  border-bottom: 2px solid var(--gold-primary);
  padding: 18px 24px;
}

.mobile-nav-drawer.open {
  display: block;
}

.mobile-nav-drawer a {
  display: block;
  padding: 10px 0;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

.mobile-nav-drawer a:hover {
  color: var(--gold-bright);
}

[data-theme="light"] .mobile-nav-drawer a:hover {
  color: #b45309;
}

/* ==========================================================================
   Tool Hero Header
   ========================================================================== */
.tool-hero-header {
  padding-top: 28px;
  padding-bottom: 14px;
  text-align: center;
}

.tool-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-bright);
  margin-bottom: 10px;
}

.tool-hero-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--text-title);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.tool-hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto;
}

/* ==========================================================================
   Tool Workspace General Card
   ========================================================================== */
.counter-card {
  background: var(--bg-card);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-card);
  margin: 20px 0 36px 0;
  text-align: center;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.counter-display-box {
  background: var(--bg-display);
  border: 2px solid var(--gold-primary);
  border-radius: 14px;
  padding: 24px 20px;
  margin-bottom: 24px;
  box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.12), 0 0 15px rgba(212, 175, 55, 0.15);
  transition: background-color 0.2s;
}

.counter-number {
  font-family: var(--font-mono);
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 900;
  color: var(--counter-num-color);
  text-shadow: var(--counter-num-shadow);
  line-height: 1;
  display: block;
  user-select: none;
}

.counter-meta-info {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--gold-primary);
  font-weight: 600;
}

/* Giant Click Area */
.main-click-area {
  margin-bottom: 24px;
}

.btn-increment {
  width: clamp(140px, 28vw, 190px);
  height: clamp(140px, 28vw, 190px);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #d4af37, #f59e0b);
  border: 3px solid #ffd700;
  color: #000000;
  font-size: clamp(3.5rem, 8vw, 5rem);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.5), 0 6px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s, box-shadow 0.2s;
  user-select: none;
  touch-action: manipulation;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-increment:active {
  transform: scale(0.94);
  box-shadow: 0 0 45px rgba(255, 215, 0, 0.8);
}

.click-hint {
  display: block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Secondary controls */
.counter-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 24px;
}

.btn-circle-action {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-card-alt);
  border: 1.5px solid var(--gold-primary);
  color: var(--counter-num-color);
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-circle-action:hover {
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.btn-reset-text {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--counter-num-color);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-reset-text:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-bright);
}

/* Toolbar */
.counter-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
}

.toolbar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.toolbar-select, .toolbar-input {
  background: var(--bg-card);
  border: 1.5px solid var(--gold-primary);
  color: var(--counter-num-color);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  outline: none;
}

.toolbar-toggle-btn {
  background: var(--bg-card);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.toolbar-toggle-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-bright);
}

[data-theme="light"] .toolbar-toggle-btn:hover {
  color: #b45309;
}

.toolbar-toggle-btn.active {
  border-color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.15);
  color: var(--counter-num-color);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   Tool 1: Multiple Counter
   ========================================================================== */
.multi-main-card {
  background: var(--bg-card);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: clamp(18px, 3vw, 28px);
  margin-top: 16px;
  margin-bottom: 32px;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.multi-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.35);
  margin-bottom: 24px;
}

.search-pill-box {
  display: flex;
  align-items: center;
  background: var(--bg-card-alt);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  width: 240px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.search-pill-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  width: 100%;
  color: var(--text-main);
  margin-left: 6px;
}

.search-pill-input::placeholder {
  color: var(--text-muted);
}

.counter-count-tag {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-primary);
}

/* Grand Total Capsule */
.grand-total-capsule {
  background: var(--bg-card-alt);
  border: 2px solid var(--gold-primary);
  color: var(--text-title);
  border-radius: 10px;
  padding: 6px 20px;
  text-align: center;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
  min-width: 110px;
}

.grand-total-digits {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--counter-num-color);
  text-shadow: var(--counter-num-shadow);
  line-height: 1.1;
}

.grand-total-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.multi-icon-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon-pill {
  background: var(--bg-card-alt);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--counter-num-color);
  transition: all 0.2s;
}

.btn-icon-pill:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

.btn-select-counters {
  background: var(--bg-card-alt);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-title);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-select-counters:hover {
  border-color: var(--gold-primary);
  color: var(--gold-bright);
}

[data-theme="light"] .btn-select-counters:hover {
  color: #b45309;
}

/* Category Block */
.category-wrapper {
  margin-bottom: 28px;
}

.category-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 8px;
}

.category-name-edit {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-title);
  border: none;
  background: transparent;
  outline: none;
}

.category-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-circle-num {
  background: var(--gold-primary);
  color: #000000;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
}

.category-total-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.category-total-label strong {
  color: var(--counter-num-color);
}

.btn-add-counter-plus {
  background: var(--bg-card-alt);
  color: var(--counter-num-color);
  border: 1.5px solid var(--gold-primary);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-add-counter-plus:hover {
  background: rgba(212, 175, 55, 0.2);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* Individual Counter Card */
.counter-box-card {
  background: var(--bg-card-alt);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  transition: background-color 0.2s;
}

.counter-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.counter-drag-handle {
  color: var(--gold-primary);
  font-size: 1rem;
  margin-right: 6px;
  cursor: grab;
}

.counter-name-input {
  border: none;
  background: transparent;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-title);
  outline: none;
}

/* LCD Box */
.counter-lcd-navy {
  background: var(--bg-display);
  border: 2px solid var(--gold-primary);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: inset 0 0 15px rgba(212, 175, 55, 0.15), 0 0 15px rgba(212, 175, 55, 0.18);
  transition: background-color 0.2s;
}

.counter-lcd-digits {
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 7vw, 4.2rem);
  font-weight: 900;
  color: var(--counter-num-color);
  text-shadow: var(--counter-num-shadow);
  line-height: 1;
  user-select: none;
  letter-spacing: 0.05em;
}

/* Dual Side-by-Side Wide Buttons */
.counter-dual-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn-counter-minus {
  background: var(--btn-minus-bg);
  color: var(--counter-num-color);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  padding: 14px 0;
  font-size: 1.8rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background-color 0.15s, border-color 0.2s;
  user-select: none;
  touch-action: manipulation;
}

.btn-counter-minus:active {
  transform: scale(0.97);
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
}

.btn-counter-plus {
  background: linear-gradient(135deg, #d4af37, #f59e0b);
  color: #000000;
  border: 2px solid #ffd700;
  border-radius: 10px;
  padding: 14px 0;
  font-size: 1.8rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.45);
  transition: transform 0.1s, box-shadow 0.2s;
  user-select: none;
  touch-action: manipulation;
}

.btn-counter-plus:active {
  transform: scale(0.97);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.7);
}

/* ==========================================================================
   Tool 2: Simple Counter
   ========================================================================== */
.simple-counter-stage {
  background: var(--bg-card);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 5vw, 48px) 20px;
  margin-top: 16px;
  margin-bottom: 32px;
  text-align: center;
  color: var(--text-main);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.simple-top-icons {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 32px;
}

.simple-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-card-alt);
  border: 1.5px solid var(--gold-primary);
  color: var(--counter-num-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.simple-icon-circle:hover {
  background: rgba(212, 175, 55, 0.2);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}

.simple-horizontal-layout {
  display: flex;
  align-items: center;
  justify-content: space-around;
  max-width: 680px;
  margin: 0 auto;
}

.btn-simple-circle-minus {
  width: clamp(64px, 15vw, 84px);
  height: clamp(64px, 15vw, 84px);
  border-radius: var(--radius-full);
  background: var(--bg-card-alt);
  border: 2px solid var(--gold-primary);
  color: var(--counter-num-color);
  font-size: 2.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.2s, box-shadow 0.2s;
  user-select: none;
  touch-action: manipulation;
}

.btn-simple-circle-minus:active {
  transform: scale(0.92);
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.simple-number-hero {
  font-family: var(--font-mono);
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 900;
  color: var(--counter-num-color);
  text-shadow: var(--counter-num-shadow);
  line-height: 1;
  user-select: none;
  letter-spacing: -0.02em;
}

.btn-simple-circle-plus {
  width: clamp(64px, 15vw, 84px);
  height: clamp(64px, 15vw, 84px);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #d4af37, #f59e0b);
  border: 2.5px solid #ffd700;
  color: #000000;
  font-size: 2.4rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
  transition: transform 0.1s, box-shadow 0.2s;
  user-select: none;
  touch-action: manipulation;
}

.btn-simple-circle-plus:active {
  transform: scale(0.92);
  box-shadow: 0 0 35px rgba(255, 215, 0, 0.8);
}

/* ==========================================================================
   Tool 3: Digital Tasbih Counter
   ========================================================================== */
.tasbih-stage-dark {
  background: var(--bg-card);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 4vw, 36px);
  margin-top: 16px;
  margin-bottom: 32px;
  color: var(--text-main);
  box-shadow: var(--shadow-card);
  transition: background-color 0.2s, box-shadow 0.2s;
}

.tasbih-stage-title {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--counter-num-color);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
  text-transform: uppercase;
  margin-bottom: 24px;
}

.tasbih-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 820px) {
  .tasbih-two-col-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Card: Controls */
.tasbih-control-panel {
  background: var(--bg-card-alt);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 16px;
  padding: 20px;
  transition: background-color 0.2s;
}

.tasbih-section-heading {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tasbih-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tasbih-chip {
  background: var(--bg-card);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.tasbih-chip:hover {
  border-color: var(--gold-primary);
  color: var(--gold-bright);
}

[data-theme="light"] .tasbih-chip:hover {
  color: #b45309;
}

.tasbih-chip.active {
  background: var(--gold-primary);
  border-color: var(--gold-bright);
  color: #000000;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.tasbih-custom-input-box {
  background: var(--bg-card);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tasbih-stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tasbih-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.tasbih-stat-num {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--counter-num-color);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.tasbih-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Right Column: Display & Big Golden TAP Area */
.tasbih-display-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tasbih-digital-box {
  background: var(--bg-display);
  border: 2px solid var(--gold-primary);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
  transition: background-color 0.2s;
}

.tasbih-arabic-text {
  font-family: "Traditional Arabic", "Amiri", "Scheherazade New", serif;
  font-size: 2rem;
  color: var(--counter-num-color);
  text-shadow: var(--counter-num-shadow);
  line-height: 1.2;
  margin-bottom: 4px;
}

.tasbih-transliteration {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--counter-num-color);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.tasbih-digits-display {
  font-family: var(--font-mono);
  font-size: clamp(3.5rem, 8vw, 5rem);
  font-weight: 900;
  color: var(--counter-num-color);
  text-shadow: var(--counter-num-shadow);
  line-height: 1;
}

/* Big Concentric TAP Ring Area */
.tasbih-tap-center-area {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}

.tasbih-concentric-tap {
  width: clamp(160px, 32vw, 190px);
  height: clamp(160px, 32vw, 190px);
  border-radius: var(--radius-full);
  background: radial-gradient(circle, var(--bg-card-alt) 60%, var(--bg-card) 100%);
  border: 3.5px solid var(--gold-primary);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.5), inset 0 0 20px rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
  user-select: none;
  touch-action: manipulation;
}

.tasbih-concentric-tap:active {
  transform: scale(0.94);
  box-shadow: 0 0 45px rgba(255, 215, 0, 0.8), inset 0 0 30px rgba(212, 175, 55, 0.4);
}

.tasbih-tap-text {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--counter-num-color);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  letter-spacing: 0.2em;
}

/* Bottom Actions Toolbar */
.tasbih-bottom-toolbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.btn-tasbih-tool {
  background: var(--bg-card-alt);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  padding: 12px 6px;
  color: var(--counter-num-color);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-tasbih-tool:hover {
  border-color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.35);
}

.btn-tasbih-tool.active {
  border-color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.18);
  color: var(--counter-num-color);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}


/* ==========================================================================
   Educational SEO Content Layout & FAQs
   ========================================================================== */
.seo-content-section {
  background: var(--bg-card);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 44px);
  margin-top: 36px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-card);
  transition: background-color 0.2s, box-shadow 0.2s;
}

.seo-content-section h2 {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 800;
  color: var(--text-title);
  margin-top: 36px;
  margin-bottom: 14px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.35);
  padding-bottom: 8px;
}

.seo-content-section h2:first-of-type {
  margin-top: 0;
}

.seo-content-section h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--counter-num-color);
  margin-top: 22px;
  margin-bottom: 8px;
}

.seo-content-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.seo-content-section strong {
  color: var(--text-title);
}

.seo-content-section ul, .seo-content-section ol {
  margin-left: 22px;
  margin-bottom: 18px;
  color: var(--text-muted);
}

.seo-content-section li {
  margin-bottom: 8px;
}

.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-box {
  background: var(--bg-card-alt);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 18px;
  border-left: 4px solid var(--gold-primary);
}

.feature-box h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--counter-num-color);
  margin-bottom: 4px;
}

.feature-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.faq-item {
  background: var(--bg-card-alt);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-summary {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-title);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--gold-bright);
}

details[open] .faq-summary::after {
  content: "−";
}

details[open] {
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.faq-answer {
  padding: 0 18px 16px 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Tools Quick Navigation */
.tools-quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.tool-nav-card {
  background: var(--bg-card-alt);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  padding: 18px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s;
}

.tool-nav-card:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.3);
  transform: translateY(-2px);
}

.tool-nav-icon {
  font-size: 1.8rem;
  color: var(--counter-num-color);
}

.tool-nav-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-title);
}

.tool-nav-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--bg-footer);
  border-top: 2px solid var(--gold-primary);
  box-shadow: var(--shadow-footer);
  padding: 50px 0 24px;
  margin-top: auto;
  transition: background-color 0.2s;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-col-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--counter-num-color);
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--gold-bright);
}

[data-theme="light"] .footer-link:hover {
  color: #b45309;
}

.footer-bottom {
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--gold-primary);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--gold-bright);
}

[data-theme="light"] .footer-bottom a:hover {
  color: #b45309;
}

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

@media (max-width: 640px) {
  .navbar {
    height: 60px;
  }
  .nav-links {
    display: none;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .simple-horizontal-layout {
    gap: 16px;
  }
}

/* ==========================================================================
   How It Works Section (Pixel-Perfect Match to User Screenshot)
   ========================================================================== */
.how-it-works-section {
  margin: 48px auto 40px auto;
  width: 100%;
  text-align: left;
}

.how-badge {
  display: inline-block;
  padding: 4px 10px;
  background: #081a12 !important;
  border: 1px solid #14442a !important;
  border-radius: 6px !important;
  color: #00e676 !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  margin-bottom: 16px !important;
}

.how-title {
  font-size: 2.35rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  letter-spacing: -0.025em !important;
  margin: 0 0 14px 0 !important;
  line-height: 1.25 !important;
}

.how-divider-bar {
  width: 52px !important;
  height: 3.5px !important;
  background: #00e676 !important;
  border-radius: 2px !important;
  margin-bottom: 22px !important;
}

.how-intro {
  font-size: 1.05rem !important;
  color: #94a3b8 !important;
  margin-bottom: 30px !important;
  line-height: 1.6 !important;
}

.how-grid-2x2 {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 20px !important;
}

.how-step-card {
  background: #08100d !important;
  border: 1px solid #14291e !important;
  border-radius: 14px !important;
  padding: 26px 28px !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 20px !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

.how-step-card:hover {
  border-color: #00e676 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 30px rgba(0, 230, 118, 0.12), 0 4px 20px rgba(0, 0, 0, 0.6) !important;
}

.how-step-num {
  width: 44px !important;
  height: 38px !important;
  min-width: 44px !important;
  background: #0b2419 !important;
  border: 1px solid #154e2f !important;
  border-radius: 8px !important;
  color: #00e676 !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'JetBrains Mono', monospace !important;
  margin-top: 2px !important;
}

.how-step-body {
  flex: 1 !important;
}

.how-step-heading {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 0 0 10px 0 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.01em !important;
}

.how-step-desc {
  font-size: 0.95rem !important;
  color: #8fa397 !important;
  line-height: 1.65 !important;
  margin: 0 !important;
}

/* Features Grid Boxes */
.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 28px 0;
}

.feature-box {
  background: #08100d;
  border: 1px solid #14291e;
  border-radius: 14px;
  padding: 24px 26px;
  transition: all 0.25s ease;
}

.feature-box:hover {
  border-color: #00e676;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 230, 118, 0.12);
}

.feature-box h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
}

.feature-box p {
  font-size: 0.95rem;
  color: #8fa397;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 820px) {
  .how-grid-2x2, .seo-features-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .how-title {
    font-size: 1.75rem !important;
  }
  .how-step-card, .feature-box {
    padding: 20px 22px !important;
  }
}

/* Light mode adaptations for How It Works and Feature Boxes */
[data-theme="light"] .how-title {
  color: var(--text-title) !important;
}

[data-theme="light"] .how-intro {
  color: var(--text-muted) !important;
}

[data-theme="light"] .how-step-card {
  background: #ffffff !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .how-step-card:hover {
  border-color: var(--gold-primary) !important;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2) !important;
}

[data-theme="light"] .how-step-heading {
  color: var(--text-title) !important;
}

[data-theme="light"] .how-step-desc {
  color: var(--text-muted) !important;
}

[data-theme="light"] .how-badge {
  background: rgba(212, 175, 55, 0.12) !important;
  border: 1px solid var(--gold-primary) !important;
  color: #b45309 !important;
}

[data-theme="light"] .how-step-num {
  background: rgba(212, 175, 55, 0.15) !important;
  border: 1px solid var(--gold-primary) !important;
  color: #b45309 !important;
}

[data-theme="light"] .seo-features-grid .feature-box {
  background: #ffffff !important;
  border: 1px solid rgba(212, 175, 55, 0.3) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .seo-features-grid .feature-box h4 {
  color: var(--text-title) !important;
}

[data-theme="light"] .seo-features-grid .feature-box p {
  color: var(--text-muted) !important;
}

/* Category & Pagination Filter Buttons */
.btn-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--text-muted, #94a3b8);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 40px;
  height: 40px;
}

.btn-filter:hover {
  border-color: var(--gold-primary, #d4af37);
  color: var(--gold-bright, #ffd700);
  background: rgba(212, 175, 55, 0.18);
  transform: translateY(-1px);
}

.btn-filter.active {
  background: var(--gold-primary, #d4af37);
  color: #050b07;
  border-color: var(--gold-primary, #d4af37);
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.35);
}

[data-theme="light"] .btn-filter {
  background: #f8fafc;
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #475569;
}

[data-theme="light"] .btn-filter:hover {
  background: rgba(212, 175, 55, 0.15);
  color: #b45309;
  border-color: var(--gold-primary, #d4af37);
}

[data-theme="light"] .btn-filter.active {
  background: var(--gold-primary, #d4af37);
  color: #0f172a;
}

/* ==========================================================================
   Accessibility & Mobile Optimization (WCAG 2.1 AA Compliance)
   ========================================================================== */

/* 1. Visible Keyboard Focus Indicators */
:focus-visible {
  outline: 2px solid var(--gold-primary, #d4af37) !important;
  outline-offset: 3px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-primary, #d4af37) !important;
  outline-offset: 2px !important;
}

/* 2. Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 3. Small Screen Usability & Overflow Prevention (320px, 375px, 390px) */
@media (max-width: 420px) {
  .counter-display,
  .counter-lcd-digits {
    font-size: clamp(2.6rem, 14vw, 4rem) !important;
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  .counter-dual-buttons {
    gap: 10px !important;
  }
  .btn-counter-minus,
  .btn-counter-plus,
  .btn-counter-big {
    min-height: 52px !important;
    touch-action: manipulation;
  }
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .header-right-capsule {
    gap: 8px !important;
    padding: 4px 10px !important;
  }
}




