/* ===== IOUHome – Warm Family Theme ===== */

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

/* --- Accessibility --- */
/* Skip-to-content link */
.skip-to-main {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  padding: 12px 24px;
  background: var(--accent, #3C7E76);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top .2s;
}
.skip-to-main:focus {
  top: 0;
  outline: none;
}

/* Focus rings — visible on keyboard, hidden for mouse */
*:focus-visible {
  outline: 2px solid var(--accent, #3C7E76);
  outline-offset: 2px;
}
/* Buttons and links get a slightly rounded outline */
a:focus-visible, button:focus-visible, .btn:focus-visible,
[role="tab"]:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--accent, #3C7E76);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}
/* Ensure form controls have a visible focus ring */
.form-control:focus-visible {
  outline: 2px solid var(--accent, #3C7E76);
  outline-offset: -1px;
  box-shadow: 0 0 0 3px rgba(60,126,118,.15);
}

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ARIA live region for toast announcements */
.aria-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

:root {
  /* Warm palette inspired by the mockup */
  --bg-page: #f4ead5;           /* parchment / warm sand */
  --bg-card: #fffdf7;
  --bg-sidebar: #1b3a4b;        /* deep navy */
  --sidebar-hover: #264e63;
  --sidebar-active: #2d6a8a;
  --accent: #3C7E76;            /* IOU Blue/Teal — brand primary */
  --accent-hover: #2F6660;
  --gold: #d4a017;
  --blue: #3C7E76;
  --green: #27ae60;
  --iou-teal: #3C7E76;          /* brand primary alias */
  --iou-green: #89AA97;         /* brand secondary */
  --iou-orange: #FA5E01;        /* brand highlight */
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --text-sidebar: #cdd8df;
  --border: #ddd4c0;
  --shadow: rgba(0,0,0,.08);
  --radius: 10px;
  --radius-sm: 6px;
  --header-height: 0px;
  --sidebar-width: 240px;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { font-size: clamp(14px, 2.5vw, 16px); }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* --- Layout --- */
.layout { display: flex; min-height: 100vh; width: 100%; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
/* Logo image is now an SVG in the sidebar-brand */
.sidebar-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.sidebar-nav a,
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-sidebar);
  font-size: .9rem;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
  position: relative;
}
.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--iou-orange);
  border-radius: 6px;
}
.sidebar-nav a.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  border: 1px solid var(--iou-orange);
  border-radius: 6px;
}

.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Sub-nav items (indented under a parent) */
.sidebar-nav a.nav-sub-item {
  padding-left: 40px;
  font-size: .82rem;
  padding-top: 7px;
  padding-bottom: 7px;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

/* Locked nav items — greyed out with tooltip */
.sidebar-nav a.nav-locked {
  opacity: .45;
  cursor: default;
}
.sidebar-nav a.nav-locked:hover {
  opacity: .65;
  background: transparent;
}
/* Cross-link to other product */
.sidebar-crosslink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,.7);
  font-size: .82rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  margin: 4px 12px;
  transition: background .15s, color .15s, border-color .15s;
  text-decoration: none;
}
.sidebar-crosslink:hover {
  background: var(--sidebar-hover);
  color: #fff;
  border-color: rgba(255,255,255,.3);
  text-decoration: none;
}
/* Tooltip is rendered inside the <a> but hidden; JS clones it into
   a fixed-position container outside the sidebar to avoid overflow clipping. */
.nav-lock-tooltip { display: none; }
#navLockTip {
  position: fixed;
  width: 220px;
  background: var(--bg-card, #fff);
  color: var(--text, #333);
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .8rem;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  z-index: 9000;
  pointer-events: auto;
  white-space: normal;
  display: none;
}
#navLockTip::before {
  content: '';
  position: absolute;
  right: 100%;
  top: var(--arrow-top, 50%);
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--border, #ddd);
}
#navLockTip::after {
  content: '';
  position: absolute;
  right: 100%;
  top: var(--arrow-top, 50%);
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--bg-card, #fff);
}
.nav-lock-tooltip-plan {
  margin-top: 6px;
  font-size: .75rem;
  color: var(--text-light, #888);
}
.nav-lock-link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  font-size: .75rem;
}
.nav-lock-link:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

/* What's New badges */
.wn-badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;white-space:nowrap}
.wn-feature{background:#e8f8f5;color:#1e8449}
.wn-improvement{background:#e8f0ed;color:#3C7E76}
.wn-fix{background:#fef5e7;color:#b7950b}

.sidebar-section {
  padding: 18px 20px 6px;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.35);
  font-weight: 600;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
}
.sidebar-user img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- Main content area --- */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  min-width: 0;
}

/* Top bar */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-welcome {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.topbar-welcome span { color: var(--blue); }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* --- Profile Menu Dropdown --- */
.profile-menu-wrap { position: relative; }
.topbar-family-img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
}
.topbar-family-img:hover, .topbar-avatar:hover {
  box-shadow: 0 0 0 3px rgba(0,0,0,.1);
  transform: scale(1.05);
}
.topbar-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: box-shadow .2s, transform .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  user-select: none;
}
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.profile-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.profile-dropdown-header img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}
.profile-dropdown-item {
  display: block;
  padding: 10px 16px;
  font-size: .88rem;
  color: var(--text) !important;
  text-decoration: none !important;
  transition: background .15s;
}
.profile-dropdown-item:hover {
  background: rgba(0,0,0,.04);
  text-decoration: none !important;
}

/* --- Theme Picker Swatches --- */
.theme-picker {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.theme-swatch {
  cursor: pointer;
  text-align: center;
  transition: transform .15s;
}
.theme-swatch:hover { transform: translateY(-2px); }
.swatch-preview {
  width: 110px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  border: 3px solid transparent;
  transition: border-color .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.theme-swatch.selected .swatch-preview {
  border-color: var(--accent);
}
.swatch-sidebar {
  width: 28px;
  flex-shrink: 0;
}
.swatch-body {
  flex: 1;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}
.swatch-card {
  height: 12px;
  border-radius: 3px;
}
.swatch-accent {
  height: 8px;
  width: 35px;
  border-radius: 3px;
  margin-top: auto;
}
.swatch-label {
  display: block;
  margin-top: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
}

/* --- Background Preset Buttons --- */
.bg-preset {
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, border-color .15s;
}
.bg-preset:hover {
  transform: scale(1.1);
  border-color: var(--accent);
}

/* Content area */
.content {
  flex: 1;
  padding: 28px 32px 40px;
}

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.page-header .subtitle {
  color: var(--text-light);
  font-size: .9rem;
  margin-top: 2px;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-header-bg, linear-gradient(135deg, #f9f3e6 0%, #fffdf7 100%));
}
.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 20px; }

/* Drag handle for dashboard card reordering */
.drag-handle { cursor: grab; font-size: 1.1rem; color: var(--text-light); padding: 0 4px; opacity: 0.4; transition: opacity .2s, color .2s; }
.drag-handle:hover { opacity: 1; color: var(--accent); }
.sortable-ghost { opacity: 0.4; border: 2px dashed var(--accent); }

/* Dashboard grid */
/* --- Dashboard Hero Background --- */
.dash-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  height: 180px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.dash-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.15));
  display: flex;
  align-items: flex-end;
  padding: 24px 28px;
}
.dash-hero-overlay h2 {
  color: #fff;
  font-size: 1.5rem;
  text-shadow: 0 2px 6px rgba(0,0,0,.3);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}
.dash-grid .card-wide { grid-column: span 1; }
.dash-grid .card-full { grid-column: span 3; }

/* --- Photo grid --- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 4/3;
}
.photo-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.photo-card:hover img { transform: scale(1.05); }
.photo-card .caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  color: #fff;
  padding: 24px 12px 10px;
  font-size: .85rem;
  font-weight: 500;
}

/* --- Tab bar --- */
.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.tab {
  padding: 8px 18px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  text-decoration: none;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

/* --- Pill tabs (modern alternative) --- */
.pill-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pill-tab {
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.pill-tab:hover {
  background: var(--border);
  color: var(--text);
  text-decoration: none;
}
.pill-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
  background: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--border); filter: brightness(.93); }

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--blue);
}
.btn-outline:hover { background: var(--blue); color: #fff; }

.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #219a52; color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #b8890f; color: #fff; }

/* --- Tables --- */
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
th {
  font-weight: 600;
  color: var(--text-light);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
tr:hover { background: rgba(0,0,0,.02); }

/* --- Status badges --- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-draft { background: #ffeaa7; color: #6c5b00; }
.badge-sealed { background: #a3d9a5; color: #1a5c1a; }
.badge-revoked { background: #f5b7b1; color: #922b21; }
.badge-released { background: #e8d5f5; color: #6c3483; }
.badge-active { background: #a3c9f1; color: #1a4a7a; }

/* --- Document list --- */
.doc-category {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  color: var(--text);
}
.doc-category:hover { background: rgba(0,0,0,.02); text-decoration: none; }
.doc-category .icon { font-size: 1.2rem; }
.doc-category .chevron { margin-left: auto; color: var(--text-light); }

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 44px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  font-size: .9rem;
}
.doc-item .doc-date { margin-left: auto; color: var(--text-light); font-size: .8rem; }

/* --- Recipe cards --- */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.recipe-card { cursor: pointer; }
.recipe-card .recipe-img {
  height: 180px;
  overflow: hidden;
}
.recipe-card .recipe-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.recipe-card:hover .recipe-img img { transform: scale(1.05); }
.recipe-card .recipe-info { padding: 14px 16px; }
.recipe-card .recipe-title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.recipe-card .recipe-meta { color: var(--text-light); font-size: .8rem; }

/* --- Recipe detail --- */
.recipe-hero {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 28px;
  margin-bottom: 28px;
}
.recipe-hero-img {
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 360px;
}
.recipe-hero-img img { width: 100%; height: 100%; object-fit: cover; }

.recipe-meta-bar {
  display: flex;
  gap: 24px;
  margin: 16px 0;
  color: var(--text-light);
  font-size: .85rem;
}
.recipe-meta-bar span { display: flex; align-items: center; gap: 6px; }

/* Percentage badge on calculator */
.calc-pct-badge {
  font-size: .8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  transition: background .2s, color .2s;
}
.calc-pct-badge.pct-up {
  background: #e8f5e9;
  color: #2e7d32;
}
.calc-pct-badge.pct-down {
  background: #fce4ec;
  color: #c62828;
}

/* Nutrition Facts Card */
.nutrition-card .card-body { padding-top: 10px; }
.nutrition-serving-note {
  font-size: .82rem;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--text);
}
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.nutrition-item {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.02);
}
.nutrition-item.nutrition-cal {
  grid-column: span 3;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px;
}
.nutrition-item.nutrition-cal .nutrition-value {
  font-size: 1.6rem;
}
.nutrition-item.nutrition-cal .nutrition-label {
  color: rgba(255,255,255,.85);
}
.nutrition-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}
.nutrition-label {
  display: block;
  font-size: .72rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.nutrition-disclaimer {
  font-size: .72rem;
  color: var(--text-light);
  font-style: italic;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.stars { color: var(--gold); }

.ingredient-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.ingredient-section h4 {
  font-size: .9rem;
  font-weight: 700;
  padding: 8px 14px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.ingredient-list { list-style: none; }
.ingredient-list li {
  padding: 6px 0;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ingredient-list li::before {
  content: '☑';
  color: var(--green);
}

.direction-step {
  margin-bottom: 18px;
}
.direction-step .step-num {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  font-size: .95rem;
}
.direction-step p { font-size: .9rem; line-height: 1.6; }

/* Comments */
.comment {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-author { font-weight: 600; font-size: .85rem; }
.comment-date { color: var(--text-light); font-size: .75rem; margin-left: 8px; }
.comment-text { font-size: .85rem; margin-top: 4px; line-height: 1.5; }

/* --- Calendar --- */
.calendar-events { list-style: none; }
.calendar-event {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.event-color {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}
.event-date {
  font-weight: 700;
  color: var(--accent);
  font-size: .85rem;
  min-width: 80px;
}
.event-title { font-size: .9rem; flex: 1; }

/* --- People cards --- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.person-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  position: relative;
}
.person-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
}
.person-card-top > img {
  width: 60px; height: 60px;
  min-width: 60px; min-height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  overflow: hidden;
  font-size: .6rem;
  color: var(--text-light);
  background: var(--bg-page);
  overflow: hidden;
  font-size: 0;
}
.person-info {
  text-align: left;
}
.person-name { font-weight: 700; font-size: .95rem; }
.person-role { color: var(--text-light); font-size: .8rem; margin-top: 2px; }
.person-email { color: var(--blue); font-size: .8rem; margin-top: 4px; }

.person-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .2s;
}
.person-card:hover .person-actions {
  opacity: 1;
}
.person-action-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.person-action-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.person-action-delete:hover {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #fff;
}

/* --- Notes --- */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.note-item {
  padding: 6px 0;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.note-item::before {
  content: '•';
  color: var(--text-light);
}

.note-remove-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
}

.note-item:hover .note-remove-btn {
  opacity: 1;
}

.note-remove-btn:hover {
  color: #e74c3c;
  background: rgba(231,76,60,.1);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-light);
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: var(--font);
  background: #fff;
  transition: border-color .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(41,128,185,.12);
}
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; }

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-light);
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --- Flash messages --- */
.flash {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Featured badge --- */
.featured-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--accent);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .7rem;
  font-weight: 700;
}

/* --- Stat counters --- */
.stat-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--bg-page);
  color: var(--text);
  border: 1px solid var(--border);
}

/* --- Quick-access items --- */
.quick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.05);
  font-size: .9rem;
  color: var(--text);
  cursor: pointer;
}
.quick-item:hover { color: var(--blue); }
.quick-item .chevron { margin-left: auto; }

/* --- Audit log --- */
.audit-table-wrap { overflow-x: auto; }
.audit-row {
  display: grid;
  grid-template-columns: 180px 140px 1fr 160px 100px;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  align-items: center;
  min-width: 700px;
}
.audit-row:first-child { font-weight: 600; color: var(--text-light); text-transform: uppercase; font-size: .75rem; letter-spacing: .5px; }
.audit-time { color: var(--text-light); font-size: .8rem; }
.audit-row.audit-critical { background: rgba(231, 76, 60, .06); border-left: 3px solid #e74c3c; }
.audit-row.audit-high { background: rgba(243, 156, 18, .06); border-left: 3px solid #f39c12; }

/* --- Trust page --- */
.trust-card {
  padding: 20px;
  margin-bottom: 16px;
}
.trust-card h4 { margin-bottom: 8px; }
.trust-card p { color: var(--text-light); font-size: .9rem; line-height: 1.5; }
.trust-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.trust-toggle:last-child { border-bottom: none; }

/* Toggle switch */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: .2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
input:checked + .slider { background: var(--green); }
input:checked + .slider::before { transform: translateX(20px); }

/* --- Family Tree (C2) --- */
.tree-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--radius, 10px);
  border: 2px solid var(--border);
  background: var(--bg-card);
  min-width: 110px;
  transition: transform .15s, box-shadow .15s;
}
.tree-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}
.tree-node-primary {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.tree-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid var(--border);
  overflow: hidden;
  font-size: .6rem;
  color: var(--text-light);
  background: var(--bg-page);
}
.tree-avatar-lg {
  width: 68px;
  height: 68px;
  border-width: 3px;
}
.tree-name {
  font-weight: 700;
  font-size: .82rem;
  text-align: center;
}
.tree-role {
  font-size: .7rem;
  font-weight: 600;
  margin-top: 2px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .card-full { grid-column: span 1; }
  .recipe-hero { grid-template-columns: 1fr; }
  .ingredient-columns { grid-template-columns: 1fr; }
  /* audit-row scrolls inside .audit-table-wrap — keep grid intact */

  /* Collapse any inline 2-col or fixed-sidebar grids */
  [style*="grid-template-columns:300px 1fr"],
  [style*="grid-template-columns: 300px 1fr"],
  [style*="grid-template-columns:1fr 360px"],
  [style*="grid-template-columns: 1fr 360px"],
  [style*="grid-template-columns:1fr minmax(0,360px)"],
  [style*="grid-template-columns: 1fr minmax(0,360px)"],
  [style*="grid-template-columns:1fr 350px"],
  [style*="grid-template-columns: 1fr 350px"] {
    grid-template-columns: 1fr !important;
  }

  /* Dashboard span-2 cards collapse */
  [style*="grid-column: span 2"],
  [style*="grid-column:span 2"] {
    grid-column: span 1 !important;
  }

  /* Media AI 6-col stats → 3-col */
  [style*="grid-template-columns:repeat(6,1fr)"],
  [style*="grid-template-columns: repeat(6,1fr)"],
  [style*="grid-template-columns:repeat(6, 1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Inline 2-col grids (documents, forms, etc) */
  [style*="grid-template-columns:1fr 1fr;"],
  [style*="grid-template-columns: 1fr 1fr;"],
  [style*="grid-template-columns:1fr 1fr 1fr;"],
  [style*="grid-template-columns: 1fr 1fr 1fr;"] {
    grid-template-columns: 1fr !important;
  }

  /* Family tree min-width override */
  [style*="min-width:600px"],
  [style*="min-width: 600px"] {
    min-width: 0 !important;
  }
}

/* Mobile menu button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.mobile-menu-btn:hover { background: var(--border); }

/* Sidebar backdrop — hidden on desktop */
.sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex !important; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-x: hidden;
    padding-left: env(safe-area-inset-left, 0px);
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .sidebar-nav a {
    white-space: normal;
    overflow: visible;
    font-size: .85rem;
    padding: 10px 16px;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: 999;
  }
  .sidebar.sidebar-open ~ .sidebar-backdrop {
    display: block;
  }

  .main { margin-left: 0; }
  .content { padding: 16px 12px; }

  .topbar { gap: 8px; padding: 10px 12px; }
  .topbar-welcome { font-size: .82rem; }
  .topbar-welcome span { display: inline; }
  .topbar-right { gap: 6px; }
  .topbar-right .btn-sm { font-size: .72rem; padding: 4px 8px; }
  .topbar-family-img, .topbar-avatar { width: 30px; height: 30px; font-size: 13px; }

  .dash-grid .card[style*="grid-column: span 2"] { grid-column: span 1 !important; }
  .billing-grid { grid-template-columns: 1fr; padding-top: 16px; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .page-header h2 { font-size: 1.2rem; }
  .page-header .subtitle { font-size: .82rem; }

  /* Cards */
  .card { border-radius: var(--radius-sm, 6px); }
  .card-header { padding: 12px 14px; }
  .card-body { padding: 14px; }

  /* Mobile collapsible cards */
  .card-header.collapsible { cursor: pointer; -webkit-user-select: none; user-select: none; }
  .card-header.collapsible::after {
    content: '▾';
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-light);
    transition: transform 0.2s ease;
    margin-left: auto;
    padding-left: 8px;
    flex-shrink: 0;
  }
  .card.collapsed > .card-header.collapsible::after { transform: rotate(-90deg); }
  .card.collapsed > *:not(.card-header) { display: none; }

  /* Tables on mobile */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: .8rem; }
  th, td { padding: 8px 10px; }

  /* Modals */
  .modal { width: 95vw !important; max-width: 95vw !important; margin: 10px; }
  .modal-body { padding: 16px !important; max-height: 65vh; overflow-y: auto; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }

  /* Compact splash/alpha modal */
  #alphaModal { padding: 10px 0 !important; }
  #alphaModal > div {
    padding: 16px 16px 14px !important;
    border-radius: 10px !important;
    width: 95% !important;
  }
  #alphaModal h2 { font-size: 17px !important; }
  #alphaModal p { font-size: 11.5px !important; line-height: 1.5 !important; }
  #alphaModal ul { font-size: 11.5px !important; line-height: 1.5 !important; padding-left: 16px !important; }
  #alphaModal li { margin-bottom: 1px; }
  #alphaModal img { width: 32px !important; height: 32px !important; max-height: 36px !important; margin-bottom: 0 !important; }
  #alphaModal > div > div:first-child { margin-bottom: 8px !important; }
  #alphaModal > div > div[style*="background:#f8f9fb"],
  #alphaModal > div > div[style*="background:#fef9e7"],
  #alphaModal > div > div[style*="background:#f0f6fb"] {
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    border-radius: 8px !important;
  }
  #alphaModal > div > div[style*="background:#f8f9fb"] p:first-child,
  #alphaModal > div > div[style*="background:#f0f6fb"] p:first-child {
    margin-bottom: 4px !important; font-size: 12.5px !important;
  }
  #alphaModal button { padding: 10px !important; font-size: 14px !important; border-radius: 8px !important; }
  .modal-footer .btn { flex: 1; min-width: 0; }

  /* People grid */
  .people-grid { grid-template-columns: 1fr !important; }

  /* Person cards */
  .person-card { margin-bottom: 0; }
  .person-card-top { padding: 16px; }
  .person-card-top > img { width: 56px; height: 56px; min-width: 56px; min-height: 56px; }

  /* Photo grid */
  .photo-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .mini-photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }

  /* Forms */
  .form-control { font-size: .88rem; padding: 8px 10px; }
  select.form-control { font-size: .88rem; }

  /* Buttons */
  .btn { padding: 8px 14px; font-size: .82rem; }
  .btn-sm { padding: 4px 10px; font-size: .75rem; }

  /* Stats */
  .stat-row { flex-wrap: wrap; gap: 6px; }
  .stat { font-size: .75rem; padding: 3px 8px; }

  /* Family tree on mobile: stack vertically */
  .tree-node { padding: 12px 14px; min-width: 90px; }
  .tree-avatar { width: 44px; height: 44px; }
  .tree-avatar-lg { width: 56px; height: 56px; }
  .tree-name { font-size: .78rem; }

  /* Memorial page */
  [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }

  /* Profile dropdown */
  .profile-dropdown { right: -8px; min-width: 200px; }

  /* Lightbox */
  .lightbox-img { max-width: 95vw; max-height: 70vh; }
  .lightbox-nav { width: 36px; height: 36px; font-size: 1.3rem; }
  .lightbox-zoom-btn { width: 34px; height: 28px; font-size: .8rem; }
  .lightbox-zoom-reset { font-size: .7rem; }

  /* Flash messages */
  .flash { font-size: .82rem; padding: 10px 14px; margin-bottom: 12px; }

  /* Photo action buttons always visible on touch */
  .photo-card .photo-actions { opacity: 1; }

  /* Person action buttons always visible on touch */
  .person-actions { opacity: 1 !important; }

  /* Tabs: horizontal scroll instead of wrap */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tab { white-space: nowrap; flex-shrink: 0; padding: 8px 14px; }

  /* Audit rows readable on mobile */
  .audit-row { gap: 6px; padding: 10px 12px; font-size: .8rem; }

  /* Calendar events: stack on mobile */
  .calendar-event { flex-wrap: wrap; gap: 8px; }
  .event-date { min-width: auto; }

  /* Media AI insight cards smaller min */
  [style*="minmax(280px"],
  [style*="minmax(260px"] {
    grid-template-columns: 1fr !important;
  }

  /* Checklist items wrap nicely */
  .checklist-step { flex-wrap: wrap; }

  /* Tables: horizontal scroll wrapper */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  thead, tbody, tr { display: table; width: 100%; table-layout: auto; }

  /* Save You wizard padding */
  .sy-main { padding-left: 12px !important; padding-right: 12px !important; }
  .sy-cat-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important; }
  .sy-items-grid { grid-template-columns: 1fr !important; }
}

/* Extra small screens */
@media (max-width: 480px) {
  .content { padding: 12px 8px; }
  .page-header h2 { font-size: 1.05rem; }
  .topbar-welcome { display: none; }
  .card-header h3 { font-size: .92rem; }
  .btn { padding: 7px 12px; font-size: .78rem; }
  .modal { margin: 4px; }
  .billing-tier { margin-bottom: 12px; }
  .tree-node { min-width: 80px; padding: 10px 12px; }
  .mini-photo-grid { grid-template-columns: 1fr 1fr; }

  /* Media AI 3-col stats → 2-col */
  [style*="grid-template-columns:repeat(6,1fr)"],
  [style*="grid-template-columns: repeat(6,1fr)"],
  [style*="grid-template-columns:repeat(6, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* All auto-fill grids collapse to single column */
  [style*="minmax(220px"],
  [style*="minmax(240px"],
  [style*="minmax(200px"] {
    grid-template-columns: 1fr !important;
  }

  /* Photo grid: single column on very small screens */
  .photo-grid { grid-template-columns: 1fr !important; }

  /* Recipe grid single column */
  .recipe-grid { grid-template-columns: 1fr !important; }

  /* Notes grid single column */
  .notes-grid { grid-template-columns: 1fr !important; }

  /* Page header buttons stack */
  .page-header > div:last-child { width: 100%; }
  .page-header > div:last-child .btn { width: 100%; justify-content: center; }

  /* Card body tighter */
  .card-body { padding: 12px; }

  /* Dashboard hero smaller */
  .dash-hero { height: 120px; }

  /* Nutrition grid 2 cols */
  .nutrition-grid { grid-template-columns: repeat(2, 1fr); }
  .nutrition-item.nutrition-cal { grid-column: span 2; }
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: .95rem; }

/* Dash card mini photo grid */
.mini-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mini-photo {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.mini-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.mini-photo-label {
  font-size: .75rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 4px;
}

/* Dash recipe mini cards */
.mini-recipe-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
}
.mini-recipe {
  text-align: center;
  flex-shrink: 0;
}
.mini-recipe img {
  width: 80px; height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.mini-recipe span {
  display: block;
  font-size: .7rem;
  margin-top: 4px;
  font-weight: 500;
}

/* Featured recipe on dashboard */
.featured-recipe-dash {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.featured-recipe-dash img { width: 100%; height: 160px; object-fit: cover; }
.featured-recipe-dash .overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff;
  padding: 28px 14px 12px;
}
.featured-recipe-dash .overlay h4 { font-size: .9rem; }

/* --- Recipe Import Modal --- */
.import-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.import-tab {
  padding: 10px 18px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: .2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.import-tab:hover { color: var(--text); }
.import-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.import-tab-content {
  /* Visibility controlled by JS inline styles */
}

.import-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  background: var(--bg-page);
}
.import-dropzone:hover,
.import-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(0,0,0,.02);
}
.import-dropzone .dropzone-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  display: block;
}
.import-dropzone p {
  font-size: .85rem;
  color: var(--text-light);
  margin-bottom: 4px;
}
.import-dropzone .dropzone-hint {
  font-size: .75rem;
  color: var(--text-light);
  opacity: .7;
}

/* OCR / import progress bar */
.import-progress {
  margin-top: 16px;
  display: none;
}
.import-progress.active {
  display: block;
}
.import-progress-label {
  font-size: .8rem;
  color: var(--text-light);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.import-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.import-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  width: 0%;
  transition: width .3s ease;
}

/* Parsed result preview */
.parsed-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--bg-page);
  margin-top: 16px;
}
.parsed-preview h4 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--accent);
}
.parsed-field {
  margin-bottom: 10px;
}
.parsed-field label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-bottom: 4px;
}
.parsed-field .parsed-value {
  font-size: .85rem;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 28px;
}
.parsed-field textarea.parsed-value {
  width: 100%;
  resize: vertical;
  font-family: inherit;
  min-height: 60px;
}
.parsed-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.parsed-meta .parsed-field {
  flex: 1;
  min-width: 100px;
}
.parsed-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: flex-end;
}

/* --- Billing page --- */
.billing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
  padding-top: 16px;
}
.billing-tier {
  position: relative;
  overflow: visible !important;
}
.billing-current {
  box-shadow: 0 0 0 3px var(--green), 0 4px 16px rgba(0,0,0,.1);
}
.billing-best-value {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 4px 16px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  z-index: 10;
  line-height: 1.4;
}
/* Ensure the card with the badge has room above it */
.billing-tier:has(.billing-best-value) {
  margin-top: 8px;
}
/* Billing feature tooltips */
.billing-info-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: .8rem;
  color: var(--accent);
  opacity: .6;
  cursor: pointer;
  vertical-align: middle;
}
.billing-feature-row:hover .billing-info-icon {
  opacity: 1;
}
.billing-tooltip {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  pointer-events: none;
}
.billing-feature-row:hover .billing-tooltip {
  display: block;
}
/* On touch / mobile, use tap-to-show via JS instead of hover */
@media (hover: none) {
  .billing-feature-row:hover .billing-tooltip {
    display: none;
  }
  .billing-feature-row.tip-open .billing-tooltip {
    display: block;
  }
}
/* Storage add-on cards (iCloud-style) */
.storage-addon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.storage-addon-card {
  position: relative;
  text-align: center;
  padding: 20px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-page);
  transition: border-color .15s, box-shadow .15s;
}
.storage-addon-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.storage-addon-popular {
  border-color: var(--accent);
}
.storage-addon-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 2px 12px;
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}
.storage-addon-amount {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.storage-addon-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}
.storage-addon-detail {
  font-size: .78rem;
  color: var(--text-light);
  margin-bottom: 6px;
}
@media (max-width: 900px) {
  .billing-grid { grid-template-columns: 1fr; padding-top: 16px; }
  .storage-addon-grid { grid-template-columns: 1fr; }
}

/* --- Photo Lightbox --- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 600;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox-overlay.open { display: flex; }

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 610;
  line-height: 1;
  opacity: .7;
  transition: opacity .2s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 92vw;
  max-height: 82vh;
  position: relative;
}

.lightbox-img {
  max-width: 85vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  transition: opacity .25s, transform .15s ease;
  transform-origin: center center;
}

.lightbox-zoom-controls {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 610;
}
.lightbox-zoom-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: .9rem;
  width: 38px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  backdrop-filter: blur(4px);
}
.lightbox-zoom-btn:hover { background: rgba(255,255,255,.3); }
.lightbox-zoom-reset {
  width: auto;
  padding: 0 10px;
  font-size: .75rem;
  font-weight: 600;
}

.lightbox-nav {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.25); }

.lightbox-caption {
  color: #fff;
  font-size: .95rem;
  font-weight: 500;
  margin-top: 14px;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.lightbox-counter {
  color: rgba(255,255,255,.5);
  font-size: .8rem;
  margin-top: 4px;
  text-align: center;
}

.mini-photo { cursor: pointer; }

/* --- Mobile Bottom Navigation --- */
.bottom-nav { display: none; }

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 100;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 6px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
  }
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none !important;
    color: var(--text-light);
    font-size: .62rem;
    font-weight: 500;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    padding: 4px 0;
    font-family: var(--font);
  }
  .bottom-nav-icon {
    font-size: 1.2rem;
    line-height: 1;
  }
  .bottom-nav-item.active {
    color: var(--accent);
    font-weight: 700;
  }
  .bottom-nav-item:hover { text-decoration: none !important; }

  /* Pad content above bottom nav */
  .content { padding-bottom: 72px !important; }

  /* Move AI toggle button above bottom nav */
  #globalAiToggleWrap { bottom: 72px !important; }

  /* AI chat panel full-screen on mobile */
  #globalAiPanel { width: 100vw !important; }

  /* Prevent iOS zoom on input focus (16px minimum) */
  .form-control,
  input[type="text"], input[type="email"], input[type="url"],
  input[type="number"], input[type="tel"], input[type="date"],
  select, textarea {
    font-size: 16px !important;
  }
}

/* --- Standalone PWA: pad topbar below status bar --- */
@media all and (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top, 0px); }
}

/* ── Media Manager ── */
.media-filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 12px 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-page); z-index: 10;
}
.media-search-wrap {
  position: relative; flex: 1; min-width: 180px; max-width: 360px;
}
.media-search-wrap::before {
  content: "\1F50D"; position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); font-size: .75rem; opacity: .5;
}
.media-search-input {
  width: 100%; padding: 8px 12px 8px 32px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .85rem; background: var(--bg-card); color: var(--text);
}
.media-pill-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.media-pill {
  padding: 5px 12px; border-radius: 20px; font-size: .75rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.media-pill:hover { border-color: var(--accent); }
.media-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.media-sort-select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .78rem; background: var(--bg-card); color: var(--text); cursor: pointer;
}
.media-results-count {
  font-size: .78rem; color: var(--text-light); margin-bottom: 12px;
}
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.media-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-card);
  transition: transform .15s, box-shadow .15s; cursor: pointer;
}
.media-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.media-card-thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
  background: var(--border);
}
.media-card-icon {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center;
  justify-content: center; font-size: 2.5rem; background: var(--bg-page);
  position: relative; flex-direction: column; gap: 4px;
}
.media-play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 2rem; color: #fff; background: rgba(0,0,0,.5); width: 44px; height: 44px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.media-card-info { padding: 8px 10px; }
.media-card-name {
  font-size: .78rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-card-meta {
  font-size: .68rem; color: var(--text-light); margin-top: 2px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.media-source-badge {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: .58rem; font-weight: 700; text-transform: uppercase;
}
.media-source-badge.photos { background: #e8f5e9; color: #2e7d32; }
.media-source-badge.documents { background: #e3f2fd; color: #1565c0; }
.media-source-badge.capsules { background: #f3e5f5; color: #7b1fa2; }
/* Duplicate comparison */
.dup-group { margin-bottom: 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
.dup-group-title { font-size: .82rem; font-weight: 700; margin-bottom: 10px; }
.dup-items { display: flex; gap: 14px; flex-wrap: wrap; }
.dup-item { text-align: center; position: relative; flex: 0 0 auto; }
.dup-item img { width: 150px; height: 112px; object-fit: cover; border-radius: 6px; border: 2px solid var(--border); }
.dup-item.keep img { border-color: var(--green, #3C7E76); }
.dup-item.remove img { border-color: #e74c3c; opacity: .7; }
.dup-item.similar img { border-color: #e67e22; opacity: .85; }
.dup-label {
  position: absolute; top: -6px; left: -6px; padding: 2px 8px; border-radius: 8px;
  font-size: .58rem; font-weight: 700; color: #fff;
}
.dup-item.keep .dup-label { background: var(--green, #3C7E76); }
.dup-item.remove .dup-label { background: #e74c3c; }
.dup-item.similar .dup-label { background: #e67e22; }
.dup-item-name { font-size: .7rem; margin-top: 4px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-item-meta { font-size: .62rem; color: var(--text-light); }
.dup-item-actions { margin-top: 4px; }
.dup-item-actions .btn { font-size: .68rem; padding: 3px 10px; }
@media (max-width: 768px) {
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .media-filter-bar { flex-direction: column; align-items: stretch; }
  .media-search-wrap { max-width: 100%; }
  .dup-items { flex-direction: column; }
  .dup-item img { width: 120px; height: 90px; }
}
@media (max-width: 480px) {
  .media-grid { grid-template-columns: 1fr; }
}

/* --- IOULegacy skin --- */
.ll-brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #3C7E76, #5a9e96);
  border-radius: 8px;
}

/* --- Explainer video component --- */
.explainer-video[open] .chevron { transform: rotate(90deg); }
.explainer-video summary::-webkit-details-marker { display: none; }
.explainer-video summary::marker { content: ""; }
.explainer-video summary:hover { opacity: .8; }

/* ===================================================================
   TASK 2: Custom Confirm Dialog (replaces native confirm())
   =================================================================== */
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 9500;
  align-items: center;
  justify-content: center;
}
.confirm-overlay.open { display: flex; }
.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 16px 48px rgba(0,0,0,.25);
  animation: confirmSlideIn .2s ease;
}
@keyframes confirmSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.confirm-dialog-body {
  padding: 28px 24px 20px;
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-line;
}
.confirm-dialog-footer {
  padding: 12px 24px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===================================================================
   TASK 3: Onboarding Tour
   =================================================================== */
.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 8000;
}
.tour-tooltip {
  position: fixed;
  z-index: 8010;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  width: 320px;
  max-width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  animation: tourFadeIn .25s ease;
}
@keyframes tourFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tour-tooltip-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
}
.tour-tooltip-body {
  font-size: .85rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 16px;
}
.tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tour-dots {
  display: flex;
  gap: 6px;
}
.tour-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.tour-dot.active {
  background: var(--accent);
}
.tour-tooltip-actions {
  display: flex;
  gap: 8px;
}

/* ===================================================================
   TASK 4: Enhanced Empty States
   =================================================================== */
.empty-state-enhanced {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-enhanced .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
  opacity: .6;
}
.empty-state-enhanced .empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state-enhanced .empty-desc {
  font-size: .88rem;
  color: var(--text-light);
  max-width: 360px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

/* ===================================================================
   TASK 5: Form Validation
   =================================================================== */
.form-error {
  font-size: .78rem;
  color: #dc3545;
  margin-top: 4px;
  display: none;
  align-items: center;
  gap: 4px;
}
.form-error.visible { display: flex; }
.form-control.invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220,53,69,.12);
}
.form-control.valid {
  border-color: var(--green, #27ae60);
}

/* ===================================================================
   TASK 7: Contextual Upgrade Modal
   =================================================================== */
.upgrade-modal-body {
  text-align: center;
  padding: 32px 28px;
}
.upgrade-modal-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}
.upgrade-modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.upgrade-modal-desc {
  font-size: .88rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 20px;
}
.upgrade-modal-features {
  text-align: left;
  margin: 0 auto 24px;
  max-width: 280px;
  list-style: none;
}
.upgrade-modal-features li {
  padding: 6px 0;
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.upgrade-modal-features li::before {
  content: '\2713';
  color: var(--green, #27ae60);
  font-weight: 700;
}

/* ===================================================================
   TASK 8: Dark Mode
   =================================================================== */
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg-page: #1a1a2e;
    --bg-card: #222240;
    --bg-sidebar: #0f0f1e;
    --sidebar-hover: #2a2a48;
    --sidebar-active: #3a3a5c;
    --accent: #5ca89f;
    --accent-hover: #4a968d;
    --border: #333355;
    --text: #e0e0e8;
    --text-light: #9090a8;
    --text-sidebar: #c0c0d0;
    --shadow: rgba(0,0,0,.3);
    --card-header-bg: linear-gradient(135deg, #1e1e38 0%, #282848 100%);
  }
}
/* Explicit dark mode class (toggled by user) */
:root[data-theme="dark"] {
  --bg-page: #1a1a2e;
  --bg-card: #222240;
  --bg-sidebar: #0f0f1e;
  --sidebar-hover: #2a2a48;
  --sidebar-active: #3a3a5c;
  --accent: #5ca89f;
  --accent-hover: #4a968d;
  --border: #333355;
  --text: #e0e0e8;
  --text-light: #9090a8;
  --text-sidebar: #c0c0d0;
  --shadow: rgba(0,0,0,.3);
  --card-header-bg: linear-gradient(135deg, #1e1e38 0%, #282848 100%);
}
:root[data-theme="dark"] body { color-scheme: dark; }
:root[data-theme="dark"] .form-control { background: #2a2a48; color: var(--text); }
:root[data-theme="dark"] .flash-success { background: #1a3a28; color: #7ae0a0; border-color: #2a5a38; }
:root[data-theme="dark"] .flash-error { background: #3a1a20; color: #f0a0a8; border-color: #5a2a30; }
:root[data-theme="dark"] a { color: var(--accent); }
:root[data-theme="dark"] .btn-outline { color: var(--accent); border-color: var(--accent); }
:root[data-theme="dark"] .btn-outline:hover { background: var(--accent); color: #fff; }
:root[data-theme="dark"] .badge-draft { background: #44420a; color: #f0e070; }
:root[data-theme="dark"] .badge-sealed { background: #1a4a1a; color: #80d080; }
:root[data-theme="dark"] .confirm-dialog { background: var(--bg-card); }
:root[data-theme="dark"] .tour-tooltip { background: var(--bg-card); }

/* ===================================================================
   TASK 9: CSS Utility Classes
   =================================================================== */
/* Spacing */
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.px-24 { padding-left: 24px; padding-right: 24px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* Display */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }
.d-block { display: block; }
.d-inline-flex { display: inline-flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Typography */
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fs-xs { font-size: .72rem; }
.fs-sm { font-size: .82rem; }
.fs-base { font-size: .9rem; }
.fs-lg { font-size: 1.05rem; }
.fs-xl { font-size: 1.3rem; }
.text-muted { color: var(--text-light); }
.text-accent { color: var(--accent); }
.text-danger { color: #dc3545; }

/* Borders & Radius */
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-full { border-radius: 50%; }
.border { border: 1px solid var(--border); }
.border-accent { border-color: var(--accent); }

/* Width */
.w-100 { width: 100%; }
.max-w-500 { max-width: 500px; }

/* ===== Feature Video Carousel ===== */
.feature-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius, 10px);
}
.feature-carousel .carousel-track {
  display: flex;
  transition: transform .45s ease;
}
.feature-carousel .carousel-slide {
  min-width: 100%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.feature-carousel .carousel-slide .slide-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 32px;
}
.feature-carousel .slide-visual {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-carousel .slide-visual .slide-icon {
  font-size: 4rem;
  line-height: 1;
}
.feature-carousel .slide-visual video,
.feature-carousel .slide-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feature-carousel .slide-content {
  flex: 1;
  min-width: 0;
}
.feature-carousel .slide-content h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text);
}
.feature-carousel .slide-content p {
  font-size: .88rem;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0 0 16px;
}
.feature-carousel .carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background .2s, transform .15s;
}
.feature-carousel .carousel-arrow:hover {
  background: var(--accent);
  color: #fff;
}
.feature-carousel .carousel-arrow.prev { left: 8px; }
.feature-carousel .carousel-arrow.next { right: 8px; }
.feature-carousel .carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 0 16px;
}
.feature-carousel .carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}
.feature-carousel .carousel-dots .dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

@media (max-width: 768px) {
  .feature-carousel .carousel-slide .slide-inner {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 16px;
  }
  .feature-carousel .slide-visual {
    width: 120px;
    height: 120px;
  }
  .feature-carousel .slide-visual .slide-icon {
    font-size: 3rem;
  }
  .feature-carousel .carousel-arrow {
    width: 30px;
    height: 30px;
    font-size: .85rem;
  }
}
