/* TeddyTools v5.0 — unified soft-red design system */

:root {
  --tm-red-50: #fff5f6;
  --tm-red-100: #ffe5e8;
  --tm-red-300: #f9a4ae;
  --tm-red-400: #f47a89;
  --tm-red-500: #ed5b6d;
  --tm-red-600: #d83f54;
  --tm-red-700: #ad2e41;
  --tm-red-glow: rgba(237, 91, 109, .18);

  --neon-blue: #ed5b6d !important;
  --neon-purple: #f07a88 !important;
  --neon-pink: #e94860 !important;
  --neon-cyan: #f29aa4 !important;
  --grad-blue: linear-gradient(135deg, #f47a89, #d83f54) !important;
  --grad-purple: linear-gradient(135deg, #f07a88, #c4384e) !important;
  --grad-pink: linear-gradient(135deg, #f47a89, #d83f54) !important;
  --grad-hero: linear-gradient(135deg, #f598a3, #ed5b6d, #c9364d) !important;
  --glow-blue: 0 0 20px rgba(237,91,109,.20), 0 0 58px rgba(237,91,109,.07) !important;
  --glow-purple: var(--glow-blue) !important;
  --primary: #ed5b6d !important;
  --color-primary: #ed5b6d !important;

  --tm-accent: #ed5b6d;
  --tm-accent-soft: rgba(237,91,109,.09);
  --tm-accent-line: rgba(237,91,109,.20);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 84% -12%, rgba(173,46,65,.09), transparent 30rem),
    radial-gradient(circle at 8% 48%, rgba(237,91,109,.045), transparent 28rem),
    var(--bg-0);
}

::selection {
  background: rgba(237,91,109,.25) !important;
}

::-webkit-scrollbar-thumb:hover {
  background: #d83f54 !important;
}

.sidebar::before,
.tm-topbar::before,
.card::before,
.marketplace-auth-card::before {
  background: linear-gradient(90deg, transparent, rgba(237,91,109,.78), transparent) !important;
}

.tm-logo-mark,
.sidebar-header .logo-icon,
.tool-icon,
.tool-card-icon,
.tm-dashboard-icon,
.checkso-icon,
.password-icon {
  border-color: rgba(237,91,109,.18) !important;
  background: linear-gradient(145deg, rgba(237,91,109,.14), rgba(117,33,48,.08)) !important;
}

.tm-page-eyebrow,
.tm-section-label,
.market-kicker,
.market-section-label,
.tool-policy-kicker,
.firewall-kicker,
.cloudflare-label {
  color: #f27b89 !important;
}

.btn-primary,
button.btn-primary,
.tm-command-trigger:hover,
.tab-btn.active,
.system-control-tabs a.active {
  border-color: rgba(245,142,155,.34) !important;
  background: linear-gradient(135deg, #ef6979, #d43e53) !important;
  box-shadow: 0 12px 28px rgba(198,49,70,.15) !important;
}

.btn-primary:hover,
button.btn-primary:hover {
  filter: brightness(1.05);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(237,91,109,.50) !important;
  box-shadow: 0 0 0 3px rgba(237,91,109,.08) !important;
}

.nav-item.active,
.sidebar-nav a.active,
.tm-mobile-nav a.active,
.tool-card-modern:hover,
.card:hover {
  border-color: rgba(237,91,109,.16) !important;
}

.nav-item.active,
.sidebar-nav a.active {
  color: #ffd8dd !important;
  background: rgba(237,91,109,.075) !important;
}

a:hover {
  --link-accent: #f27b89;
}

.badge-primary,
.badge-info {
  color: #ffdce0 !important;
  border-color: rgba(237,91,109,.20) !important;
  background: rgba(237,91,109,.08) !important;
}

.tm-balance-pill,
.credit-badge {
  border-color: rgba(237,91,109,.16) !important;
}

.marketplace-page {
  --market-brand: #ed5b6d !important;
  --market-brand-2: #f2939e !important;
  background:
    radial-gradient(circle at 76% 8%, rgba(173,46,65,.08), transparent 26rem),
    radial-gradient(circle at 36% 35%, rgba(237,91,109,.045), transparent 30rem),
    var(--market-bg) !important;
}

.market-hero::before {
  background: radial-gradient(circle, rgba(237,91,109,.12), rgba(148,40,56,.035) 42%, transparent 68%) !important;
}

.marketplace-auth {
  background:
    radial-gradient(circle at 50% 4%, rgba(173,46,65,.10), transparent 30rem),
    radial-gradient(circle at 18% 72%, rgba(237,91,109,.045), transparent 27rem),
    #08090e !important;
}

.marketplace-auth-card {
  border-color: rgba(237,91,109,.15) !important;
  background: linear-gradient(155deg, rgba(21,18,24,.98), rgba(10,9,14,.99)) !important;
}

.tt-auth-brand {
  display:inline-flex;
  align-items:center;
  gap:10px;
  margin-bottom:24px;
  color:#fbf7f8;
  text-decoration:none;
}
.tt-auth-logo {
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  padding:4px;
  overflow:hidden;
  border:1px solid rgba(237,91,109,.20);
  border-radius:12px;
  background:radial-gradient(circle, rgba(237,91,109,.10), rgba(10,9,14,.92) 72%);
}
.tt-auth-logo img { width:100%; height:100%; object-fit:contain; filter:drop-shadow(0 0 8px rgba(255,78,54,.48)); }
.tt-auth-wordmark { display:inline-flex; align-items:baseline; gap:2px; letter-spacing:-.035em; }
.tt-auth-wordmark strong { color:#fffafb; font-weight:800; }
.tt-auth-wordmark b { color:#ed5b6d; font-size:.76rem; font-weight:850; }

.auth-turnstile {
  display:grid;
  gap:11px;
  margin-top:14px;
  padding:13px;
  border:1px solid rgba(237,91,109,.16);
  border-radius:14px;
  background:linear-gradient(145deg, rgba(237,91,109,.045), rgba(116,31,45,.025));
}
.auth-turnstile-head { display:flex; align-items:center; gap:10px; }
.auth-turnstile-head strong,.auth-turnstile-head small { display:block; }
.auth-turnstile-head strong { color:#f6eef0; font-size:.79rem; }
.auth-turnstile-head small { margin-top:3px; color:#8f7e83; font-size:.65rem; }
.auth-turnstile-shield {
  display:grid; place-items:center; width:36px; height:36px; flex:0 0 36px;
  border:1px solid rgba(237,91,109,.17);
  border-radius:10px; color:#f4a7b0; background:rgba(237,91,109,.08);
}
.auth-turnstile-shield svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.auth-turnstile-widget { width:100%; min-width:0; overflow:hidden; border-radius:10px; }
.auth-turnstile-status { margin:0; color:#85747a; font-size:.63rem; line-height:1.45; }
.auth-turnstile-status[data-state="ok"] { color:#76d5a1; }
.auth-turnstile-status[data-state="error"] { color:#ff9ba9; }
.auth-turnstile-config-error { padding:10px; border:1px solid rgba(255,183,79,.22); border-radius:10px; color:#ffd18b; background:rgba(255,183,79,.05); font-size:.68rem; }
.tt-auth-submit:disabled { opacity:.50; cursor:not-allowed; filter:saturate(.55); }

@media (max-width:620px) {
  .auth-turnstile { padding:11px; }
}


/* ============================================================
   TeddyTools UX v5.2 — Auth visual fix
   Fixes legacy .auth-brand span styles leaking into wordmark.
   ============================================================ */

.marketplace-auth-card .tt-auth-brand {
  display: inline-flex !important;
  align-items: center !important;
  gap: 11px !important;
  margin-bottom: 24px !important;
  color: #fffafb !important;
  text-decoration: none !important;
}

/* marketplace.css has `.auth-brand span { width:38px; ... background }`.
   Reset that rule for the wordmark so it does not become a second pink square. */
.marketplace-auth-card .tt-auth-brand .tt-auth-wordmark {
  display: inline-flex !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  gap: 2px !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: inherit !important;
  letter-spacing: -.035em !important;
}

.marketplace-auth-card .tt-auth-brand .tt-auth-logo {
  display: grid !important;
  place-items: center !important;
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
  padding: 4px !important;
  border: 1px solid rgba(237,91,109,.20) !important;
  border-radius: 12px !important;
  background: radial-gradient(circle, rgba(237,91,109,.11), rgba(10,9,14,.94) 72%) !important;
  box-shadow: 0 10px 28px rgba(208,50,72,.10) !important;
}

.marketplace-auth-card .tt-auth-brand .tt-auth-logo img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.marketplace-auth-card .tt-auth-wordmark strong {
  display: inline !important;
  margin: 0 !important;
  color: #fffafb !important;
  font-size: 1rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

.marketplace-auth-card .tt-auth-wordmark b {
  display: inline !important;
  margin: 0 !important;
  color: #ed5b6d !important;
  font-size: .72rem !important;
  font-weight: 850 !important;
  line-height: 1 !important;
}

/* Keep the auth card compact and consistent. */
.marketplace-auth-card {
  width: min(440px, 100%) !important;
  padding: 28px !important;
}

.marketplace-auth-card .auth-logo {
  margin-bottom: 20px !important;
}

.marketplace-auth-card .auth-logo h1 {
  margin-bottom: 7px !important;
}

.marketplace-auth-card .auth-remember {
  margin-top: 3px;
}

/* Turnstile: normal state remains embedded inside Login.
   After successful verification, collapse the heavy widget into one compact status row. */
.auth-turnstile {
  overflow: hidden;
  transition:
    border-color .2s ease,
    background .2s ease,
    padding .2s ease;
}

.auth-turnstile-widget {
  max-height: 90px;
  opacity: 1;
  transition:
    max-height .24s ease,
    opacity .18s ease,
    margin .24s ease;
}

.auth-turnstile.is-verified {
  border-color: rgba(73, 198, 127, .18);
  background: rgba(73, 198, 127, .035);
}

.auth-turnstile.is-verified .auth-turnstile-shield {
  color: #8fe0af;
  border-color: rgba(73, 198, 127, .18);
  background: rgba(73, 198, 127, .07);
}

.auth-turnstile.is-verified .auth-turnstile-widget {
  max-height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.auth-turnstile.is-verified .auth-turnstile-head small {
  display: none;
}

.auth-turnstile.is-verified .auth-turnstile-status {
  color: #7ed7a2;
  font-weight: 650;
}

/* Cloudflare iframe should never force overflow on small widths. */
.auth-turnstile-widget,
.auth-turnstile-widget .cf-turnstile,
.auth-turnstile-widget iframe {
  max-width: 100% !important;
}

@media (max-width: 520px) {
  .marketplace-auth {
    padding: 18px 12px !important;
  }

  .marketplace-auth-card {
    padding: 20px !important;
    border-radius: 18px !important;
  }

  .marketplace-auth-card .tt-auth-brand {
    margin-bottom: 20px !important;
  }

  .marketplace-auth-card .tt-auth-brand .tt-auth-logo {
    width: 39px !important;
    height: 39px !important;
    flex-basis: 39px !important;
  }
}


/* ============================================================
   TeddyTools UX v5.6 — Unified Light/Dark System
   ============================================================ */

:root {
  --tm-accent: #e85b6d;
  --tm-accent-hover: #d9465a;
  --tm-accent-soft: rgba(232,91,109,.09);
  --tm-accent-line: rgba(232,91,109,.21);
}

html[data-theme="dark"] {
  --bg-0: #08090e;
  --bg-1: #0d0e14;
  --bg-2: #12131b;
  --bg-3: #181923;
  --bg-4: #22232f;
  --bg-glass: rgba(18,19,27,.88);
  --bg-glass-hover: rgba(25,25,35,.94);
  --text: #eee8ea;
  --text-bright: #fffafb;
  --text-muted: #a4979c;
  --text-dim: #73676c;
  --border: rgba(255,221,225,.085);
  --border-bright: rgba(255,214,220,.15);

  --tm-shell: #090a0f;
  --tm-panel: #111219;
  --tm-panel-2: #171820;
  --tm-panel-3: #1e1f29;
  --tm-line: rgba(255,221,225,.085);
  --tm-line-strong: rgba(255,214,220,.16);
  --tm-text: #fff9fa;
  --tm-muted: #aa9ca1;
  --tm-subtle: #776a70;
  --tm-blue: #ee7382;
  --tm-violet: #f08b97;
  --tm-red: #ee6678;
  --tm-shadow: 0 24px 70px rgba(0,0,0,.30);
}

html[data-theme="light"] {
  color-scheme: light;

  --bg-0: #f8f5f6;
  --bg-1: #f3eef0;
  --bg-2: #ffffff;
  --bg-3: #fbf7f8;
  --bg-4: #eadfe2;
  --bg-glass: #ffffff;
  --bg-glass-hover: #fff7f8;

  --text: #372b30;
  --text-bright: #171014;
  --text-muted: #66575d;
  --text-dim: #88777e;

  --border: rgba(84,45,56,.105);
  --border-bright: rgba(84,45,56,.17);

  --neon-blue: #c83f55 !important;
  --neon-purple: #d75869 !important;
  --neon-pink: #c83f55 !important;
  --neon-cyan: #d96574 !important;
  --neon-green: #087f5b;
  --neon-yellow: #8b6508;
  --neon-orange: #ad4d16;
  --neon-red: #c72f42;

  --tm-shell: #f8f5f6;
  --tm-panel: #ffffff;
  --tm-panel-2: #fbf7f8;
  --tm-panel-3: #f3e9ec;
  --tm-line: rgba(84,45,56,.10);
  --tm-line-strong: rgba(84,45,56,.18);
  --tm-text: #21171b;
  --tm-muted: #64565c;
  --tm-subtle: #89787e;
  --tm-blue: #c83f55;
  --tm-cyan: #c83f55;
  --tm-violet: #d75869;
  --tm-green: #087f5b;
  --tm-amber: #8b6508;
  --tm-red: #c72f42;
  --tm-shadow: 0 20px 55px rgba(54,31,38,.09);

  --market-bg: #f8f5f6 !important;
  --market-surface: #ffffff !important;
  --market-surface-soft: #fbf7f8 !important;
  --market-text: #21171b !important;
  --market-muted: #64565c !important;
  --market-line: rgba(84,45,56,.11) !important;
  --market-brand: #c83f55 !important;
  --market-brand-2: #df6a79 !important;

  --primary: #c83f55 !important;
  --color-primary: #c83f55 !important;
  --grad-blue: linear-gradient(135deg,#e66a79,#c83f55) !important;
  --grad-purple: linear-gradient(135deg,#e17885,#c83f55) !important;
  --grad-pink: linear-gradient(135deg,#e66a79,#c83f55) !important;
  --grad-hero: linear-gradient(135deg,#ef9ba5,#dd6171,#bd364d) !important;
  --glow-blue: 0 8px 24px rgba(150,47,65,.09) !important;
  --glow-purple: 0 8px 24px rgba(150,47,65,.08) !important;
}

html[data-theme="light"] body,
html[data-theme="light"] body.marketplace-page,
html[data-theme="light"] body.tool-workspace-page {
  color: var(--text);
  background:
    radial-gradient(circle at 88% -12%, rgba(232,91,109,.055), transparent 28rem),
    radial-gradient(circle at 10% 42%, rgba(196,56,77,.025), transparent 27rem),
    #f8f5f6 !important;
}

/* Opaque surfaces in Light Mode = crisp text, no blurred glass. */
html[data-theme="light"] .sidebar,
html[data-theme="light"] .tm-topbar,
html[data-theme="light"] .topbar,
html[data-theme="light"] .tm-mobile-nav,
html[data-theme="light"] .tm-command-shell,
html[data-theme="light"] .tm-shortcut-shell,
html[data-theme="light"] .tm-customize-shell,
html[data-theme="light"] .card,
html[data-theme="light"] .profile-card,
html[data-theme="light"] .stat-box,
html[data-theme="light"] .tool-card,
html[data-theme="light"] .tool-card-modern,
html[data-theme="light"] .tools-hero,
html[data-theme="light"] .tm-dashboard-primary,
html[data-theme="light"] .tm-dashboard-balance,
html[data-theme="light"] .tm-launch-card,
html[data-theme="light"] .tm-next-action,
html[data-theme="light"] .history-metrics article,
html[data-theme="light"] .control-panel-hero,
html[data-theme="light"] .control-module-card,
html[data-theme="light"] .leaderboard-card,
html[data-theme="light"] .tier-list-card,
html[data-theme="light"] .membership-current {
  color: var(--tm-text) !important;
  background: #fff !important;
  border-color: var(--tm-line) !important;
  box-shadow: 0 10px 30px rgba(54,31,38,.045) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme="light"] .sidebar { border-right-color: var(--tm-line) !important; }
html[data-theme="light"] .tm-topbar,
html[data-theme="light"] .topbar { border-bottom-color: var(--tm-line) !important; }

html[data-theme="light"] .nav-section,
html[data-theme="light"] .tm-page-eyebrow,
html[data-theme="light"] .tm-section-label,
html[data-theme="light"] .market-section-label,
html[data-theme="light"] .market-kicker,
html[data-theme="light"] .tool-policy-kicker,
html[data-theme="light"] .firewall-kicker {
  color: #a03b4d !important;
}

html[data-theme="light"] .nav-item,
html[data-theme="light"] .tm-quick-tool,
html[data-theme="light"] .tm-sidebar-util,
html[data-theme="light"] .tm-command-trigger,
html[data-theme="light"] .tm-icon-btn,
html[data-theme="light"] .tm-command-item,
html[data-theme="light"] .tm-filter-btn,
html[data-theme="light"] .tm-view-btn {
  color: #65575d !important;
}

html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .tm-quick-tool:hover,
html[data-theme="light"] .tm-sidebar-util:hover,
html[data-theme="light"] .tm-command-trigger:hover,
html[data-theme="light"] .tm-icon-btn:hover,
html[data-theme="light"] .tm-command-item:hover,
html[data-theme="light"] .tm-command-item.active,
html[data-theme="light"] .tm-filter-btn.active,
html[data-theme="light"] .tm-filter-btn:hover,
html[data-theme="light"] .tm-view-btn.active,
html[data-theme="light"] .tm-view-btn:hover {
  color: #21171b !important;
  background: #f8edef !important;
  border-color: rgba(200,63,85,.19) !important;
}

html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .sidebar-nav a.active,
html[data-theme="light"] .tm-mobile-nav a.active {
  color: #9f2f44 !important;
  background: #fff0f2 !important;
  border-color: rgba(200,63,85,.18) !important;
  box-shadow: inset 3px 0 #d95869 !important;
}

html[data-theme="light"] .tm-wordmark strong { color: #21171b !important; }
html[data-theme="light"] .tm-wordmark b { color: #c83f55 !important; }

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] strong,
html[data-theme="light"] .text-bright,
html[data-theme="light"] .tm-page-title h1,
html[data-theme="light"] .tool-card-modern h3,
html[data-theme="light"] .tm-launch-card h3 {
  color: #21171b;
}

html[data-theme="light"] p,
html[data-theme="light"] small,
html[data-theme="light"] .text-muted,
html[data-theme="light"] .tm-section-head p,
html[data-theme="light"] .tool-card-modern > p,
html[data-theme="light"] .tm-command-item small,
html[data-theme="light"] .tm-tool-context-main span {
  color: #66575d;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .form-control,
html[data-theme="light"] .tm-tools-search {
  color: #21171b !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.16) !important;
  opacity: 1 !important;
  filter: none !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #998990 !important;
  opacity: 1 !important;
}
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .tm-tools-search:focus-within {
  border-color: rgba(200,63,85,.52) !important;
  box-shadow: 0 0 0 3px rgba(200,63,85,.09) !important;
}

html[data-theme="light"] .btn-primary,
html[data-theme="light"] button.btn-primary,
html[data-theme="light"] .tm-topup-btn {
  color: #fff !important;
  background: linear-gradient(135deg,#e46878,#c83f55) !important;
  border-color: rgba(184,47,69,.18) !important;
  box-shadow: 0 8px 20px rgba(160,43,62,.12) !important;
}
html[data-theme="light"] .btn-secondary {
  color: #4d3f44 !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.15) !important;
}

.tm-command-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
}
.tm-command-empty strong { margin-top: 4px; font-size: .8rem; }
.tm-command-empty span {
  max-width: 390px;
  color: var(--tm-subtle);
  font-size: .67rem;
  line-height: 1.5;
}
.tm-command-group {
  padding: 8px 10px 4px;
  color: var(--tm-subtle);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tm-sidebar-shortcut {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) 16px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--tm-muted);
  font-size: .72rem;
  font-weight: 650;
}
.tm-sidebar-shortcut:hover {
  color: var(--tm-text);
  background: var(--tm-panel-2);
}
.tm-sidebar-shortcut span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-sidebar-shortcut > i {
  color: var(--tm-subtle);
  font-size: .65rem;
}

.tm-tool-favorite { z-index: 5; }
.tm-page-pin.active {
  color: #f4c560;
  border-color: rgba(244,197,96,.24);
  background: rgba(244,197,96,.06);
}
html[data-theme="light"] .tm-tool-favorite {
  color: #8d7d83 !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.12) !important;
}
html[data-theme="light"] .tm-tool-favorite.active,
html[data-theme="light"] .tm-page-pin.active {
  color: #a66d00 !important;
  background: #fff8e8 !important;
  border-color: rgba(166,109,0,.24) !important;
}

html[data-theme="light"] table,
html[data-theme="light"] .table-wrap {
  color: #352a2e !important;
  background: #fff !important;
}
html[data-theme="light"] .table-wrap th,
html[data-theme="light"] th {
  color: #62545a !important;
  background: #f8f2f4 !important;
  border-color: rgba(84,45,56,.10) !important;
}
html[data-theme="light"] td { border-color: rgba(84,45,56,.085) !important; }
html[data-theme="light"] tr:hover td { background: #fff7f8 !important; }

html[data-theme="light"] .tool-card-icon,
html[data-theme="light"] .tm-launch-icon,
html[data-theme="light"] .tm-logo-mark {
  color: #c83f55 !important;
  background: #fff1f3 !important;
  border-color: rgba(200,63,85,.16) !important;
}
html[data-theme="light"] .tm-tool-chip,
html[data-theme="light"] .tool-card-state,
html[data-theme="light"] .tm-tool-context,
html[data-theme="light"] .tm-tool-context-meta span {
  color: #62545a !important;
  background: #fbf7f8 !important;
  border-color: rgba(84,45,56,.10) !important;
}

html[data-theme="light"] .marketplace-page {
  color: #352a2e !important;
  background:
    radial-gradient(circle at 84% 0%,rgba(232,91,109,.05),transparent 28rem),
    #f8f5f6 !important;
}
html[data-theme="light"] .market-hero,
html[data-theme="light"] .market-welcome,
html[data-theme="light"] .market-balance-card,
html[data-theme="light"] .shop-product-card,
html[data-theme="light"] .shop-summary-item,
html[data-theme="light"] .shop-store-tab,
html[data-theme="light"] .shop-category-pill {
  color: #352a2e !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.11) !important;
  box-shadow: 0 10px 28px rgba(54,31,38,.045) !important;
}
html[data-theme="light"] .shop-product-card:hover {
  background: #fff9fa !important;
  border-color: rgba(200,63,85,.22) !important;
}

html[data-theme="light"] .checkso-hero,
html[data-theme="light"] .checkso-card,
html[data-theme="light"] .checkso-notes article,
html[data-theme="light"] .checkso-alert {
  color: #352a2e !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.11) !important;
}
html[data-theme="light"] .checkso-grid input {
  color: #21171b !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.16) !important;
}
html[data-theme="light"] .checkso-price { background: #fff5f6 !important; }
html[data-theme="light"] .checkso-price strong { color: #8b6508 !important; }

.support-chat-launcher,
.chat-composer button {
  background: linear-gradient(135deg,#e46878,#c83f55) !important;
}
.support-chat-panel > header {
  background: linear-gradient(135deg,#d95567,#b9364d) !important;
}
.chat-message.is-mine .chat-bubble {
  background: linear-gradient(135deg,#e46878,#c83f55) !important;
}
.chat-thread-item.active { box-shadow: inset 3px 0 #d95869 !important; }
html[data-theme="light"] .support-chat-panel,
html[data-theme="light"] .chat-inbox,
html[data-theme="light"] .chat-thread-list,
html[data-theme="light"] .chat-conversation,
html[data-theme="light"] .chat-composer,
html[data-theme="light"] .chat-bubble {
  color: #352a2e !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.11) !important;
}
html[data-theme="light"] .chat-message-list { background: #fbf7f8 !important; }

html[data-theme="light"] .firewall-hero,
html[data-theme="light"] .firewall-mode-card,
html[data-theme="light"] .firewall-metrics > *,
html[data-theme="light"] .security-center-hero,
html[data-theme="light"] .security-mode-option {
  color: #352a2e !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.11) !important;
}

/* Auth is properly light instead of a dark glass card on white background. */
html[data-theme="light"] .marketplace-auth {
  color: #352a2e !important;
  background:
    radial-gradient(circle at 50% 0%,rgba(232,91,109,.055),transparent 30rem),
    #f8f5f6 !important;
}
html[data-theme="light"] .marketplace-auth::before { opacity: .06 !important; }
html[data-theme="light"] .marketplace-auth-card {
  color: #352a2e !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.12) !important;
  box-shadow: 0 24px 70px rgba(54,31,38,.10) !important;
  backdrop-filter: none !important;
}
html[data-theme="light"] .marketplace-auth-card .auth-logo h1,
html[data-theme="light"] .marketplace-auth-card .tt-auth-wordmark strong,
html[data-theme="light"] .auth-turnstile-head strong,
html[data-theme="light"] .marketplace-auth-card label {
  color: #21171b !important;
}
html[data-theme="light"] .marketplace-auth-card .auth-logo p,
html[data-theme="light"] .auth-turnstile-head small,
html[data-theme="light"] .auth-turnstile-status {
  color: #716168 !important;
}
html[data-theme="light"] .marketplace-auth-card .form-control,
html[data-theme="light"] .marketplace-auth-card .auth-remember {
  color: #21171b !important;
  background: #fff !important;
  border-color: rgba(84,45,56,.14) !important;
}
html[data-theme="light"] .auth-turnstile {
  background: #fff8f9 !important;
  border-color: rgba(200,63,85,.14) !important;
}
html[data-theme="light"] .auth-turnstile-shield {
  color: #b4384d !important;
  background: #fff0f2 !important;
  border-color: rgba(200,63,85,.15) !important;
}

html[data-theme="light"] .theme-starfield { display: none !important; }
html[data-theme="light"] .tm-logo-mark,
html[data-theme="light"] .card,
html[data-theme="light"] .tool-card-modern,
html[data-theme="light"] .tm-launch-card {
  filter: none !important;
  text-shadow: none !important;
}
html[data-theme="light"] .tm-mobile-nav {
  background: #fff !important;
  box-shadow: 0 14px 38px rgba(54,31,38,.10) !important;
}

/* ============================================================
   TeddyTools UX v5.8 — Search / Theme State / Decorative Mesh
   ============================================================ */

/* Decorative particles never participate in hit-testing on any internal page. */
.theme-starfield,
body.marketplace-page .theme-starfield,
body.tool-workspace-page .theme-starfield {
  pointer-events: none !important;
  touch-action: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: default !important;
}

/* Native dialog top-layer already wins, this z-index also protects fallback mode. */
.tm-command-dialog,
.tm-shortcut-dialog,
.tm-confirm-dialog,
.tm-customize-dialog {
  z-index: 2147483000 !important;
}
.tm-command-dialog.tm-dialog-fallback-open,
.tm-shortcut-dialog.tm-dialog-fallback-open,
.tm-confirm-dialog.tm-dialog-fallback-open,
.tm-customize-dialog.tm-dialog-fallback-open {
  display: block !important;
}
body.tm-ui-dialog-open { overflow: hidden; }

.tm-command-close {
  display: none;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--tm-line);
  border-radius: 9px;
  color: var(--tm-muted);
  background: var(--tm-panel-2);
  cursor: pointer;
}
.tm-command-close:hover { color: var(--tm-text); border-color: var(--tm-line-strong); }

.tm-theme-state i,
[data-theme-toggle] i {
  font-size: .9rem;
}

@media (max-width: 900px) {
  /* Search stays discoverable on phones instead of becoming an unlabeled icon. */
  .tm-command-trigger {
    width: auto !important;
    min-width: 74px;
    padding: 0 11px !important;
  }
  .tm-command-trigger span {
    display: inline !important;
    font-size: .68rem;
  }
  .tm-command-trigger kbd { display: none !important; }
  .tm-command-close { display: grid; }
  .tm-command-esc { display: none; }
}

@media (max-width: 480px) {
  .tm-command-trigger {
    min-width: 64px;
    gap: 7px;
    padding-inline: 9px !important;
  }
  .tm-command-dialog {
    top: max(10px, env(safe-area-inset-top)) !important;
    width: calc(100vw - 16px) !important;
  }
  .tm-command-shell { border-radius: 15px !important; }
  .tm-command-head { padding: 11px 10px !important; }
  .tm-command-head input { font-size: 16px !important; }
  .tm-command-meta { display: none !important; }
  .tm-command-results { max-height: min(68vh, 560px) !important; }
}

@media (max-width: 620px) {
  /* v5.8: keep Search + Theme visible on phones; bottom nav already owns Deposit. */
  .tm-command-trigger {
    display: flex !important;
  }
  [data-theme-toggle] {
    display: grid !important;
  }
  .tm-balance-pill,
  .tm-topup-btn {
    display: none !important;
  }
  .tm-topbar-actions {
    gap: 6px !important;
  }
}

html[data-theme="dark"] .theme-starfield {
  opacity: .52 !important;
  filter: saturate(.78) !important;
}

@media (max-width: 620px) {
  .tm-command-dialog,
  .tm-shortcut-dialog {
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: translateX(-50%) !important;
    border-radius: 20px 20px 0 0 !important;
  }
}

/* ============================================================
   TeddyTools UX v5.14 — Cross-device Responsive Stabilization
   Loaded last across the shared workspace shell.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html {
  max-width: 100%;
  scrollbar-gutter: stable;
}
body { max-width: 100%; }
body { min-width: 0; }

/* One predictable keyboard focus treatment across legacy and marketplace pages. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--market-brand, var(--neon-blue, #ed5b6d)) 34%, transparent);
  outline-offset: 2px;
}

:where(button, [role="button"], .btn, .nav-item, .tm-mobile-nav a) {
  touch-action: manipulation;
}

/* Never allow long Vietnamese labels, IDs, emails or generated values to widen the page. */
.card,
.card-header,
.card-body,
.marketplace-content,
.shop-content,
.tool-workspace-page .content,
.tm-dashboard-primary,
.tm-dashboard-balance,
.tm-workbench-grid,
.tm-next-actions,
.tools-grid,
.tool-card-modern,
.tool-card-modern > *,
.tool-policy-row,
.history-metrics,
.market-product-grid,
.admin-editor-grid,
.admin-content-grid,
.control-tool-revenue,
.control-tool-revenue-grid,
.checkso-content,
.checkso-card,
.checkso-history-card,
.profile-card,
.deposit-layout,
.firewall-layout,
.chat-inbox {
  min-width: 0;
  max-width: 100%;
}

.card h1,.card h2,.card h3,.card h4,
.card p,.card span,.card strong,.card small,
.tool-card-modern h3,.tool-card-modern p,
.tm-dashboard-primary h2,.tm-dashboard-primary p,
.marketplace-content h1,.marketplace-content h2,.marketplace-content h3,
.marketplace-content p,.marketplace-content dd,.marketplace-content dt,
.checkso-content p,.checkso-content strong,
.profile-card .email,
.admin-marketplace-page td,
.admin-marketplace-page th {
  overflow-wrap: anywhere;
  word-break: normal;
}

img, video, iframe, canvas, svg { max-width: 100%; }
iframe { border: 0; }

/* Shared tables scroll inside their own card rather than widening the viewport. */
.table-wrap,
.admin-table-wrap,
.history-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

/* Tabs stay usable on narrow devices. */
.tabs,
.system-control-tabs,
.market-store-tabs,
.market-category-tabs,
.tm-filter-group {
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

/* Mobile workspace shell */
@media (max-width: 900px) {
  html { overflow-x: clip; }
  body {
    overflow-x: clip;
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .layout { width: 100%; min-width: 0; }
  .main,
  body.tm-sidebar-collapsed .main {
    width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
  }

  .sidebar {
    width: min(86vw, 304px) !important;
    max-width: 304px !important;
    height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow: hidden;
  }
  .sidebar-nav {
    min-height: 0;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .tm-sidebar-footer { flex: 0 0 auto; }

  .tm-topbar,
  .topbar.shop-topbar {
    display: flex;
    align-items: center !important;
    width: 100%;
    min-height: 58px !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    overflow: visible;
  }
  .tm-topbar .topbar-left,
  .topbar.shop-topbar .topbar-left {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    padding: 0 !important;
    overflow: hidden;
  }
  .tm-mobile-menu {
    display: grid !important;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }
  /* app.js legacy toggle is intentionally suppressed on shared-shell pages. */
  [data-ui-sidebar] ~ * .mobile-toggle,
  .shop-topbar .mobile-toggle { display: none !important; }

  .tm-page-title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }
  .tm-page-title .tm-page-eyebrow { display: none !important; }
  .tm-page-title h1,
  .tm-topbar .topbar-left h1 {
    max-width: 100% !important;
    margin: 0 !important;
    overflow: hidden;
    color: var(--tm-text, var(--text-bright));
    font-size: clamp(.86rem, 2.7vw, 1rem) !important;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tm-topbar-actions,
  .topbar-right.tm-topbar-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
    gap: 6px !important;
  }
  .tm-command-trigger,
  .tm-icon-btn,
  .tm-user-avatar,
  .tm-topup-btn {
    flex: 0 0 auto;
  }
  .tm-command-trigger {
    min-width: 40px !important;
    width: auto !important;
    min-height: 40px !important;
    padding: 0 10px !important;
  }
  .tm-command-trigger kbd { display: none !important; }
  [data-theme-toggle], .tm-icon-btn { min-width: 40px; min-height: 40px; }

  .shop-content,
  .marketplace-content,
  .content,
  .tool-workspace-page .content {
    width: 100%;
    max-width: 100%;
    padding: 16px 14px 104px !important;
  }

  .tm-mobile-nav {
    left: 50%;
    bottom: max(7px, env(safe-area-inset-bottom, 0px)) !important;
    width: min(540px, calc(100vw - 12px)) !important;
    padding: 5px !important;
    border-radius: 16px !important;
    transform: translateX(-50%);
  }
  .tm-mobile-nav a {
    min-width: 0;
    min-height: 50px;
    padding: 5px 2px;
    line-height: 1.15;
  }
  .tm-mobile-nav a span {
    display: block;
    width: 100%;
    overflow: hidden;
    font-size: .58rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Keep floating support above the bottom navigation. */
  .support-chat { bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
  .support-chat-panel { max-height: calc(100dvh - 116px) !important; }

  /* Generic multi-column sections should stack before they become cramped. */
  .tm-dashboard-hero,
  .tm-workbench-grid,
  .tm-next-actions,
  .market-hero,
  .market-dashboard-hero,
  .deposit-layout,
  .admin-editor-grid,
  .admin-content-grid,
  .shop-about-support,
  .checkso-grid,
  .checkso-notes,
  .firewall-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  .card-header,
  .tm-section-head,
  .market-catalog-heading,
  .admin-market-hero,
  .admin-list-toolbar,
  .control-tool-revenue > header {
    align-items: flex-start !important;
    flex-wrap: wrap;
    gap: 10px !important;
  }

  .card-header > *,
  .tm-section-head > *,
  .admin-market-hero > *,
  .admin-list-toolbar > * { min-width: 0; }

  .system-control-tabs,
  .tabs,
  .market-store-tabs,
  .market-category-tabs {
    display: flex !important;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .system-control-tabs::-webkit-scrollbar,
  .tabs::-webkit-scrollbar,
  .market-store-tabs::-webkit-scrollbar,
  .market-category-tabs::-webkit-scrollbar { display: none; }
  .system-control-tabs a,
  .tabs .tab-btn,
  .market-store-tabs a,
  .market-category-tabs a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Every modal remains inside the visual viewport. */
  dialog,
  .market-dialog,
  .welcome-dialog,
  .tm-command-dialog,
  .tm-confirm-dialog,
  .tm-customize-dialog {
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
  }
}

@media (max-width: 680px) {
  body { font-size: 14px; }

  .shop-content,
  .marketplace-content,
  .content,
  .tool-workspace-page .content {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .tm-command-trigger {
    width: 40px !important;
    min-width: 40px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  .tm-command-trigger span { display: none !important; }
  .tm-balance-pill,
  .tm-topup-btn { display: none !important; }

  .tm-user-avatar,
  .topbar-right .user-avatar {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
  }

  .tools-grid,
  .tools-grid.tm-list-view {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .tool-card-modern,
  .tools-grid.tm-list-view .tool-card-modern {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 15px !important;
  }
  .tool-card-modern h3 { margin-top: 14px !important; }
  .tool-card-actions,
  .tool-card-actions .btn { width: 100%; }

  .profile-card,
  .checkso-hero,
  .admin-market-hero,
  .control-panel-hero,
  .history-hero,
  .tools-hero,
  .tool-policy-hero,
  .membership-current {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .checkso-card,
  .checkso-history-card,
  .deposit-card,
  .deposit-side-card,
  .card-body { padding: 15px !important; }

  .checkso-actions,
  .market-dialog-actions,
  .market-hero-actions,
  .welcome-actions,
  .maintenance-actions,
  .admin-actions,
  .tool-policy-save {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
  }
  .checkso-actions .btn,
  .market-dialog-actions .btn,
  .market-hero-actions .btn,
  .welcome-actions .btn,
  .maintenance-actions .btn,
  .admin-actions .btn,
  .tool-policy-save .btn { width: 100% !important; }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .form-control {
    min-width: 0;
    max-width: 100%;
    font-size: 16px !important; /* prevents iOS auto zoom */
  }

  .tm-command-dialog {
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
  }
  .tm-command-shell {
    max-height: min(84dvh, 680px);
    border-radius: 20px 20px 0 0 !important;
  }
  .tm-command-results { max-height: 58dvh !important; }

  .marketplace-auth {
    min-height: 100dvh !important;
    padding: max(12px, env(safe-area-inset-top, 0px)) 10px max(12px, env(safe-area-inset-bottom, 0px)) !important;
  }
  .marketplace-auth-card {
    width: min(100%, 460px) !important;
    padding: 22px 16px !important;
    border-radius: 19px !important;
  }
  .marketplace-auth-card .auth-logo h1 { font-size: clamp(1.45rem, 7vw, 1.8rem) !important; }
  .auth-turnstile { min-width: 0 !important; overflow: hidden !important; }
  .auth-turnstile-widget { width: 100% !important; min-width: 0 !important; overflow: hidden !important; }
  .auth-turnstile-widget > div,
  .auth-turnstile-widget iframe { max-width: 100% !important; }
}

@media (max-width: 420px) {
  .tm-topbar,
  .topbar.shop-topbar { padding-inline: 7px !important; gap: 5px !important; }
  .tm-topbar .topbar-left { gap: 5px !important; }
  .tm-mobile-menu,
  .tm-command-trigger,
  [data-theme-toggle],
  .tm-icon-btn {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }
  .tm-page-title h1,
  .tm-topbar .topbar-left h1 { font-size: .82rem !important; }
  .tm-user-avatar,
  .topbar-right .user-avatar {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
  }

  .tm-mobile-nav a span { font-size: .54rem; }
  .tm-mobile-nav a i { font-size: .82rem; }

  .card-header { padding: 12px 13px !important; }
  .card-body { padding: 13px !important; }
  .btn { white-space: normal; }

  .marketplace-auth-card { padding-inline: 13px !important; }
  .auth-turnstile { padding: 9px !important; }
}

@media (max-width: 350px) {
  /* Profile is already reachable from the bottom nav; hide avatar to protect title/actions. */
  .tm-topbar .tm-user-avatar { display: none !important; }
  .tm-page-title h1 { font-size: .78rem !important; }
  .shop-content,
  .marketplace-content,
  .content,
  .tool-workspace-page .content { padding-inline: 7px !important; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1000px) {
  body { padding-bottom: 0; }
  .tm-mobile-nav { position: static !important; width: calc(100% - 16px) !important; margin: 8px auto; transform: none !important; }
  .support-chat { bottom: 14px !important; }
  .sidebar { width: min(70vw, 300px) !important; }
}

@media (max-width: 900px) {
  body.tm-mobile-keyboard-open { padding-bottom: 12px !important; }
  body.tm-mobile-keyboard-open .tm-mobile-nav {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translate(-50%, 135%) !important;
  }
  body.tm-mobile-keyboard-open .support-chat { display: none !important; }
}

/* v5.14 audit pass — touch ergonomics, safe areas and tiny-screen readability. */
@media (max-width: 900px) {
  .sidebar { height: 100vh; }
  @supports (height: 100dvh) { .sidebar { height: 100dvh; } }

  .tm-topbar,
  .topbar.shop-topbar {
    padding-left: max(10px, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(10px, env(safe-area-inset-right, 0px)) !important;
  }

  .sidebar {
    padding-left: env(safe-area-inset-left, 0px);
  }

  .history-search,
  .admin-order-search,
  .tm-tools-search,
  .form-group,
  .form-control,
  .file-drop-zone,
  .tool-workspace-page form,
  .tool-workspace-page fieldset {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .history-table-wrap,
  .table-wrap,
  .admin-table-wrap {
    touch-action: pan-x pan-y;
  }

  .nav-item,
  .tm-quick-tool,
  .tm-sidebar-util {
    min-height: 44px;
  }

  .tm-mobile-nav a {
    min-height: 52px;
  }
}

@media (max-width: 680px) {
  body { font-size: 15px; }

  .nav-item { font-size: .82rem; }
  .tm-quick-tool,
  .tm-sidebar-util { font-size: .78rem; }
  .tm-mobile-nav a span { font-size: .64rem; }

  .history-search,
  .admin-order-search { width: 100% !important; }

  .history-tabs,
  .shop-admin-tabs,
  .checker-mode-tabs,
  .pw-tabs {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .history-tabs::-webkit-scrollbar,
  .shop-admin-tabs::-webkit-scrollbar,
  .checker-mode-tabs::-webkit-scrollbar,
  .pw-tabs::-webkit-scrollbar { display: none; }

  .history-tabs > *,
  .shop-admin-tabs > *,
  .checker-mode-tabs > *,
  .pw-tabs > * {
    flex: 0 0 auto;
  }

  .alert,
  .tm-alert,
  .history-note,
  .lq-warning,
  .checker-security-note {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .alert,
  .tm-alert {
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px !important;
    font-size: .78rem;
    line-height: 1.45;
  }
}

@media (hover: none), (pointer: coarse) {
  .btn:hover,
  .tool-card-modern:hover,
  .tm-launch-card:hover,
  .control-module-card:hover,
  .market-product-card:hover {
    transform: none !important;
  }

  button,
  a,
  input,
  select,
  textarea,
  label {
    -webkit-tap-highlight-color: transparent;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1000px) {
  body { padding-bottom: 12px !important; }
  .tm-mobile-nav {
    position: static !important;
    width: calc(100% - 12px) !important;
    margin: 8px auto !important;
    transform: none !important;
  }
  .support-chat { bottom: 12px !important; }
}

/* Federated sign-in and account security surfaces. */
.google-auth-panel {
  margin: 17px 0 0;
}

.google-auth-button {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 13px;
  color: #f8fafc;
  background: rgba(255, 255, 255, .045);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
  font: inherit;
  font-size: .82rem;
  font-weight: 760;
  text-align: center;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

a.google-auth-button:hover {
  border-color: rgba(255, 255, 255, .26);
  background: rgba(255, 255, 255, .075);
  box-shadow: 0 11px 28px rgba(0, 0, 0, .15);
  transform: translateY(-1px);
}

a.google-auth-button:focus-visible {
  outline: 3px solid rgba(66, 133, 244, .30);
  outline-offset: 2px;
}

.google-auth-button:disabled {
  cursor: not-allowed;
  opacity: .68;
  box-shadow: none;
}

.google-auth-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  padding: 3px;
  border-radius: 7px;
  background: #fff;
}

.google-auth-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.google-auth-arrow {
  color: var(--text-muted);
  font-size: 1rem;
}

.google-auth-state {
  padding: 4px 7px;
  border: 1px solid rgba(251, 191, 36, .16);
  border-radius: 999px;
  color: #f5c76a;
  background: rgba(251, 191, 36, .07);
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .025em;
  white-space: nowrap;
}

.google-auth-status {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 8px 2px 0;
  color: var(--text-muted);
  font-size: .62rem;
  line-height: 1.45;
}

.google-auth-status i {
  margin-top: 2px;
  color: #67d39a;
}

.google-auth-status.is-pending i {
  color: #e3ad4c;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
  color: var(--text-muted);
  font-size: .64rem;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}

.auth-divider span {
  flex: 0 0 auto;
}

.google-account-card { margin: 18px 0; }
.google-account-card h3 { display: flex; align-items: center; gap: 9px; }
.google-account-body { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.google-account-body p { margin: 4px 0 0; color: var(--text-muted); font-size: .75rem; }
.google-account-safe { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; color: #22c55e; background: rgba(34, 197, 94, .09); font-size: .7rem; font-weight: 700; }
.profile-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

html[data-theme="light"] .google-auth-button {
  color: #202124;
  background: #fff;
  border-color: #dadce0;
  box-shadow: 0 5px 16px rgba(60, 64, 67, .08);
}

html[data-theme="light"] a.google-auth-button:hover {
  border-color: #c6c9ce;
  background: #f8fafd;
  box-shadow: 0 7px 20px rgba(60, 64, 67, .13);
}

html[data-theme="light"] .google-auth-state {
  color: #9a6700;
  background: #fff9e8;
  border-color: #f2dda1;
}

@media (max-width: 760px) {
  .google-account-body { align-items: flex-start; flex-direction: column; }
  .google-account-body .btn,
  .google-account-safe { width: 100%; justify-content: center; }
  .profile-security-grid { grid-template-columns: 1fr; gap: 14px; }
}


/* ============================================================
   TeddyTools v5.38 — Stable topbar theme control
   Keep the shared-shell theme switch compact and inside topbar.
   ============================================================ */
.tm-topbar .tm-theme-state[data-theme-toggle],
.shop-topbar .tm-theme-state[data-theme-toggle] {
  position: static !important;
  inset: auto !important;
  flex: 0 0 40px !important;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 11px !important;
  line-height: 1 !important;
  transform: none !important;
}
.tm-topbar .tm-theme-state[data-theme-toggle] i,
.shop-topbar .tm-theme-state[data-theme-toggle] i {
  width: 1em;
  height: 1em;
  display: block;
  font-size: .92rem !important;
  line-height: 1 !important;
}
.tm-topbar .tm-theme-state[data-theme-toggle] .theme-toggle-text,
.shop-topbar .tm-theme-state[data-theme-toggle] .theme-toggle-text {
  display: none !important;
}

@media (max-width: 620px) {
  .tm-topbar .tm-theme-state[data-theme-toggle],
  .shop-topbar .tm-theme-state[data-theme-toggle] {
    flex-basis: 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
  }
  .tm-topbar .tm-login-btn {
    min-height: 38px !important;
    padding: 0 11px !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 390px) {
  .tm-topbar .tm-login-btn span { display: none !important; }
  .tm-topbar .tm-login-btn {
    width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}
