/* ══════════════════════════════════════════════════════════════════
   SafeWordHub — Brand Stylesheet v3.0 (Ember/Violet Edition)
   Modern design system with dark/light mode support
   ══════════════════════════════════════════════════════════════════ */

/* ── CSS CUSTOM PROPERTIES — DESIGN TOKENS ─────────────────────── */
:root {
  /* Core Palette (Dark Mode Default) */
  --swh-ink:        #0C0C0F;
  --swh-surface:    #141418;
  --swh-card:       #1B1B21;
  --swh-border:     #2A2A34;
  --swh-muted:      #6E6E82;
  --swh-body:       #C8C8D6;
  --swh-heading:    #F0F0F5;

  /* Accent: Ember (Primary) */
  --swh-ember-50:   #FFF5F3;
  --swh-ember-100:  #FFE0DA;
  --swh-ember-200:  #FFB8A8;
  --swh-ember-300:  #FF8A6E;
  --swh-ember-400:  #F0613E;
  --swh-ember-500:  #D94420;
  --swh-ember-600:  #B53518;
  --swh-ember-700:  #8C2812;

  /* Accent: Violet (Secondary) */
  --swh-violet-50:  #F5F2FF;
  --swh-violet-100: #E2DBFF;
  --swh-violet-200: #C4B5FF;
  --swh-violet-300: #A48EFF;
  --swh-violet-400: #8468F0;
  --swh-violet-500: #6B4FD6;
  --swh-violet-600: #5239B0;

  /* Semantic Colors */
  --swh-success:    #34D399;
  --swh-caution:    #FBBF24;
  --swh-danger:     #F87171;

  /* Typography */
  --font-display:   'Inter', system-ui, -apple-system, sans-serif;
  --font-body:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Spacing (8px grid) */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.25rem;  --sp-6: 1.5rem;   --sp-7: 1.75rem;  --sp-8: 2rem;     --sp-10: 2.5rem;
  --sp-12: 3rem;    --sp-16: 4rem;    --sp-20: 5rem;    --sp-24: 6rem;

  /* Border Radii */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 16px;  --r-xl: 24px;  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --container-max: 1200px;
  --container-sm: 760px;
  --container-pad: clamp(16px, 3vw, 28px);
  --nav-width: 260px;
}

/* Light Mode Tokens */
[data-theme="light"] {
  --swh-ink:        #FFFFFF;
  --swh-surface:    #F5F5FA;
  --swh-card:       #FFFFFF;
  --swh-border:     #D8D8E4;
  --swh-muted:      #8888A0;
  --swh-body:       #3A3A50;
  --swh-heading:    #111118;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

/* ── RESET & BASE ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  font-family: var(--font-body);
  background: var(--swh-ink);
  color: var(--swh-body);
  font-size: clamp(16px, 1.1vw, 17px);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
a { color: var(--swh-ember-400); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--swh-ember-300); }
img { max-width: 100%; display: block; }
svg { display: block; }

/* ── FOCUS & ACCESSIBILITY ─────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--swh-ember-400);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; top: -100%; left: 0;
  padding: var(--sp-3) var(--sp-6);
  background: var(--swh-ember-500);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 99999;
  text-decoration: none;
  border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus { top: 0; outline: none; }

/* ── LAYOUT & STRUCTURE ────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.page-wrap {
  min-height: calc(100vh - 200px);
  padding: var(--sp-12) 0 var(--sp-20);
}

.layout-cluster { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
.layout-stack { display: flex; flex-direction: column; gap: var(--sp-2); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }

/* ── NAVIGATION (SITE HEADER) ──────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--swh-surface);
  border-bottom: 1px solid var(--swh-border);
  box-shadow: var(--shadow-sm);
}

.site-header > .container {
  max-width: calc(var(--container-max) + (var(--container-pad) * 2));
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) 0;
  gap: var(--sp-4);
  min-height: 56px;
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  row-gap: var(--sp-2);
  padding: var(--sp-3) 0 var(--sp-4);
  position: relative;
  border-top: 1px solid var(--swh-border);
  flex-wrap: wrap;
}

.site-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--swh-heading);
  text-decoration: none;
  transition: color var(--duration-fast);
  min-width: 0;
}
.site-logo:hover { color: var(--swh-ember-400); }
.site-logo .accent { color: var(--swh-ember-400); }
.site-logo-text { line-height: 1; }
.site-logo-image {
  max-height: 36px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}
.site-tagline {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--swh-muted);
  line-height: 1.1;
}

@media (max-width: 720px) {
  .site-tagline { display: none; }
  .site-logo-image { max-height: 30px; max-width: 160px; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links > a,
.site-nav-parent {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--swh-body);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.site-nav-parent {
  background: transparent;
}

.nav-section-label {
  display: none;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--swh-muted);
  padding: var(--sp-2) var(--sp-4) 0;
}

.nav-section-label.active {
  color: var(--swh-ember-400);
}

.nav-links > a:hover,
.site-nav-parent:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--swh-border);
  color: var(--swh-heading);
}

.nav-links > a.active,
.site-nav-parent.active,
.site-nav-dropdown a.active {
  background: rgba(240, 97, 62, 0.12);
  border-color: rgba(240, 97, 62, 0.35);
  color: var(--swh-heading);
}

.nav-links > a.danger {
  color: var(--swh-danger);
}

.nav-links > a.danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

/* Dropdown Navigation */
.site-nav-group {
  position: relative;
}

.site-nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  padding: var(--sp-2);
  display: none;
  z-index: 1000;
}

.site-nav-group.open .site-nav-dropdown,
.site-nav-dropdown.show {
  display: block;
}

.site-nav-dropdown a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  color: var(--swh-body);
  transition: all var(--duration-fast);
  position: relative;
}

.site-nav-dropdown a.danger {
  color: var(--swh-danger);
}

.site-nav-dropdown a.danger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.site-nav-dropdown a:hover {
  background: var(--swh-surface);
  color: var(--swh-heading);
}

.user-menu-meta {
  padding: var(--sp-3) var(--sp-4);
}

.user-menu-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--swh-heading);
  margin-bottom: 2px;
}

/* Notification Bell */
.notif-nav {
  position: relative;
  z-index: 1001;
  margin-left: auto; /* push bell + avatar + hamburger to far right */
}

.notif-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: transparent;
  border: 1px solid var(--swh-border);
  color: var(--swh-body);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.notif-btn:hover {
  background: var(--swh-card);
  color: var(--swh-heading);
  border-color: var(--swh-ember-400);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--swh-ember-500);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 90vw;
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 1000;
  max-height: 400px;
  overflow: hidden;
  flex-direction: column;
}

.notif-dropdown.show,
.notif-dropdown[aria-hidden="false"] {
  display: flex;
}

.notif-dropdown-ft {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--swh-border);
  background: var(--swh-surface);
  font-size: 0.8rem;
}

.notif-dropdown-ft a {
  color: var(--swh-ember-400);
  font-weight: 500;
}

.notif-dropdown-hd {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--swh-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--swh-surface);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--swh-heading);
}

.notif-mark-all {
  font-size: 0.75rem;
  color: var(--swh-ember-400);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-sm);
  transition: background var(--duration-fast);
}

.notif-mark-all:hover {
  background: rgba(240, 97, 62, 0.1);
}

.notif-list {
  overflow-y: auto;
  flex: 1;
}

.notif-item {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--swh-border);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.notif-item-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--swh-heading);
  margin-bottom: 2px;
}

.notif-item-body {
  font-size: 0.82rem;
  color: var(--swh-body);
  line-height: 1.5;
}

.notif-item-time {
  margin-top: var(--sp-2);
  font-size: 0.72rem;
  color: var(--swh-muted);
}

.notif-item:hover {
  background: var(--swh-surface);
}

.notif-item.unread {
  background: rgba(240, 97, 62, 0.05);
  border-left: 3px solid var(--swh-ember-400);
}

.notif-empty {
  padding: var(--sp-8);
  text-align: center;
  color: var(--swh-muted);
  font-size: 0.875rem;
  font-style: italic;
}

/* User Avatar/Menu */
.user-menu {
  position: relative;
}

.user-avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  border: 2px solid var(--swh-border);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--duration-fast);
  background: var(--swh-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--swh-muted);
}

.user-avatar-btn:hover {
  border-color: var(--swh-ember-400);
}

.user-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  color: var(--swh-heading);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: all var(--duration-fast);
  border-radius: 2px;
}

.nav-open .nav-toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Theme + Privacy Toggle Buttons — inline in nav-inner */
.theme-toggle,
.privacy-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  border: 1px solid var(--swh-border);
  background: transparent;
  color: var(--swh-heading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.theme-toggle:hover,
.privacy-toggle:hover {
  background: var(--swh-card);
  border-color: var(--swh-ember-400);
}

.theme-toggle svg,
.privacy-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
}

.privacy-toggle.is-active {
  background: rgba(240, 97, 62, 0.14);
  border-color: rgba(240, 97, 62, 0.5);
  color: var(--swh-ember-300);
}

[data-theme="light"] .privacy-toggle.is-active {
  background: rgba(240, 97, 62, 0.12);
  border-color: rgba(240, 97, 62, 0.45);
  color: var(--swh-ember-600);
}

/* Privacy mode blurs user media across the app, including profile/blog/proof uploads. */
html[data-privacy-media="on"] img:not(.privacy-exempt),
html[data-privacy-media="on"] video:not(.privacy-exempt),
html[data-privacy-media="on"] picture:not(.privacy-exempt) img {
  filter: blur(14px) saturate(0.8);
  transition: filter var(--duration-fast) var(--ease-out);
}

/* ── FOOTER ────────────────────────────────────────────────────── */
.site-footer {
  background: var(--swh-surface);
  border-top: 1px solid var(--swh-border);
  padding: var(--sp-12) 0 var(--sp-8);
  margin-top: var(--sp-20);
}

.footer-shell {
  display: grid;
  grid-template-columns: 1.5fr repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-10);
}

.footer-brand {
  max-width: 320px;
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-8);
}

.footer-logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--swh-heading);
  margin-bottom: var(--sp-3);
}

.footer-tagline {
  font-style: italic;
  color: var(--swh-muted);
  margin-bottom: var(--sp-2);
  font-size: 0.95rem;
}

.footer-brand-sub {
  font-size: 0.85rem;
  color: var(--swh-muted);
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--swh-ember-400);
  margin-bottom: var(--sp-4);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--sp-2);
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--swh-body);
  transition: color var(--duration-fast);
}

.footer-col a:hover {
  color: var(--swh-heading);
}

.footer-copy {
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--swh-border);
  font-size: 0.8rem;
  color: var(--swh-muted);
  text-align: center;
}

/* ── TYPOGRAPHY ────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--swh-heading);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 2.5rem); margin-bottom: var(--sp-6); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: var(--sp-5); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin-bottom: var(--sp-4); }
h4 { font-size: 1.1rem; margin-bottom: var(--sp-3); }

.page-header {
  margin-bottom: var(--sp-10);
}

.page-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--swh-heading);
  margin-bottom: var(--sp-3);
}

.subtitle {
  font-size: 1rem;
  color: var(--swh-muted);
  line-height: 1.6;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--swh-ember-400);
  margin-bottom: var(--sp-3);
  font-family: var(--font-mono);
}

/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 44px;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  line-height: 1;
}

.btn-solid,
.btn-primary {
  background: var(--swh-ember-500);
  color: #fff;
  border: 1px solid var(--swh-ember-500);
}

.btn-solid:hover,
.btn-primary:hover {
  background: var(--swh-ember-400);
  border-color: var(--swh-ember-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary,
.btn {
  background: transparent;
  color: var(--swh-ember-400);
  border: 1.5px solid var(--swh-ember-400);
}

.btn-secondary:hover,
.btn:hover {
  background: rgba(240, 97, 62, 0.1);
  color: var(--swh-ember-300);
  border-color: var(--swh-ember-300);
}

.btn-ghost {
  background: transparent;
  color: var(--swh-body);
  border: 1px solid var(--swh-border);
}

.btn-ghost:hover {
  background: var(--swh-card);
  color: var(--swh-heading);
  border-color: var(--swh-ember-400);
}

.btn-violet {
  background: var(--swh-violet-500);
  color: #fff;
  border: 1px solid var(--swh-violet-500);
}

.btn-violet:hover {
  background: var(--swh-violet-400);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--swh-danger);
  color: #fff;
  border: 1px solid var(--swh-danger);
}

.btn-danger:hover {
  background: #EF4444;
  transform: translateY(-1px);
}

.btn-sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.8rem;
  min-height: 36px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── FORMS ─────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-5);
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--swh-heading);
  margin-bottom: var(--sp-2);
}

.required::after {
  content: " *";
  color: var(--swh-danger);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  color: var(--swh-heading);
  font-size: 0.9rem;
  font-family: var(--font-body);
  min-height: 44px;
  transition: all var(--duration-fast);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--swh-ember-400);
  box-shadow: 0 0 0 3px rgba(240, 97, 62, 0.15);
  background: var(--swh-card);
}

input::placeholder,
textarea::placeholder {
  color: var(--swh-muted);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E6E82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-10);
  appearance: none;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--swh-ember-500);
  border-radius: var(--r-sm);
}

.hint,
.text-muted {
  font-size: 0.8rem;
  color: var(--swh-muted);
  margin-top: var(--sp-2);
}

.form-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
}

/* ── CARDS & PANELS ────────────────────────────────────────────── */
.card {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  cursor: pointer;
}

.card:hover {
  border-color: rgba(240, 97, 62, 0.3);
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--swh-heading);
  margin-bottom: var(--sp-3);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--swh-body);
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-6);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.card-header-row .card-title {
  margin-bottom: 0;
  flex: 1;
}

.kink-consent-indicator {
  position: absolute;
  bottom: var(--sp-4);
  right: var(--sp-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  font-size: 16px;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all var(--duration-fast);
  pointer-events: none;
}

.kink-consent-indicator.kink-consent-desire {
  background: rgba(76, 175, 80, 0.15);
  border-color: #4CAF50;
}

.kink-consent-indicator.kink-consent-amber {
  background: rgba(255, 193, 7, 0.15);
  border-color: #FFC107;
}

.kink-consent-indicator.kink-consent-crimson {
  background: rgba(244, 67, 54, 0.15);
  border-color: #F44336;
}

/* ── TABLES ────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: var(--sp-6) 0;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--swh-border);
}

.data-table thead th {
  background: var(--swh-ember-500);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: var(--sp-4) var(--sp-5);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tbody td {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--swh-border);
  vertical-align: top;
  color: var(--swh-body);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--swh-surface);
}

.data-table .label-cell {
  font-weight: 600;
  color: var(--swh-heading);
  white-space: nowrap;
}

.data-table input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--swh-ember-400);
  outline-offset: 2px;
}

/* ── MODALS ────────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  backdrop-filter: blur(4px);
}

.modal.show,
.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  background: var(--swh-card);
  border-radius: var(--r-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--sp-8);
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--duration-normal) var(--ease-out);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal .close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: transparent;
  border: none;
  color: var(--swh-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--duration-fast);
}

.modal .close:hover {
  background: var(--swh-surface);
  color: var(--swh-heading);
}

.modal h2 {
  margin-bottom: var(--sp-6);
  padding-right: var(--sp-10);
}

/* ── FLASH MESSAGES ────────────────────────────────────────────── */
.flash {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-5);
  border-left: 4px solid;
  font-size: 0.9rem;
  line-height: 1.6;
}

.flash-success {
  background: rgba(52, 211, 153, 0.1);
  border-color: var(--swh-success);
  color: var(--swh-success);
}

.flash-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: var(--swh-danger);
  color: var(--swh-danger);
}

.flash-info {
  background: rgba(132, 104, 240, 0.1);
  border-color: var(--swh-violet-400);
  color: var(--swh-violet-400);
}

.flash-warning {
  background: rgba(251, 191, 36, 0.1);
  border-color: var(--swh-caution);
  color: var(--swh-caution);
}

/* ── BADGES & TAGS ─────────────────────────────────────────────── */
.badge,
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-ember,
.tag-ember {
  background: rgba(217, 68, 32, 0.12);
  color: var(--swh-ember-400);
}

.badge-violet,
.tag-violet {
  background: rgba(107, 79, 214, 0.12);
  color: var(--swh-violet-400);
}

.badge-success,
.tag-success {
  background: rgba(52, 211, 153, 0.12);
  color: var(--swh-success);
}

.badge-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--swh-danger);
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--swh-ember-500);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

.nav-badge-warn {
  background: var(--swh-danger);
}

.site-nav-dropdown .nav-badge {
  position: static;
  margin-left: var(--sp-2);
}

/* ── ADMIN BAR (styles moved to admin.css) ─────────────────────── */

.footer-col a.active {
  color: var(--swh-ember-400);
  font-weight: 600;
}

.footer-subsection {
  margin-top: var(--sp-6);
}

.footer-utility-row {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px dashed var(--swh-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: center;
}

.footer-utility-row a {
  font-size: 0.82rem;
  color: var(--swh-muted);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-full);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}

.footer-utility-row a:hover,
.footer-utility-row a.active {
  background: var(--swh-card);
  color: var(--swh-heading);
}

@media (min-width: 641px) {
  .footer-utility-row a + a::before {
    content: "\00b7";
    color: var(--swh-border);
    margin-right: var(--sp-3);
  }
}

/* Admin nav styles moved to admin.css */

/* ── IMPERSONATION BANNER ──────────────────────────────────────── */
.impersonation-bar {
  background: var(--swh-ember-500);
  color: #fff;
  padding: var(--sp-3) 0;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.impersonation-bar a {
  color: #fff;
  text-decoration: underline;
  margin-left: var(--sp-3);
}

.impersonation-bar a:hover {
  opacity: 0.9;
}

/* ── CHAT INTERFACE ────────────────────────────────────────────── */
.chat-bubble-btn {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: var(--swh-ember-500);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
  transition: all var(--duration-fast);
}

.chat-bubble-btn:hover {
  transform: scale(1.1);
  background: var(--swh-ember-400);
}

.chat-bubble-btn svg {
  width: 24px;
  height: 24px;
}

.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--swh-danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  min-width: 18px;
}

/* ── DASHBOARD STATS ───────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-6);
}

.dash-stat {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  text-align: center;
  transition: all var(--duration-fast);
}

.dash-stat:hover {
  border-color: var(--swh-ember-400);
  transform: translateY(-2px);
}

.dash-stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--swh-heading);
  line-height: 1;
  margin-bottom: var(--sp-2);
}

.dash-stat-label {
  font-size: 0.85rem;
  color: var(--swh-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ── UTILITY CLASSES ───────────────────────────────────────────── */
.text-ember { color: var(--swh-ember-400) !important; }
.text-violet { color: var(--swh-violet-400) !important; }
.text-success { color: var(--swh-success) !important; }
.text-danger { color: var(--swh-danger) !important; }
.text-muted { color: var(--swh-muted) !important; }
.text-heading { color: var(--swh-heading) !important; }
.text-body { color: var(--swh-body) !important; }

.bg-surface { background: var(--swh-surface) !important; }
.bg-card { background: var(--swh-card) !important; }
.bg-ember-subtle { background: rgba(240, 97, 62, 0.1) !important; }
.bg-violet-subtle { background: rgba(132, 104, 240, 0.1) !important; }

.border-ember { border-color: var(--swh-ember-400) !important; }
.border-violet { border-color: var(--swh-violet-400) !important; }
.border-default { border-color: var(--swh-border) !important; }

.mono { font-family: var(--font-mono) !important; }
.italic { font-style: italic; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }

.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }
.mb-10 { margin-bottom: var(--sp-10); }
.mb-12 { margin-bottom: var(--sp-12); }
.mb-1  { margin-bottom: var(--sp-1); }

.transition-fast { transition: all var(--duration-fast) var(--ease-out); }
.transition-normal { transition: all var(--duration-normal) var(--ease-out); }
.transition-slow { transition: all var(--duration-slow) var(--ease-out); }

.separator,
.gold-rule,
.gold-rule-full {
  border: none;
  border-top: 1px solid var(--swh-border);
  margin: var(--sp-8) 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .header-top {
    gap: var(--sp-2);
  }

  .header-controls {
    gap: var(--sp-2);
    flex-shrink: 0;
  }

  .site-logo {
    flex: 1 1 auto;
    overflow: hidden;
  }

  body.nav-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto; /* push to far right when it's the last element */
  }

  /* When notif-nav is present before nav-toggle, it already has margin-left:auto */
  .notif-nav ~ .nav-toggle {
    margin-left: 0;
  }

  /* On mobile, push theme-toggle right when notif-nav is absent (logged-out) */
  .theme-toggle {
    margin-left: auto;
  }
  /* When notif-nav is present, it already has margin-left:auto, so theme-toggle's auto = 0 */
  .notif-nav ~ .theme-toggle {
    margin-left: 0;
  }
  .privacy-toggle {
    margin-left: 0;
  }

  .site-header.nav-open .nav-links,
  .nav-inner.nav-open .nav-links,
  .nav-links.nav-open,
  body.nav-open > .nav-links {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--mobile-nav-offset, 0px);
    left: 0;
    right: 0;
    width: 100vw;
    margin-left: 0;
    background: var(--swh-card);
    border-bottom: 1px solid var(--swh-border);
    box-shadow: var(--shadow-md);
    padding: var(--sp-5) var(--sp-4) calc(var(--sp-10) + env(safe-area-inset-bottom, 0px));
    gap: var(--sp-2);
    display: none;
    min-height: 0;
    height: calc((var(--vh, 1vh) * 100) - var(--mobile-nav-offset, 0px));
    max-height: calc((var(--vh, 1vh) * 100) - var(--mobile-nav-offset, 0px));
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: auto;
    pointer-events: auto;
    z-index: 999;
    scrollbar-width: thin;
    scrollbar-color: var(--swh-border) transparent;
  }

  /* Webkit scrollbar styling (Chrome, Safari, Edge) */
  .nav-links::-webkit-scrollbar {
    width: 6px;
  }

  .nav-links::-webkit-scrollbar-track {
    background: transparent;
  }

  .nav-links::-webkit-scrollbar-thumb {
    background: var(--swh-border);
    border-radius: 3px;
  }

  .nav-links::-webkit-scrollbar-thumb:hover {
    background: var(--swh-muted);
  }

  .nav-links > a {
    width: 100%;
    text-align: left;
    display: block;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    border: 1px solid var(--swh-border);
    background: rgba(255, 255, 255, 0.02);
  }

  .site-nav-group {
    width: 100%;
  }

  .site-nav-parent {
    display: block;
    width: 100%;
    text-align: left;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    border: 1px solid var(--swh-border);
    background: rgba(255, 255, 255, 0.02);
  }

  .nav-section-label {
    display: block;
    margin-top: var(--sp-4);
    margin-bottom: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-full);
    border: 1px solid var(--swh-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--swh-muted);
  }

  .nav-links > .nav-section-label:first-child {
    margin-top: 0;
  }

  .nav-links > .nav-section-label.active {
    color: var(--swh-ember-400);
  }

  .site-nav-dropdown {
    position: static;
    box-shadow: none;
    border: 1px solid rgba(240, 97, 62, 0.3);
    border-left-width: 3px;
    border-radius: var(--r-md);
    background: rgba(240, 97, 62, 0.05);
    margin-left: var(--sp-2);
    margin-top: var(--sp-2);
    max-height: none;
    padding: var(--sp-2);
  }

  .site-nav-group + .site-nav-group {
    margin-top: var(--sp-1);
  }

  .site-nav-dropdown a {
    padding: var(--sp-2) var(--sp-3);
    font-size: 0.85rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
  }

  .footer-links-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .footer-shell {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }

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

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

@media (max-width: 640px) {
  .page-wrap {
    padding: var(--sp-8) 0 var(--sp-16);
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }

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

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .modal-content {
    padding: var(--sp-6);
  }

  .footer-links-grid {
    grid-template-columns: 1fr;
  }

  .footer-utility-row {
    gap: var(--sp-2);
    margin-top: var(--sp-6);
    padding-top: var(--sp-4);
  }

  .footer-utility-row a {
    font-size: 0.78rem;
    min-height: 34px;
    padding: var(--sp-2) var(--sp-2);
  }

}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--sp-4);
  }
}

@media (max-width: 420px) {
  .header-top {
    gap: 6px;
    min-height: 48px;
    padding: 10px 0;
  }

  .header-controls {
    gap: 6px;
  }

  .site-logo-image {
    max-height: 24px;
    max-width: 112px;
  }

  .notif-btn,
  .user-avatar-btn,
  .theme-toggle,
  .privacy-toggle,
  .nav-toggle {
    width: 38px;
    height: 38px;
  }

  .user-avatar-btn {
    border-width: 1px;
  }

  .notif-badge {
    font-size: 0.58rem;
    min-width: 16px;
    padding: 1px 5px;
  }
}

/* ── REDUCED MOTION ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── PRINT ─────────────────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle,
  .theme-toggle,
  .privacy-toggle,
  .chat-bubble-btn,
  .impersonation-bar {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .card {
    border: 1px solid #ddd;
  }
}

/* ══════════════════════════════════════════════════════════════════
   END OF STYLESHEET
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   SafeWordHub — Extended Component Styles v3.1
   Dashboard · Tasks · Balance/Achievements · Chat
   ══════════════════════════════════════════════════════════════════ */

/* ── DYNAMIC BADGE ─────────────────────────────────────────────── */
.dynamic-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: rgba(240, 97, 62, 0.08);
  border: 1px solid rgba(240, 97, 62, 0.25);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  color: var(--swh-body);
  max-width: 100%;
  overflow: hidden;
}

.dynamic-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--swh-success);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.dynamic-badge-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--swh-body);
}

/* ── DASHBOARD LAYOUT ──────────────────────────────────────────── */
.study-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--sp-6);
  align-items: start;
  margin-bottom: var(--sp-8);
}

@media (max-width: 960px) {
  .study-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
  .study-sidebar {
    order: -1;
    gap: var(--sp-4);
  }
}

.study-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

/* Sidebar groups for logical organization */
.study-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Add visual separation between groups 1 and 2 only (group 3 moved to bottom) */
.study-sidebar-group:first-child {
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--swh-border);
}

.study-sidebar-card {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: all var(--duration-fast) var(--ease-out);
}

.study-sidebar-card-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--swh-ember-400);
  margin-bottom: var(--sp-4);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--swh-border);
}

/* ── ACTIVITY FEED ─────────────────────────────────────────────── */
.study-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.study-feed-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-left: 2px solid var(--swh-border);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--duration-fast), border-color var(--duration-fast);
}

.study-feed-item:hover {
  background: rgba(240, 97, 62, 0.05);
}

[data-theme="light"] .study-feed-item {
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .study-feed-item:hover {
  background: rgba(240, 97, 62, 0.04);
}

.study-feed-item--task-approved   { border-left-color: var(--swh-success); }
.study-feed-item--task-submitted  { border-left-color: var(--swh-violet-400); }
.study-feed-item--task-rejected   { border-left-color: var(--swh-danger); }
.study-feed-item--task-failed     { border-left-color: var(--swh-danger); }
.study-feed-item--points-gain     { border-left-color: var(--swh-ember-400); }
.study-feed-item--points-loss     { border-left-color: var(--swh-danger); }
.study-feed-item--achievement     { border-left-color: var(--swh-ember-400); }
.study-feed-item--punishment      { border-left-color: var(--swh-danger); }

.study-feed-icon {
  font-size: 13px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: var(--swh-muted);
  line-height: 1.6;
}

.study-feed-body { flex: 1; min-width: 0; }

.study-feed-text {
  font-size: 13px;
  color: var(--swh-heading);
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.study-feed-time {
  font-size: 11px;
  color: var(--swh-muted);
  margin-top: 2px;
}

/* ── INSIGHTS SECTION (50/50 BOTTOM LAYOUT) ─────────────────────── */
.study-insights-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin-top: var(--sp-6);
}

@media (max-width: 1024px) {
  .study-insights-section {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
}

.study-insights-card {
  background: linear-gradient(135deg, rgba(240, 97, 62, 0.04) 0%, rgba(132, 104, 240, 0.02) 100%);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: all var(--duration-fast) var(--ease-out);
}

.study-insights-card:hover {
  border-color: var(--swh-ember-400);
  box-shadow: 0 4px 12px rgba(240, 97, 62, 0.1);
}

/* ── PENDING BANNER ────────────────────────────────────────────── */
.study-pending-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-6);
}

@media (max-width: 640px) {
  .study-pending-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }
}

.study-pending-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--swh-caution);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.study-pending-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  background: rgba(240, 97, 62, 0.1);
  border: 1px solid rgba(240, 97, 62, 0.3);
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--swh-ember-400);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.study-pending-chip:hover {
  background: rgba(240, 97, 62, 0.18);
  border-color: var(--swh-ember-400);
  color: var(--swh-ember-300);
}

/* ── QUICK LINKS ───────────────────────────────────────────────── */
.study-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-top: var(--sp-8);
  margin-top: var(--sp-6);
  border-top: 1px solid var(--swh-border);
}

@media (max-width: 640px) {
  .study-quicklinks { flex-direction: column; }
  .study-quicklinks .btn { width: 100%; justify-content: center; }
}

/* ── PARTNER AVATAR & ONLINE STATUS ────────────────────────────── */
.study-partner-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: rgba(240, 97, 62, 0.15);
  border: 1.5px solid rgba(240, 97, 62, 0.35);
  color: var(--swh-ember-400);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.study-online-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--r-full);
  background: var(--swh-muted);
  flex-shrink: 0;
  display: inline-block;
}

.study-online-dot.online {
  background: var(--swh-success);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.25);
}

.study-online-dot.recent  { background: var(--swh-caution); }
.study-online-dot.offline { background: var(--swh-muted); }

/* ── DUE LABELS ────────────────────────────────────────────────── */
.study-due-label {
  font-size: 11px;
  color: var(--swh-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.study-due-label.due-overdue { color: var(--swh-danger); font-weight: 600; }
.study-due-label.due-urgent  { color: var(--swh-caution); font-weight: 600; }
.study-due-label.due-soon    { color: var(--swh-ember-300); }

/* ── FEED PAGINATION ───────────────────────────────────────────── */
.study-feed-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.study-feed-nav {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--swh-border);
  background: transparent;
  color: var(--swh-body);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  line-height: 1;
  font-family: var(--font-body);
}

.study-feed-nav:hover:not(:disabled) {
  background: var(--swh-card);
  border-color: var(--swh-ember-400);
  color: var(--swh-heading);
}

.study-feed-nav:disabled { opacity: 0.35; cursor: not-allowed; }

.study-feed-page-info {
  font-size: 12px;
  color: var(--swh-muted);
  min-width: 40px;
  text-align: center;
}

/* ── TASK LIST ─────────────────────────────────────────────────── */
.task-list { margin-top: var(--sp-6); }

.task-item {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-4);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.task-item:hover {
  border-color: rgba(240, 97, 62, 0.4);
  box-shadow: var(--shadow-sm);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.task-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--swh-heading);
  line-height: 1.4;
}

.task-due {
  font-size: 13px;
  font-style: italic;
  color: var(--swh-muted);
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

/* ── BALANCE TABS ──────────────────────────────────────────────── */
.balance-tabs {
  display: flex;
  border-bottom: 2px solid var(--swh-border);
  margin-bottom: var(--sp-6);
  gap: 0;
  flex-wrap: wrap;
}

.balance-tab {
  padding: var(--sp-3) var(--sp-5);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--swh-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  font-family: var(--font-body);
}

.balance-tab:hover { color: var(--swh-heading); }

.balance-tab.active {
  color: var(--swh-ember-400);
  border-bottom-color: var(--swh-ember-400);
}

.balance-panel { display: none; }
.balance-panel.active { display: block; }

/* ── BALANCE METER ─────────────────────────────────────────────── */
.balance-meter-wrap {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-6);
}

[data-theme="light"] .balance-meter-wrap { background: rgba(0, 0, 0, 0.02); }

.balance-meter-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--swh-muted);
}

.balance-meter-track {
  position: relative;
  height: 4px;
  background: var(--swh-surface);
  border-radius: var(--r-full);
  overflow: visible;
}

.balance-meter-needle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: var(--r-full);
  background: var(--swh-ember-400);
  border: 2px solid var(--swh-card);
  box-shadow: 0 0 0 2px var(--swh-ember-500);
  transition: left var(--duration-normal) var(--ease-out);
}

.balance-meter-caption {
  font-size: 0.75rem;
  color: var(--swh-muted);
  margin-top: var(--sp-3);
  text-align: center;
}

/* ── BALANCE MINI STATS ────────────────────────────────────────── */
.balance-mini-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin: var(--sp-6) 0;
}

@media (max-width: 640px) {
  .balance-mini-stats { grid-template-columns: repeat(2, 1fr); }
}

.balance-mini-stat {
  text-align: center;
  padding: var(--sp-4);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
}

.balance-mini-stat-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--swh-heading);
  line-height: 1;
  margin-bottom: var(--sp-1);
}

.balance-mini-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--swh-muted);
}

/* ── BALANCE STREAK ────────────────────────────────────────────── */
.balance-streak {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
}

.balance-streak.balance-streak-clean {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.05);
}

.balance-streak.balance-streak-active {
  border-color: rgba(240, 97, 62, 0.3);
  background: rgba(240, 97, 62, 0.05);
}

.balance-streak-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--swh-heading);
  line-height: 1;
}

/* ── BALANCE ISSUE BOX ─────────────────────────────────────────── */
.balance-issue-box {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}

/* ── REWARD BAR ────────────────────────────────────────────────── */
.balance-reward-bar {
  width: 100%;
  height: 6px;
  background: var(--swh-surface);
  border-radius: var(--r-full);
  overflow: hidden;
  margin: var(--sp-2) 0;
}

.balance-reward-bar-fill {
  height: 100%;
  background: var(--swh-ember-400);
  border-radius: var(--r-full);
  transition: width var(--duration-slow) var(--ease-out);
}

.balance-reward-hint {
  font-size: 0.75rem;
  color: var(--swh-muted);
  margin-top: var(--sp-1);
}

/* ── PENDING REDEMPTIONS BANNER ────────────────────────────────── */
.balance-pending-banner {
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-6);
}

.balance-pending-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--swh-caution);
  margin-bottom: var(--sp-4);
}

/* ── ACHIEVEMENT GRID ──────────────────────────────────────────── */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.achievement-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-5) var(--sp-3);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  gap: var(--sp-2);
  transition: all var(--duration-normal) var(--ease-out);
}

.achievement-badge.earned {
  border-color: rgba(240, 97, 62, 0.35);
  background: rgba(240, 97, 62, 0.05);
}

.achievement-badge.locked {
  opacity: 0.55;
  filter: grayscale(0.4);
}

.achievement-badge.earned:hover {
  border-color: var(--swh-ember-400);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.achievement-icon  { font-size: 2rem; line-height: 1; }

.achievement-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--swh-heading);
  line-height: 1.3;
}

.achievement-desc {
  font-size: 0.7rem;
  color: var(--swh-muted);
  line-height: 1.4;
}

.achievement-date {
  font-size: 0.65rem;
  color: var(--swh-ember-400);
  font-family: var(--font-mono);
}

.achievement-progress-hint {
  font-size: 0.7rem;
  color: var(--swh-muted);
  font-style: italic;
}

/* ── ACHIEVEMENT PROGRESS BAR ──────────────────────────────────── */
.achievement-badge.almost-there {
  opacity: 0.85;
  filter: grayscale(0);
  border-color: rgba(240, 97, 62, 0.2);
}

.ach-progress-wrap {
  margin-top: var(--sp-2);
  width: 100%;
}

.ach-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: rgba(247, 240, 220, 0.45);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.achievement-badge.almost-there .ach-progress-labels {
  color: rgba(247, 240, 220, 0.7);
}

.ach-progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.ach-progress-fill {
  height: 100%;
  background: var(--swh-violet-400);
  border-radius: 3px;
  transition: width 0.3s var(--ease-out);
}

.achievement-badge.almost-there .ach-progress-fill {
  background: var(--swh-ember-400);
  box-shadow: 0 0 6px rgba(240, 97, 62, 0.5);
}

/* ── CHAT FLOATING WRAPPER ─────────────────────────────────────── */
.chat-floating {
  position: fixed;
  right: 20px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 1300;
}

/* ── CHAT MODAL (bottom-right popup, NOT full overlay) ─────────── */
.modal.chat-modal {
  position: fixed;
  top: auto;
  left: auto;
  right: 20px;
  bottom: 92px;
  width: auto;
  height: auto;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  z-index: 1350;
  display: none;
  align-items: flex-end;
  justify-content: flex-end;
}

.modal.chat-modal.show,
.modal.chat-modal[aria-hidden="false"] {
  display: flex;
  flex-direction: column;
}

.modal.chat-modal .modal-content {
  width: 390px;
  max-width: calc(100vw - 32px);
  height: calc(var(--vh, 1vh) * 75);
  max-height: calc(var(--vh, 1vh) * 75);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--r-lg);
  border: 1px solid var(--swh-border);
  background: var(--swh-card);
  box-shadow: var(--shadow-lg);
  animation: none;
}

/* Chat header */
.chat-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 16px;
  background: var(--swh-surface);
  border-bottom: 1px solid var(--swh-border);
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: rgba(240, 97, 62, 0.12);
  border: 1.5px solid rgba(240, 97, 62, 0.35);
  color: var(--swh-ember-400);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--swh-heading);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.chat-meta {
  font-size: 11px;
  color: var(--swh-muted);
  line-height: 1;
}

.chat-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--swh-border);
  background: transparent;
  color: var(--swh-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.chat-close-btn:hover {
  background: var(--swh-surface);
  color: var(--swh-heading);
  border-color: var(--swh-ember-400);
}

/* Chat message area */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  scrollbar-width: thin;
  scrollbar-color: var(--swh-border) transparent;
}

.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb {
  background: var(--swh-border);
  border-radius: var(--r-full);
}

/* Compose form */
.chat-form {
  padding: var(--sp-3);
  background: var(--swh-surface);
  border-top: 1px solid var(--swh-border);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
}

.chat-input-row textarea {
  flex: 1;
  min-height: 40px;
  max-height: 150px;
  border: 1px solid var(--swh-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--r-md);
  resize: none;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--swh-heading);
  padding: var(--sp-2) var(--sp-3);
  line-height: 1.5;
  overflow-y: auto;
  width: 100%;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

[data-theme="light"] .chat-input-row textarea { background: rgba(0, 0, 0, 0.03); }

.chat-input-row textarea:focus {
  border-color: var(--swh-ember-400);
  box-shadow: 0 0 0 2px rgba(240, 97, 62, 0.12);
  outline: none;
}

.chat-input-row textarea::placeholder { color: var(--swh-muted); }

.chat-attach-btn,
.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: 1px solid var(--swh-border);
  background: transparent;
  color: var(--swh-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.chat-attach-btn:hover {
  background: var(--swh-card);
  color: var(--swh-heading);
  border-color: var(--swh-ember-400);
}

.chat-send-btn {
  background: var(--swh-ember-500);
  border-color: var(--swh-ember-500);
  color: #fff;
}

.chat-send-btn:hover {
  background: var(--swh-ember-400);
  border-color: var(--swh-ember-400);
}

.chat-preview { padding-top: var(--sp-1); }
.chat-preview img {
  max-height: 80px;
  border-radius: var(--r-sm);
  border: 1px solid var(--swh-border);
}

/* Chat messages */
.chat-msg {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
}

.chat-msg.out { flex-direction: row-reverse; }

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--swh-muted);
  flex-shrink: 0;
  overflow: hidden;
}

.chat-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-avatar-fallback { color: var(--swh-ember-400); font-weight: 700; font-size: 12px; }

.chat-bubble { max-width: 72%; }

.chat-bubble .chat-msg-text {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg.in  .chat-bubble .chat-msg-text {
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  color: var(--swh-heading);
  border-bottom-left-radius: 4px;
}

.chat-msg.out .chat-bubble .chat-msg-text {
  background: var(--swh-ember-500);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg-meta {
  font-size: 11px;
  color: var(--swh-muted);
  margin-top: var(--sp-1);
  padding: 0 var(--sp-1);
}

.chat-msg.out .chat-msg-meta { text-align: right; }

.chat-read-receipt { margin-left: 4px; color: var(--swh-ember-400); font-size: 11px; }

.chat-bubble .chat-image {
  max-width: 220px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: block;
  transition: opacity var(--duration-fast);
}

.chat-bubble .chat-image:hover { opacity: 0.88; }

/* Chat modal — mobile bottom sheet */
@media (max-width: 640px) {
  .modal.chat-modal {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
  }

  .modal.chat-modal .modal-content {
    width: 100%;
    max-width: 100%;
    height: calc(var(--vh, 1vh) * 85);
    max-height: calc(var(--vh, 1vh) * 85);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.1
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.2 — All Pages (Auth, Profile, Protocols,
   Chronicles, Kinks, Consent, Points, Rewards, Admin)
   ══════════════════════════════════════════════════════════════════ */

/* ── Utility helpers ───────────────────────────────────────────── */
.clickable { cursor: pointer; }
.w-full { width: 100%; }
.mono { font-family: var(--font-mono); }
.container-sm {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
}

.gold-rule,
.gold-rule-full {
  border: none;
  border-top: 1px solid var(--swh-border);
  margin: var(--sp-6) 0;
  opacity: 0.5;
}

.section-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--swh-ember-400);
  opacity: .7;
  margin-bottom: var(--sp-3);
}

.section-eyebrow {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--swh-muted);
  margin-top: 0;
  margin-bottom: var(--sp-1);
}

/* Severity dots (protocols priority) */
.severity-dots { display: inline-flex; align-items: center; gap: 3px; }
.severity-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--swh-border);
  transition: background var(--duration-fast);
}
.severity-dot.filled.s1 { background: #34D399; }
.severity-dot.filled.s2 { background: #FBBF24; }
.severity-dot.filled.s3 { background: #F97316; }
.severity-dot.filled.s4 { background: #EF4444; }
.severity-dot.filled.s5 { background: #DC2626; }

/* ── Auth pages (login, register, forgot, reset) ───────────────── */
.auth-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: var(--sp-10) var(--sp-4) var(--sp-12);
}

.auth-card {
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-10) var(--sp-8);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-card .site-logo {
  display: block;
  text-align: center;
  margin-bottom: var(--sp-5);
}

.auth-title {
  text-align: center;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin-bottom: var(--sp-6);
  color: var(--swh-heading);
}

.radio-group {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--swh-body);
}

.radio-option input[type="radio"],
.radio-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--swh-ember-400);
  cursor: pointer;
  flex-shrink: 0;
}

hr.separator {
  border: none;
  border-top: 1px solid var(--swh-border);
  margin: var(--sp-6) 0;
  opacity: 0.4;
}

.form-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-4);
}

.text-ember { color: var(--swh-ember-400); }

/* ── Profile page ──────────────────────────────────────────────── */
.profile-hero {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: var(--sp-5);
  align-items: start;
  padding: var(--sp-6);
}

.profile-avatar-col { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--swh-border);
  flex-shrink: 0;
}

.profile-avatar-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--swh-card);
  border: 2px solid var(--swh-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.photo-upload-hint {
  font-size: 11px;
  color: var(--swh-muted);
  text-align: center;
  margin: 0;
}

.profile-info { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }

.profile-name {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--swh-heading);
  margin: 0;
  line-height: 1.2;
}

.profile-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.attr-pill {
  display: inline-flex;
  align-items: center;
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-full);
  padding: 3px var(--sp-3);
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--swh-body);
}

.attr-pill.age { color: var(--swh-ember-400); border-color: rgba(240,97,62,.35); }

.profile-attr-selects { display: flex; flex-direction: column; gap: var(--sp-2); }
.profile-attr-selects select { font-size: 13px; padding: var(--sp-2) var(--sp-3); }

.profile-card-actions { display: flex; flex-direction: column; gap: var(--sp-2); flex-shrink: 0; }

.profile-section {
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--swh-border);
}

.about-view {
  font-size: 15px;
  line-height: 1.7;
  color: var(--swh-body);
  min-height: 48px;
}

.about-placeholder { color: var(--swh-muted); font-style: italic; }

.editor-toolbar {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  margin-bottom: var(--sp-2);
}

.editor-toolbar button {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  padding: 4px var(--sp-2);
  font-size: 13px;
  cursor: pointer;
  color: var(--swh-body);
  transition: background var(--duration-fast);
}

.editor-toolbar button:hover { background: var(--swh-surface); }

@media (max-width: 640px) {
  .profile-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .profile-avatar-col { align-items: center; }
  .profile-pills { justify-content: center; }
  .profile-card-actions { flex-direction: row; justify-content: center; }
}

/* ── Protocols page ────────────────────────────────────────────── */
.protocol-list { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-4); }

.protocol-card {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-left: 3px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  transition: border-color var(--duration-fast);
}

.protocol-card.protocol-acked { border-left-color: var(--swh-success); }

.protocol-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.protocol-card-title {
  font-weight: 600;
  color: var(--swh-heading);
  font-size: 15px;
}

.protocol-card-desc {
  margin-top: var(--sp-3);
  font-size: 14px;
  color: rgba(247,240,220,.7);
  line-height: 1.6;
  white-space: pre-wrap;
}

.protocol-card-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.protocol-card-footer {
  margin-top: var(--sp-3);
  font-size: 12px;
  color: var(--swh-muted);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.protocol-ack-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px var(--sp-2);
  border-radius: var(--r-full);
}

.protocol-ack-badge.acked {
  background: rgba(52,211,153,.12);
  color: var(--swh-success);
  border: 1px solid rgba(52,211,153,.25);
}

.protocol-ack-badge.unacked {
  background: rgba(251,191,36,.1);
  color: var(--swh-caution);
  border: 1px solid rgba(251,191,36,.25);
}

.protocol-ack-badge.stale {
  background: rgba(248,113,113,.1);
  color: var(--swh-danger);
  border: 1px solid rgba(248,113,113,.25);
}

.protocol-cat-tabs {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--swh-border);
  padding-bottom: var(--sp-2);
}

.protocol-cat-tab {
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px;
  font-weight: 500;
  color: var(--swh-muted);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: color var(--duration-fast), background var(--duration-fast);
}

.protocol-cat-tab:hover { color: var(--swh-body); background: var(--swh-card); }
.protocol-cat-tab.active { color: var(--swh-ember-400); font-weight: 600; }

.protocol-cat-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(240,97,62,.1);
  color: var(--swh-ember-400);
  border: 1px solid rgba(240,97,62,.2);
  border-radius: var(--r-full);
  padding: 2px var(--sp-2);
}

.protocol-inactive { opacity: 0.5; }

.protocol-unacked-banner {
  background: rgba(251,191,36,.08);
  border: 1px solid rgba(251,191,36,.25);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  color: var(--swh-caution);
}

.protocol-violation-count {
  font-size: 12px;
  color: var(--swh-danger);
  font-weight: 600;
}

/* Violation count badge (inline in card title row) */
.protocol-violation-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.12);
  color: var(--swh-danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
  letter-spacing: .02em;
}

/* Log Violation collapsible form */
.violation-log-details {
  margin-top: var(--sp-4);
  border-top: 1px solid rgba(247,240,220,.08);
  padding-top: var(--sp-4);
}
.violation-log-summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: rgba(247,240,220,.45);
  user-select: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: .03em;
}
.violation-log-summary::-webkit-details-marker { display: none; }
.violation-log-summary::before {
  content: '▸';
  font-size: 10px;
  transition: transform .15s ease;
}
details[open] .violation-log-summary::before { transform: rotate(90deg); }
.violation-log-summary:hover { color: rgba(247,240,220,.7); }
.violation-log-form {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.violation-log-notes {
  width: 100%;
  resize: vertical;
  font-size: 13px;
  border-radius: var(--r-md);
  border: 1px solid rgba(247,240,220,.15);
  background: rgba(0,0,0,.2);
  color: var(--swh-text);
  padding: var(--sp-3) var(--sp-4);
  font-family: inherit;
}
.violation-log-notes::placeholder { color: rgba(247,240,220,.3); }
.violation-log-actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}

/* Protocol acked card subtle tint */
.protocol-acked .protocol-card-title { color: rgba(247,240,220,.8); }

/* ── Chronicles / Blog ─────────────────────────────────────────── */
.chronicle-post-item {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-3);
  transition: border-color var(--duration-fast);
}

.chronicle-post-item:hover { border-color: rgba(240,97,62,.35); }

.blog-slug-url {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--swh-body);
  flex-wrap: wrap;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: 12px;
  color: var(--swh-muted);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.privacy-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  border: 1px solid;
}

.privacy-badge.public  { color: var(--swh-success); border-color: rgba(52,211,153,.3); background: rgba(52,211,153,.08); }
.privacy-badge.standard { color: var(--swh-ember-400); border-color: rgba(240,97,62,.3); background: rgba(240,97,62,.08); }
.privacy-badge.private { color: var(--swh-muted); border-color: var(--swh-border); background: transparent; }

.edited-note {
  font-style: italic;
  opacity: 0.55;
}

.post-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--swh-heading);
  text-decoration: none;
  margin-bottom: var(--sp-1);
  transition: color var(--duration-fast);
}
.post-title:hover { color: var(--swh-ember-400); }

.post-content {
  font-size: 15px;
  line-height: 1.75;
  color: var(--swh-body);
  margin-top: var(--sp-4);
}

.post-content img { max-width: 100%; border-radius: var(--r-md); margin: var(--sp-3) 0; }
.post-content video {
  max-width: 100%;
  width: 100%;
  border-radius: var(--r-md);
  margin: var(--sp-3) 0;
  display: block;
  background: #000;
}
.post-content p { margin: 0 0 var(--sp-3); }
.post-content h2, .post-content h3 { color: var(--swh-heading); margin: var(--sp-5) 0 var(--sp-2); }

/* Image figures: alignment + captions */
.post-content .post-figure { margin: var(--sp-4) 0; display: block; }
.post-content .post-figure img { margin: 0; width: 100%; }
.post-content .post-figure figcaption {
  font-size: 13px;
  color: var(--swh-muted);
  text-align: center;
  margin-top: var(--sp-1);
  font-style: italic;
  line-height: 1.4;
}
.post-content .post-figure--left {
  float: left;
  width: 45%;
  margin: 0 var(--sp-5) var(--sp-4) 0;
  clear: left;
}
.post-content .post-figure--right {
  float: right;
  width: 45%;
  margin: 0 0 var(--sp-4) var(--sp-5);
  clear: right;
}
.post-content .post-figure--center {
  margin-left: auto;
  margin-right: auto;
  max-width: 70%;
  clear: both;
}
.post-content::after { content: ''; display: table; clear: both; }

/* Checklist items */
.post-content ul[data-list-type="checklist"] {
  list-style: none;
  padding-left: var(--sp-5);
}
.post-content ul[data-list-type="checklist"] > li {
  padding-left: 0;
  letter-spacing: 0.01em;
}

/* Comments */
.comment-list { margin-top: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); }

.comment-item {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--swh-heading);
  margin-bottom: var(--sp-1);
}

.comment-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--swh-body);
}

.comment-form { margin-top: var(--sp-5); padding: var(--sp-6); }

/* ── Kink Library ──────────────────────────────────────────────── */
.sort-dropdown { position: relative; display: inline-block; }

.sort-menu {
  position: absolute;
  left: 0;
  top: 100%;
  margin: var(--sp-1) 0 0;
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 140px;
  z-index: 200;
  list-style: none;
  padding: var(--sp-1) 0;
}

.sort-option {
  padding: var(--sp-2) var(--sp-4);
  font-size: 13px;
  color: var(--swh-body);
  cursor: pointer;
  transition: background var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sort-option:hover { background: var(--swh-card); }
.sort-option[aria-checked="true"] { color: var(--swh-ember-400); }

.tick { color: var(--swh-ember-400); font-size: 12px; float: right; }

/* Suggest kink item */
.suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.suggest-item:hover { background: var(--swh-card); }

/* ── Consent Hub ───────────────────────────────────────────────── */
.consent-legend {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--swh-muted);
  margin-bottom: var(--sp-4);
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.swatch.match   { background: var(--swh-success); }
.swatch.conflict { background: var(--swh-danger); }

.consent-tag {
  position: relative;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}

.consent-tag:focus-visible {
  outline: 2px solid var(--swh-ember-400);
  outline-offset: 1px;
}

.consent-tag.consent-match {
  border-color: rgba(52,211,153,.4) !important;
  background: rgba(52,211,153,.1) !important;
  color: var(--swh-success) !important;
}

.consent-tag.consent-conflict {
  border-color: rgba(248,113,113,.4) !important;
  background: rgba(248,113,113,.1) !important;
  color: var(--swh-danger) !important;
}

.remove-x {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0 0 0 var(--sp-1);
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}
.remove-x:hover { opacity: 1; }

/* View kink consent in modal */
#view-kink-consent .consent-tag { margin: 2px; }

.consent-page .page-header {
  margin-bottom: var(--sp-5);
}

.consent-page .consent-section-card {
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}

.consent-page .consent-buckets {
  gap: var(--sp-4);
}

.consent-page .consent-bucket {
  padding: var(--sp-3) var(--sp-2);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  background: var(--swh-surface);
  min-height: 80px;
  transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
}

.consent-page .consent-bucket.drop-active {
  border-color: var(--swh-ember-400);
  background: rgba(240, 97, 62, 0.08);
  box-shadow: inset 0 0 0 1px rgba(240, 97, 62, 0.2);
}

.consent-page .consent-bucket h4 {
  margin-bottom: var(--sp-2);
}

@media (max-width: 768px) {
  .consent-page .consent-section-card {
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
  }

  .consent-page .consent-bucket {
    padding: var(--sp-3);
  }
}

/* ── Points page ───────────────────────────────────────────────── */
.points-balance-display {
  text-align: center;
  padding: var(--sp-8) 0 var(--sp-6);
}

.points-balance-number {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  color: var(--swh-ember-400);
  line-height: 1;
  letter-spacing: -.02em;
}

.points-balance-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--swh-muted);
  margin-top: var(--sp-2);
}

.points-amount {
  font-weight: 700;
  font-family: var(--font-mono);
}

.points-amount.gain { color: var(--swh-success); }
.points-amount.loss { color: var(--swh-danger); }

/* ── Rewards page ──────────────────────────────────────────────── */
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px,100%), 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.reward-card {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.reward-card:hover { border-color: rgba(240,97,62,.35); box-shadow: var(--shadow-sm); }

.reward-card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--swh-heading);
}

.reward-card-desc {
  font-size: 13px;
  color: var(--swh-muted);
  line-height: 1.5;
  flex: 1;
}

.reward-card-cost {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--swh-ember-400);
}

.reward-card-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.reward-inactive {
  opacity: 0.45;
  filter: grayscale(0.3);
}

/* ── Punishments ───────────────────────────────────────────────── */
.punishment-item {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-left: 3px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  transition: border-color var(--duration-fast);
}

.punishment-item.status-pending {
  border-left-color: var(--swh-caution);
  background: rgba(251,191,36,.04);
}

/* ── Tasks extras ──────────────────────────────────────────────── */
.category-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-full);
  padding: 2px var(--sp-2);
  color: var(--swh-muted);
}

.difficulty-stars { display: inline-flex; gap: 2px; }
.difficulty-stars .filled { color: var(--swh-ember-400); }
.difficulty-stars .empty  { color: var(--swh-border); }

.priority-high { color: var(--swh-danger); font-weight: 700; }
.priority-low  { color: var(--swh-success); }

.bulk-check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
  font-size: 13px;
}

.task-note-list { margin-top: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }

.task-note-item {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
}

.task-note-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--swh-muted);
  margin-bottom: var(--sp-1);
}

.task-note-meta {
  font-size: 12px;
  color: var(--swh-muted);
  margin-top: var(--sp-1);
}

.task-note-body { font-size: 14px; color: var(--swh-body); line-height: 1.6; }

/* ── Admin pages (styles moved to admin.css) ───────────────────── */

/* Feature pill (tiers) */
.feat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  color: var(--swh-body);
}

.feat-summary {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.summary-bar {
  display: flex;
  gap: var(--sp-5);
  flex-wrap: wrap;
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--swh-border);
  margin-bottom: var(--sp-5);
}

.summary-bar .stat-val {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--swh-ember-400);
  line-height: 1;
}

.summary-bar .stat-lbl {
  font-size: 11px;
  color: var(--swh-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 2px;
}

/* Cron entries */
.cron-entry {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.cron-detail {
  background: var(--swh-ink);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--swh-body);
  overflow-x: auto;
  margin-top: var(--sp-3);
}

/* Checkbox option (multi-select flags) */
.checkbox-option {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-size: 14px;
  color: var(--swh-body);
  padding: var(--sp-1) 0;
}

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

/* User search results */
.user-search-results {
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
}

.user-result-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--swh-heading);
}

.user-result-meta {
  font-size: 12px;
  color: var(--swh-muted);
}

/* Assign panel */
.assign-panel {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-top: var(--sp-3);
}

/* Media table */
.media-table { width: 100%; border-collapse: collapse; }
.media-table th {
  background: var(--swh-card);
  border-bottom: 1px solid var(--swh-border);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--swh-muted);
  white-space: nowrap;
}
.media-table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: middle; }

/* Import results */
.import-results {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: var(--sp-4);
  max-height: 300px;
  overflow-y: auto;
}

/* ── Support / Help pages ──────────────────────────────────────── */
.support-ticket-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
  transition: border-color var(--duration-fast);
}
.support-ticket-item:hover { border-color: rgba(240,97,62,.35); }
.support-ticket-title { font-weight: 600; color: var(--swh-heading); }
.support-ticket-meta { font-size: 12px; color: var(--swh-muted); margin-top: var(--sp-1); }

/* ── Light mode overrides for new components ───────────────────── */
[data-theme="light"] .auth-card { background: #ffffff; border-color: #e2e2e2; }
[data-theme="light"] .auth-card .auth-title { color: #1a1a1a; }
[data-theme="light"] .protocol-card { background: #f8f8f8; border-color: #e0e0e0; }
[data-theme="light"] .protocol-card-title { color: #1a1a1a; }
[data-theme="light"] .protocol-card-desc { color: rgba(0,0,0,.65); }
[data-theme="light"] .chronicle-post-item { background: #f8f8f8; border-color: #e0e0e0; }
[data-theme="light"] .post-title { color: #1a1a1a; }
[data-theme="light"] .reward-card { background: #f8f8f8; border-color: #e0e0e0; }
[data-theme="light"] .reward-card-title { color: #1a1a1a; }
[data-theme="light"] .punishment-item { background: #f8f8f8; border-color: #e0e0e0; }
/* admin-table light theme moved to admin.css */
[data-theme="light"] .cron-detail { background: #f4f4f4; color: #333; }
[data-theme="light"] .points-balance-number { color: var(--swh-ember-500); }
[data-theme="light"] .sort-menu { background: #ffffff; border-color: #ddd; }
[data-theme="light"] .sort-option { color: #333; }
[data-theme="light"] .sort-option:hover { background: #f5f5f5; }
[data-theme="light"] .profile-avatar-placeholder { background: #e8e8e8; }
[data-theme="light"] .about-view { color: #333; }
[data-theme="light"] .protocol-unacked-banner { background: rgba(251,191,36,.05); }

/* ── Public landing page fixes ─────────────────────────────────── */
/* Contact form already has inline styles in index.php; ensure inputs inherit */
.contact-form input,
.contact-form textarea,
.contact-form select {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  color: var(--swh-body);
  font-family: var(--font-body);
  font-size: 15px;
  padding: var(--sp-3) var(--sp-4);
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--duration-fast);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--swh-ember-400);
}

.contact-form textarea { resize: vertical; min-height: 140px; }

.contact-form label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--swh-ember-400);
  margin-bottom: 6px;
}

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.contact-form-grid .full-width { grid-column: 1 / -1; }

.contact-form-submit {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.contact-errors {
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: var(--r-sm);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-4) 0;
  list-style: none;
}

.contact-errors li {
  color: var(--swh-danger);
  font-size: 14px;
  padding: 2px 0;
}

.contact-success {
  background: rgba(52,211,153,.08);
  border: 1px solid rgba(52,211,153,.3);
  border-radius: var(--r-sm);
  padding: var(--sp-4) var(--sp-5);
  margin: var(--sp-4) 0;
  color: var(--swh-success);
  font-weight: 600;
  text-align: center;
}

.honeypot {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
}

@media (max-width: 600px) {
  .contact-form-grid { grid-template-columns: 1fr; }
}

/* ── Responsive tweaks ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .auth-card { padding: var(--sp-7) var(--sp-5); }
  .rewards-grid { grid-template-columns: 1fr; }
  .protocol-card-header { flex-direction: column; align-items: flex-start; }
  .filter-bar, .admin-filters { flex-direction: column; align-items: stretch; }
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.2
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.3 — Dynamic Settings, Tasks, Connect, Support,
   Help, Achievements, Invite, Utility
   ══════════════════════════════════════════════════════════════════ */

/* ── Colour utility classes ────────────────────────────────────── */
.text-gold  { color: #d4af37; }
.text-wine  { color: #9b2335; }

/* ── Layout grid utilities ─────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}

/* ── Page breadcrumb ───────────────────────────────────────────── */
.page-back {
  font-size: 13px;
  color: var(--swh-muted);
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.page-back a { color: var(--swh-ember-400); text-decoration: none; }
.page-back a:hover { text-decoration: underline; }

/* ── Dynamic Settings (My Dynamic) ────────────────────────────── */
.dyn-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.dyn-tool-card {
  display: flex;
  flex-direction: column;
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  text-decoration: none;
  color: inherit;
  gap: var(--sp-2);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
  cursor: pointer;
}

.dyn-tool-card:hover {
  border-color: rgba(240, 97, 62, 0.45);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
}

.dyn-tool-card--alert {
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.04);
}

.dyn-tool-card--alert:hover {
  border-color: rgba(251, 191, 36, 0.6);
}

.dyn-tool-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.dyn-tool-icon {
  font-size: 22px;
  color: var(--swh-ember-400);
  flex-shrink: 0;
  line-height: 1;
}

.dyn-tool-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--swh-heading);
  flex: 1;
}

.dyn-tool-desc {
  font-size: 13px;
  color: var(--swh-muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.dyn-tool-meta {
  display: flex;
  gap: var(--sp-3);
  font-size: 12px;
  color: var(--swh-muted);
  margin-top: auto;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--swh-border);
}

.dyn-tool-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(251, 191, 36, 0.15);
  color: var(--swh-caution);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  padding: 2px var(--sp-2);
  margin-left: auto;
}

/* ── Task view — proof gallery ─────────────────────────────────── */
.proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.proof-item {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.proof-media {
  position: relative;
  display: block;
}

.proof-item img,
.proof-item video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.proof-item-video .proof-media::after,
.proof-item-live-photo .proof-media::after {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  letter-spacing: .04em;
  font-weight: 700;
  text-transform: uppercase;
  pointer-events: none;
}

.proof-item-video .proof-media::after {
  content: 'Video';
  color: #ffddb8;
  background: rgba(82, 34, 0, 0.72);
  border: 1px solid rgba(255, 173, 108, 0.5);
}

.proof-item-live-photo .proof-media::after {
  content: 'Live Photo';
  color: #c9f6de;
  background: rgba(10, 56, 35, 0.72);
  border: 1px solid rgba(122, 243, 190, 0.5);
}

.proof-caption {
  font-size: 12px;
  color: var(--swh-muted);
  padding: var(--sp-2) var(--sp-3);
  line-height: 1.4;
}

/* Points / proof type badges */
.points-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px var(--sp-2);
  border-radius: var(--r-full);
  border: 1px solid;
}

.points-badge.positive {
  color: var(--swh-success);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}

.points-badge.negative {
  color: var(--swh-danger);
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

.proof-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  border: 1px solid var(--swh-border);
  background: var(--swh-card);
  color: var(--swh-muted);
}

.task-view-actions {
  gap: var(--sp-2);
}

.task-header-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-header-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--swh-border);
  border-radius: var(--r-full);
  padding: 3px 9px;
  font-size: 11px;
  color: var(--swh-muted);
  background: rgba(255,255,255,.02);
}

.task-view-responsive .btn {
  padding: 8px 12px;
  font-size: 12px;
}

.task-view-responsive .btn.btn-sm {
  padding: 6px 10px;
  font-size: 11px;
}

.task-view-responsive.page-wrap {
  padding-top: var(--sp-8);
  padding-bottom: var(--sp-12);
}

.task-view-responsive .page-header {
  margin-bottom: var(--sp-5);
}

.task-view-shell {
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  background: var(--swh-card);
  padding: var(--sp-5);
}

.task-view-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.task-view-panel {
  padding: var(--sp-5);
}

.task-view-responsive .task-view-section {
  margin-top: 0;
  margin-bottom: 0;
}

.task-view-responsive .gold-rule-full {
  margin: var(--sp-3) 0;
  opacity: 0.5;
}

.task-view-responsive .form-group {
  margin-bottom: var(--sp-3);
}

.task-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--swh-border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.task-status-copy {
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  opacity: .85;
}

.task-status-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: rgba(247,240,220,.08);
}

.task-status-pending {
  color: var(--swh-muted);
  border-color: rgba(247,240,220,.2);
}

.task-status-in_progress {
  color: #fde68a;
  border-color: rgba(251,191,36,.55);
  background: rgba(251,191,36,.10);
}

.task-status-submitted {
  color: var(--swh-ember-400);
  border-color: rgba(240,97,62,.45);
  background: rgba(240,97,62,.08);
}

.task-status-approved {
  color: var(--swh-success);
  border-color: rgba(52,211,153,.45);
  background: rgba(52,211,153,.09);
}

.task-status-rejected,
.task-status-failed {
  color: var(--swh-danger);
  border-color: rgba(248,113,113,.42);
  background: rgba(248,113,113,.08);
}

.task-status-rail {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.task-status-rail .rail-step {
  width: 16px;
  height: 4px;
  border-radius: 999px;
  background: rgba(247,240,220,.18);
}

.task-status-rail .rail-step.active {
  background: rgba(212,175,55,.88);
}

.task-status-rail.status-in_progress .rail-step.active {
  background: rgba(251,191,36,.90);
}

.task-status-rail.status-submitted .rail-step.active {
  background: rgba(240,97,62,.92);
}

.task-status-rail.status-approved .rail-step.active {
  background: rgba(52,211,153,.95);
}

.task-status-rail.status-rejected .rail-step.active,
.task-status-rail.status-failed .rail-step.active {
  background: rgba(248,113,113,.95);
}

@media (max-width: 640px) {
  .task-status-copy {
    display: none;
  }
  .task-status-rail .rail-step {
    width: 12px;
  }
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  color: var(--swh-muted);
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--swh-ember-400);
  background: rgba(240, 97, 62, 0.04);
  color: var(--swh-body);
}

/* ── Connect / My Dynamic partner card ─────────────────────────── */
.conn-last-active {
  text-align: right;
  flex-shrink: 0;
}

.conn-meta {
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}

.danger-zone {
  background: rgba(248, 113, 113, 0.05);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin-top: var(--sp-4);
}

.role-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px var(--sp-3);
  border-radius: var(--r-full);
  border: 1px solid;
}

.role-dom {
  color: var(--swh-ember-400);
  border-color: rgba(240, 97, 62, 0.35);
  background: rgba(240, 97, 62, 0.08);
}

.role-sub {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

/* Invite card */
.invite-card { width: 100%; }

.invite-box {
  background: var(--swh-ink);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  margin-top: var(--sp-4);
}

.invite-url {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--swh-ember-400);
  word-break: break-all;
  line-height: 1.6;
  margin: var(--sp-2) 0;
}

/* ── Recurrence form panels ────────────────────────────────────── */
.rec-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  margin: var(--sp-4) 0;
}

.rec-day-grid {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.rec-day-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--swh-border);
  background: var(--swh-card);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--swh-muted);
  transition: all var(--duration-fast);
  flex-direction: column;
}

.rec-day-label:has(input:checked) {
  background: var(--swh-ember-400);
  color: #fff;
  border-color: var(--swh-ember-400);
}

/* ── Achievements ──────────────────────────────────────────────── */
/* Already in v3.1 — add missing sub-elements */
.achievement-lock {
  font-size: 18px;
  opacity: 0.4;
  margin-top: var(--sp-1);
}

.section-create-box {
  width: 100%;
  padding: var(--sp-5);
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--r-md);
  margin-top: var(--sp-4);
}

.badge-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Support tabs ──────────────────────────────────────────────── */
.support-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--sp-8);
  border-bottom: 1px solid var(--swh-border);
}

.support-tab {
  padding: var(--sp-2) var(--sp-5);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(247, 240, 220, 0.6);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.support-tab:hover { color: var(--swh-body); }

.support-tab.active {
  color: var(--swh-ember-400);
  border-bottom-color: var(--swh-ember-400);
  font-weight: 600;
}

.support-tab-count {
  background: #c23b4f;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px var(--sp-1);
  border-radius: var(--r-full);
  min-width: 18px;
  text-align: center;
}

/* Ticket card */
.ticket-card {
  display: block;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  color: inherit;
  transition: border-color var(--duration-fast);
}

.ticket-card:hover {
  border-color: rgba(240, 97, 62, 0.35);
  color: inherit;
}

.ticket-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.ticket-card-subject {
  font-weight: 600;
  color: var(--swh-heading);
  margin-bottom: var(--sp-1);
}

.ticket-card-meta {
  font-size: 12px;
  color: var(--swh-muted);
}

.ticket-card-badges {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.ticket-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* New ticket form wrapper */
.new-ticket-box {
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--r-md);
  padding: var(--sp-7);
  width: 100%;
}

/* ── Help article layout ────────────────────────────────────────── */
.help-article-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: var(--sp-10);
  align-items: start;
}

.help-sidebar-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  position: sticky;
  top: calc(var(--nav-height, 68px) + var(--sp-4));
}

.help-sidebar-card h3 {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--swh-ember-400);
  margin-bottom: var(--sp-3);
}

.help-sidebar-link {
  display: block;
  font-size: 13px;
  color: rgba(247, 240, 220, 0.75);
  text-decoration: none;
  line-height: 1.4;
  padding: var(--sp-1) 0;
  transition: color var(--duration-fast);
}

.help-sidebar-link:hover { color: var(--swh-ember-400); }

/* Article helpful box */
.help-helpful-box {
  margin-top: var(--sp-12);
  padding: var(--sp-5);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  text-align: center;
}

/* Article prose */
.prose {
  line-height: 1.8;
  color: rgba(247, 240, 220, 0.85);
  font-size: 15px;
}

.prose p  { margin: 0 0 var(--sp-4); }
.prose h2 { font-size: 1.2rem; color: var(--swh-heading); margin: var(--sp-7) 0 var(--sp-3); }
.prose h3 { font-size: 1rem; color: var(--swh-heading); margin: var(--sp-5) 0 var(--sp-2); }
.prose ul, .prose ol { padding-left: var(--sp-6); margin: 0 0 var(--sp-4); }
.prose li { margin-bottom: var(--sp-1); }
.prose code { font-family: var(--font-mono); font-size: 13px; background: var(--swh-card); border-radius: var(--r-sm); padding: 2px var(--sp-1); }
.prose pre  { background: var(--swh-card); border: 1px solid var(--swh-border); border-radius: var(--r-md); padding: var(--sp-4); overflow-x: auto; margin-bottom: var(--sp-4); }
.prose blockquote { border-left: 3px solid var(--swh-ember-400); margin: 0 0 var(--sp-4) 0; padding: var(--sp-3) var(--sp-5); background: rgba(240, 97, 62, 0.05); }
.prose img { max-width: 100%; border-radius: var(--r-md); }

@media (max-width: 768px) {
  .help-article-layout {
    grid-template-columns: 1fr;
  }

  .help-sidebar-card {
    position: static;
    order: -1;
  }
}

/* ── My Account page ────────────────────────────────────────────── */
.account-section {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}

.account-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--swh-border);
}

.account-section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--swh-ember-400);
  margin: 0;
}

.account-section-body { padding: var(--sp-5) var(--sp-6); }

/* 2FA device list */
.device-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--swh-ink);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  flex-wrap: wrap;
}

.device-item-label { font-size: 13px; color: var(--swh-body); }
.device-item-meta  { font-size: 12px; color: var(--swh-muted); }

/* ── Chronicles post editor ────────────────────────────────────── */
.post-editor {
  min-height: 260px;
  padding: var(--sp-4);
  background: var(--swh-ink);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  color: var(--swh-body);
  font-size: 15px;
  line-height: 1.7;
  outline: none;
  transition: border-color var(--duration-fast);
}

.post-editor:focus {
  border-color: var(--swh-ember-400);
}

.post-editor[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: var(--swh-muted);
  pointer-events: none;
}

/* ── Chronicles view (single post) ─────────────────────────────── */
.post-view-card {
  padding: 0;
  overflow: hidden;
}

.post-view-header {
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
}

.post-view-title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--swh-ember-400);
  margin: 0 0 var(--sp-6);
  font-weight: 600;
}

.post-view-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--sp-4);
}

.comment-section-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--swh-ember-400);
  margin-bottom: var(--sp-4);
}

/* ── Support ticket thread ──────────────────────────────────────── */
.ticket-thread { display: flex; flex-direction: column; gap: var(--sp-4); }

.ticket-message {
  display: flex;
  gap: var(--sp-3);
}

/* own-msg = current user's message → right-aligned via row-reverse */
.ticket-message.own-msg { flex-direction: row-reverse; }

.ticket-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.ticket-msg-avatar.staff  { background: rgba(240, 97, 62, 0.15); color: var(--swh-ember-400); }
.ticket-msg-avatar.user   { background: var(--swh-card); color: var(--swh-muted); }

.ticket-msg-bubble {
  max-width: min(480px, 75%);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
}

/* Staff messages get ember-tinted bubble */
.ticket-message.is-staff .ticket-msg-bubble {
  background: rgba(240, 97, 62, 0.06);
  border-color: rgba(240, 97, 62, 0.2);
}

.ticket-msg-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--swh-body);
  white-space: pre-wrap;
}

.ticket-msg-meta {
  font-size: 11px;
  color: var(--swh-muted);
  margin-top: var(--sp-2);
}

.ticket-attach-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 12px;
  border: 1px solid rgba(240, 97, 62, 0.3);
  border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
  color: var(--swh-ember-400);
  text-decoration: none;
  margin-top: var(--sp-2);
  transition: background var(--duration-fast);
}

.ticket-attach-link:hover { background: rgba(240, 97, 62, 0.08); }

/* ── Light mode fixes for new components ───────────────────────── */
[data-theme="light"] .dyn-tool-card   { background: #f8f8f8; border-color: #e0e0e0; }
[data-theme="light"] .dyn-tool-title  { color: #1a1a1a; }
[data-theme="light"] .dyn-tool-desc   { color: #666; }
[data-theme="light"] .invite-box      { background: #f0f0f0; }
[data-theme="light"] .invite-url      { color: var(--swh-ember-500); }
[data-theme="light"] .danger-zone     { background: rgba(248,113,113,.04); }
[data-theme="light"] .ticket-card     { background: #fff; border-color: #e0e0e0; }
[data-theme="light"] .ticket-card:hover { border-color: var(--swh-ember-400); }
[data-theme="light"] .new-ticket-box  { background: rgba(212,175,55,.03); }
[data-theme="light"] .proof-item      { background: #f8f8f8; }
[data-theme="light"] .post-editor     { background: #fff; border-color: #d0d0d0; color: #333; }
[data-theme="light"] .ticket-msg-bubble { background: #f8f8f8; border-color: #e0e0e0; }
[data-theme="light"] .ticket-message.is-staff .ticket-msg-bubble { background: rgba(240,97,62,.04); border-color: rgba(240,97,62,.2); }
[data-theme="light"] .help-sidebar-card { background: #f8f8f8; border-color: #e0e0e0; }
[data-theme="light"] .rec-section     { background: #f8f8f8; border-color: #e0e0e0; }
[data-theme="light"] .prose           { color: #333; }
[data-theme="light"] .section-create-box { background: rgba(212,175,55,.04); border-color: rgba(212,175,55,.2); }

/* ── Responsive additions ───────────────────────────────────────── */
@media (max-width: 640px) {
  .conn-meta    { gap: var(--sp-5); }
  .conn-last-active { text-align: left; }
  .profile-hero { grid-template-columns: 88px 1fr; }
  .profile-hero .conn-last-active { grid-column: 1 / -1; text-align: left; }

  .support-tabs { flex-wrap: wrap; }
  .support-tab  { padding: var(--sp-2) var(--sp-3); font-size: 13px; }

  .ticket-msg-bubble { max-width: 90%; }

  .dyn-settings-grid { grid-template-columns: 1fr; }

  .new-ticket-box { padding: var(--sp-5) var(--sp-4); }

  .help-helpful-box { padding: var(--sp-4); }
}

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.4 — Help Centre + Ticket Thread fixes
   ══════════════════════════════════════════════════════════════════ */

/* ── Help Centre — category grid ────────────────────────────────── */
.help-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--sp-4);
}

.help-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-4);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  text-align: center;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.help-cat-card:hover {
  border-color: rgba(240, 97, 62, 0.45);
  background: rgba(240, 97, 62, 0.05);
}

.help-cat-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: var(--sp-1);
}

.help-cat-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--swh-heading);
}

.help-cat-desc {
  font-size: 12px;
  color: var(--swh-muted);
  line-height: 1.5;
}

/* ── Help Centre — featured articles grid ───────────────────────── */
.help-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--sp-4);
}

/* ── Help Centre — CTA cards (User Manual / Contact Support) ────── */
.help-cta-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-5);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.help-cta-card:hover {
  border-color: rgba(240, 97, 62, 0.4);
  background: rgba(240, 97, 62, 0.04);
}

.help-cta-icon {
  font-size: 32px;
  flex-shrink: 0;
  line-height: 1;
}

.help-cta-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--swh-heading);
  margin-bottom: 4px;
}

.help-cta-desc {
  font-size: 13px;
  color: var(--swh-muted);
  line-height: 1.5;
}

/* ── Ticket header card ──────────────────────────────────────────── */
.ticket-header-card {
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-7);
}

.ticket-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.ticket-header-title {
  font-size: 1.25rem;
  margin-bottom: var(--sp-1);
  color: var(--swh-heading);
}

.ticket-header-meta {
  font-size: 12px;
  color: var(--swh-muted);
}

.ticket-header-badges {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-shrink: 0;
}

/* ── CSAT prompt ─────────────────────────────────────────────────── */
.csat-prompt {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.32);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.csat-prompt-text {
  font-size: 14px;
  color: var(--swh-body);
}

/* ── Light mode overrides v3.4 ──────────────────────────────────── */
[data-theme="light"] .help-cat-card   { background: #f9f9f9; border-color: #e0e0e0; }
[data-theme="light"] .help-cat-card:hover { background: rgba(240,97,62,.04); }
[data-theme="light"] .help-cat-name   { color: #1a1a1a; }
[data-theme="light"] .help-cta-card   { background: #f9f9f9; border-color: #e0e0e0; }
[data-theme="light"] .help-cta-title  { color: #1a1a1a; }
[data-theme="light"] .ticket-header-card { background: #fff; border-color: #ddd; }

/* ── Responsive v3.4 ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .help-cat-grid    { grid-template-columns: repeat(2, 1fr); }
  .help-articles-grid { grid-template-columns: 1fr; }
  .help-cta-card    { padding: var(--sp-4); gap: var(--sp-3); }
  .help-cta-icon    { font-size: 24px; }
  .ticket-header-card { padding: var(--sp-4); }
  .ticket-header-top { flex-direction: column; }
  .csat-prompt      { flex-direction: column; align-items: flex-start; }
}

/* ── Help Category article list ─────────────────────────────────── */
.help-cat-article-row {
  display: block;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}

.help-cat-article-row:hover {
  border-color: rgba(240, 97, 62, 0.4);
  background: rgba(240, 97, 62, 0.04);
}

.help-cat-article-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
}

.help-cat-article-body { flex: 1; min-width: 0; }

.help-cat-article-title {
  font-weight: 600;
  color: var(--swh-heading);
  margin-bottom: var(--sp-1);
  line-height: 1.4;
}

.help-cat-article-date {
  font-size: 11px;
  color: var(--swh-muted);
  white-space: nowrap;
  margin-top: 2px;
  flex-shrink: 0;
}

[data-theme="light"] .help-cat-article-row { background: #f9f9f9; border-color: #e0e0e0; }
[data-theme="light"] .help-cat-article-title { color: #1a1a1a; }

/* ── Admin support queue ─────────────────────────────────────────── */
.summary-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-5);
  min-width: 110px;
  text-align: center;
}

.summary-card .num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--swh-ember-400);
  line-height: 1;
}

.summary-card .lbl {
  font-size: 11px;
  color: var(--swh-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 2px;
}

.ticket-row:hover { background: rgba(255, 255, 255, 0.03); }

.badge-status,
.badge-priority {
  display: inline-block;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

/* ── Task priority borders ───────────────────────────────────────── */
.task-item { position: relative; }
.task-item.priority-high { border-left: 3px solid var(--swh-danger); }
.task-item.priority-low  { border-left: 3px solid rgba(110, 110, 130, 0.45); }

/* ── User Manual ─────────────────────────────────────────────────── */
.manual-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-10);
  align-items: start;
}

.manual-toc { position: sticky; top: 80px; }

.manual-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.manual-toc a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px;
  color: var(--swh-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  transition: color var(--duration-fast), border-color var(--duration-fast), background var(--duration-fast);
}

.manual-toc a:hover,
.manual-toc a.active {
  color: var(--swh-ember-400);
  border-left-color: var(--swh-ember-400);
  background: rgba(240, 97, 62, 0.07);
}

.manual-section {
  padding-top: var(--sp-6);
  border-top: 1px solid var(--swh-border);
  margin-bottom: var(--sp-8);
  scroll-margin-top: 90px;
}

.manual-section h2 { font-size: 1.25rem; color: var(--swh-ember-400); margin-bottom: var(--sp-4); font-weight: 700; }
.manual-section h3 { font-size: 1rem; font-weight: 700; color: var(--swh-heading); margin: var(--sp-5) 0 var(--sp-2); }
.manual-section p, .manual-section li { font-size: 14px; line-height: 1.8; color: var(--swh-body); }
.manual-section ul, .manual-section ol { padding-left: 20px; margin-bottom: var(--sp-3); }
.manual-section li { margin-bottom: 4px; }

.manual-tip     { background: rgba(240, 97, 62, 0.07);  border-left: 3px solid var(--swh-ember-400); padding: var(--sp-3) var(--sp-4); border-radius: 0 var(--r-md) var(--r-md) 0; margin: var(--sp-4) 0; font-size: 13px; color: var(--swh-body); }
.manual-note    { background: rgba(33, 150, 243, 0.08); border-left: 3px solid #2196f3; padding: var(--sp-3) var(--sp-4); border-radius: 0 var(--r-md) var(--r-md) 0; margin: var(--sp-4) 0; font-size: 13px; color: var(--swh-body); }
.manual-warning { background: rgba(244, 67, 54, 0.08);  border-left: 3px solid #f44336; padding: var(--sp-3) var(--sp-4); border-radius: 0 var(--r-md) var(--r-md) 0; margin: var(--sp-4) 0; font-size: 13px; color: var(--swh-body); }

@media (max-width: 768px) {
  .manual-layout { grid-template-columns: 1fr; }
  .manual-toc {
    position: static;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--swh-border);
    border-radius: var(--r-md);
    padding: var(--sp-4);
    margin-bottom: var(--sp-6);
  }
  .manual-toc details > summary {
    cursor: pointer;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--swh-ember-400);
    font-weight: 700;
  }
}

/* ── Landing page (index.php) ────────────────────────────────────── */
.features-section  { padding: clamp(60px, 8vw, 100px) 0; }
.faq-section       { padding: clamp(60px, 8vw, 100px) 0; }
.contact-section   { padding: clamp(60px, 8vw, 100px) 0; }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: clamp(16px, 3vw, 24px);
}

.section-body { font-size: clamp(15px, 1.5vw, 17px); }

.feat-group-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--swh-ember-400);
  opacity: .7;
  margin: var(--sp-12) 0 var(--sp-5);
}
.feat-group-label:first-of-type { margin-top: 0; }

.faq-item { margin-bottom: clamp(12px, 2vw, 18px); }

.contact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-8);
}
.contact-form-grid .full-width { grid-column: 1 / -1; }
.contact-form-submit { display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; }

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  color: var(--swh-body);
  font-family: var(--font-body);
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color var(--duration-fast);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--swh-ember-400);
}

.contact-form textarea { resize: vertical; min-height: 140px; }

.contact-form label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--swh-ember-400);
  margin-bottom: 6px;
}

.contact-errors {
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.35);
  border-radius: var(--r-sm);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.contact-errors li { color: #f08080; font-size: 14px; margin: var(--sp-1) 0; }

.contact-success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid var(--swh-success);
  border-radius: var(--r-sm);
  padding: var(--sp-5);
  color: var(--swh-success);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-align: center;
  margin-bottom: var(--sp-6);
}

.honeypot { display: none !important; visibility: hidden !important; position: absolute !important; }

.hero { padding: clamp(60px, 8vw, 112px) 0 clamp(48px, 6vw, 80px); }
.hero-actions {
  display: flex;
  gap: clamp(12px, 2vw, 20px);
  flex-wrap: wrap;
  margin-top: clamp(24px, 4vw, 32px);
}

.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--sp-6);
}

/* Age gate overlay */
#age-gate {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.97);
  z-index: 9999;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
}
#age-gate.hidden { display: none !important; }
#age-gate-box {
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  padding: clamp(32px, 6vw, 56px);
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

@media (max-width: 600px) {
  .contact-form-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.4
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.5
   task_trends, support_csat, task_suggestions, points, rewards,
   and utility helpers
   ══════════════════════════════════════════════════════════════════ */

/* ── Utility helpers ─────────────────────────────────────────────── */
.text-xs  { font-size: 12px; }
.fw-600   { font-weight: 600; }
.fw-700   { font-weight: 700; }
.mb-2     { margin-bottom: var(--sp-2); }
.mb-3     { margin-bottom: var(--sp-3); }
.mb-8     { margin-bottom: var(--sp-8); }
.italic   { font-style: italic; }

/* Semantic text-color utilities (supplement existing .text-ember/.text-muted) */
.text-success { color: var(--swh-success); }
.text-danger  { color: var(--swh-danger); }
.text-caution { color: var(--swh-caution); }

/* ── Task Trends ─────────────────────────────────────────────────── */
.trend-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
}
.trend-stat-card {
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-3);
  text-align: center;
}
.trend-stat-value {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--sp-1);
}
.trend-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--swh-muted);
}
.trend-stat-success { color: var(--swh-success); }
.trend-stat-danger  { color: var(--swh-danger); }
.trend-stat-caution { color: var(--swh-caution); }
.trend-stat-muted   { color: var(--swh-muted); }
.trend-stat-ember   { color: var(--swh-ember-400); }

.trend-chart-card {
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  margin-bottom: var(--sp-7);
}
.trend-chart-canvas-wrap {
  position: relative;
  height: 240px;
}

.trend-chart-toolbar {
  display: inline-flex;
  gap: var(--sp-1);
  background: rgba(247,240,220,.06);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-full);
  padding: 4px;
  margin-bottom: var(--sp-4);
}

.trend-range-btn {
  border: 0;
  background: transparent;
  color: var(--swh-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-radius: var(--r-full);
  padding: 7px 11px;
  cursor: pointer;
}

.trend-range-btn.is-active {
  background: var(--swh-ember-400);
  color: var(--swh-ink);
}

.trend-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.trend-log-table th,
.trend-log-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--swh-border);
  text-align: left;
  white-space: nowrap;
}
.trend-log-table th {
  color: var(--swh-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
}
.trend-log-table tbody tr:hover { background: var(--swh-surface-hover, rgba(255,255,255,.03)); }

.task-trends-page {
  max-width: 1160px;
}

.trend-page-header {
  margin-bottom: var(--sp-5);
}

.trend-overview-card,
.trend-log-card,
.trend-empty-card {
  background: linear-gradient(160deg, rgba(212,175,55,.08) 0%, rgba(212,175,55,.02) 38%, rgba(0,0,0,.04) 100%);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.trend-overview-head {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  align-items: flex-start;
  margin-bottom: var(--sp-3);
}

.trend-overview-title {
  margin: var(--sp-1) 0 0;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.15;
  color: var(--swh-heading);
}

.trend-overview-streak {
  font-size: 13px;
  color: var(--swh-muted);
  white-space: nowrap;
}

.trend-progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(247,240,220,.12);
  overflow: hidden;
  margin-bottom: var(--sp-3);
}

.trend-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--swh-ember-400), var(--swh-caution));
}

.trend-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  font-size: 13px;
  color: var(--swh-muted);
}

.trend-log-wrap {
  /* Outer .trend-log-card already provides the container border; no inner border needed */
}

@media (max-width: 860px) {
  .trend-overview-head {
    flex-direction: column;
  }

  .trend-overview-streak {
    white-space: normal;
  }

  .trend-chart-canvas-wrap {
    height: 210px;
  }

  .trend-chart-toolbar {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }

  .trend-range-btn {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
  }

  .trend-log-table thead {
    display: none;
  }

  .trend-log-table,
  .trend-log-table tbody,
  .trend-log-table tr,
  .trend-log-table td {
    display: block;
    width: 100%;
  }

  .trend-log-table tr {
    border-bottom: 1px solid var(--swh-border);
    padding: var(--sp-2) var(--sp-1);
  }

  .trend-log-table td {
    border: 0;
    padding: var(--sp-1) var(--sp-2);
    white-space: normal;
  }

  .trend-log-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--swh-muted);
    margin-bottom: 2px;
  }
}

/* ── Notifications full page ─────────────────────────────────────────
   Used by notifications.php — the mobile-targeted full-page view
   ─────────────────────────────────────────────────────────────────── */
.notif-page-wrap {
  max-width: 680px;
}

.notif-page-header {
  margin-bottom: var(--sp-6);
}

.notif-page-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.notif-page-header-top h1 {
  margin: 0;
  line-height: 1.2;
}

.notif-page-count {
  display: inline-block;
  margin-left: var(--sp-2);
  background: var(--swh-ember-500);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-full);
  vertical-align: middle;
  line-height: 1.4;
}

.notif-page-empty {
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
}

.notif-page-empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--sp-3);
  line-height: 1;
}

.notif-page-empty-msg {
  color: var(--swh-muted);
  font-size: 0.9rem;
}

.notif-page-list {
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.notif-page-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--swh-border);
  background: var(--swh-surface);
}

.notif-page-item:last-child {
  border-bottom: 0;
}

.notif-page-item.unread {
  background: rgba(240, 97, 62, 0.05);
  border-left: 3px solid var(--swh-ember-400);
}

.notif-page-item-body {
  flex: 1;
  min-width: 0;
}

.notif-page-item-form {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  align-self: center;
}

.notif-page-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--swh-border);
  background: transparent;
  color: var(--swh-ember-400);
  font-size: 12px;
  font-weight: 600;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}

.notif-page-action-btn:hover {
  background: rgba(240, 97, 62, 0.1);
  border-color: var(--swh-ember-400);
}

.notif-page-dismiss-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--swh-border);
  background: transparent;
  color: var(--swh-muted);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.notif-page-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--swh-success);
}

/* ── END Notifications full page ─────────────────────────────────────── */

.csat-success-card,
.csat-form-card {
  width: 100%;
  margin: var(--sp-10) 0 0;
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-7);
  text-align: center;
}
.csat-success-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: var(--sp-4);
}
.csat-success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--swh-heading);
  margin-bottom: var(--sp-3);
}
.csat-star-wrap {
  margin: var(--sp-5) 0 var(--sp-4);
}
.csat-star-row {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.csat-star {
  font-size: 36px;
  cursor: pointer;
  color: var(--swh-border);
  transition: color var(--duration-fast, .15s) ease, transform var(--duration-fast, .15s) ease;
  user-select: none;
  line-height: 1;
}
.csat-star:hover,
.csat-star.active { color: var(--swh-caution); transform: scale(1.15); }
.csat-star-label {
  font-size: 13px;
  color: var(--swh-muted);
  min-height: 1.4em;
}

/* ── Task Suggestions ────────────────────────────────────────────── */
.suggestion-card {
  border-color: var(--swh-border);
  transition: border-color var(--duration-fast, .15s) ease;
}
.suggestion-card.suggestion-pending {
  border-color: var(--swh-ember-400);
}
.suggestion-card-inner {
  display: flex;
  gap: var(--sp-5);
  align-items: flex-start;
}
.suggestion-card-body {
  flex: 1;
  min-width: 0;
}
.suggestion-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.suggestion-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--swh-heading);
}
.suggestion-dom-note {
  background: var(--swh-ink);
  border-left: 3px solid var(--swh-ember-400);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px;
  color: var(--swh-muted);
  margin-top: var(--sp-3);
}
.suggestion-decision {
  flex-shrink: 0;
  min-width: 220px;
  max-width: 280px;
}
.suggestion-decision textarea {
  width: 100%;
  margin-bottom: var(--sp-2);
  font-size: 13px;
  border-radius: var(--r-sm);
  background: var(--swh-ink);
  border: 1px solid var(--swh-border);
  color: var(--swh-body);
  padding: var(--sp-2) var(--sp-3);
}
@media (max-width: 640px) {
  .suggestion-card-inner  { flex-direction: column; }
  .suggestion-decision    { min-width: 0; max-width: 100%; width: 100%; }
}

/* ── Points page ─────────────────────────────────────────────────── */
.form-section-box {
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-6);
}
.adjust-points-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--sp-4);
}
@media (max-width: 640px) {
  .adjust-points-grid { grid-template-columns: 1fr; }
}

/* ── Rewards page ────────────────────────────────────────────────── */
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-7);
}
.reward-card {
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.reward-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
.reward-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--swh-heading);
}
.reward-card-cost {
  font-size: 13px;
  font-weight: 700;
  color: var(--swh-caution);
  white-space: nowrap;
}
.reward-card-desc {
  font-size: 13px;
  color: var(--swh-muted);
  flex: 1;
}
.reward-redeem-form { margin-top: auto; }

/* ── Light-mode overrides for v3.5 ──────────────────────────────── */
[data-theme="light"] .trend-stat-card,
[data-theme="light"] .trend-chart-card,
[data-theme="light"] .csat-success-card,
[data-theme="light"] .csat-form-card,
[data-theme="light"] .form-section-box,
[data-theme="light"] .reward-card {
  background: #fff;
  border-color: rgba(0,0,0,.12);
}
[data-theme="light"] .suggestion-dom-note { background: #f5f5f5; }
[data-theme="light"] .suggestion-decision textarea {
  background: #fafafa;
  border-color: rgba(0,0,0,.15);
  color: #111;
}
[data-theme="light"] .csat-star { color: #ccc; }
[data-theme="light"] .csat-star:hover,
[data-theme="light"] .csat-star.active { color: var(--swh-caution); }
[data-theme="light"] .trend-log-table tbody tr:hover { background: rgba(0,0,0,.03); }
[data-theme="light"] .trend-overview-card,
[data-theme="light"] .trend-log-card,
[data-theme="light"] .trend-empty-card {
  background: linear-gradient(160deg, rgba(212,175,55,.1) 0%, rgba(212,175,55,.03) 42%, rgba(255,255,255,.92) 100%);
  border-color: rgba(0,0,0,.12);
}

/* ── Reward grid (balance.php) ───────────────────────────────────── */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.reward-inactive { opacity: 0.55; }
.reward-card-actions {
  margin-top: auto;
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}

/* ── Recurrence box (templates.php / task_create.php) ────────────── */
.recurrence-box {
  padding: var(--sp-4);
  background: rgba(212, 175, 55, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-4);
}

/* ── Cron logs (admin/cron_logs.php) ────────────────────────────── */
.cron-run-row { cursor: pointer; transition: background var(--duration-fast, .15s); }
.cron-run-row:hover { background: rgba(212, 175, 55, 0.06); }
.cron-run-row.active { background: rgba(212, 175, 55, 0.10); }
.cron-detail { display: none; padding: var(--sp-3) var(--sp-4); background: rgba(0,0,0,.15); border-top: 1px solid rgba(212,175,55,.10); }
.cron-detail.show { display: block; }
.cron-entry { display: flex; gap: var(--sp-2); padding: var(--sp-1) 0; border-bottom: 1px solid rgba(212,175,55,.05); font-size: 13px; font-family: monospace; }
.cron-entry:last-child { border-bottom: none; }
.event-badge { display: inline-block; padding: var(--sp-1) var(--sp-2); border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.ev-spawn     { background: rgba(76,175,80,.2);  color: #4caf50; }
.ev-auto_fail { background: rgba(244,67,54,.2);  color: #f44336; }
.ev-reminder  { background: rgba(33,150,243,.2); color: #42a5f5; }
.ev-skip      { background: rgba(158,158,158,.2);color: #9e9e9e; }
.ev-error     { background: rgba(255,87,34,.25); color: #ff7043; }
.ev-summary   { background: rgba(240,97,62,.2);  color: var(--swh-ember-400); }
.stat-card    { background: rgba(255,255,255,.03); border: 1px solid rgba(212,175,55,.12); border-radius: var(--r-md); padding: var(--sp-4); text-align: center; }
.stat-val     { font-size: 28px; font-weight: 700; color: var(--swh-ember-400); }
.stat-lbl     { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--swh-muted); margin-top: var(--sp-1); }
.run-errors   { color: #f44336; font-weight: 700; }
.no-errors    { color: #4caf50; }
.btn-delete-run {
  background: none;
  border: none;
  color: rgba(244, 67, 54, .5);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: var(--sp-1);
  border-radius: 4px;
  transition: color var(--duration-fast, .15s);
}
.btn-delete-run:hover { color: #f44336; }

/* ── Admin KB filter bar (admin/kb.php) ─────────────────────────── */
.filter-bar select,
.filter-bar input[type=text] {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(212,175,55,.2);
  color: var(--swh-body);
  padding: var(--sp-1) var(--sp-2);
  border-radius: 6px;
  font-size: 13px;
}

/* ── Admin support ticket view (admin/support_ticket.php) ───────── */
.ticket-meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-7); }
.meta-card { background: var(--swh-card); border: 1px solid var(--swh-border); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-4); }
.meta-card .meta-label { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--swh-muted); margin-bottom: 4px; }
.meta-card .meta-val { font-size: 14px; font-weight: 600; color: var(--swh-heading); }
.msg-bubble { padding: var(--sp-5); border-radius: var(--r-md); margin-bottom: var(--sp-4); }
.msg-staff  { background: rgba(240,97,62,.08); border: 1px solid rgba(240,97,62,.26); }
.msg-member { background: var(--swh-surface); border: 1px solid var(--swh-border); }
.msg-system { background: rgba(88,166,255,.06); border: 1px solid rgba(88,166,255,.22); font-style: italic; text-align: center; font-size: 13px; }
.msg-meta   { font-size: 11px; color: var(--swh-muted); margin-bottom: 8px; }
.action-card { background: var(--swh-card); border: 1px solid var(--swh-border); border-radius: var(--r-md); padding: var(--sp-5); margin-bottom: var(--sp-4); }
.action-card h4 { margin: 0 0 12px; font-size: 13px; color: var(--swh-heading); text-transform: uppercase; letter-spacing: .06em; }

/* ── Admin tiers (admin/tiers.php) ──────────────────────────────── */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px,100%),1fr)); gap: var(--sp-5); margin: var(--sp-4) 0 var(--sp-6); }
.tier-card { background: var(--swh-surface); border: 1px solid rgba(212,175,55,.18); border-radius: var(--r-sm); padding: var(--sp-5); display: flex; flex-direction: column; }
.tier-card-header { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.tier-badge-pill { display: inline-block; padding: var(--sp-1) var(--sp-2); border-radius: var(--r-full); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #fff; font-weight: 600; }
.tier-card-title { font-size: 1.25rem; font-weight: 700; color: var(--swh-ember-400); margin-bottom: var(--sp-1); line-height: 1.2; }
.tier-card-desc { font-size: 13px; color: var(--swh-muted); margin-bottom: var(--sp-3); line-height: 1.5; }
.tier-card-meta { font-size: 12px; color: var(--swh-muted); margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--swh-border); }
.tier-card-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--swh-border); }
.feat-summary { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: var(--sp-3); }
.feat-pill { font-size: 11px; padding: 2px 8px; border-radius: var(--r-full); border: 1px solid; white-space: nowrap; }
.feat-pill.on  { border-color: rgba(76,175,80,.4);  color: #81c784; background: rgba(76,175,80,.08); }
.feat-pill.off { border-color: rgba(120,120,120,.2); color: rgba(247,240,220,.18); background: transparent; }
.feat-divider { width: 100%; height: 0; border-top: 1px dashed rgba(255,255,255,.08); margin: var(--sp-1) 0; }
.default-badge { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--swh-ember-400); border: 1px solid var(--swh-ember-400); border-radius: var(--r-full); padding: var(--sp-1) var(--sp-2); }
.inactive-badge { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--swh-muted); opacity: .5; border: 1px solid var(--swh-border); border-radius: var(--r-full); padding: var(--sp-1) var(--sp-2); }
/* Tier limits: 2-col key/value grid */
.tier-limits-summary { display: grid; grid-template-columns: 1fr auto; gap: 3px var(--sp-4); font-size: 11px; color: rgba(247,240,220,.45); margin-bottom: var(--sp-4); padding: var(--sp-3); background: rgba(255,255,255,.03); border-radius: var(--r-sm); }
.tier-limits-summary .limit-val { text-align: right; font-weight: 700; color: rgba(247,240,220,.75); white-space: nowrap; }
.form-section-title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: rgba(240,97,62,.7); margin: var(--sp-6) 0 var(--sp-2); border-bottom: 1px solid rgba(240,97,62,.15); padding-bottom: var(--sp-1); }
.feat-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: var(--sp-2); }
.feat-toggle-row { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2); background: rgba(255,255,255,.02); border-radius: 3px; }
.feat-toggle-row label { font-size: 13px; color: var(--swh-body); flex: 1; cursor: pointer; }
.limits-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: var(--sp-2); }
.limit-field label { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(240,97,62,.65); margin-bottom: 5px; }
.limit-field input { width: 100%; padding: var(--sp-2); background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,55,.18); border-radius: 3px; color: var(--swh-body); font-size: 14px; box-sizing: border-box; }
.limit-field input:focus { outline: none; border-color: rgba(212,175,55,.45); }
.limit-field .hint { font-size: 11px; color: var(--swh-muted); margin-top: 3px; }
.assign-panel { background: var(--swh-surface); border: 1px solid rgba(212,175,55,.18); border-radius: var(--r-sm); padding: var(--sp-6); margin-top: var(--sp-8); }
.user-search-results { margin-top: 12px; }
.user-result-row { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2); background: rgba(255,255,255,.03); border-radius: 3px; margin-bottom: var(--sp-1); cursor: pointer; border: 1px solid transparent; transition: border-color var(--duration-fast, .15s); }
.user-result-row:hover, .user-result-row.selected { border-color: rgba(212,175,55,.3); }
.user-result-name { font-size: 14px; color: var(--swh-body); }
.user-result-meta { font-size: 11px; color: var(--swh-muted); }
.color-swatch { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,.2); flex-shrink: 0; }

/* ── Admin KB editor (admin/kb_edit.php) ────────────────────────── */
.kb-editor-wrap { display: grid; grid-template-columns: 1fr 260px; gap: var(--sp-6); align-items: start; }
@media (max-width: 800px) { .kb-editor-wrap { grid-template-columns: 1fr; } }
.sidebar-card { background: rgba(255,255,255,.03); border: 1px solid rgba(212,175,55,.12); border-radius: var(--r-md); padding: var(--sp-4); margin-bottom: var(--sp-4); }
.sidebar-card h4 { margin: 0 0 12px; font-size: 12px; color: var(--swh-muted); text-transform: uppercase; letter-spacing: .06em; }
#bodyEditor { min-height: 420px; background: rgba(255,255,255,.03); border: 1px solid rgba(212,175,55,.18); border-radius: var(--r-sm); padding: var(--sp-4); color: var(--swh-body); font-size: 14px; line-height: 1.7; outline: none; }
#bodyEditor:focus { border-color: rgba(212,175,55,.45); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-bottom: var(--sp-2); }
.toolbar button { background: rgba(255,255,255,.05); border: 1px solid rgba(212,175,55,.15); color: var(--swh-body); padding: var(--sp-1) var(--sp-2); border-radius: 5px; cursor: pointer; font-size: 12px; }
.toolbar button:hover { background: rgba(212,175,55,.1); }

/* ── blog-slug-url (chronicles.php) ─────────────────────────────── */
.blog-slug-url {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
  font-size: 14px;
  color: var(--swh-muted);
  word-break: break-all;
}
[data-theme="light"] .blog-slug-url { background: #fff; border-color: rgba(0,0,0,.12); }

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.5
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.6 — utility additions + balance/achievements
   ══════════════════════════════════════════════════════════════════ */

/* ── Card variant with subtle gold border ───────────────────────── */
.card-subtle { border-color: rgba(212,175,55,0.15); }

/* ── Form section panel (subtle inset container with label) ─────── */
.form-section-panel {
  padding: 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(212,175,55,0.08);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}
.form-section-panel-label {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--swh-ember-400);
  margin-bottom: var(--sp-4);
  font-weight: 600;
}

/* ── Recurrence day-of-week pill ────────────────────────────────── */
.rec-day-pill {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: var(--r-sm);
}
.rec-day-pill:has(input:checked) {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.35);
}

/* ── Extra utility helpers ──────────────────────────────────────── */
.flex-wrap      { flex-wrap: wrap; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.gap-1  { gap: var(--sp-1); }
.gap-3  { gap: var(--sp-3); }
.gap-4  { gap: var(--sp-4); }
.gap-6  { gap: var(--sp-6); }
.ml-1   { margin-left: var(--sp-1); }
.ml-2   { margin-left: var(--sp-2); }
.ml-auto { margin-left: auto; }
.mr-1   { margin-right: var(--sp-1); }
.mr-2   { margin-right: var(--sp-2); }
.mr-auto { margin-right: auto; }
.mb-7   { margin-bottom: var(--sp-7); }
.text-center   { text-align: center; }
.cursor-pointer { cursor: pointer; }
.overflow-x-auto { overflow-x: auto; }

/* ── Achievement action buttons (small) ────────────────────────── */
.badge-actions {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--sp-2);
}

/* ── Achievement create form — 3-column grid (name | icon | desc) ─ */
.achieve-create-grid {
  display: grid;
  grid-template-columns: 1fr auto 2fr;
  gap: var(--sp-2);
  align-items: end;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .achieve-create-grid { grid-template-columns: 1fr 60px; }
  .achieve-create-grid .form-group:last-child { grid-column: 1 / -1; }
}

/* ── Icon picker input (emoji single-char) ──────────────────────── */
.icon-input {
  width: 60px;
  text-align: center;
  font-size: 1.4rem;
}

/* ── Punishment list helpers ────────────────────────────────────── */
.pun-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.severity-picker {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-1);
}
.severity-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 13px;
}

/* ── Shared ack / create form bottom row ────────────────────────── */
.form-row-inline {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}
.form-row {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* ── Section sub-heading (h3 variant) ───────────────────────────── */
.section-h3 { margin-bottom: var(--sp-4); }
.section-h3-danger { margin-bottom: var(--sp-4); color: var(--swh-danger); }

/* ── Chronicles card layout ─────────────────────────────────────── */
.chronicles-setup-card {
  width: 100%;
  margin: var(--sp-8) 0;
}
.chronicles-setup-card-sub {
  width: 100%;
  margin: var(--sp-8) 0;
  padding: var(--sp-12) var(--sp-10);
  text-align: center;
}
.chronicles-setup-icon {
  font-size: 34px;
  margin-bottom: var(--sp-5);
  opacity: .35;
}
.chronicles-setup-hint {
  color: rgba(247,240,220,.6);
  font-size: 14px;
  margin-bottom: var(--sp-6);
}
.chronicles-setup-hint-sm {
  color: rgba(247,240,220,.4);
}
.chronicles-sub-text {
  color: rgba(247,240,220,.6);
}
.chronicles-set-btn {
  width: 100%;
  padding: var(--sp-3);
}
.chronicles-posts-wrap { margin-top: var(--sp-5); }
.chronicles-url-wrap   { margin-bottom: var(--sp-8); }

/* ── Protocols banner cluster ───────────────────────────────────── */
.protocol-banner-cluster {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.protocol-banner-hint {
  font-size: 13px;
  opacity: .7;
  margin-top: 3px;
}
.protocol-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--sp-4);
}

/* ── Light mode overrides for v3.6 ─────────────────────────────── */
[data-theme="light"] .chronicles-setup-hint    { color: rgba(30,20,10,.55); }
[data-theme="light"] .chronicles-setup-hint-sm { color: rgba(30,20,10,.4); }
[data-theme="light"] .chronicles-sub-text      { color: rgba(30,20,10,.55); }

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.6
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.7 — Dashboard cleanup
   ══════════════════════════════════════════════════════════════════ */

/* ── Utility additions ──────────────────────────────────────────── */
.mt-1  { margin-top: var(--sp-1); }
.mt-5  { margin-top: var(--sp-5); }
.mt-7  { margin-top: var(--sp-7); }
.mt-9  { margin-top: var(--sp-9); }
.mt-10 { margin-top: var(--sp-10); }
.mt-12 { margin-top: var(--sp-12); }
.flex-col { flex-direction: column; }
.list-none { list-style: none; padding: 0; margin: 0; }
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-mono { font-family: monospace; }
.gap-5 { gap: var(--sp-5); }
.mb-0  { margin-bottom: 0; }
.notif-toggle-label { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; }

.notif-form {
  display: grid;
  gap: var(--sp-4);
}

.notif-master-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.notif-master-item {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  background: var(--swh-surface);
  color: var(--swh-heading);
}

.notif-group-card {
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  background: var(--swh-surface);
  overflow: hidden;
}

.notif-group-head {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--swh-heading);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--swh-border);
  background: rgba(240, 97, 62, 0.08);
}

.notif-table-wrap {
  overflow-x: auto;
}

.notif-prefs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  table-layout: fixed;
}

.notif-prefs-table th,
.notif-prefs-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--swh-border);
  color: var(--swh-body);
  vertical-align: middle;
}

.notif-prefs-table th:first-child,
.notif-prefs-table td:first-child {
  width: 64%;
  text-align: left;
}

.notif-prefs-table th:not(:first-child),
.notif-prefs-table td:not(:first-child) {
  width: 12%;
  text-align: center;
}

.notif-prefs-table th {
  color: var(--swh-heading);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.notif-prefs-table tr:last-child td {
  border-bottom: 0;
}

.notif-prefs-table input[type="checkbox"] {
  transform: scale(1.05);
  display: block;
  margin: 0 auto;
}

.push-diag-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.push-diag-toggle {
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  border: 1px solid var(--swh-border);
  background: var(--swh-surface);
  color: var(--swh-muted);
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.push-diag-toggle:hover {
  color: var(--swh-heading);
  border-color: rgba(240, 97, 62, 0.5);
}

.push-diag-panel {
  margin-top: var(--sp-3);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  background: var(--swh-card);
  padding: var(--sp-3);
}

@media (max-width: 760px) {
  .notif-master-grid {
    grid-template-columns: 1fr;
  }

  .notif-prefs-table th,
  .notif-prefs-table td {
    padding: var(--sp-2) var(--sp-2);
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .notif-prefs-table th {
    font-size: 0.7rem;
    letter-spacing: 0.04em;
  }

  .notif-prefs-table th:first-child,
  .notif-prefs-table td:first-child {
    width: 58%;
  }

  .notif-prefs-table th:not(:first-child),
  .notif-prefs-table td:not(:first-child) {
    width: 14%;
  }

  .notif-prefs-table input[type="checkbox"] {
    transform: scale(1);
  }
}

/* ── Dash-stat anchor reset ─────────────────────────────────────── */
a.dash-stat {
  display: block;
  text-decoration: none;
}

/* ── Dynamic badge inactive state (no connection) ──────────────── */
.dynamic-badge--inactive {
  border-color: rgba(240, 97, 62, .3);
  color: var(--swh-ember-400);
}
.dynamic-badge--inactive .dot {
  background: var(--swh-ember-400);
  box-shadow: 0 0 6px rgba(240, 97, 62, 0.5);
}
.dynamic-badge--inactive a {
  color: inherit;
  text-decoration: underline;
  margin-left: var(--sp-1);
}

/* ── Partner sidebar card internals ────────────────────────────── */
.partner-card-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.partner-info { flex: 1; min-width: 0; }
.partner-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.partner-role-eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 2px;
}
.partner-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-1);
  flex-shrink: 0;
}
.partner-card-divider {
  border-top: 1px solid var(--swh-border);
  padding-top: var(--sp-2);
}

/* ── Due-soon list items ─────────────────────────────────────────── */
.due-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--swh-border);
}
.due-item-link {
  text-decoration: none;
  flex: 1;
  margin-right: var(--sp-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Next achievement widget ────────────────────────────────────── */
.achieve-next-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}
.achieve-progress-bar {
  background: rgba(240, 97, 62, .1);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}
.achieve-progress-fill {
  background: var(--swh-ember-400);
  height: 5px;
  border-radius: 4px;
}
.achieve-progress-link {
  display: inline-block;
  text-decoration: none;
  margin-top: var(--sp-3);
}

/* ── BDSM & Compatibility widgets ──────────────────────────────── */
.study-sidebar-card {
  position: relative;
}

/* Highlight insights sections (Group 3: BDSM & Compatibility) */
.study-sidebar-group:nth-child(3) .study-sidebar-card {
  background: linear-gradient(135deg, rgba(240, 97, 62, 0.04) 0%, rgba(132, 104, 240, 0.02) 100%);
}

/* Score/match strength display */
.bdsm-archetype-score,
.compatibility-score {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin: var(--sp-2) 0 var(--sp-3);
}

.bdsm-archetype-score strong,
.compatibility-score strong {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--swh-ember-300);
}

/* Compatibility checklist styling */
.compatibility-checklist {
  display: grid;
  gap: var(--sp-2);
  background: var(--swh-surface);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  margin: var(--sp-3) 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.compatibility-check-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.compatibility-check-item::before {
  content: attr(data-status);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Completed check */
.compatibility-check-item.completed::before {
  content: '✓';
  background: rgba(52, 211, 153, 0.2);
  color: var(--swh-success);
}

/* Incomplete check */
.compatibility-check-item.incomplete::before {
  content: '○';
  background: transparent;
  color: var(--swh-muted);
  border: 1px solid var(--swh-muted);
}

.compatibility-check-item.completed {
  color: var(--swh-body);
}

.compatibility-check-item.incomplete {
  color: var(--swh-muted);
}


/* ── No-connection empty state card ────────────────────────────── */
.no-connection-card {
  width: 100%;
  margin: var(--sp-12) 0;
  padding: var(--sp-12);
}
.no-connection-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ── Admin kink suggestion dropdown (moved to admin.css) ────────── */

/* ── Kink search dropdown in modals ─────────────────────────────── */
.kink-dropdown-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--swh-border);
  margin-top: 6px;
  background: var(--swh-surface);
  position: relative;
  z-index: 20;
}

/* ── Admin settings panels (moved to admin.css) ─────────────────── */

/* ── Invite link inputs (admin/registration) ────────────────────── */
.invite-token-input {
  font-size: 11px;
  font-family: monospace;
  width: 100%;
  background: rgba(212, 175, 55, .06);
  border: 1px solid rgba(212, 175, 55, .15);
  color: var(--swh-heading);
  padding: var(--sp-1) var(--sp-2);
  border-radius: 4px;
  cursor: text;
}
.invite-token-expired { font-size: 11px; font-family: monospace; color: rgba(247, 240, 220, .3); }
.invite-status        { font-size: 12px; font-weight: 600; }
.invite-status--used  { color: #6bcf6b; }
.invite-status--expired { color: rgba(247, 240, 220, .35); }
.invite-status--unused  { color: var(--swh-ember-400); }

/* ── Pager ellipsis ─────────────────────────────────────────────── */
.pager-ellipsis { padding: 0 var(--sp-1); opacity: .4; }

/* ── Admin support queue + pagination (moved to admin.css) ──────── */

/* ── Activity feed JS badge overrides ──────────────────────────── */
.study-feed-item .badge {
  margin-left: 6px;
  font-size: 10px;
}
.study-feed-item .points-badge {
  margin-left: 6px;
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.7
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.8 — task_create recurrence + form utilities
   ══════════════════════════════════════════════════════════════════ */

/* Recurrence section dividers */
.rec-range-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(212,175,55,0.12);
}
.rec-diff-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(212,175,55,0.12);
}
.rec-section-label {
  display: block;
  margin-bottom: 10px;
  color: var(--swh-ember-400);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.8
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.9 — admin/notifications email editor + push
   ══════════════════════════════════════════════════════════════════ */

/* Utility additions */
.mb-8 { margin-bottom: var(--sp-8); }
.items-end { align-items: flex-end; }

/* Email template preview frame */
.preview-frame {
  background: #fff;
  color: #111;
  padding: var(--sp-6);
  border-radius: 6px;
  font-family: sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

/* Email editor layout (moved from admin/notifications.php <style> block) */
.email-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
#body_editor,
#body_source,
#livePreviewFrame {
  color: #111;
}
#body_editor p, #body_editor div, #body_editor span, #body_editor li,
#body_editor td, #body_editor th, #body_editor h1, #body_editor h2,
#body_editor h3, #body_editor h4, #body_editor h5, #body_editor h6,
#body_editor blockquote,
#livePreviewFrame p, #livePreviewFrame div, #livePreviewFrame span,
#livePreviewFrame li, #livePreviewFrame td, #livePreviewFrame th,
#livePreviewFrame h1, #livePreviewFrame h2, #livePreviewFrame h3,
#livePreviewFrame h4, #livePreviewFrame h5, #livePreviewFrame h6,
#livePreviewFrame blockquote {
  color: inherit;
  font-family: inherit;
  line-height: inherit;
}
#body_editor a, #livePreviewFrame a {
  color: #1d4ed8;
  text-decoration: underline;
}
@media (max-width: 980px) {
  .email-editor-grid {
    grid-template-columns: 1fr;
  }
  .email-editor-grid .editor-col {
    border-right: 0 !important;
    border-bottom: 1px solid rgba(212,175,55,.15);
  }
}

/* Editor toolbar */
#editorToolbar {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  padding: var(--sp-2);
  background: rgba(13,30,51,.55);
  border-bottom: 1px solid rgba(212,175,55,.15);
}

/* Editor wrapper border */
.notif-editor-wrap {
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: var(--sp-2);
}

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v4.0 — subscription dashboard
   ══════════════════════════════════════════════════════════════════ */

.subscription-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.subscription-hero-copy {
  flex: 1 1 420px;
}

.subscription-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin-bottom: var(--sp-3);
}

.subscription-subnote {
  color: var(--swh-muted);
  font-size: 0.9rem;
  margin-top: var(--sp-3);
}

.usage-overall {
  min-width: 220px;
  padding: var(--sp-5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(240,97,62,0.12), rgba(132,104,240,0.08));
}

.usage-overall-label {
  font-size: 0.76rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--swh-muted);
  margin-bottom: var(--sp-2);
}

.usage-overall-value {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 900;
  line-height: 1;
  color: var(--swh-heading);
}

.usage-overall-value.is-success { color: var(--swh-success); }
.usage-overall-value.is-caution { color: var(--swh-caution); }
.usage-overall-value.is-danger { color: var(--swh-danger); }

.usage-overall-meta {
  margin-top: var(--sp-2);
  color: var(--swh-muted);
  font-size: 0.85rem;
}

.subscription-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.usage-meter-row + .usage-meter-row {
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.usage-meter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-2);
}

.usage-meter-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--swh-heading);
}

.usage-meter-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  flex-wrap: wrap;
  text-align: right;
}

.usage-meter-badge,
.usage-meter-unlimited,
.usage-meter-noconn {
  color: var(--swh-muted);
  font-size: 0.85rem;
}

.usage-meter-link {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.usage-meter-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: var(--r-full);
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.usage-meter-fill {
  height: 100%;
  border-radius: inherit;
  transition: width var(--duration-slow) var(--ease-out);
}

.usage-meter-fill--success { background: linear-gradient(90deg, rgba(52,211,153,0.7), var(--swh-success)); }
.usage-meter-fill--caution { background: linear-gradient(90deg, rgba(251,191,36,0.7), var(--swh-caution)); }
.usage-meter-fill--danger { background: linear-gradient(90deg, rgba(248,113,113,0.7), var(--swh-danger)); }

.usage-meter-warning {
  margin-top: var(--sp-2);
  font-size: 0.84rem;
  color: var(--swh-caution);
}

.sparkline-wrap {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.sparkline-heading {
  margin-bottom: var(--sp-2);
  color: var(--swh-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.sparkline-empty {
  color: var(--swh-muted);
  font-size: 0.84rem;
}

.subscription-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
}

.subscription-stat-tile {
  padding: var(--sp-5);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-lg);
}

.subscription-stat-value {
  color: var(--swh-heading);
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 800;
}

.subscription-stat-label {
  margin-top: var(--sp-2);
  color: var(--swh-muted);
  font-size: 0.85rem;
}

.feature-section {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: var(--sp-4);
}

.feature-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.feature-section summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  color: var(--swh-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

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

.feature-section summary::after {
  content: '+';
  color: var(--swh-ember-400);
  font-size: 1.15rem;
}

.feature-section[open] summary::after {
  content: '-';
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.feature-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-full);
  border: 1px solid transparent;
  font-size: 0.85rem;
}

.feature-chip strong {
  color: inherit;
  font-size: inherit;
}

.feature-chip-state {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.feature-chip--on {
  color: var(--swh-success);
  background: rgba(52,211,153,0.1);
  border-color: rgba(52,211,153,0.2);
}

.feature-chip--off {
  color: var(--swh-muted);
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.06);
}

.subscription-settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: var(--sp-5);
  align-items: end;
}

.subscription-settings-copy {
  color: var(--swh-muted);
  font-size: 0.9rem;
}

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

  .usage-meter-label {
    flex-direction: column;
    align-items: flex-start;
  }

  .usage-meter-meta {
    justify-content: flex-start;
    text-align: left;
  }
}

/* ── Billing: status grid ────────────────────────────────────────── */
.billing-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.billing-status-tile {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
}

.billing-status-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--swh-muted);
  margin-bottom: var(--sp-1);
}

.billing-status-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--swh-text);
}

.billing-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.billing-badge--active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.billing-badge--expired {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.billing-badge--manual {
  background: rgba(212,175,55,0.12);
  color: var(--swh-gold);
  border: 1px solid rgba(212,175,55,0.25);
}

.billing-sub-note {
  margin-top: var(--sp-3);
  font-size: 0.85rem;
  color: var(--swh-muted);
  font-style: italic;
}

/* ── Billing: empty state ────────────────────────────────────────── */
.billing-empty-state {
  padding: var(--sp-4) 0 var(--sp-2);
  color: var(--swh-muted);
  font-size: 0.9rem;
}

.billing-empty-state p {
  margin: 0 0 var(--sp-2);
}

.billing-empty-hint {
  font-size: 0.85rem;
}

/* ── Billing: history table ──────────────────────────────────────── */
.billing-history-note {
  font-size: 0.85rem;
  color: var(--swh-muted);
  margin: var(--sp-2) 0 var(--sp-3);
}

.billing-history-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--sp-4);
}

.billing-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.billing-history-table th {
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--swh-muted);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  white-space: nowrap;
}

.billing-history-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--swh-text);
  vertical-align: middle;
}

.billing-history-table tr:last-child td {
  border-bottom: none;
}

.billing-history-table tbody tr:hover td {
  background: rgba(255,255,255,0.03);
}

.billing-row--expired td {
  opacity: 0.55;
}

.billing-row-empty {
  color: var(--swh-muted);
}

/* ── Billing: support CTA ────────────────────────────────────────── */
.billing-support-row {
  display: flex;
  justify-content: flex-start;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid rgba(255,255,255,0.07);
}

@media (max-width: 600px) {
  .billing-status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .billing-support-row {
    justify-content: stretch;
  }

  .billing-support-row .btn {
    width: 100%;
    text-align: center;
  }
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v4.0
   ══════════════════════════════════════════════════════════════════ */

/* Editor column right border */
.editor-col {
  border-right: 1px solid rgba(212,175,55,.15);
}

/* Pane header label */
.notif-editor-pane-label {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid rgba(212,175,55,.15);
  background: rgba(13,30,51,.45);
  font-size: 12px;
  color: rgba(247,240,220,.8);
}

/* Editor and preview panes */
#body_editor,
#livePreviewFrame {
  min-height: 300px;
  max-height: 480px;
  overflow: auto;
  padding: var(--sp-3);
  background: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
#body_source {
  width: 100%;
  min-height: 300px;
  max-height: 480px;
  overflow: auto;
  border: 0;
  padding: var(--sp-4);
  resize: vertical;
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

/* Push notification panels */
.notif-push-panel {
  border: 1px solid rgba(247,240,220,.2);
  border-radius: 4px;
  padding: var(--sp-4);
}
.notif-push-panel-title {
  margin-top: 0;
  margin-bottom: var(--sp-3);
  font-size: 14px;
  font-weight: 600;
}
.notif-key-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(247,240,220,.7);
  margin-bottom: var(--sp-1);
}
.notif-key-code {
  display: block;
  background: rgba(0,0,0,.3);
  padding: var(--sp-2);
  border-radius: 3px;
  font-size: 11px;
  word-break: break-all;
  max-height: 80px;
  overflow-y: auto;
}
.notif-push-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.notif-push-stat-card {
  background: rgba(0,0,0,.2);
  padding: var(--sp-3);
  border-radius: 3px;
}
.notif-push-stat-label {
  font-size: 11px;
  color: rgba(247,240,220,.6);
  margin-bottom: var(--sp-1);
}
.notif-push-stat-value {
  font-size: 24px;
  font-weight: 600;
}
.notif-push-ua-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(247,240,220,.7);
  margin-bottom: var(--sp-2);
}
.notif-push-ua-list { font-size: 12px; }
.notif-push-ua-row {
  padding: var(--sp-1) 0;
  border-bottom: 1px solid rgba(247,240,220,.1);
}
.notif-push-ua-count {
  float: right;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.9
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.10 — admin/tiers structural classes
   ══════════════════════════════════════════════════════════════════ */

.tier-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
/* .tier-limits-summary — defined in the tier-grid block above */
.tier-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-2);
}
.assign-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.tier-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--sp-8) 0 var(--sp-5);
}
.tier-history-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(212,175,55,0.12);
}
.tier-history-table th,
.tier-history-table td {
  padding: var(--sp-2) var(--sp-4);
}
.tier-history-name { font-weight: 600; font-size: 14px; }
.tier-history-meta { font-size: 11px; color: rgba(247,240,220,.4); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.10
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.17 - Kink Calendar
   ══════════════════════════════════════════════════════════════════ */

.kink-calendar-page .subtitle {
  margin-top: 4px;
  color: var(--swh-muted);
}

.kink-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.calendar-shell {
  padding: var(--sp-5);
}

.calendar-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.calendar-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: -4px 0 var(--sp-4);
}

.calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--swh-muted);
}

.calendar-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.calendar-legend-dot.is-planned {
  background: rgba(251, 191, 36, 0.95);
}

.calendar-legend-dot.is-confirmed,
.calendar-legend-dot.is-completed {
  background: rgba(52, 211, 153, 0.95);
}

.calendar-legend-dot.is-cancelled {
  background: rgba(248, 113, 113, 0.95);
}

.calendar-grid-header,
.calendar-grid-body {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--sp-2);
}

.calendar-grid-header span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--swh-muted);
  padding: 0 var(--sp-2);
}

.calendar-day {
  position: relative;
}

.calendar-cell {
  min-height: 112px;
  border-radius: var(--r-md);
  border: 1px solid var(--swh-border);
  background: var(--swh-surface);
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--swh-body);
  text-decoration: none;
}

.calendar-cell:hover {
  border-color: rgba(240, 97, 62, 0.4);
  transform: translateY(-1px);
}

.calendar-cell.is-empty {
  background: transparent;
  border-style: dashed;
  pointer-events: none;
}

.calendar-day.is-active .calendar-cell {
  border-color: var(--swh-ember-400);
  box-shadow: 0 0 0 1px rgba(240, 97, 62, 0.35) inset;
}

.calendar-cell .day-num {
  font-weight: 700;
  color: var(--swh-heading);
}

.calendar-cell .day-meta {
  font-size: 11px;
  color: var(--swh-muted);
}

.calendar-cell .day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.calendar-cell .day-event,
.calendar-cell .day-event-more {
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-cell .day-event {
  color: var(--swh-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-cell .day-event-more {
  color: var(--swh-muted);
}

.calendar-cell .day-event-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  flex: 0 0 7px;
  background: rgba(251, 191, 36, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.calendar-cell .day-event-dot--planned {
  background: rgba(251, 191, 36, 0.95);
}

.calendar-cell .day-event-dot--confirmed,
.calendar-cell .day-event-dot--completed {
  background: rgba(52, 211, 153, 0.95);
}

.calendar-cell .day-event-dot--cancelled {
  background: rgba(248, 113, 113, 0.95);
}

.calendar-day.lvl-1 .calendar-cell { background: rgba(52, 211, 153, 0.12); }
.calendar-day.lvl-2 .calendar-cell { background: rgba(251, 191, 36, 0.13); }
.calendar-day.lvl-3 .calendar-cell { background: rgba(240, 97, 62, 0.16); }

.calendar-quick-add {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: var(--r-full);
  border: 1px solid rgba(240, 97, 62, 0.45);
  background: linear-gradient(135deg, rgba(240, 97, 62, 0.95), rgba(216, 77, 45, 0.95));
  color: #fff;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 4;
}

.calendar-day:hover .calendar-quick-add,
.calendar-day:focus-within .calendar-quick-add {
  opacity: 1;
  transform: translateY(0);
}

.calendar-quick-add:hover {
  border-color: rgba(240, 97, 62, 0.85);
}

.calendar-event-hero {
  padding: var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  background: radial-gradient(circle at top right, rgba(240, 97, 62, 0.14), rgba(0, 0, 0, 0));
  border: 1px solid rgba(240, 97, 62, 0.18);
}

.calendar-event-title {
  margin: 0;
}

.calendar-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.calendar-meta-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--swh-border);
  border-radius: var(--r-full);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--swh-body);
  background: rgba(255, 255, 255, 0.02);
}

.calendar-status-pill {
  border-color: rgba(240, 97, 62, 0.5);
  background: rgba(240, 97, 62, 0.16);
  color: var(--swh-heading);
  text-transform: capitalize;
  font-weight: 600;
}

.calendar-status-pill--planned {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.15);
}

.calendar-status-pill--confirmed,
.calendar-status-pill--completed {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.15);
}

.calendar-status-pill--cancelled {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.16);
}

.calendar-event-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-4);
}

.calendar-event-main {
  padding: var(--sp-5);
}

.calendar-event-main p {
  margin-top: 0;
}

.calendar-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.calendar-detail-item {
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  background: rgba(255, 255, 255, 0.02);
}

.calendar-detail-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--swh-muted);
  margin-bottom: 4px;
}

.calendar-detail-value {
  color: var(--swh-heading);
  font-weight: 600;
}

.calendar-intensity-track {
  margin-top: 8px;
  width: 100%;
  height: 6px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.calendar-intensity-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fbbf24, #f0613e);
}

.calendar-event-side {
  padding: var(--sp-5);
  align-self: start;
  position: sticky;
  top: 86px;
}

.calendar-action-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.calendar-action-stack .btn {
  width: 100%;
}

.calendar-kink-grid-title {
  margin: var(--sp-4) 0 var(--sp-2);
  font-size: 13px;
  color: var(--swh-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calendar-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}

.calendar-event-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.calendar-event-item {
  display: block;
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.calendar-event-item:hover {
  border-color: rgba(240, 97, 62, 0.45);
  transform: translateY(-1px);
}

.calendar-upcoming-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.calendar-upcoming-list li {
  border-bottom: 1px solid var(--swh-border);
  padding-bottom: var(--sp-2);
}

.calendar-form {
  padding: var(--sp-5);
}

.calendar-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.calendar-kink-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.calendar-kink-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  border: 1px solid var(--swh-border);
  background: var(--swh-surface);
  border-radius: var(--r-full);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.calendar-kink-pill.is-static {
  cursor: default;
}

.calendar-kink-picker {
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  padding: var(--sp-3);
}

.calendar-kink-picker-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.calendar-kink-search {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 220px;
  background: rgba(8,12,20,0.72);
  border: 1px solid var(--swh-border);
  color: var(--swh-body);
}

.calendar-kink-search::placeholder {
  color: var(--swh-muted);
}

.calendar-kink-search:focus {
  border-color: rgba(240,97,62,0.45);
  box-shadow: 0 0 0 3px rgba(240,97,62,0.14);
}

.calendar-kink-count {
  font-size: 12px;
  color: var(--swh-muted);
}

.calendar-kink-grid.calendar-kink-grid--picker {
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.calendar-kink-grid.calendar-kink-grid--picker::-webkit-scrollbar {
  width: 8px;
}

.calendar-kink-grid.calendar-kink-grid--picker::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

.calendar-kink-pill.calendar-kink-pill--choice {
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.calendar-kink-pill.calendar-kink-pill--choice:hover {
  border-color: rgba(240,97,62,0.3);
  background: rgba(240,97,62,0.08);
}

.calendar-kink-pill.calendar-kink-pill--choice input {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 4px;
  background: rgba(5,10,16,0.72);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

.calendar-kink-pill.calendar-kink-pill--choice input::after {
  content: '';
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: transform .14s ease;
  clip-path: polygon(14% 44%, 0 59%, 43% 100%, 100% 23%, 85% 9%, 41% 62%);
  background: #071627;
}

.calendar-kink-pill.calendar-kink-pill--choice input:checked {
  background: rgba(240,97,62,0.95);
  border-color: rgba(240,97,62,0.95);
}

.calendar-kink-pill.calendar-kink-pill--choice input:checked::after {
  transform: scale(1);
}

.calendar-kink-pill.calendar-kink-pill--choice input:focus-visible {
  outline: 2px solid rgba(240,97,62,0.45);
  outline-offset: 1px;
}

.calendar-kink-pill.calendar-kink-pill--choice.is-selected {
  border-color: rgba(240,97,62,0.48);
  background: rgba(240,97,62,0.14);
  color: var(--swh-heading);
}

.calendar-kink-empty {
  display: none;
  font-size: 12px;
  color: var(--swh-muted);
  padding: var(--sp-2) 0 0;
}

[data-theme="light"] .calendar-kink-picker {
  background: linear-gradient(180deg, rgba(17,17,24,0.02), rgba(17,17,24,0.01));
  border-color: rgba(17,17,24,0.14);
}

[data-theme="light"] .calendar-kink-search {
  background: rgba(17,17,24,0.02);
  border-color: rgba(17,17,24,0.16);
  color: #1b1f2b;
}

[data-theme="light"] .calendar-kink-search::placeholder {
  color: rgba(17,17,24,0.52);
}

[data-theme="light"] .calendar-kink-search:focus {
  border-color: rgba(240,97,62,0.5);
  box-shadow: 0 0 0 3px rgba(240,97,62,0.12);
}

[data-theme="light"] .calendar-kink-pill.calendar-kink-pill--choice {
  background: rgba(17,17,24,0.03);
  border-color: rgba(17,17,24,0.14);
  color: #2a3144;
}

[data-theme="light"] .calendar-kink-pill.calendar-kink-pill--choice input {
  border-color: rgba(17,17,24,0.24);
  background: rgba(17,17,24,0.03);
}

[data-theme="light"] .calendar-kink-pill.calendar-kink-pill--choice input::after {
  background: #ffffff;
}

[data-theme="light"] .calendar-kink-pill.calendar-kink-pill--choice:hover {
  border-color: rgba(240,97,62,0.35);
  background: rgba(240,97,62,0.08);
}

[data-theme="light"] .calendar-kink-pill.calendar-kink-pill--choice.is-selected {
  border-color: rgba(240,97,62,0.5);
  background: rgba(240,97,62,0.14);
  color: #1b1f2b;
}

[data-theme="light"] .calendar-kink-grid.calendar-kink-grid--picker::-webkit-scrollbar-thumb {
  background: rgba(17,17,24,0.22);
}

.calendar-warning {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.08);
}

.calendar-warning-list {
  margin-top: var(--sp-3);
  padding-left: 18px;
}

.calendar-inline-checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.calendar-aftercare-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.calendar-aftercare-item {
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  background: var(--swh-surface);
}

.calendar-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--sp-2);
}

.calendar-heat-cell {
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  padding: var(--sp-2);
  min-height: 98px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--swh-body);
}

.calendar-heat-cell strong {
  font-size: 15px;
  color: var(--swh-heading);
}

.calendar-heat-cell.heat-lvl-0 { background: rgba(255, 255, 255, 0.02); }
.calendar-heat-cell.heat-lvl-1 { background: rgba(52, 211, 153, 0.12); }
.calendar-heat-cell.heat-lvl-2 { background: rgba(251, 191, 36, 0.14); }
.calendar-heat-cell.heat-lvl-3 { background: rgba(240, 97, 62, 0.16); }
.calendar-heat-cell.heat-lvl-4 { background: rgba(248, 113, 113, 0.2); }

@media (max-width: 980px) {
  .calendar-event-layout,
  .calendar-two-col,
  .calendar-aftercare-list,
  .calendar-form-grid {
    grid-template-columns: 1fr;
  }

  .calendar-quick-add {
    opacity: 1;
    transform: none;
  }

  .calendar-event-side {
    position: static;
    top: auto;
  }
}

@media (max-width: 760px) {
  .calendar-cell,
  .calendar-heat-cell {
    min-height: 88px;
  }

  .calendar-kink-grid.calendar-kink-grid--picker {
    max-height: 220px;
  }

  .calendar-grid-header {
    font-size: 11px;
  }

  .calendar-event-hero,
  .calendar-event-main,
  .calendar-event-side,
  .calendar-form,
  .card#aftercare {
    padding: var(--sp-4);
  }

  .calendar-detail-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }

  .calendar-action-stack .btn {
    min-height: 42px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.17
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.11 — admin/cron_logs structural classes
   ══════════════════════════════════════════════════════════════════ */

.cron-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px,1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}
.cron-lastrun-info {
  font-size: 13px;
  color: rgba(247,240,220,.4);
  margin-bottom: var(--sp-6);
}
.cron-setup-hint {
  background: rgba(212,175,55,0.04);
  border: 1px solid rgba(212,175,55,0.12);
  border-radius: 10px;
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-8);
  font-size: 13px;
}
.cron-setup-code {
  display: block;
  margin-top: var(--sp-2);
  color: rgba(247,240,220,.8);
  font-family: monospace;
  background: rgba(0,0,0,.2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 6px;
}
.cron-table-wrap {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(212,175,55,0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: var(--sp-6);
}
.cron-run-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cron-thead-row {
  border-bottom: 1px solid rgba(212,175,55,0.2);
  color: rgba(247,240,220,.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.cron-manage-panel {
  background: rgba(244,67,54,0.04);
  border: 1px solid rgba(244,67,54,0.15);
  border-radius: 10px;
  padding: var(--sp-5) var(--sp-6);
  max-width: 560px;
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.11
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.12 — admin/email_settings button variants
   ══════════════════════════════════════════════════════════════════ */

.btn-info {
  background-color: #0d6efd;
  color: #fff;
  border: none;
  padding: var(--sp-2) var(--sp-4);
  border-radius: 4px;
  cursor: pointer;
}
.btn-info:hover { background-color: #0b5ed7; }
.btn-secondary {
  background-color: #6c757d;
  color: #fff;
  border: none;
  padding: var(--sp-2) var(--sp-4);
  border-radius: 4px;
  cursor: pointer;
}
.btn-secondary:hover { background-color: #5c636a; }

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.12
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.13 — admin/support_ticket
   ══════════════════════════════════════════════════════════════════ */

.back-link {
  color: var(--swh-muted);
  text-decoration: none;
  font-size: 13px;
}

.ticket-thread-layout {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

.ticket-header-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.ticket-subject {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 var(--sp-1);
  color: var(--swh-heading);
}

.ticket-meta {
  font-size: 13px;
  color: var(--swh-muted);
  margin-bottom: var(--sp-6);
}

.ticket-msg-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--swh-body);
}

.ticket-attach-link {
  background: rgba(240, 97, 62, 0.07);
  border: 1px solid rgba(240, 97, 62, 0.2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 4px;
  text-decoration: none;
}

.ticket-reply-form {
  margin-top: var(--sp-8);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: 10px;
  padding: var(--sp-5);
}

.ticket-closed-msg {
  text-align: center;
  padding: var(--sp-5);
  color: var(--swh-muted);
  font-size: 13px;
}

.ticket-sidebar {
  width: 240px;
  flex-shrink: 0;
}

.sidebar-select {
  width: 100%;
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  color: var(--swh-body);
  padding: var(--sp-1) var(--sp-2);
  border-radius: 6px;
  margin-bottom: var(--sp-2);
}

.csat-stars {
  font-size: 20px;
  color: var(--swh-ember-400);
}

.csat-comment {
  font-size: 12px;
  margin-top: var(--sp-2);
  color: var(--swh-body);
  font-style: italic;
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.13
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.14 — templates.php
   ══════════════════════════════════════════════════════════════════ */

.rec-day-label {
  cursor: pointer;
  padding: var(--sp-1) var(--sp-2);
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 4px;
  font-size: 12px;
}

.bundle-tpl-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 6px;
  padding: var(--sp-2);
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.14
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.15 — kinks.php modal content
   ══════════════════════════════════════════════════════════════════ */

#view-kink-desc {
  margin-top: var(--sp-3);
  white-space: pre-wrap;
  color: rgba(247, 240, 220, 0.92);
}

#view-kink-tags { margin-top: var(--sp-3); }

#view-kink-consent {
  margin-top: var(--sp-3);
  font-size: 14px;
  color: rgba(247, 240, 220, 0.95);
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.15
   ══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.16 — admin/kb_edit
   ══════════════════════════════════════════════════════════════════ */

.kb-title-input {
  font-size: 18px;
  padding: var(--sp-2) var(--sp-3);
}

.kb-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--text);
  padding: var(--sp-2);
  border-radius: 6px;
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.16
   ══════════════════════════════════════════════════════════════════ */
  background: rgba(240, 97, 62, .06);
  color: var(--swh-ember-300);
}
.dynamic-badge--inactive .dot {
  background: rgba(240, 97, 62, .3);
  animation: none;
}

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.8 — Compatibility Report
   ══════════════════════════════════════════════════════════════════ */

/* ── Compatibility Meter (Gauge) ────────────────────────────────── */
.compat-meter-wrap {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.compat-meter-track {
  position: relative;
  height: 12px;
  background: linear-gradient(to right, 
    var(--swh-danger) 0%, 
    var(--swh-caution) 50%, 
    var(--swh-success) 100%);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-2);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.2);
}

.compat-meter-needle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: var(--swh-heading);
  border: 3px solid var(--swh-card);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  transition: left var(--duration-normal) var(--ease-out);
  z-index: 2;
}

.compat-meter-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--swh-muted);
}

.compat-score {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.compat-score.compat-excellent { color: var(--swh-success); }
.compat-score.compat-moderate { color: var(--swh-caution); }
.compat-score.compat-low { color: var(--swh-danger); }

.compat-meter-caption {
  margin-top: var(--sp-2);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Compatibility Details Toggle ───────────────────────────────── */
.compat-details-toggle {
  cursor: pointer;
  user-select: none;
  padding: var(--sp-3) var(--sp-4);
  background: var(--swh-surface);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-md);
  color: var(--swh-ember-400);
  font-weight: 600;
  transition: all var(--duration-fast);
  list-style: none;
}

.compat-details-toggle::-webkit-details-marker {
  display: none;
}

.compat-details-toggle::before {
  content: '▶';
  display: inline-block;
  margin-right: var(--sp-2);
  transition: transform var(--duration-fast);
}

details[open] .compat-details-toggle::before {
  transform: rotate(90deg);
}

.compat-details-toggle:hover {
  background: var(--swh-border);
  border-color: var(--swh-ember-400);
}

/* ── Compatibility Breakdown Sections ───────────────────────────── */
.compat-breakdown {
  padding: var(--sp-4) 0;
}

.compat-section {
  padding: var(--sp-3);
  background: var(--swh-surface);
  border-radius: var(--r-md);
}

.compat-section h4 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.compat-kink-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.compat-kink-badge {
  cursor: pointer;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}

.compat-kink-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* ── Semantic Color Utilities ───────────────────────────────────── */
.text-success { color: var(--swh-success); }
.text-caution { color: var(--swh-caution); }
.text-danger  { color: var(--swh-danger); }

.badge-success {
  background: var(--swh-success);
  color: var(--swh-ink);
}

.badge-danger {
  background: var(--swh-danger);
  color: var(--swh-ink);
}

/* ── Responsive adjustments ─────────────────────────────────────── */
@media (max-width: 600px) {
  .compat-score {
    font-size: 28px;
  }
  
  .compat-meter-label-row {
    font-size: 12px;
  }
  
  .dash-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── Compatibility Chart ────────────────────────────────────────── */
.compat-chart-wrap {
  max-width: 450px;
  margin: 0 auto;
  padding: var(--sp-4);
  background: var(--swh-surface);
  border-radius: var(--r-md);
}

.compat-chart-wrap canvas {
  max-height: 300px;
}

@media (max-width: 600px) {
  .compat-chart-wrap {
    max-width: 100%;
    padding: var(--sp-3);
  }
  
  .compat-chart-wrap canvas {
    max-height: 250px;
  }
}

/* ── Compatibility Search and Filter ────────────────────────────── */
.compat-filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--swh-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--swh-border);
}

.compat-search-input {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  color: var(--swh-body);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color var(--duration-fast);
}

.compat-search-input:focus {
  outline: none;
  border-color: var(--swh-ember-400);
  box-shadow: 0 0 0 3px rgba(240, 97, 62, 0.1);
}

.compat-search-input::placeholder {
  color: var(--swh-muted);
  opacity: 0.7;
}

.compat-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.compat-filter-btn {
  padding: var(--sp-2) var(--sp-3);
  background: var(--swh-card);
  border: 1px solid var(--swh-border);
  border-radius: var(--r-sm);
  color: var(--swh-body);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.compat-filter-btn:hover {
  background: var(--swh-border);
  border-color: var(--swh-ember-400);
}

.compat-filter-btn.active {
  background: var(--swh-ember-400);
  border-color: var(--swh-ember-400);
  color: var(--swh-ink);
}

@media (min-width: 600px) {
  .compat-filter-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .compat-search-input {
    max-width: 300px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   EXTENDED STYLES v3.10 — Lightbox for Images & Videos
   ══════════════════════════════════════════════════════════════════ */

/* ── Lightbox Overlay & Container ──────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: var(--sp-6);
  backdrop-filter: blur(4px);
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-content {
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
}

/* ── Lightbox Media (Images & Videos) ──────────────────────────── */
.lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.lightbox-img,
.lightbox-video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(90vh - 140px);
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ── Lightbox Controls ─────────────────────────────────────────── */
.lightbox-close {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--swh-heading);
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--r-sm);
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  transition: background var(--duration-fast);
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: var(--swh-ember-400);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: var(--swh-heading);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  font-size: 20px;
  border-radius: var(--r-sm);
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  transition: all var(--duration-fast);
  z-index: 10;
}

.lightbox-prev {
  left: var(--sp-2);
}

.lightbox-next {
  right: var(--sp-2);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(0, 0, 0, 0.75);
  border-color: var(--swh-violet-400);
  color: var(--swh-violet-300);
}

.lightbox-download {
  display: block;
  position: relative;
  margin: var(--sp-3) auto var(--sp-2);
  background: rgba(0, 0, 0, 0.6);
  color: var(--swh-heading);
  padding: var(--sp-2) var(--sp-3);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  width: fit-content;
  min-width: 120px;
  transition: all var(--duration-fast);
}

.lightbox-download:hover {
  background: var(--swh-violet-500);
  border-color: var(--swh-violet-400);
  color: var(--swh-heading);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(132, 104, 240, 0.3);
}

/* ── Lightbox Caption ──────────────────────────────────────────── */
.lightbox-caption {
  color: var(--swh-body);
  font-size: 13px;
  margin-top: var(--sp-2);
  text-align: center;
  padding: 0 var(--sp-4);
  line-height: 1.5;
}

/* ── Lightbox Mobile Optimizations ────────────────────────────── */
@media (max-width: 768px) {
  .lightbox-overlay {
    padding: var(--sp-3);
  }

  .lightbox-prev,
  .lightbox-next {
    padding: var(--sp-2) var(--sp-3);
    font-size: 18px;
  }

  .lightbox-close {
    top: var(--sp-1);
    right: var(--sp-1);
    padding: var(--sp-2);
    font-size: 13px;
  }

  .lightbox-img,
  .lightbox-video {
    max-height: calc(80vh - 120px);
  }
}

/* ── Lightbox Accessibility ────────────────────────────────────── */
.lightbox-overlay[aria-hidden="true"] {
  display: none;
}

.lightbox-prev:focus,
.lightbox-next:focus,
.lightbox-close:focus,
.lightbox-download:focus {
  outline: 2px solid var(--swh-violet-400);
  outline-offset: 2px;
}

.lightbox-overlay.lightbox-has-video .lightbox-prev,
.lightbox-overlay.lightbox-has-video .lightbox-next {
  display: none;
}

/* ══════════════════════════════════════════════════════════════════
   END EXTENDED STYLES v3.10
   ══════════════════════════════════════════════════════════════════ */
