/* --- FCC Page Isolation Fix --- */

.page {
  display: none;
}

.page.active {
  display: block;
}
:root {
    --fcc-header-height: 72px;
    /* ── Core brand tokens ── */
    --blue:        #2F72E8;
    --blue-dark:   #1d55c4;
    --blue-deeper: #163fa0;
    --blue-light:  #5a95f5;
    --blue-pale:   #e8f0fd;
    --blue-mid:    #ccdaf7;
    --yellow:      #F9C523;
    --yellow-dark: #e0a800;
    --yellow-pale: #fff8e1;
    /* ── Semantic skin vars (overridden by skin.js at runtime) ── */
    --bg: #f6f8ff;
    --bg-soft: #eef2ff;
    --card: #ffffff;
    --card-2: #e8f0fd;
    --primary: #2F72E8;
    --accent: #F9C523;
    --accent-2: rgba(47,114,232,0.12);
    --text: #0d1f4a;
    --muted: #7a95c8;
    --success: #22c55e;
    --warning: #F9C523;
    --danger: #e03c3c;
    --border: #ccdaf7;
    --shadow: 0 2px 8px rgba(13,31,74,0.06), 0 8px 32px rgba(13,31,74,0.08);
    --radius: 20px;
    --settings-selected-bg: rgba(47,114,232,0.12);
    --settings-selected-border: var(--primary);
    --settings-selected-text: var(--text);
    --header-bg: rgba(255,255,255,0.88);
    --header-border: rgba(0,0,0,0.08);
    --header-text: #0d1f4a;
    --header-control-bg: rgba(255,255,255,0.9);
    --header-control-text: #0d1f4a;
    --header-control-border: rgba(0,0,0,0.12);
    --app-bg: var(--bg);
    --surface-bg: var(--bg-soft);
    --card-bg: var(--card);
    --text-color: var(--text);
    --border-color: var(--border);
    --button-bg: var(--primary);
    --button-text: #ffffff;
    --button-border: var(--blue-mid);
    /* Sidebar theming */
    --sidebar-bg: #0d1f4a;
    --sidebar-nav-text: #EAF4FF;
    --sidebar-nav-hover: rgba(125, 183, 255, 0.25);
    --sidebar-nav-active: rgba(125, 183, 255, 0.35);
    /* Derived/muted */
    --muted-text: var(--muted);
  }

  body.theme-dark,
  [data-theme="dark"] {
    --bg: #1a1516;
    --bg-soft: #251e1f;
    --card: #2d2526;
    --card-2: #352c2d;
    --primary: #c99ca3;
    --accent: #b5838d;
    --accent-2: #4a3d3f;
    --text: #f5e6e4;
    --muted: #a08d8a;
    --success: #6b9b7a;
    --warning: #d4a84b;
    --danger: #c96a6a;
    --border: #3d3234;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
  
  * { box-sizing: border-box; }
  
  html, body {
    margin: 0;
    padding: 0;
    font-family: 'Nunito', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
  }
  
  body {
    min-height: 100vh;
  }

  /* ---- App splash screen ---- */
  .app-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(165deg, var(--bg-soft) 0%, var(--bg) 50%, var(--accent-2) 100%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
    pointer-events: none;
  }
  .app-splash.splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
  }
  .app-splash-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    max-width: 100%;
  }
  .splash-logo {
    width: 1152px;
    height: 1152px;
    max-width: 90vw;
    max-height: 50vh;
    object-fit: contain;
    animation: splash-logo-in 0.6s ease forwards;
    display: block;
    margin-left: auto;
    margin-right: auto;
  }
  .splash-title {
    margin-top: 16px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    animation: splash-text-in 0.7s ease 0.15s forwards;
    opacity: 0;
    transform: translateY(10px);
    width: 100%;
  }
  .splash-status {
    margin-top: 12px;
    font-size: 0.95rem;
    color: var(--text);
  }
  .splash-countdown {
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
  }
  .splash-error {
    display: none;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    max-width: 340px;
    box-shadow: var(--shadow);
  }
  .app-splash.splash-error-visible .splash-error {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .splash-loading {
    margin-top: 12px;
  }
  .splash-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: splash-spin 0.8s linear infinite;
  }
  @keyframes splash-spin {
    to { transform: rotate(360deg); }
  }
  .app-splash.splash-error-visible .splash-loading {
    display: none;
  }
  .app-splash.splash-error-visible .splash-status,
  .app-splash.splash-error-visible .splash-countdown {
    display: none;
  }
  .app-splash.splash-error-visible {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .splash-error-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
  }
  .splash-error-code {
    margin: 0 0 6px;
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--muted);
  }
  .splash-error-message {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.4;
  }
  .splash-error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }
  .splash-error-actions .btn-primary,
  .splash-error-actions .btn-secondary {
    min-width: 120px;
  }
  @media (max-width: 380px) {
    .splash-error-actions {
      flex-direction: column;
    }
    .splash-error-actions .btn-primary,
    .splash-error-actions .btn-secondary {
      width: 100%;
      min-width: 0;
    }
  }
  .splash-debug-log {
    margin-top: 12px;
    padding: 10px 12px;
    max-height: 180px;
    overflow-y: auto;
    background: rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--mono-font, ui-monospace, monospace);
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text);
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .splash-debug-log:empty {
    display: none !important;
  }
  .splash-closed-state {
    margin-top: 20px;
    padding: 16px 20px;
    text-align: center;
  }
  .splash-closed-state .splash-error-title {
    margin: 0 0 8px;
  }
  .splash-closed-state .splash-error-message {
    margin: 0;
  }
  .offline-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9990;
    padding: 10px 16px;
    background: var(--warning);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.08);
  }
  .offline-banner[aria-hidden="false"],
  .offline-banner.offline-banner-visible {
    display: block !important;
  }
  @media (max-width: 767px) {
    body.logged-in .offline-banner {
      top: 52px;
    }
  }
  @keyframes splash-logo-in {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
  }
  @keyframes splash-text-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @media (prefers-reduced-motion: reduce) {
    .splash-logo,
    .splash-title,
    .splash-sub {
      animation: none;
      opacity: 1;
      transform: none;
    }
  }
  
  header {
    background: var(--bg-soft);
    padding: 28px 16px 18px;
    text-align: center;
    border-bottom: 1px solid #f2d7d2;
    box-shadow: 0 2px 10px rgba(181,131,141,0.05);
  }
  
  header h1 {
    margin: 0;
    color: var(--primary);
    font-size: 2.2rem;
    letter-spacing: 0.03em;
  }
  
  header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 1rem;
  }

  .header-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
  }
  .header-logo-wide {
    max-width: 420px;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    vertical-align: bottom;
  }
  .header-brand .header-subtitle {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
    padding: 0;
    line-height: 1.2;
  }
  @media (max-width: 1024px) {
    .header-logo-wide {
      max-width: 320px;
    }
  }
  
  /* ---- Sidebar (replaces horizontal nav) ---- */
  .sidebar-nav {
    --sidebar-width: 260px;
    position: fixed;
    top: var(--fcc-header-height, 72px);
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: calc(100vh - var(--fcc-header-height, 72px));
    background: var(--sidebar-bg, #17335D);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    z-index: 100;
    padding: 16px 0 24px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: none;
  }

  body.logged-in .sidebar-nav {
    display: block;
  }

  .sidebar-list,
  .sidebar-section-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .drawer-brand {
    display: none;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    flex-shrink: 0;
  }
  .drawer-brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-right: 10px;
    flex-shrink: 0;
  }
  .drawer-brand-text {
    min-width: 0;
  }
  .drawer-brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.25;
  }
  .drawer-brand-subtitle {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 2px;
  }
  .sidebar-dashboard {
    padding: 0 12px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }

  .sidebar-dashboard .nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
  }

  .sidebar-section {
    margin-bottom: 4px;
  }

  .sidebar-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    margin: 0 8px 2px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--sidebar-nav-text, #EAF4FF);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
  }

  .sidebar-section-head:hover {
    background: var(--sidebar-nav-hover, rgba(125, 183, 255, 0.25));
    color: #FFFFFF;
  }

  .sidebar-section-head::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  .sidebar-section.collapsed .sidebar-section-head::after {
    transform: rotate(-135deg);
  }

  .sidebar-section-list {
    padding: 0 8px 8px 20px;
  }

  .sidebar-section.collapsed .sidebar-section-list {
    display: none;
  }

  .sidebar-section-list .nav-link {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--sidebar-nav-text, #EAF4FF);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.18s ease, color 0.18s ease;
  }

  .sidebar-section-list .nav-link:hover {
    background: var(--sidebar-nav-hover, rgba(125, 183, 255, 0.25));
    color: #FFFFFF;
  }

  .sidebar-section-list .nav-link.active {
    background: var(--sidebar-nav-active, rgba(125, 183, 255, 0.35));
    color: #FFFFFF;
  }

  .sidebar-section-list .nav-link.nav-link-sub {
    padding-left: 28px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
  }

  .nav-link {
    display: inline-block;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    transition: 0.18s ease;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(67, 40, 24, 0.35);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.25s ease;
  }

  body.sidebar-drawer-open .sidebar-backdrop {
    display: block;
    opacity: 1;
  }

  .main-with-sidebar {
    max-width: 1250px;
    margin: 0;
    padding: calc(var(--fcc-header-height, 72px) + 28px) 14px 40px;
    min-height: 100vh;
  }

  body.logged-out .main-with-sidebar {
    max-width: 100%;
    padding: 24px 40px 40px;
  }
  
body.logged-in .main-with-sidebar {
    margin-left: var(--sidebar-width, 260px);
  }

  /* ================================
   FCC HEADER
================================ */

.fcc-header {
  --fcc-header-height: 72px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--fcc-header-height);
  min-height: var(--fcc-header-height);
  background: var(--header-bg, #dfe8f3);
  border-bottom: 1px solid var(--header-border, #c7d3e0);
  color: var(--header-text, #1a1a1a);
  z-index: 1000;
}

body.logged-in .fcc-header {
  left: var(--sidebar-width, 260px);
  width: calc(100% - var(--sidebar-width, 260px));
}

body.logged-out .fcc-header {
  left: 0;
  width: 100%;
}

.fcc-header-inner {
  height: 100%;
  min-height: var(--fcc-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 0 28px;
  box-sizing: border-box;
  width: 100%;
  transform: translateY(-10px);
}

.fcc-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 0 40%;
}

.fcc-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-left: auto;
  margin-right: 25%;
  min-width: 0;
  flex: 0 0 auto;
}

.fcc-header-brand {
  display: flex;
  align-items: center;
  margin-left: -15%;
  flex: 0 0 auto;
  height: 100%;
  min-width: 0;
}

.sidebar-toggle {
  display: none;
}

.fcc-header-icon {
  display: block;
  height: 36%;
  width: auto;
  max-width: 36%;
  object-fit: contain;
  flex-shrink: 0;
}

.fcc-mode-select {
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--header-control-border, var(--border));
  background: var(--header-control-bg, var(--card));
  color: var(--header-control-text, var(--text));
}

.fcc-user {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.fcc-user-label {
  white-space: nowrap;
  color: var(--header-text, inherit);
}

.fcc-logout {
  min-height: 38px;
  white-space: nowrap;
  background: var(--button-bg);
  color: var(--button-text);
  border: 1px solid var(--button-border, transparent);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

@media (max-width: 767px) {
  .fcc-header,
  body.logged-in .fcc-header,
  body.logged-out .fcc-header {
    left: 0;
    width: 100%;
  }

  .fcc-header-inner {
    padding: 0 12px;
    gap: 10px;
    transform: translateY(-4px);
  }

  .fcc-header-left {
    flex: 0 1 auto;
  }

  .fcc-header-right {
    margin-right: 0;
  }

  .fcc-header-icon {
    height: 100%;
  }

  .fcc-user-label {
    display: none;
  }
}

  .fcc-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
  }

  .app-bar-mobile {
    display: none;
  }

  .main-header-inner {
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
  }

@media (max-width: 900px) {
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--sidebar-bg, #17335D);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
  }
}

  @media (max-width: 767px) {
    .sidebar-nav {
      transform: translateX(-100%);
      box-shadow: none;
      display: flex;
      flex-direction: column;
      padding-bottom: 24px;
    }

    body.logged-in .sidebar-nav {
      display: flex;
    }

    body.sidebar-drawer-open .sidebar-nav {
      transform: translateX(0);
      box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    body.sidebar-drawer-open {
      overflow: hidden;
      overscroll-behavior: none;
      touch-action: pan-y;
    }
    body.sidebar-drawer-open .main-with-sidebar {
      overflow: hidden;
    }

    body.logged-in .main-with-sidebar {
      margin-left: 0;
      padding-bottom: 72px;
    }

    body.logged-in .app-bar-mobile {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      min-height: 52px;
      padding: 6px 12px;
      gap: 8px;
    }
    .app-bar-brand {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1;
      min-width: 0;
      padding: 0 6px;
    }
    .app-bar-logo-wide {
      display: block;
      max-width: 340px;
      width: 100%;
      height: auto;
      max-height: 60px;
      object-fit: contain;
    }

    @media (max-width: 380px) {
      .app-bar-logo-wide {
        max-width: 300px;
        max-height: 56px;
      }
    }

    body.logged-out .main-header-inner {
      display: block;
    }

    body.logged-in .main-header-inner {
      display: none;
    }

    .main-header {
      padding-left: 0;
      padding-right: 0;
      padding-top: 4px;
      padding-bottom: 4px;
    }

    .drawer-brand {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .sidebar-toggle {
      display: flex !important;
      align-items: center;
      justify-content: center;
      position: relative;
      top: auto;
      transform: none;
      flex-shrink: 0;
    }

    .sidebar-toggle::before {
      margin: 0 auto;
      box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor;
    }

    .app-bar-profile-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-width: 44px;
      min-height: 44px;
      padding: 6px 10px;
      border: none;
      border-radius: 12px;
      background: var(--accent-2);
      color: var(--primary);
      font-family: inherit;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
    }

    .app-bar-profile-btn:hover {
      background: var(--accent);
    }

    .app-bar-profile-name {
      max-width: 80px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .app-bar-profile-photo {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--primary);
      flex-shrink: 0;
      box-shadow: 0 0 0 2px var(--accent-2);
    }

    .sidebar-drawer-footer {
      margin-top: auto;
      padding: 16px 12px 24px;
      border-top: 1px solid var(--border);
    }

    .sidebar-drawer-account {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .sidebar-drawer-user {
      font-weight: 700;
      font-size: 0.95rem;
      color: var(--text);
    }

    .sidebar-drawer-mode-label {
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--primary);
    }

    .sidebar-drawer-mode-select {
      width: 100%;
      padding: 10px 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--card);
      font-size: 0.95rem;
    }

    .sidebar-drawer-link {
      display: block;
      padding: 10px 12px;
      border-radius: 10px;
      font-weight: 600;
    }

    .bottom-nav {
      display: none;
    }

    body.logged-in .bottom-nav {
      display: flex;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      height: 56px;
      padding-bottom: env(safe-area-inset-bottom, 0);
      background: var(--bg-soft);
      border-top: 1px solid var(--border);
      z-index: 90;
      align-items: center;
      justify-content: space-around;
      box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    }

    .bottom-nav[aria-hidden="false"] {
      display: flex;
    }

    .bottom-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      flex: 1;
      min-height: 44px;
      padding: 6px 4px;
      text-decoration: none;
      color: var(--primary);
      font-size: 0.7rem;
      font-weight: 600;
      background: none;
      border: none;
      font-family: inherit;
      cursor: pointer;
      transition: color 0.18s ease, background 0.18s ease;
    }

    .bottom-nav-item:hover,
    .bottom-nav-item.active {
      color: var(--text);
    }

    .bottom-nav-item.active .bottom-nav-icon {
      opacity: 1;
    }

    .bottom-nav-icon {
      font-size: 1.25rem;
      line-height: 1;
      opacity: 0.85;
    }

    .bottom-nav-label {
      line-height: 1.2;
    }

    .dashboard-grid.dashboard-widgets {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .dashboard-grid.dashboard-widgets .welcome-card { order: 0; }
    .dashboard-grid.dashboard-widgets .parent-logged-in-bar { order: 1; }
    .dashboard-grid.dashboard-widgets .kid-only-hidden.dashboard-kid-view { order: 2; }
    .dashboard-grid.dashboard-widgets #dashboardOverdueBanner { order: 3; }
    .dashboard-grid.dashboard-widgets .widget-events { order: 4; }
    .dashboard-grid.dashboard-widgets .widget-memories { order: 5; }
    .dashboard-grid.dashboard-widgets .widget-insights { order: 6; }
    .dashboard-grid.dashboard-widgets .widget-assistant { order: 7; }
    .dashboard-grid.dashboard-widgets .widget-weekly-report { order: 8; }
    .dashboard-grid.dashboard-widgets .widget-my-points { order: 9; }
    .dashboard-grid.dashboard-widgets .widget-my-chores { order: 10; }
    .dashboard-grid.dashboard-widgets .widget-my-goals { order: 11; }
    .dashboard-grid.dashboard-widgets .widget-leaderboard { order: 12; }
    .dashboard-grid.dashboard-widgets .widget-budget { order: 13; }
    .dashboard-grid.dashboard-widgets .widget-chores { order: 14; }
    .dashboard-grid.dashboard-widgets .widget-quick-actions { order: 15; }
    .dashboard-grid.dashboard-widgets .widget-parent-alerts { order: 16; }
    .dashboard-grid.dashboard-widgets .welcome-card { order: 0; }
    .dashboard-grid.dashboard-widgets #dashboardOverdueBanner { order: 1; }
    .dashboard-grid.dashboard-widgets #dashboardParentAlertsCard { order: 2; }
    .dashboard-grid.dashboard-widgets .widget-events { order: 3; }
    .dashboard-grid.dashboard-widgets .widget-chores { order: 4; }
    .dashboard-grid.dashboard-widgets .widget-my-chores { order: 5; }
    .dashboard-grid.dashboard-widgets .widget-memories { order: 6; }
    .dashboard-grid.dashboard-widgets .widget-insights { order: 7; }
    .dashboard-grid.dashboard-widgets .widget-assistant { order: 8; }
    .dashboard-grid.dashboard-widgets .widget-weekly-report { order: 9; }
    .dashboard-grid.dashboard-widgets .widget-my-points { order: 10; }
    .dashboard-grid.dashboard-widgets .widget-my-goals { order: 11; }
    .dashboard-grid.dashboard-widgets .widget-leaderboard { order: 12; }
    .dashboard-grid.dashboard-widgets .widget-budget { order: 13; }
    .dashboard-grid.dashboard-widgets .widget-quick-actions { order: 14; }
    .parent-logged-in-bar,
    #dashboardParentBarWrap,
    #dashboardKidSelectorWrap {
      display: none !important;
    }
    .welcome-card {
      padding: 14px 16px;
      margin-bottom: 12px;
    }
    .welcome-card h2 {
      font-size: 1.25rem;
      margin-bottom: 6px;
    }
    .welcome-card p:not(.bible-verse-line) {
      font-size: 0.9rem;
      margin-bottom: 6px;
    }
    .welcome-card .bible-verse-line {
      font-size: 0.75rem;
      margin-top: 6px;
      margin-bottom: 0;
    }
    .dashboard-grid.dashboard-widgets {
      gap: 14px;
    }
    .dashboard-card {
      padding: 16px;
    }
    .dashboard-card h3 {
      font-size: 1.05rem;
      margin-bottom: 8px;
    }
    .bottom-nav {
      height: 56px;
      padding-bottom: env(safe-area-inset-bottom, 0);
      border-top: 2px solid var(--border);
      box-shadow: 0 -2px 16px rgba(181, 131, 141, 0.08);
    }
    .bottom-nav-item.active {
      color: var(--primary);
      font-weight: 700;
    }
    .bottom-nav-item.active .bottom-nav-icon {
      opacity: 1;
    }
    .bottom-nav-item {
      padding: 8px 4px;
      gap: 3px;
    }
    .bottom-nav-icon {
      font-size: 1.35rem;
    }
    .bottom-nav-label {
      font-size: 0.68rem;
    }
  }

  @media (min-width: 768px) {
    .app-bar-mobile {
      display: none !important;
    }

    .main-header-inner {
      display: block;
    }

    body.logged-in .main-with-sidebar {
      padding-bottom: 40px;
    }

    .bottom-nav {
      display: none !important;
    }

    .sidebar-backdrop {
      display: none !important;
    }
  }

  main {
    max-width: 1250px;
    padding: 24px 14px 40px;
  }

  main:not(.main-with-sidebar) {
    margin: 0 auto;
  }
  
  .page {
    display: none;
    animation: fadeIn 0.25s ease;
  }
  
  .page.active {
    display: block;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .welcome-card,
  .section-card,
  .dashboard-card,
  .profile-card,
  .memory-card,
  .leaderboard-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  
  .welcome-card,
  .section-card,
  .leaderboard-card {
    padding: 22px;
  }

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.budget-close-btn {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .budget-close-btn {
    min-height: 40px;
    padding-inline: 14px;
  }
}
  
  .welcome-card {
    text-align: center;
    margin-bottom: 24px;
    background: linear-gradient(180deg, #fff6f3 0%, #fffaf9 100%);
  }
  
  .welcome-card h2,
  .section-title {
    margin-top: 0;
    color: var(--primary);
  }
  
  .section-title {
    margin-bottom: 14px;
    font-size: 1.4rem;
  }

  .push-notifications-card {
    padding: 22px;
    margin-bottom: 18px;
  }
  .push-notifications-card .push-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  .push-notifications-card .push-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
  }
  .push-notifications-card .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  
  .login-view {
    padding: 20px 20px 24px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 120px);
  }
  /* When login is hidden (display:none set by JS), ensure it never blocks touches */
  .login-view[aria-hidden="true"] {
    pointer-events: none !important;
  }
  body.logged-out .login-view {
    max-width: 100%;
  }
  .login-layout {
    display: grid;
    grid-template-columns: 420px minmax(520px, 1fr);
    gap: 24px;
    align-items: start;
  }
  .login-left {
    display: grid;
    grid-template-rows: auto auto;
    gap: 18px;
    align-content: start;
  }
  .login-right {
    position: sticky;
    top: 24px;
    width: 100%;
  }
  .login-family-values-card,
  .family-values-page-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  }
  .family-inspiration-card {
    width: 100%;
    max-height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 18px 20px;
    background: linear-gradient(180deg, var(--card-2, var(--card)) 0%, var(--card) 100%);
  }
  body.theme-dark .family-inspiration-card,
  [data-theme="dark"] .family-inspiration-card {
    background: linear-gradient(180deg, var(--card-2, var(--card)) 0%, var(--card) 100%);
  }
  .family-creed-line {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
  }
  .login-family-values-card h3 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    color: var(--primary);
  }
  .family-inspiration-subtitle {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.95rem;
  }
  .family-inspiration-divider {
    height: 1px;
    background: var(--border);
    margin: 14px 0 12px;
  }
  #loginFamilyValuesList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 4px;
    max-height: 420px;
  }
  #familyValuesList {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .login-daily-verse-wrap {
    margin-top: 12px;
    flex-shrink: 0;
  }
  .login-daily-verse-wrap h4 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 1rem;
  }
  .login-daily-verse-text {
    margin: 0 0 8px;
    font-style: italic;
    line-height: 1.45;
    font-size: 14px;
  }
  .login-daily-verse-ref {
    margin: 0 0 8px;
    font-weight: 700;
    color: var(--primary);
  }
  .login-daily-verse-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
  }
  .login-daily-verse-reflection {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--accent-2);
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
  }
  .valueRow {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-2);
  }
  .loginValueRow {
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.72);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.01em;
  }
  body.theme-dark .loginValueRow,
  [data-theme="dark"] .loginValueRow {
    background: rgba(255, 255, 255, 0.08);
  }
  .valueRow {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
  }
  .valueRowText,
  .loginValueRow {
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  .valueIndex {
    font-weight: 700;
    color: var(--primary);
    min-width: 1.8em;
  }
  .loginValueIndex {
    font-weight: 700;
    color: var(--primary);
    min-width: 1.5em;
  }
  .valueLabel,
  .loginValueText {
    flex: 1;
  }
  .valueRowActions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  .valueRowActions button {
    padding: 4px 10px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid var(--button-border, var(--border));
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
  }
  .valueRowActions button:not(:disabled):hover {
    filter: brightness(1.08);
  }
  .valueRowActions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .familyValuesEditorBar {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .family-values-title {
    text-align: center;
    margin-bottom: 4px;
  }
  .family-values-subtitle {
    text-align: center;
    margin: 0 0 20px;
  }
  .family-values-page-card {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px;
  }
  @media (min-width: 1024px) {
    body.logged-out {
      overflow: hidden;
    }
    .login-view {
      overflow: hidden;
    }
  }
  @media (max-width: 1023px) {
    body.logged-out {
      overflow: auto;
    }
    .login-layout {
      grid-template-columns: 1fr;
      max-width: 100%;
    }
    .login-right {
      position: static;
    }
    .family-inspiration-card {
      max-height: none;
    }
    #loginFamilyValuesList {
      max-height: none;
      overflow: visible;
    }
  }
  .login-view-card {
    padding: 22px 24px 24px;
    background: linear-gradient(180deg, var(--card-2, var(--card)) 0%, var(--card) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .login-brand-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    margin-bottom: 12px;
    display: block;
  }
  .login-view-card h2 {
    margin: 0 0 6px;
    color: var(--primary);
    font-size: 1.6rem;
  }
  .login-view-card .muted {
    margin-bottom: 12px;
  }
  .login-view-widgets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .login-view-widgets .dashboard-card {
    margin: 0;
    padding: 16px;
    min-height: 0;
  }
  .reminders-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
  }
  .reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border-radius: 10px;
    margin-bottom: 8px;
  }
  .reminder-item span {
    flex: 1;
  }
  .reminder-item .delete-reminder-btn {
    flex-shrink: 0;
  }

  .dashboard-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  
  .dashboard-card {
    padding: 18px;
    min-height: 180px;
    background: linear-gradient(180deg, var(--card-2, var(--card)) 0%, var(--card) 100%);
  }
  
  .dashboard-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary);
    font-size: 1.08rem;
  }
  
  .dashboard-card ul {
    margin: 0;
    padding-left: 18px;
  }
  
  .dashboard-card li {
    margin-bottom: 8px;
  }
  .dashboard-expense-top3-label {
    margin-top: 8px;
  }
  .dashboard-expense-top3 {
    padding-left: 12px;
  }

  .budget-widget-summary p {
    margin: 4px 0;
  }
  .budget-progress-wrap {
    height: 12px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0 4px;
  }
  .budget-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
  }
  .budget-progress-wrap.budget-over .budget-progress-bar {
    background: var(--danger);
  }
  .budget-pct {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 0 8px;
  }
  .dashboard-insight {
    font-size: 0.9rem;
    margin: 6px 0 0;
  }
  .insight-warn {
    color: var(--danger);
  }
  .insight-ok {
    color: var(--success);
  }
  .chore-widget-list {
    margin: 0 0 8px;
  }
  .chore-widget-row {
    margin-bottom: 6px;
  }
  .chore-done {
    color: var(--muted);
    text-decoration: line-through;
  }
  .chore-rate {
    margin: 8px 0 0;
    font-size: 0.9rem;
  }

  .chore-overdue {
    background: #fff2f2;
    border-left: 4px solid #ff5c5c;
  }

  .kid-complete-btn {
    margin-left: 10px;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    border: none;
    background: #4CAF50;
    color: white;
    cursor: pointer;
  }

  .reward-progress-wrap {
    height: 10px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
    margin: 6px 0;
  }

  .reward-progress-bar {
    height: 100%;
    background: #7b5cff;
  }

  .chore-pending-review {
    background: #fff8e8;
    border-left: 4px solid #f0b429;
  }

  .chore-proof-note {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef4ff;
    color: #355caa;
  }

  .chore-proof-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-top: 6px;
  }

  .chore-proof-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
  }

  .chore-proof-file-label {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 14px;
  }

  .chore-proof-file-label input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
  }

  .chore-view-proof-link {
    font-size: 12px;
    color: var(--primary);
    margin-left: 4px;
  }

  /* Wall iPad / shared device: larger tap targets for kid chore proof */
  .chore-proof-actions .kid-complete-btn,
  .chore-proof-file-label {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 1rem;
  }

  .chore-review-actions {
    display: inline-flex;
    gap: 8px;
    margin-left: 10px;
  }

  .chore-approve-btn,
  .chore-sendback-btn {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
  }

  .chore-approve-btn {
    background: #4CAF50;
    color: #fff;
  }

  .chore-sendback-btn {
    background: #d9534f;
    color: #fff;
  }

  .kid-review-pill {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff3cd;
    color: #8a6d3b;
  }

  .chore-photo-proof-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
  }
  .chore-photo-proof-badge--required {
    background: #f8d7da;
    color: #721c24;
  }
  .chore-photo-proof-badge--optional {
    background: var(--bg-soft, #f0f0f0);
    color: var(--text-muted, #666);
  }

  .overdue-warning-pill {
    background: #fff3cd;
    color: #856404;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 6px;
  }

  .points-locked-pill {
    background: #f8d7da;
    color: #721c24;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 6px;
  }

  .penalty-pill {
    background: #ffccd5;
    color: #7a0615;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 6px;
  }

  .chore-overdue-warning {
    margin: 4px 0 0 20px;
    font-size: 0.85rem;
  }

  .chip-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    font-size: 0.8rem;
    cursor: pointer;
  }
  .chip-btn.chip-active {
    background: #ffe0e0;
    color: #8b1a1a;
    border-color: #f3a8a8;
  }

  .widget-assistant .muted.small { margin: 0 0 10px; }
  .assistant-examples {
    font-size: 0.8rem;
    line-height: 1.35;
    margin-bottom: 12px;
    color: var(--muted);
  }
  .assistant-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
  }
  .assistant-input-wrap input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--card);
  }
  .assistant-input-wrap .btn-primary { flex-shrink: 0; }
  .assistant-response {
    min-height: 2.5em;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .assistant-response.answered { border: 1px solid var(--border); }

  .leaderboard-widget-list {
    margin: 0;
    padding-left: 22px;
  }
  .leaderboard-widget-list li {
    margin-bottom: 6px;
  }
  .event-next {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }
  .event-list {
    margin: 0;
    padding-left: 18px;
  }
  .event-list li {
    margin-bottom: 4px;
  }
  .memory-widget-list {
    margin: 4px 0 0;
    padding-left: 18px;
  }
  .memory-widget-list li {
    margin-bottom: 4px;
  }

  .memory-highlights-subtitle {
    margin: -4px 0 10px 0;
    font-style: italic;
    color: var(--muted);
  }
  .memory-highlights-inner {
    margin-bottom: 6px;
  }
  .memory-highlight-hero-wrap {
    margin-bottom: 12px;
  }
  .memory-highlights-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .memory-highlight-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(180, 160, 140, 0.35);
    background: linear-gradient(180deg, #fefdfb 0%, #faf8f5 100%);
    cursor: pointer;
    transition: 0.2s ease;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }
  .memory-highlight-card:hover {
    background: linear-gradient(180deg, #fdf9f4 0%, #f8f2ea 100%);
    border-color: rgba(180, 160, 140, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }
  .memory-highlight-card:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  .memory-highlight-card--hero {
    padding: 12px 14px;
    border-radius: 14px;
    border-color: rgba(200, 175, 150, 0.4);
    background: linear-gradient(165deg, #fefcf9 0%, #fbf6f0 50%, #f8f2ea 100%);
    box-shadow: 0 2px 10px rgba(120, 100, 80, 0.08);
  }
  .memory-highlight-card--hero:hover {
    box-shadow: 0 4px 14px rgba(120, 100, 80, 0.12);
  }
  .memory-highlight-card--on-this-day {
    border-color: rgba(190, 155, 110, 0.5);
    background: linear-gradient(165deg, #fdf9f2 0%, #faf4e8 50%, #f5ecd9 100%);
  }
  .memory-highlight-card--on-this-day:hover {
    background: linear-gradient(165deg, #faf4e8 0%, #f5ecd9 100%);
    border-color: rgba(180, 145, 100, 0.6);
  }
  .memory-highlight-card--hero.memory-highlight-card--on-this-day {
    background: linear-gradient(165deg, #fdf8ef 0%, #f9f0e0 50%, #f3e8d4 100%);
  }
  .memory-highlight-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(145deg, #ebe5dd 0%, #e0d9d0 100%);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6);
  }
  .memory-highlight-card--hero .memory-highlight-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
  }
  .memory-highlight-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .memory-highlight-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: rgba(140, 120, 100, 0.6);
  }
  .memory-highlight-card--hero .memory-highlight-thumb--placeholder {
    font-size: 1.85rem;
  }
  .memory-highlight-body {
    flex: 1;
    min-width: 0;
  }
  .memory-highlight-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(220, 195, 165, 0.5);
    color: #6b5344;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
  }
  .memory-highlight-card--on-this-day .memory-highlight-badge {
    background: rgba(190, 155, 110, 0.45);
    color: #4a3d2a;
  }
  .memory-highlight-card--hero .memory-highlight-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
  }
  .memory-highlight-on-this-day-sub {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 2px;
    font-style: italic;
  }
  .memory-highlight-title {
    margin: 0 0 3px 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
  }
  .memory-highlight-card--hero .memory-highlight-title {
    font-size: 1rem;
    margin-bottom: 4px;
  }
  .memory-highlight-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .memory-highlight-card:not(.memory-highlight-card--hero) .memory-highlight-meta {
    margin-bottom: 2px;
  }
  .memory-highlight-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 2px;
  }
  .memory-highlight-tag {
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(230, 218, 205, 0.7);
    color: #5c4a3a;
  }
  .memory-highlight-notes {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.35;
    font-style: italic;
  }
  .memory-highlights-view-all-wrap {
    margin: 10px 0 0 0;
    text-align: center;
  }
  .memory-highlights-view-all {
    font-size: 0.88rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
  }
  .memory-highlights-view-all:hover {
    text-decoration: underline;
  }
  .memory-highlights-empty {
    padding: 16px 12px;
    text-align: center;
  }
  .memory-highlights-empty-text {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
  }
  .memory-highlights-empty .muted {
    margin: 0;
  }

  @media (max-width: 767px) {
    .memory-highlights-list {
      flex-direction: row;
      flex-wrap: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
      gap: 12px;
      padding-bottom: 8px;
      -webkit-overflow-scrolling: touch;
      scroll-snap-type: x proximity;
    }
    .memory-highlight-card {
      flex: 0 0 auto;
      width:  min(72vw, 280px);
      min-width: 200px;
      scroll-snap-align: start;
    }
    .memory-highlight-card--hero .memory-highlight-thumb {
      width: 56px;
      height: 56px;
    }
  }
  @media (max-width: 480px) {
    .memory-highlight-card {
      min-height: 52px;
      padding: 12px 10px;
    }
    .memory-highlight-card--hero {
      min-height: 0;
      padding: 14px 12px;
    }
    .memory-highlight-card--hero .memory-highlight-thumb {
      width: 64px;
      height: 64px;
    }
    .memory-highlights-list {
      gap: 10px;
    }
  }

  .insights-list {
    margin: 0;
    padding-left: 18px;
  }
  .insights-list li {
    margin-bottom: 6px;
  }
  .quick-actions-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
  }
  .quick-action-btn {
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--primary);
    cursor: pointer;
    transition: 0.18s ease;
  }
  .quick-action-btn:hover {
    background: var(--accent-2);
    border-color: var(--accent);
  }
  .alerts-list {
    margin: 0;
    padding-left: 18px;
  }
  .alerts-list li {
    margin-bottom: 6px;
    color: var(--text);
  }

  .activity-feed-list {
    margin: 0;
    padding-left: 18px;
    list-style: none;
  }
  .activity-feed-list .activity-feed-item {
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border, #eee);
    word-break: break-word;
  }
  .activity-feed-list .activity-feed-item:last-child {
    border-bottom: none;
  }

  .two-col {
    display: grid;
    gap: 18px;
    grid-template-columns: 1.1fr 1fr;
    align-items: start;
  }
  
  .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 12px;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  
  .full-width {
    grid-column: 1 / -1;
  }
  
  .filter-min {
    min-width: 220px;
  }
  
  label {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.98rem;
  }
  
  input,
  select,
  textarea,
  button {
    font: inherit;
  }
  
  input,
  select,
  textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid var(--border, #e9bdb5);
    border-radius: 12px;
    background: var(--card, #fff);
    color: var(--text);
    outline: none;
  }
  
  input:focus,
  select:focus,
  textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--accent-2, rgba(181,131,141,0.12));
  }
  
  textarea {
    min-height: 90px;
    resize: vertical;
  }
  
  button {
    border: none;
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
  }
  
  .btn-primary {
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--button-border, transparent);
  }
  
  .btn-primary:hover {
    filter: brightness(1.08);
    color: var(--button-text);
  }
  
  .btn-secondary {
    background: transparent;
    border: 1px solid var(--button-bg);
    color: var(--button-bg);
  }
  
  .btn-secondary:hover {
    background: var(--button-bg);
    color: var(--button-text);
  }
  
  table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card, #fff);
    border-radius: 16px;
    overflow: hidden;
  }
  
  th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #f4d8d2;
    text-align: left;
    vertical-align: top;
  }
  
  th {
    background: var(--accent-2);
    color: var(--primary);
    font-size: 0.98rem;
  }
  
  tr:last-child td {
    border-bottom: none;
  }
  
  .table-wrap {
    overflow-x: auto;
  }
  
  .status-pill {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
  }
  
  .status-pending {
    background: #fff2cf;
    color: #7a5b00;
  }
  
  .status-complete {
    background: #daf1e2;
    color: #22643f;
  }
  
  .status-overdue {
    background: #ffe0e0;
    color: #8b1a1a;
  }

  .status-pending-review {
    background: #e8e4f0;
    color: #4a4063;
  }
  
  .kid-chore-action-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--button-border, var(--border));
    background: var(--button-bg);
    color: var(--button-text);
    font-weight: 700;
    cursor: pointer;
  }
  
  .kid-chore-action-btn:hover {
    filter: brightness(1.08);
  }
  
  .kid-chore-photo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    margin-left: 6px;
  }
  
  .kid-chore-photo-btn input[type="file"] {
    display: none;
  }
  
  .leaderboard-card {
    margin-top: 18px;
  }
  
  .profiles-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  /* FCC Profiles mobile cleanup */
  .fcc-profiles-toolbar,
  .profile-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 16px;
    padding: 12px 0;
  }
  .profile-toolbar-select-wrap {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
  .profile-toolbar-select-wrap label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--primary);
  }
  .profile-select-input,
  .profile-toolbar-select-wrap select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    font-size: 1rem;
    background: #fff;
  }
  /* FCC Profiles action bar: single horizontal row of icon+label buttons */
  .profile-action-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    margin-top: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }
  .profile-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 4px;
    border: 1.5px solid var(--border);
    background: var(--card-bg, #fff);
    color: var(--primary);
    transition: background 0.15s, border-color 0.15s;
  }
  .profile-action-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--accent, rgba(0, 0, 0, 0.15));
  }
  .profile-action-btn.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }
  .profile-action-btn.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover, #c94d3a);
    border-color: var(--accent-hover, #c94d3a);
  }
  .profile-action-btn.btn-danger {
    background: #fde8e8;
    color: #b91c1c;
    border-color: #fecaca;
  }
  .profile-action-btn.btn-danger:hover:not(:disabled) {
    background: #fecaca;
    border-color: #f87171;
  }
  .profile-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  .profile-action-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 2px;
  }
  .profile-action-label {
    white-space: nowrap;
    line-height: 1.2;
  }
  @media (min-width: 480px) {
    .profile-action-row {
      grid-template-columns: repeat(4, 1fr);
    }
    .profile-action-btn {
      flex-direction: row;
      padding: 10px 12px;
    }
    .profile-action-icon {
      margin-bottom: 0;
      margin-right: 6px;
    }
  }
  @media (min-width: 640px) {
    .profile-toolbar-select-wrap {
      max-width: 480px;
    }
    .profile-action-row {
      grid-template-columns: repeat(4, 1fr);
      max-width: 100%;
    }
  }

  .profile-detail-view {
    margin-top: 16px;
  }

  .profile-detail-card {
    padding: 20px;
    position: relative;
    background: linear-gradient(180deg, #fff6f4 0%, #fffdfc 100%);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
  }

  .profile-detail-card .profile-avatar {
    position: static;
    margin-bottom: 12px;
  }

  .profile-card {
    padding: 20px;
    position: relative;
    background: linear-gradient(180deg, #fff6f4 0%, #fffdfc 100%);
  }
  
  /* FCC Profile avatar system: image or initials fallback */
  .profile-avatar {
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border, rgba(0, 0, 0, 0.12));
    background: var(--card-bg, #f5f0ee);
  }
  .profile-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .profile-avatar-fallback {
    font-weight: 800;
    color: var(--primary);
  }
  .profile-avatar-initials {
    line-height: 1;
    letter-spacing: -0.02em;
  }
  .profile-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  .profile-avatar-md {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  .profile-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }
  .profile-avatar-fallback[data-color-index="0"] { background: #fde3de; color: #8b4513; border-color: #e8c4bc; }
  .profile-avatar-fallback[data-color-index="1"] { background: #d5e0e8; color: #2c5282; border-color: #b8d4e8; }
  .profile-avatar-fallback[data-color-index="2"] { background: #e8e5d5; color: #5a543a; border-color: #d4d0b8; }
  .profile-avatar-fallback[data-color-index="3"] { background: #e0e8e5; color: #2d5a3a; border-color: #b8d8c4; }
  .profile-avatar-fallback[data-color-index="4"] { background: #e8d5e8; color: #4a3a4a; border-color: #d8b8d8; }
  .profile-avatar-fallback[data-color-index="5"] { background: #e5dde8; color: #4a3a5a; border-color: #c4b8e0; }
  .profile-avatar-fallback[data-color-index="6"] { background: #e8e0d5; color: #5a4a3a; border-color: #d8c8b8; }
  .profile-avatar-fallback[data-color-index="7"] { background: #dde5e8; color: #3a4a5a; border-color: #b8c8d8; }

  .profile-selected-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    min-width: 0;
    max-width: 100%;
  }
  .profile-selected-summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .profile-selected-name {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .profile-selected-role {
    font-size: 0.85rem;
    color: var(--muted, #6b6b6b);
  }

  .profile-header-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    min-width: 0;
    max-width: 100%;
  }
  .profile-header-summary-text {
    min-width: 0;
  }
  .profile-header-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.3;
  }
  .profile-header-role {
    margin-top: 4px;
  }

  .profile-row {
    margin-bottom: 10px;
    padding-right: 58px;
  }
  
  .profile-label {
    display: inline-block;
    min-width: 110px;
    font-weight: 800;
    color: var(--primary);
  }

  .role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
  }
  .role-badge--admin { background: #e8d5e8; color: #4a3a4a; }
  .role-badge--parent { background: #d5e0e8; color: #3a4a5a; }
  .role-badge--caretaker { background: #e8e0d5; color: #5a4a3a; }
  .role-badge--child { background: #e8e5d5; color: #5a543a; }

  .family-profiles-manager .input,
  .family-profiles-manager select,
  .family-profiles-manager textarea {
    width: 100%;
    box-sizing: border-box;
  }
  .family-profiles-manager .btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
  }
  .family-profiles-manager .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
  }

  .manage-profiles-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
  }
  .manage-profiles-table th,
  .manage-profiles-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
  }
  .manage-profiles-table th {
    font-weight: 700;
    color: var(--primary);
  }
  .status-active { color: var(--ok, #2d7d2d); }
  .assign-kid-row { display: block; margin-bottom: 6px; }
  .assign-kids-checkboxes { margin-top: 10px; }

  .notification-pref-row { display: block; margin-bottom: 10px; }
  .notification-pref-row input { margin-right: 8px; }
  .email-log-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
  .email-log-table th, .email-log-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
  .email-log-table th { font-weight: 700; color: var(--primary); }
  
  .profile-subsection {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e7c3bc;
  }
  
  /* ----- Memories: warm family scrapbook ----- */
  .memory-scrapbook-section .section-title {
    color: #5c4329;
  }
  .memory-browse-intro {
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #8a735a;
  }
  .memory-search-wrap {
    margin-bottom: 1rem;
  }
  .memory-search-input {
    width: 100%;
    max-width: 360px;
    padding: 0.65rem 0.85rem;
    min-height: 44px;
    font-size: 1rem;
    border: 1px solid #d4b896;
    border-radius: 12px;
    background: #fdf9f3;
    color: #5c4329;
  }
  .memory-search-input::placeholder {
    color: #9a8570;
  }
  .memory-search-input:focus {
    outline: none;
    border-color: #8a735a;
    box-shadow: 0 0 0 2px rgba(196, 165, 116, 0.25);
  }
  @media (max-width: 480px) {
    .memory-search-input {
      min-height: 48px;
      padding: 0.75rem 1rem;
      font-size: 16px;
    }
  }
  .memory-upload-first {
    margin-bottom: 0.5rem;
  }
  .memory-photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 12px;
    min-height: 0;
  }
  .memory-photo-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border, #d4b896);
    background: var(--card, #fdf9f3);
  }
  .memory-photo-preview-item.is-cover {
    border-color: var(--primary, #8a735a);
    box-shadow: 0 0 0 2px rgba(196, 165, 116, 0.35);
  }
  .memory-photo-preview-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
  }
  .memory-photo-preview-item .memory-preview-meta {
    padding: 4px 6px;
    font-size: 0.7rem;
    color: var(--muted, #8a735a);
    background: rgba(0,0,0,0.04);
  }
  .memory-photo-preview-item .memory-preview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
  }
  .memory-photo-preview-item .memory-preview-actions button {
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    font-size: 0.7rem;
    border-radius: 4px;
    border: 1px solid var(--button-border, var(--border));
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
  }
  .memory-photo-preview-item .memory-preview-actions button:hover {
    filter: brightness(1.08);
  }
  .memory-field-from-meta {
    display: block;
    margin-top: 2px;
    font-style: italic;
  }
  .memory-metadata-hints {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--muted, #8a735a);
  }
  .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;
  }
  .memory-tag-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  .memory-filter-chip {
    padding: 0.4rem 0.85rem;
    min-height: 36px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    background: #ebe0d4;
    color: #5c4329;
  }
  .memory-filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(92, 67, 41, 0.12);
  }
  .memory-filter-chip.is-active {
    box-shadow: 0 2px 10px rgba(92, 67, 41, 0.2);
  }
  .memory-filter-chip--all.is-active {
    background: #5c4329;
    color: #fdf9f3;
  }
  .memory-filter-chip--birthday { background: #f8d7e2; color: #8b4a5c; }
  .memory-filter-chip--birthday.is-active { background: #d4a5b0; color: #fff; }
  .memory-filter-chip--vacation { background: #c5e0f0; color: #2d5a7b; }
  .memory-filter-chip--vacation.is-active { background: #7eb8d4; color: #fff; }
  .memory-filter-chip--school { background: #e8e4c9; color: #5c5829; }
  .memory-filter-chip--school.is-active { background: #c4c08a; color: #fff; }
  .memory-filter-chip--sports { background: #c8e6c4; color: #2d5c2d; }
  .memory-filter-chip--sports.is-active { background: #8bc48a; color: #fff; }
  .memory-filter-chip--achievement { background: #ffe0b8; color: #7d5a2d; }
  .memory-filter-chip--achievement.is-active { background: #e8b878; color: #fff; }
  .memory-filter-chip--holiday { background: #f0d0d0; color: #8b4545; }
  .memory-filter-chip--holiday.is-active { background: #d49090; color: #fff; }
  .memory-filter-chip--family { background: #e8d5c4; color: #5c4329; }
  .memory-filter-chip--family.is-active { background: #c4a574; color: #fff; }
  .memory-filter-chip--travel { background: #d4e8e8; color: #2d5c5c; }
  .memory-filter-chip--travel.is-active { background: #8bc4c4; color: #fff; }
  .memory-filter-chip--milestone { background: #e8d8f0; color: #5c3d6b; }
  .memory-filter-chip--milestone.is-active { background: #c4a0d4; color: #fff; }
  .memory-filter-chip--friends { background: #f5e6cc; color: #6b5329; }
  .memory-filter-chip--friends.is-active { background: #d4b876; color: #fff; }
  .memory-filter-chip--first-day-of-school { background: #e0e8f0; color: #3d5a7b; }
  .memory-filter-chip--first-day-of-school.is-active { background: #90a8c4; color: #fff; }
  .memory-filter-chip--award,
  .memory-filter-chip--art,
  .memory-filter-chip--music,
  .memory-filter-chip--dance,
  .memory-filter-chip--church,
  .memory-filter-chip--medical,
  .memory-filter-chip--outdoors,
  .memory-filter-chip--reading,
  .memory-filter-chip--graduation { background: #ebe0d4; color: #5c4329; }
  .memory-filter-chip--award.is-active,
  .memory-filter-chip--art.is-active,
  .memory-filter-chip--music.is-active,
  .memory-filter-chip--dance.is-active,
  .memory-filter-chip--church.is-active,
  .memory-filter-chip--medical.is-active,
  .memory-filter-chip--outdoors.is-active,
  .memory-filter-chip--reading.is-active,
  .memory-filter-chip--graduation.is-active { background: #8a735a; color: #fff; }

  .memory-filter-tag-wrap label {
    font-size: 0.85rem;
    color: #8a735a;
  }

  .memory-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
  }
  .memory-tag-chip {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    border: none;
  }
  .memory-tag-chip--birthday { background: #f8d7e2; color: #8b4a5c; }
  .memory-tag-chip--vacation { background: #c5e0f0; color: #2d5a7b; }
  .memory-tag-chip--school { background: #e8e4c9; color: #5c5829; }
  .memory-tag-chip--sports { background: #c8e6c4; color: #2d5c2d; }
  .memory-tag-chip--achievement { background: #ffe0b8; color: #7d5a2d; }
  .memory-tag-chip--holiday { background: #f0d0d0; color: #8b4545; }
  .memory-tag-chip--family { background: #e8d5c4; color: #5c4329; }
  .memory-tag-chip--travel { background: #d4e8e8; color: #2d5c5c; }
  .memory-tag-chip--milestone { background: #e8d8f0; color: #5c3d6b; }
  .memory-tag-chip--friends { background: #f5e6cc; color: #6b5329; }
  .memory-tag-chip--first-day-of-school { background: #e0e8f0; color: #3d5a7b; }
  .memory-tag-chip--award,
  .memory-tag-chip--art,
  .memory-tag-chip--music,
  .memory-tag-chip--dance,
  .memory-tag-chip--church,
  .memory-tag-chip--medical,
  .memory-tag-chip--outdoors,
  .memory-tag-chip--reading,
  .memory-tag-chip--graduation { background: #e8e0d8; color: #5c4329; }
  .memory-tag-more {
    font-size: 0.72rem;
    color: #8a735a;
    font-style: italic;
  }
  .memory-filters,
  .memories-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
  }
  .memory-filters .form-group {
    min-width: 0;
  }
  .memory-filters label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b5344;
    margin-bottom: 4px;
  }
  .memory-empty-state {
    text-align: center;
    color: #8a735a;
    font-size: 1.05rem;
    padding: 2rem 1rem;
    line-height: 1.5;
  }

  .memory-toolbar {
    margin-bottom: 1.25rem;
  }
  .memory-slideshow-btn {
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #e8d5c4 0%, #d4b896 100%);
    border: 1px solid #c4a574;
    color: #5c4329;
  }
  .memory-slideshow-btn:hover {
    background: linear-gradient(180deg, #d4b896 0%, #c4a574 100%);
    color: #3d2e1f;
  }

  .memory-timeline {
    margin-top: 0.5rem;
  }
  .memory-timeline-group {
    margin-bottom: 2rem;
  }
  .memory-group-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #5c4329;
    margin: 1.75rem 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #e8d5c4;
    letter-spacing: 0.02em;
  }
  .memory-list-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    margin-top: 0.75rem;
  }
  @media (max-width: 480px) {
    .memory-list-grid {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
  }

  .memory-card {
    background: #fdf9f3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(92, 67, 41, 0.08), 0 0 0 1px rgba(196, 165, 116, 0.2);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
  }
  .memory-card:hover {
    box-shadow: 0 6px 20px rgba(92, 67, 41, 0.12), 0 0 0 1px rgba(196, 165, 116, 0.3);
  }

  .memory-thumb-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    line-height: 0;
  }
  .memory-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    background: #ebe0d4;
  }
  .memory-thumb-placeholder {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ebe0d4 0%, #e0d4c4 100%);
    color: #9a8570;
    font-size: 0.9rem;
  }
  .memory-card-body {
    padding: 1rem 1rem 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
  .memory-child-name {
    font-size: 1rem;
    font-weight: 700;
    color: #5c4329;
    letter-spacing: 0.02em;
  }
  .memory-date {
    font-size: 0.9rem;
    color: #8a735a;
    font-weight: 500;
  }
  .memory-category-tag {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #7b5c3d;
    background: #f0e6d8;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    width: fit-content;
    margin-top: 0.15rem;
  }
  .memory-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #4a3728;
    margin: 0.25rem 0 0;
    line-height: 1.3;
  }
  .memory-notes-preview {
    font-size: 0.88rem;
    color: #6b5a4a;
    line-height: 1.4;
    margin-top: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .memory-chip,
  .memory-meta {
    font-size: 0.9rem;
    color: #8a735a;
  }
  .memory-chip {
    display: inline-block;
    background: #f0e6d8;
    color: #7b5c3d;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.78rem;
  }
  .memory-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px dashed #e0d4c4;
  }
  .memory-card-actions .btn-secondary {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }

  .memory-file-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    margin: 0;
    min-height: 100px;
    background: linear-gradient(135deg, #f0e6d8 0%, #e8dcc8 100%);
    border: 1px dashed #c4a574;
    color: #5c4329;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-radius: 0;
    transition: background 0.2s ease;
  }
  .memory-file-link:hover {
    background: linear-gradient(135deg, #e8dcc8 0%, #e0d0b8 100%);
    color: #4a3728;
  }
  .memory-file-icon {
    font-size: 1.25rem;
  }

  .memory-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(44, 33, 22, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
  }
  .memory-lightbox.hidden {
    display: none;
  }
  .memory-lightbox-content {
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .memory-lightbox-content img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  }
  .memory-lightbox-info {
    color: #f5efe6;
    margin-top: 1rem;
    text-align: center;
    max-width: 420px;
    font-size: 0.95rem;
  }
  .memory-lightbox-info div {
    margin-bottom: 0.25rem;
  }
  #memoryLightboxTitle {
    font-weight: 700;
    font-size: 1.1rem;
  }
  #memoryLightboxMeta {
    color: #d4c4a8;
    font-size: 0.9rem;
  }
  .memory-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(245, 239, 230, 0.15);
    border: 1px solid rgba(245, 239, 230, 0.3);
    color: #f5efe6;
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
  }
  .memory-lightbox-close:hover {
    background: rgba(245, 239, 230, 0.25);
  }
  .memory-lightbox-prev,
  .memory-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(245, 239, 230, 0.15);
    border: 1px solid rgba(245, 239, 230, 0.3);
    color: #f5efe6;
    font-size: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
  }
  .memory-lightbox-prev:hover,
  .memory-lightbox-next:hover {
    background: rgba(245, 239, 230, 0.25);
  }
  .memory-lightbox-prev { left: 12px; }
  .memory-lightbox-next { right: 12px; }

  /* Vacation & Holidays */
  .trip-list-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .trip-card {
    background: linear-gradient(180deg, #fffdf8 0%, #fff7ee 100%);
    border-radius: 18px;
    border: 1px solid var(--border);
    padding: 14px 16px;
    cursor: pointer;
    transition: 0.18s ease;
  }

  .trip-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--accent);
  }

  .trip-card-selected {
    box-shadow: var(--shadow);
    border-color: var(--primary);
  }

  .trip-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
  }

  .trip-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--primary);
  }

  .trip-type {
    font-size: 0.9rem;
    color: var(--muted);
  }

  .trip-countdown {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    white-space: nowrap;
  }

  .trip-countdown-upcoming {
    border-color: var(--primary);
    background: var(--accent-2);
  }

  .trip-countdown-current {
    border-color: var(--success);
    background: rgba(154, 209, 179, 0.2);
  }

  .trip-countdown-past {
    border-color: var(--muted);
    background: #f0e0dc;
  }

  .trip-dates {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .trip-budget-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .trip-doc-row {
    margin: 4px 0 6px;
  }

  .trip-file-link {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-2);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
  }

  .trip-file-link:hover {
    background: var(--accent);
    color: var(--text);
  }

  .trip-notes {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 8px;
  }

  .trip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .packing-list-wrapper,
  .checklist-wrapper {
    min-height: 120px;
  }

  .packing-header {
    font-weight: 700;
    color: var(--primary);
  }

  .packing-list {
    margin: 10px 0 0;
    padding-left: 0;
    list-style: none;
  }

  .packing-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
  }

  .packing-list label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }

  .packing-list input[type="checkbox"] {
    width: auto;
  }

  .packing-done {
    text-decoration: line-through;
    color: var(--muted);
  }
  
  .memory-category-title {
    margin: 14px 0 8px;
    color: #9a6b1a;
    font-weight: 800;
  }
  
  .muted {
    color: var(--muted);
  }
  
  .empty-state {
    color: var(--muted);
    font-style: italic;
  }
  
  .small {
    font-size: 0.92rem;
  }
  
  .calendar-placeholder,
  .expenses-placeholder,
  .vacation-placeholder {
    line-height: 1.7;
  }
  
  .top-gap {
    margin-top: 16px;
  }
  
  .top-gap-lg {
    margin-top: 18px;
  }

  .section-subtitle {
    font-size: 1.1rem;
    margin: 16px 0 10px;
    color: var(--primary);
  }
  .automation-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .automation-item {
    padding: 12px 14px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }
  .automation-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
  }
  .automation-summary {
    margin: 6px 0 10px 0;
    padding-left: 0;
  }
  .automation-actions {
    display: flex;
    gap: 8px;
  }
  .automation-add-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
  }
  .automation-assign-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
  }
  .automation-assign-row select {
    min-width: 120px;
  }
  .automation-assign-row .autoChoreName {
    flex: 1;
    min-width: 100px;
  }
  .automation-edit-form h3 {
    margin-top: 0;
    font-size: 1.15rem;
    color: var(--primary);
  }

  .receipt-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
  }
  .receipt-preview {
    margin-top: 10px;
    display: none;
  }
  .receipt-preview img.receipt-thumb {
    max-width: 160px;
    max-height: 120px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
  }
  .receipt-preview a.receipt-file-link {
    color: var(--primary);
    font-weight: 600;
  }
  .receipt-list-thumb {
    text-decoration: none;
  }

  /* Family Timeline */
  .timeline-wrap {
    margin-top: 20px;
  }
  .timeline-year-block {
    margin-bottom: 32px;
  }
  .timeline-year {
    font-size: 1.75rem;
    color: var(--primary);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
  }
  .timeline-entries {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .timeline-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--card-2) 0%, var(--card) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .timeline-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
  }
  .timeline-card-body {
    flex: 1;
    min-width: 0;
  }
  .timeline-card-meta {
    font-size: 0.85rem;
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
  }
  .timeline-card-title {
    margin: 0;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
  }
  .timeline-card-notes {
    margin: 6px 0 0;
    font-size: 0.9rem;
    line-height: 1.4;
  }
  .timeline-card-media {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-soft);
  }
  .timeline-card-media img.timeline-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .timeline-card-media .timeline-file-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 8px;
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    text-align: center;
  }
  .timeline-card-media .timeline-file-link:hover {
    text-decoration: underline;
  }
  .timeline-memory .timeline-card-body { margin-left: 0; }
  .timeline-memory.has-media .timeline-card-body { margin-left: 0; }
  .timeline-birthday .timeline-card-icon,
  .timeline-trip .timeline-card-icon {
    margin-top: 2px;
  }
  
  @media (max-width: 900px) {
    .two-col {
      grid-template-columns: 1fr;
    }
  }
  
  @media (max-width: 640px) {
    header h1 {
      font-size: 1.7rem;
    }
  
    main {
      padding: 18px 10px 28px;
    }
  
    .welcome-card,
    .section-card,
    .leaderboard-card,
    .dashboard-card,
    .profile-card {
      padding: 16px;
    }
  
    .profile-row {
      padding-right: 0;
    }
  
    .profile-avatar {
      position: static;
      margin-bottom: 12px;
    }
  
    .profile-label {
      min-width: 95px;
    }
  }

  .hidden {
    display: none !important;
  }
  
  .form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  
  .summary-stack {
    display: grid;
    gap: 12px;
  }
  
  .summary-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
  }
  
  .summary-good {
    border-left: 6px solid green;
  }
  
  .summary-over {
    border-left: 6px solid red;
  }
  
  .budget-overview-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-top: 8px;
  }
  .budget-overview-line {
    margin: 0;
    font-size: 0.95rem;
  }
  .budget-overview-card {
    margin-bottom: 0;
  }

  .charts-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .chart-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
  }

  #budgetHistoryBody td {
    background: #fff;
  }

  .profile-photo {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--accent);
    position: absolute;
    top: 16px;
    right: 16px;
    background: #fff;
  }
  
  .inline-field-group {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  
  .inline-field-group input {
    flex: 1;
  }
  
  .header-controls {
    margin-top: 14px;
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
  }

  .mode-switcher {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  
  .mode-switcher label {
    margin: 0;
  }

  .logged-in-parent {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
  }

  .header-user-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .header-user-photo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .logged-in-photo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
  }
  .logged-in-photo-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--card);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
  }
  .btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  .logged-in-photo .logged-in-photo-img,
  .logged-in-photo .logged-in-photo-avatar {
    flex-shrink: 0;
  }
  
  .activity-log-list .table-wrap {
    margin-top: 8px;
  }
  
  .activity-log-list table {
    font-size: 0.9rem;
  }
  
  .parent-only-hidden {
    display: none !important;
  }

  .kid-only-hidden {
    display: none !important;
  }

  #kidLoginScreen,
  .parent-login-screen {
    margin-bottom: 16px;
  }
  #dashboardParentBarWrap,
  #dashboardKidSelectorWrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
  }
  #dashboardParentBarWrap .logged-in-photo-img,
  #dashboardKidSelectorWrap .logged-in-photo-img {
    width: 40px;
    height: 40px;
  }
  #dashboardParentBarWrap .logged-in-photo-avatar,
  #dashboardKidSelectorWrap .logged-in-photo-avatar {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .kid-login-card {
    padding: 24px;
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 320px;
  }
  .kid-login-card h3 {
    margin: 0 0 8px;
  }
  .kid-login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
  }
  .kid-login-form .form-group {
    margin: 0;
  }
  .kid-login-form select,
  .kid-login-form input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-size: 1rem;
  }
  .kid-login-form .btn-primary {
    width: 100%;
    justify-content: center;
  }
  #dashboardKidSelectorWrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
  }
  .kid-logged-in-label {
    font-weight: 700;
    color: var(--text);
  }

  .bible-verse-line {
    margin-top: 4px;
    font-style: italic;
  }

  .overdue-banner {
    margin: 12px 0;
    padding: 12px 16px;
    background: var(--warning);
    color: var(--text);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .overdue-banner-link {
    font-weight: 600;
    text-decoration: underline;
    color: var(--text);
  }
  .dashboard-kid-view {
    margin-top: 16px;
    padding: 24px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }
  .dashboard-kid-view .kid-view-section {
    margin-bottom: 24px;
  }
  .dashboard-kid-view .kid-view-section h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    color: var(--primary);
  }
  .dashboard-kid-view .overdue-callout {
    background: rgba(255, 209, 102, 0.25);
    border: 1px solid var(--warning);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
  }

  .medical-panel-wrap {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .medical-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
  }
  .medical-panel-inner {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }
  .medical-panel-inner .section-title { margin-top: 0; }
  .medical-info-fields .form-group { margin-bottom: 14px; }
  .medical-info-value { margin: 4px 0 0; }
  .medical-panel-actions { margin-top: 20px; display: flex; gap: 10px; }

  .wishlist-list { list-style: none; padding: 0; margin: 0; }
  .wishlist-item { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .wishlist-owner { font-weight: 600; }
  .reports-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 12px;
    margin-bottom: 8px;
    align-items: flex-end;
  }
  .reports-filters .form-group {
    margin-bottom: 0;
  }
  .reports-filters .reports-date-range {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  @media (max-width: 720px) {
    .reports-filters {
      flex-direction: column;
      align-items: stretch;
    }
  }
  .reports-report-select {
    margin-top: 8px;
    margin-bottom: 8px;
  }
  .reports-subfilters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: flex-end;
  }
  .reports-subfilters .form-group {
    margin-bottom: 0;
  }
  .reports-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
  #reportsKpiChoresWrap,
  #reportsKpiSpendingWrap,
  #reportsKpiPointsWrap {
    display: contents;
  }
  .reports-kpi-card {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
  }
  .reports-kpi-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .reports-kpi-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
  }
  .reports-chart {
    margin-top: 8px;
  }
  .reports-donut {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    margin: 8px auto;
  }
  .reports-donut-hole {
    position: absolute;
    inset: 22%;
    border-radius: 50%;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px;
  }
  .reports-donut-label {
    font-size: 0.8rem;
    line-height: 1.2;
    color: var(--text);
  }
  .reports-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 140px;
    border-top: 1px solid var(--border);
    padding-top: 6px;
  }
  .reports-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
  }
  .reports-bar-stack {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
    height: 100%;
  }
  .reports-bar-inner,
  .reports-bar-inner-secondary {
    flex: 1;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
  }
  .reports-bar-inner-secondary {
    background: var(--accent);
  }
  .reports-bar-label {
    margin-top: 4px;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .reports-bar-value {
    font-weight: 600;
  }
  .reports-chart-legend {
    margin-top: 6px;
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--muted);
  }
  .reports-donut-legend {
    flex-wrap: wrap;
    margin-top: 8px;
  }
  .reports-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .reports-chart-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--primary);
  }
  .reports-chart-legend-swatch.secondary {
    background: var(--accent);
  }
  .reports-card { padding: 16px; background: var(--bg-soft); border-radius: 12px; }
  .reports-title { margin-top: 0; }
  .reports-period { margin-top: 4px; margin-bottom: 8px; }
  .report-actions { margin-top: 12px; }

  /* FCC report layout baseline: preserve current print/screen structure; future changes should extend, not replace. */
  /* ── FCC shared report layout (Expense/Budget + Behavior Reports) ───────── */
  .fcc-report-card {
    background: #fff;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, rgba(0,0,0,.08));
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
  }
  .fcc-report-header { margin: 0 0 2px; font-size: 1.15rem; font-weight: 700; }
  .fcc-report-subtitle { margin: 0 0 4px; font-size: 0.95rem; color: var(--muted, #555); }
  .fcc-report-meta { margin: 0 0 8px; font-size: 0.875rem; color: var(--muted, #555); }
  .fcc-report-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 10px;
    align-items: center;
  }
  .fcc-report-summary-chip {
    padding: 6px 10px;
    background: var(--bg-soft, #f5f5f5);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
  }
  .fcc-report-section {
    margin-bottom: 12px;
  }
  .fcc-report-section:last-child { margin-bottom: 0; }
  .fcc-report-section h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
  .fcc-report-table-wrap {
    overflow-x: auto;
    margin: 6px 0;
  }
  .fcc-report-table-wrap table,
  .fcc-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
  }
  .fcc-report-table-wrap th,
  .fcc-report-table-wrap td,
  .fcc-report-table th,
  .fcc-report-table td {
    border: 1px solid var(--border, rgba(0,0,0,.1));
    padding: 6px 8px;
    text-align: left;
  }
  .fcc-report-table-wrap th,
  .fcc-report-table th { background: var(--bg-soft, #f5f5f5); font-weight: 600; }
  .fcc-report-table-wrap td.numeric,
  .fcc-report-table td.numeric { text-align: right; }
  .fcc-report-chart-wrap {
    margin-top: 8px;
    margin-bottom: 8px;
    text-align: center;
    max-width: 100%;
  }
  .fcc-report-chart-wrap .reports-donut,
  .fcc-report-chart-wrap .reports-bar-chart { margin-left: auto; margin-right: auto; }
  .fcc-report-chart-wrap .reports-chart-legend { justify-content: center; flex-wrap: wrap; gap: 8px; }
  .fcc-report-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border, rgba(0,0,0,.06)); }
  .fcc-report-print-btn { margin-right: 8px; }

  .print-report-container {
    display: none;
  }

  .print-report-page {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    color: #000000;
  }
  .print-report-header {
    margin-bottom: 16px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
  }
  .print-app-title {
    font-size: 1.4rem;
    margin: 0 0 4px;
  }
  .print-report-title {
    font-size: 1.2rem;
    margin: 0 0 4px;
  }
  .print-report-period {
    margin: 0 0 4px;
  }
  .print-report-footer {
    margin-top: 16px;
    text-align: right;
  }

  /* FCC print baseline: preserve current compact report print layout; future changes should refine page fit and chart containment, not replace the structure. */
  @media print {
    body.printing-report {
      background: #ffffff !important;
    }
    body.printing-report .sidebar-nav,
    body.printing-report .fcc-header,
    body.printing-report #loginView,
    body.printing-report .main-with-sidebar > *:not(#printReportContainer) {
      display: none !important;
    }
    body.printing-report #printReportContainer {
      display: block !important;
      padding: 20px;
    }
    body.printing-report #printReportContainer * {
      box-shadow: none !important;
      border-radius: 0 !important;
      background: #ffffff !important;
    }
    /* SVG rect fills are not CSS backgrounds — they are unaffected by the
       rule above and will always render their fill colors in print.     */
  }

  .my-points-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 4px;
  }
  .my-goals-text {
    margin: 0;
    line-height: 1.4;
  }

  /* Calendar */
  .calendar-subtitle {
    margin-top: -8px;
    margin-bottom: 16px;
  }
  .calendar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }
  .calendar-filters-trigger-wrap {
    margin-bottom: 10px;
  }
  .calendar-filters-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    min-height: 44px;
    padding: 8px 16px;
  }
  .calendar-filters-trigger-icon {
    font-size: 1.1rem;
  }
  .calendar-filters-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    background: var(--primary, #b5838d);
    color: #fff;
    border-radius: 999px;
  }
  .calendar-filters-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    touch-action: none;
  }
  .calendar-filters-popup {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--card);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .calendar-filters-popup-inner {
    padding: 20px 20px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .calendar-filters-popup-title {
    margin: 0 0 16px;
    font-size: 1.25rem;
  }
  .calendar-filters-popup-body {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
  }
  .calendar-filters-popup-body .calendar-filter-pill {
    min-height: 44px;
    padding: 8px 14px;
  }
  .calendar-filters-popup-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  .calendar-filters-popup-actions .btn-primary,
  .calendar-filters-popup-actions .btn-secondary {
    flex: 1;
    min-height: 44px;
  }
  @media (min-width: 768px) {
    .calendar-filters-popup {
      left: 50%;
      right: auto;
      bottom: auto;
      top: 50%;
      transform: translate(-50%, -50%);
      border-radius: 18px;
      max-width: 400px;
      max-height: 90vh;
    }
  }
  .calendar-tools-trigger-wrap {
    margin-top: 10px;
    margin-bottom: 0;
  }
  .calendar-tools-btn {
    min-height: 44px;
    min-width: 120px;
    padding: 10px 16px;
  }
  .calendar-tools-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    touch-action: none;
  }
  .calendar-tools-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--card);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .calendar-tools-panel-inner {
    padding: 20px 20px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .calendar-tools-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
  }
  .calendar-tools-panel-title {
    margin: 0;
    font-size: 1.25rem;
  }
  .calendar-tools-section {
    margin-bottom: 24px;
  }
  .calendar-tools-section:last-child {
    margin-bottom: 0;
  }
  .calendar-tools-section-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 600;
  }
  .calendar-tools-section .calendar-filters-popup-body {
    margin-bottom: 12px;
  }
  .calendar-tools-section .calendar-filters-popup-actions .btn-primary,
  .calendar-tools-section .calendar-filters-popup-actions .btn-secondary {
    min-height: 44px;
  }
  .calendar-tools-section .calendar-seed-actions h4 {
    margin: 0 0 8px;
  }
  .calendar-tools-section.calendar-seed-actions .btn-secondary {
    min-height: 44px;
    margin-right: 8px;
    margin-bottom: 8px;
  }
  @media (min-width: 768px) {
    .calendar-tools-panel {
      left: 50%;
      right: auto;
      bottom: auto;
      top: 50%;
      transform: translate(-50%, -50%);
      border-radius: 18px;
      max-width: 420px;
      max-height: 90vh;
    }
  }
  .calendar-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--bg-soft, #f0f0f0);
    border: 1px solid var(--border, #eee);
  }
  .calendar-filter-pill input {
    margin: 0;
  }
  .calendar-filter-pill:has(input:checked) {
    background: var(--primary-light, #e8d5d9);
    border-color: var(--primary, #b5838d);
  }

  /* Dashboard widget visibility popup (mobile: bottom sheet) */
  .dashboard-widgets-actions {
    display: none;
    margin: 0 0 12px;
    padding: 0;
  }
  .dashboard-widgets-actions[data-visible="true"] {
    display: block;
  }
  .dashboard-manage-widgets-btn {
    min-height: 44px;
    min-width: 160px;
    padding: 10px 16px;
    font-size: 1rem;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
  }
  .dashboard-widgets-popup-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 8px;
  }
  .dashboard-widgets-popup-bulk-actions .btn-small {
    min-height: 44px;
    min-width: 120px;
    padding: 8px 14px;
  }
  .dashboard-empty-state { padding: 16px; text-align: center; }
  .dashboard-empty-state .btn-link { font-size: 1rem; }
  .dashboard-widgets-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    touch-action: none;
  }
  .dashboard-widgets-popup {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--card);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dashboard-widgets-popup-inner {
    padding: 20px 20px 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .dashboard-widgets-popup-title { margin: 0 0 8px; font-size: 1.25rem; }
  .dashboard-widgets-popup-list,
  #dashboardWidgetsPopupList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0 20px;
    max-height: 50vh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .dashboard-widgets-popup-list .widget-toggle-row,
  #dashboardWidgetsPopupList .widget-toggle-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 8px 4px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
  }
  .dashboard-widgets-popup-list .widget-toggle-row input,
  #dashboardWidgetsPopupList .widget-toggle-row input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
  }
  .dashboard-widgets-popup-list .widget-toggle-row label,
  #dashboardWidgetsPopupList .widget-toggle-row label {
    flex: 1 1 auto;
    min-width: 0;
  }
  .dashboard-widgets-popup-list .widget-move-btn,
  #dashboardWidgetsPopupList .widget-move-btn {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 10px;
  }
  .dashboard-widgets-popup-list .widget-toggle-label,
  #dashboardWidgetsPopupList .widget-toggle-label {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    color: var(--text) !important;
    font-size: 15px;
    line-height: 1.35;
    text-indent: 0;
    position: static;
  }
  .dashboard-widgets-popup-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
  }
  .dashboard-widgets-popup-actions .btn-primary,
  .dashboard-widgets-popup-actions .btn-secondary { flex: 1; min-height: 44px; }
  @media (min-width: 768px) {
    .dashboard-widgets-popup {
      left: 50%;
      right: auto;
      bottom: auto;
      top: 50%;
      transform: translate(-50%, -50%);
      border-radius: 18px;
      max-width: 420px;
      max-height: 90vh;
    }
  }
  .meals-import-details { margin-top: 8px; }

  /* School Portal (Aeries phase 1) */
  .school-portal-card { margin-top: 12px; }
  .school-portal-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
  .school-portal-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
  .school-portal-actions .btn-primary,
  .school-portal-actions .btn-secondary { min-height: 44px; }
  .school-portal-embed-wrap { margin-top: 16px; border: 1px solid var(--border, #eee); border-radius: 8px; overflow: hidden; }
  .school-portal-iframe { width: 100%; height: 420px; border: 0; display: block; }
  .school-portal-embed-fallback { padding: 16px; background: var(--bg-soft, #f5f5f5); }
  .school-portal-embed-fallback .btn-primary { margin-top: 8px; }
  .school-portal-notes textarea { min-height: 80px; }

  .school-portal-grades h3 { margin-top: 0; }
  .grades-form-grid { row-gap: 10px; }
  .grades-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
  }
  .grades-form-actions .btn-primary,
  .grades-form-actions .btn-secondary {
    min-height: 44px;
    flex: 1;
  }
  .grades-list {
    border-top: 1px solid var(--border, #eee);
    margin-top: 12px;
    padding-top: 8px;
  }
  .grades-list-empty {
    padding: 8px 0;
  }
  .grades-child-group {
    margin-top: 8px;
    padding-top: 8px;
  }
  .grades-child-header {
    font-weight: 600;
    margin-bottom: 4px;
  }
  .grade-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #eee);
  }
  .grade-row-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
  }
  .grade-row-meta {
    font-size: 0.8rem;
    color: var(--muted, #777);
    margin-top: 2px;
  }
  .grade-row-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
  }
  .grade-row-actions button {
    min-height: 36px;
    padding-inline: 10px;
  }
  .grades-summary {
    font-size: 0.85rem;
    color: var(--muted, #555);
  }
  .grades-summary-list {
    margin-top: 4px;
  }
  .grades-summary-item {
    margin: 2px 0;
  }

  /* Report cards upload + list */
  .school-portal-report-upload h3,
  .school-portal-report-list h3,
  .school-portal-report-viewer h3 {
    margin-top: 0;
  }
  .report-form-grid {
    row-gap: 10px;
  }
  .report-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
  }
  .report-form-actions .btn-primary,
  .report-form-actions .btn-secondary {
    min-height: 44px;
    flex: 1;
  }
  .report-list {
    font-size: 0.9rem;
  }
  .report-list-empty {
    padding: 8px 0;
  }
  .report-child-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border, #eee);
  }
  .report-child-header {
    font-weight: 600;
    margin-bottom: 4px;
  }
  .report-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border, #eee);
  }
  .report-row-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
  }
  .report-row-meta {
    font-size: 0.8rem;
    color: var(--muted, #777);
    margin-top: 2px;
  }
  .report-row-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
  }
  .report-row-actions button {
    min-height: 36px;
    padding-inline: 10px;
  }
  .report-viewer-preview img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
  }
  .report-viewer-preview iframe {
    width: 100%;
    height: 360px;
    border: 0;
    border-radius: 8px;
  }
  .report-viewer-meta {
    line-height: 1.4;
  }
  .report-viewer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .report-viewer-actions .btn-secondary,
  .report-viewer-actions .btn-primary {
    min-height: 40px;
    flex: 1;
  }
  .report-error {
    margin-top: 6px;
    color: var(--danger, #c00);
  }
  .meals-import-summary { cursor: pointer; font-weight: 600; }
  .meals-preview-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
  .meals-preview-table th, .meals-preview-table td { border: 1px solid var(--border, #eee); padding: 6px 8px; text-align: left; }
  .meals-preview-table th { background: var(--bg-soft, #f5f5f5); }
  .meals-import-msg { margin-top: 6px; }

  .calendar-meals-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 4px;
  }
  .calendar-meals-legend-footer {
    margin-top: 12px;
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 1px solid var(--border, #eee);
    max-width: 100%;
  }
  .calendar-meals-legend-footer .calendar-meals-legend-chip {
    flex-shrink: 0;
  }
  .calendar-meals-legend-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid rgba(0,0,0,.08);
  }
  .calendar-meals-legend-breakfast { background-color: #FFF3B0; color: #1a1a1a; }
  .calendar-meals-legend-lunch { background-color: #FFD6A5; color: #1a1a1a; }

  .day-detail-meal {
    padding: 4px 8px !important;
    margin: 2px 0;
    border-radius: 6px;
    font-size: 0.9rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .day-detail-meal--breakfast { background-color: #FFF3B0; color: #1a1a1a; }
  .day-detail-meal--lunch { background-color: #FFD6A5; color: #1a1a1a; }
  .day-detail-event-colored { padding: 4px 8px; border-radius: 6px; margin: 2px 0; font-size: 0.9rem; }

  .todays-meals-profile { margin-bottom: 10px; }
  .todays-meals-profile-name { font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
  .todays-meals-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin: 4px 0; font-size: 0.9rem; }
  .todays-meals-label { flex: 0 0 auto; min-width: 90px; }
  .todays-meals-value { flex: 1 1 auto; word-break: break-word; }
  .todays-meals-tomorrow { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border, #eee); }
  .todays-meals-empty { margin: 0; }
  .todays-meals-no-school { font-weight: 600; margin: 0 0 4px 0; }

.daily-briefing-content { margin: 0; }
.daily-briefing-text {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Unified selected state for appearance/skin options */
.skin-preset-btn.is-selected,
.skin-presets-row .skin-preset-btn.is-selected {
  background: var(--settings-selected-bg);
  border-color: var(--settings-selected-border);
  color: var(--settings-selected-text);
  font-weight: 600;
}

.skin-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skin-colors-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skin-preset-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.appearance-summary {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-bg, var(--bg-soft));
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
}

.appearance-summary p { margin: 0 0 4px 0; }
.appearance-summary p:last-child { margin-bottom: 0; }

.skin-color-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.skin-color-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.skin-color-row input[type="color"] {
  width: 40px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border, #ddd);
  border-radius: 4px;
  background: transparent;
}

.skin-image-preview {
  border-radius: 12px;
  border: 1px dashed var(--border, #ddd);
  padding: 8px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skin-image-preview-thumb {
  width: 100%;
  max-width: 260px;
  height: 80px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
}

.skin-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fcc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--card-bg, var(--card));
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,0.15));
  font-size: 0.9rem;
  z-index: 10000;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
  pointer-events: none;
}

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

.widget-school-meals .todays-lunch-profile {
  margin-bottom: 10px;
}

.widget-school-meals .todays-lunch-name {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--primary);
}

.widget-school-meals .todays-lunch-main {
  margin: 4px 0;
  line-height: 1.4;
}

.widget-school-meals .todays-lunch-empty {
  margin: 0 0 4px 0;
}

  .calendar-meals-status .meals-status-section {
    margin-top: 6px;
  }
  .calendar-meals-status .meals-status-list {
    list-style: none;
    padding-left: 0;
    margin: 2px 0 0 0;
    font-size: 0.85rem;
  }
  .calendar-meals-status .meals-status-list li {
    margin: 2px 0;
  }

  .calendar-nav {
    min-width: 90px;
  }
  .calendar-month-year {
    margin: 0;
    min-width: 180px;
    text-align: center;
    color: var(--primary);
    font-size: 1.35rem;
  }
  .calendar-grid-wrap {
    margin-bottom: 24px;
  }
  .calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--muted);
    text-align: center;
  }
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
  }
  .calendar-day {
    aspect-ratio: 1;
    max-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 4px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: 0.18s ease;
    font-weight: 600;
    font-size: 0.95rem;
  }
  .calendar-day:hover {
    background: var(--accent-2);
    border-color: var(--accent);
  }
  .calendar-day-other {
    background: var(--bg-soft);
    color: var(--muted);
    opacity: 0.85;
  }
  .calendar-day-today {
    border-color: var(--primary);
    background: linear-gradient(180deg, var(--accent-2) 0%, var(--card) 100%);
    box-shadow: 0 0 0 2px var(--primary);
  }
  .calendar-day-has-events .calendar-day-dots {
    display: flex;
  }
  .calendar-day-num {
    line-height: 1.2;
  }
  .calendar-day-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    margin-top: 2px;
    font-size: 0.75rem;
  }
  .calendar-dot {
    line-height: 1;
  }
  .calendar-day-detail {
    margin-top: 8px;
    padding: 18px 22px;
  }
  .day-detail-title {
    margin: 0 0 14px;
    color: var(--primary);
    font-size: 1.2rem;
  }
  .day-detail-content {
    min-height: 60px;
  }
  .day-detail-block {
    margin-bottom: 18px;
  }
  .day-detail-block:last-child {
    margin-bottom: 0;
  }
  .day-detail-block h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--text);
  }
  .day-detail-list {
    margin: 0;
    padding-left: 20px;
  }
  .day-detail-list li {
    margin-bottom: 6px;
  }
  .day-detail-total {
    margin-top: 6px;
    list-style: none;
    padding-left: 0;
    border-top: 1px solid var(--border);
    padding-top: 6px;
  }

  /* FCC Calendar mobile layout fix */
  #calendar,
  #calendar .section-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  @media (max-width: 768px) {
    /* FCC Calendar mobile layout fix: contain calendar within viewport */
    #calendar {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      min-width: 0;
    }
    #calendar .section-card {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
      padding-left: 12px;
      padding-right: 12px;
      min-width: 0;
    }
    #calendar .calendar-controls {
      gap: 12px;
      margin-bottom: 12px;
    }
    #calendar .calendar-month-year {
      min-width: 0;
      font-size: 1.15rem;
    }
    #calendar .calendar-grid-wrap {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
      margin-bottom: 20px;
      overflow: hidden;
    }
    #calendar .calendar-weekdays {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 2px;
      margin-bottom: 4px;
      font-size: 0.7rem;
      font-weight: 700;
      color: var(--muted);
      text-align: center;
    }
    #calendar .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 4px;
      min-width: 0;
    }
    #calendar .calendar-day {
      aspect-ratio: 1;
      max-height: 56px;
      min-height: 0;
      padding: 4px 2px;
      font-size: 0.8rem;
      border-radius: 8px;
    }
    #calendar .calendar-day-num {
      line-height: 1.1;
    }
    #calendar .calendar-day-dots {
      font-size: 0.65rem;
      gap: 1px;
      margin-top: 1px;
    }
    #calendar .calendar-dot {
      font-size: 0.65rem;
    }
    #calendar .calendar-day-detail {
      padding: 14px 12px;
      margin-top: 8px;
    }
    #calendar .calendar-subtitle {
      margin-bottom: 12px;
    }
  }

  @media (max-width: 480px) {
    /* FCC Calendar mobile layout fix: iPhone SE / small screens */
    #calendar .section-card {
      padding-left: 10px;
      padding-right: 10px;
    }
    #calendar .calendar-controls {
      gap: 8px;
      margin-bottom: 10px;
    }
    #calendar .calendar-month-year {
      font-size: 1rem;
    }
    #calendar .calendar-nav {
      padding: 6px 10px;
      font-size: 0.85rem;
    }
    #calendar .calendar-grid-wrap {
      margin-bottom: 16px;
    }
    #calendar .calendar-weekdays {
      gap: 2px;
      font-size: 0.65rem;
    }
    #calendar .calendar-grid {
      gap: 3px;
    }
    #calendar .calendar-day {
      max-height: 48px;
      padding: 3px 2px;
      font-size: 0.75rem;
      border-radius: 6px;
    }
    #calendar .calendar-day-dots {
      font-size: 0.6rem;
    }
    #calendar .calendar-dot {
      font-size: 0.6rem;
    }
  }

  .reward-balance {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--accent-2);
    border-radius: 12px;
    border: 1px solid var(--border);
  }
  .reward-balance-text {
    margin: 0;
    font-size: 1.05rem;
  }
  .reward-store-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .reward-store-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
  }
  .reward-store-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
  }
  .reward-store-name {
    flex: 1;
    font-weight: 600;
    color: var(--text);
  }
  .reward-store-cost {
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
  }
  .reward-store-action {
    flex-shrink: 0;
  }
  .reward-manage-list ul.reward-store-list .reward-store-item {
    margin-bottom: 8px;
  }

  .meeting-focus-title {
    margin: 20px 0 12px;
    font-size: 1.15rem;
    color: var(--primary);
  }
  .meeting-add-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }
  .meeting-add-wrap input {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 1rem;
  }
  .meeting-focus-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .meeting-focus-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
  }
  .meeting-focus-bullet {
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
  }
  .meeting-focus-text {
    flex: 1;
  }
  .meeting-focus-by {
    flex-shrink: 0;
  }
  .meeting-focus-action {
    margin-left: auto;
  }

  .weekly-report-stats {
    margin: 0 0 8px;
  }
  .weekly-report-stats p {
    margin: 6px 0;
  }

  .weekly-summary-stats {
    margin: 0 0 12px;
  }
  .weekly-summary-stats p {
    margin: 6px 0;
  }
  .weekly-summary-highlight {
    word-break: break-word;
  }

  .widget-parent-action-center .pac-section {
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border, #eee);
  }
  .widget-parent-action-center .pac-section:last-of-type {
    border-bottom: none;
  }
  .widget-parent-action-center .pac-section-muted .pac-label {
    font-weight: 500;
    color: var(--text-muted, #666);
  }
  .widget-parent-action-center .pac-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
  }
  .widget-parent-action-center .pac-label {
    font-weight: 600;
  }
  .widget-parent-action-center .pac-count {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-soft, #f0f0f0);
    color: var(--text, #333);
  }
  .widget-parent-action-center .pac-count-urgent {
    background: #f8d7da;
    color: #721c24;
  }
  .widget-parent-action-center .pac-pill {
    font-size: 11px;
    color: var(--text-muted, #666);
  }
  .widget-parent-action-center .pac-empty {
    margin: 4px 0 6px;
    font-size: 13px;
    color: var(--text-muted, #666);
  }
  .widget-parent-action-center .pac-item {
    margin: 2px 0;
    font-size: 13px;
    word-break: break-word;
  }
  .widget-parent-action-center .pac-sub {
    margin: 4px 0 6px;
    font-size: 12px;
    color: var(--text-muted, #666);
  }
  .widget-parent-action-center .pac-action-btn {
    margin-top: 6px;
    font-size: 12px;
    padding: 4px 10px;
  }

  .achievements-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
  }
  .achievement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
  }
  .achievement-unlocked {
    border-color: var(--primary);
  }
  .achievement-locked {
    opacity: 0.75;
  }
  .achievement-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
  }
  .achievement-name {
    font-weight: 600;
  }
  .achievements-kid-title {
    margin: 20px 0 8px;
    font-size: 1.1rem;
    color: var(--primary);
  }
  .achievements-kid-title:first-of-type {
    margin-top: 0;
  }

  .login-view-values {
    margin-bottom: 20px;
  }
  .login-view-values-card {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--card) 0%, var(--accent-2) 100%);
    border-radius: var(--radius);
    border: 2px solid var(--primary);
    text-align: center;
  }
  .login-view-values-title {
    margin: 0 0 16px;
    font-size: 1.35rem;
    color: var(--primary);
  }
  .values-list-login {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
  }
  .values-list-login li {
    margin-bottom: 8px;
  }
  .values-list-login li:last-child {
    margin-bottom: 0;
  }

  .values-display-card .values-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
  }
  .values-display-card .value-item {
    padding: 14px 18px;
    margin-bottom: 10px;
    background: var(--accent-2);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
  }
  .values-manage-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
  }
  .value-manage-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: var(--bg-soft);
    border-radius: 10px;
  }
  .value-manage-item .value-remove-btn {
    flex-shrink: 0;
  }

  .daily-verse-card {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
  }
  .daily-verse-card.sunday-verse {
    background: linear-gradient(180deg, #fff4f0 0%, #fffaf9 100%);
    border-color: var(--accent);
  }
  .daily-verse-title {
    margin: 0 0 14px;
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
  }
  .daily-verse-text {
    margin: 0 0 12px;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--text);
  }
  .daily-verse-ref {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
  }
  .daily-verse-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }
  .daily-verse-tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--accent-2);
    border: 1px solid var(--border);
    border-radius: 999px;
  }
  .daily-verse-reflection {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .daily-verse-reflection-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
  }
  .daily-verse-reflection-text {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--text);
    font-style: italic;
  }

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


/* Chore point values */
.read-only-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: inherit;
}

.chore-points-task {
  font-weight: 600;
}

.chore-points-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chore-points-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  font-weight: 600;
}

.chore-points-empty {
  padding: 18px 0;
  opacity: 0.75;
}

#chorePoints .btn-inline {
  margin-right: 8px;
}


/* Expense page cleanup */
.expenses-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.expense-form-card,
.expense-summary-card {
  align-self: start;
}

.expense-card-header {
  margin-bottom: 16px;
}

.expense-card-copy {
  margin: 6px 0 0;
  max-width: 48ch;
  line-height: 1.5;
}

.expense-form-clean {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.expense-form-section {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.28);
}

.expense-form-section-title {
  margin: 0 0 14px;
  font-size: 1rem;
  color: var(--primary);
}

.expense-main-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.expense-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.inline-field-group--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.expense-delete-category-group {
  align-self: end;
}

/* Destructive action (delete/remove) – keep distinct from theme Button color */
.btn-secondary-dangerish {
  min-height: 46px;
  width: 100%;
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}
.btn-secondary-dangerish:hover {
  filter: brightness(1.1);
  background: var(--danger) !important;
  color: #fff !important;
}

.expense-notes-grid textarea {
  min-height: 110px;
}

.expense-receipt-group input[type="file"] {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.expense-form-actions {
  justify-content: flex-start;
  gap: 12px;
}

.expense-summary-card {
  position: sticky;
  top: 18px;
}

.expense-summary-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.expense-summary-stack > * {
  margin-top: 0 !important;
}

.expense-summary-actions .btn-secondary {
  min-width: 220px;
}

@media (max-width: 980px) {
  .expenses-layout {
    grid-template-columns: 1fr;
  }

  .expense-summary-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .expense-main-grid,
  .expense-category-grid {
    grid-template-columns: 1fr;
  }

  .inline-field-group--split {
    grid-template-columns: 1fr;
  }

  .expense-summary-actions .btn-secondary,
  .btn-secondary-dangerish {
    width: 100%;
  }
}


/* Expense receipt + OCR placement cleanup */
.expense-receipt-section {
  order: 2;
}

.expense-category-section {
  order: 3;
}

.receipt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.expense-receipt-group .muted.small {
  display: block;
  margin-top: 8px;
}

.expense-receipt-group #readReceiptBtn {
  white-space: nowrap;
}

/* Family Profiles: kid read-only and editable styling */
.profile-field-input:disabled,
.profile-field-input[readonly] {
  background: var(--bg-soft);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.9;
}

.profile-kid-helper {
  grid-column: 1 / -1;
}

.profile-edit-photo-row input[type="file"] {
  padding: 8px 12px;
  min-height: 44px;
}

@media (max-width: 640px) {
  .profile-edit-photo-row input[type="file"] {
    min-height: 48px;
  }
}

.profile-color-row {
  align-items: flex-end;
}

.profile-color-picker {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
}

.chore-due-display {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Family Values dashboard chips */
.family-values-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.family-value-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.family-values-section-title {
  margin: 0 0 8px;
  font-size: 1rem;
}

/* Kids dashboard Smart Widgets */
.smart-widgets-section {
  margin-top: 16px;
}

.smart-widgets-section h3 {
  margin: 0 0 12px;
}

.smart-widgets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.smart-widget-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  min-height: 80px;
}

.smart-widget-card--highlight {
  border-left: 4px solid var(--primary);
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.06);
}

.smart-widget-icon {
  font-size: 1.25rem;
  display: block;
  margin-bottom: 6px;
}

.smart-widget-title {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.smart-widget-message {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
}

.smart-widget-sub {
  margin: 4px 0 0;
}

.smart-widget-progress {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}

.smart-widget-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.2s ease;
}

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

  .smart-widget-card {
    min-height: 72px;
    padding: 12px;
  }
}

/* FCC Security: parent override modal */
.fcc-override-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.fcc-override-modal {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.fcc-override-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.fcc-override-message {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.fcc-override-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.fcc-override-actions .btn-primary,
.fcc-override-actions .btn-secondary {
  flex: 1;
  min-height: 44px;
}

.fcc-override-error {
  margin-top: 12px;
  color: var(--danger, #c00);
}

.security-log-list {
  overflow-x: auto;
}

.security-log-list .table {
  width: 100%;
  min-width: 480px;
}

/* FCC Login: role choose + keypad */
.login-role-section {
  margin-bottom: 1rem;
}
.login-role-title {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  color: var(--muted);
}
.login-profile-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.login-profile-btn {
  min-height: 44px;
  min-width: 80px;
  padding: 10px 16px;
  font-size: 1rem;
  border-radius: 12px;
}
.login-pin-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.login-pin-display-wrap {
  text-align: center;
  margin-bottom: 1rem;
  min-height: 2rem;
}
.login-pin-dots {
  font-size: 1.5rem;
  letter-spacing: 0.25em;
  color: var(--text);
}
/* iPhone Safari: 16px+ and large tap targets prevent zoom on tap */
.login-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 280px;
  margin: 0 auto 1rem;
}
.login-keypad-btn {
  min-height: 52px;
  min-width: 52px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid var(--button-border, var(--border));
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.login-keypad-btn:hover, .login-keypad-btn:focus {
  filter: brightness(1.08);
}
@media (max-width: 480px) {
  .login-keypad {
    gap: 14px;
    max-width: 100%;
  }
  .login-keypad-btn {
    min-height: 56px;
    min-width: 56px;
    font-size: 18px;
  }
}
.login-pin-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.login-pin-error {
  margin-top: 8px;
  color: var(--danger, #c00);
}
.login-locked-wrap {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border, #eee);
  border-radius: 12px;
  background: var(--bg-soft, #f8f8f8);
}
.login-locked-message {
  margin: 0 0 12px;
  font-size: 0.95rem;
}
.login-locked-code {
  margin: 0 0 16px;
}
.login-locked-wrap .btn-primary {
  min-height: 44px;
}
.security-locked-section {
  margin-bottom: 24px;
}
.security-locked-section h4 { margin: 0 0 8px; }
.security-locked-list { margin: 8px 0 0; padding-left: 0; list-style: none; }
.security-locked-list li { margin-bottom: 4px; }
.security-locked-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 0; border-bottom: 1px solid var(--border, #eee); }
.security-locked-row:last-child { border-bottom: none; }
.security-locked-info { flex: 1 1 auto; min-width: 0; }
.security-unlock-btn { flex: 0 0 auto; min-height: 44px; }
.login-cooldown-message { margin-top: 8px; color: var(--warning, #b8860b); }
.login-biometric-wrap {
  margin-bottom: 12px;
}
/* Parent PIN text input: 16px prevents iPhone Safari zoom on focus */
.login-parent-pin-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.login-parent-pin-input {
  font-size: 16px;
  min-height: 48px;
  padding: 12px 16px;
  flex: 1;
  min-width: 120px;
}
.login-keypad-toggle-wrap {
  margin: 0 0 8px;
  font-size: 14px;
}
.login-keypad-toggle-wrap .btn-link {
  background: none;
  border: none;
  color: var(--primary, #6d4c5c);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
  font-size: 16px;
}

/* FCC Messages page */
.nav-badge {
  display: inline-block;
  min-width: 1.2em;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 4px;
}
.messages-page-card { max-width: 100%; overflow-x: hidden; }
.messages-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.messages-page-title { margin: 0; }
.messages-header-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5em; min-height: 1.5em; padding: 4px 8px; border-radius: 999px;
  font-size: 0.875rem; font-weight: 600; background: var(--primary, #6d4c5c); color: #fff;
}
.messages-page-desc { margin-bottom: 16px; }
.messages-filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.messages-pill {
  min-height: 44px; padding: 10px 16px; border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 999px; background: var(--card-bg, #fff); color: var(--text, #333);
  font-size: 0.9375rem; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.messages-pill:hover, .messages-pill:focus { background: var(--hover-bg, #f5f5f5); }
.messages-pill--active { background: var(--primary, #6d4c5c); color: #fff; border-color: var(--primary, #6d4c5c); }
.messages-compose-wrap { margin-bottom: 24px; }
.messages-new-message-btn { min-height: 48px; padding: 12px 24px; font-size: 1rem; }
.messages-compose-card {
  border: 1px solid var(--border-color, #e0e0e0); border-radius: 8px; padding: 1rem; margin-top: 12px;
}
.messages-compose-card--collapsed { display: none !important; }
.messages-compose-card:not(.messages-compose-card--collapsed) { display: block; }
.messages-compose-form .form-group { margin-bottom: 16px; }
.messages-compose-form .input { min-height: 44px; font-size: 16px; }
.messages-compose-form textarea.input { min-height: 120px; }
.messages-compose-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.messages-compose-actions .btn-primary, .messages-compose-actions .btn-secondary { min-height: 48px; padding: 12px 20px; }
.messages-announcements-block { margin-bottom: 24px; }
.messages-list-heading { margin: 0 0 12px; font-size: 1.125rem; }
.messages-inbox-block { margin-top: 8px; }
.messages-card-list { display: flex; flex-direction: column; gap: 12px; }
.message-card {
  border: 1px solid var(--border-color, #e0e0e0); border-radius: 8px; padding: 16px;
  cursor: pointer; transition: background 0.15s ease; text-align: left; width: 100%; box-sizing: border-box;
}
.message-card:hover, .message-card:focus { background: var(--hover-bg, #f5f5f5); outline: none; }
.message-card--unread { border-left: 4px solid var(--primary, #6d4c5c); background: var(--light-bg, #fafafa); }
.message-card--priority-high { border-left-color: var(--danger, #c62828); }
.message-card__row { display: flex; align-items: flex-start; gap: 12px; }
.message-card__unread-dot { flex-shrink: 0; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--primary, #6d4c5c); }
.message-card__main { flex: 1; min-width: 0; }
.message-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.message-card__sender { font-weight: 600; font-size: 0.9375rem; }
.message-card__time { font-size: 0.8125rem; }
.message-card__title { font-weight: 500; font-size: 1rem; margin-bottom: 4px; }
.message-card__preview { font-size: 0.875rem; margin-bottom: 8px; line-height: 1.4; }
.message-card__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.message-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 500; background: var(--border-color, #e0e0e0); color: var(--text, #333); }
.message-badge--announcement { background: var(--primary, #6d4c5c); color: #fff; }
.message-badge--priority { background: var(--danger, #c62828); color: #fff; }
.message-card__body-wrap { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-color, #e0e0e0); }
.message-card__body { font-size: 0.9375rem; line-height: 1.5; margin-bottom: 12px; white-space: pre-wrap; word-break: break-word; }
.message-card__mark-read { min-height: 44px; padding: 10px 16px; }
.message-card__replies { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-color, #e0e0e0); }
.message-card__replies-heading { font-size: 0.875rem; font-weight: 600; margin-bottom: 10px; }
.message-card__reply-item { margin-bottom: 12px; padding: 10px 12px; background: var(--light-bg, #f8f8f8); border-radius: 6px; }
.message-card__reply-sender { font-weight: 600; font-size: 0.875rem; }
.message-card__reply-time { font-size: 0.75rem; margin-left: 6px; }
.message-card__reply-body { font-size: 0.875rem; line-height: 1.4; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.message-card__reply-box-wrap { margin-top: 12px; }
.message-card__reply-input { width: 100%; min-height: 60px; padding: 12px; font-size: 16px; box-sizing: border-box; margin-bottom: 10px; }
.message-card__reply-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.message-card__reply-btn { margin-top: 8px; min-height: 44px; padding: 10px 16px; }
.message-card__reply-send, .message-card__reply-cancel { min-height: 44px; padding: 10px 16px; }

/* Parent Activity audit list in Settings */
.parent-activity-audit-list {
  max-height: 40vh;
  overflow-y: auto;
  margin-top: 8px;
}
.parent-activity-audit-list .table-wrap {
  width: 100%;
}
.parent-activity-audit-list table {
  font-size: 0.9rem;
}
.parent-activity-audit-list td,
.parent-activity-audit-list th {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

/* System Log (Settings) */
.system-log-list {
  max-height: 50vh;
  overflow-y: auto;
  margin-top: 8px;
  font-size: 0.875rem;
}
.system-log-entries {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.system-log-entry {
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--card-bg, #fff);
  word-break: break-word;
}
.system-log-entry.system-log-error {
  border-left: 4px solid var(--error-color, #c62828);
}
.system-log-entry.system-log-warn {
  border-left: 4px solid var(--warn-color, #f9a825);
}
.system-log-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
}
.system-log-when {
  color: var(--muted-color, #666);
  white-space: nowrap;
}
.system-log-level {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.system-log-code {
  font-family: var(--mono-font, monospace);
  font-size: 0.8rem;
}
.system-log-details {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color, #eee);
}
.system-log-details pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
}
.system-log-toggle {
  margin-top: 4px;
}
@media (max-width: 600px) {
  .system-log-row {
    flex-direction: column;
    gap: 2px;
  }
  .system-log-entry {
    padding: 6px 8px;
  }
}

/* FCC Behavior Module */
.family-behavior-card .card-header { margin-bottom: 16px; }
.family-behavior-card-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.family-behavior-card-header-top h2 { margin: 0; }
.family-behavior-card #behaviorLogBtn { flex-shrink: 0; min-height: 44px; }
.behavior-subtitle { margin-top: 4px; margin-bottom: 12px; }
.behavior-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.behavior-summary-card {
  padding: 14px;
  border-radius: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  text-align: center;
}
.behavior-summary-value { display: block; font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.behavior-summary-label { font-size: 0.85rem; color: var(--muted, #6b6b6b); }
.behavior-patterns-section h3,
.behavior-risk-section h3,
.behavior-history-section h3 { margin: 0 0 10px; font-size: 1.1rem; }
.behavior-pattern-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.behavior-pattern-card {
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff8f6 0%, #fff 100%);
  border: 1px solid var(--border, rgba(0,0,0,.08));
}
.behavior-pattern-title { font-weight: 700; margin-bottom: 6px; }
.behavior-pattern-summary { font-size: 0.9rem; color: var(--muted, #555); }
.behavior-risk-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.behavior-risk-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff8e8;
  border: 1px solid #e8d8a0;
}
.behavior-risk-card--medium { background: #fff0e0; border-color: #e0c0a0; }
.behavior-risk-card--high { background: #ffe8e0; border-color: #e0a0a0; }
.behavior-risk-card-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  color: var(--primary);
}
.behavior-risk-summary { font-size: 0.9rem; }
.behavior-risk-suggestion {
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}
.behavior-risk-try { margin-top: 8px; font-size: 0.9rem; font-weight: 600; color: var(--primary); }
.behavior-risk-try-second { font-weight: 500; font-size: 0.88rem; }
.behavior-risk-why { margin-top: 6px; font-size: 0.85rem; color: var(--muted, #6b6b6b); }
.behavior-risk-feedback { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.1); }
.behavior-risk-feedback-label { font-size: 0.85rem; margin-right: 6px; }
.behavior-feedback-btn { margin-right: 4px; margin-bottom: 4px; }
/* Phase 8 — Pattern detection (Behavior Plans) */
.behavior-plans-empty-state {
  padding: 24px 20px;
  text-align: center;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 12px;
  margin-bottom: 20px;
}
.behavior-plans-empty-text { font-weight: 600; margin: 0 0 8px; }
.behavior-plans-empty-sub { margin: 0 0 16px; }
.behavior-suggestions-section h3,
.behavior-support-ideas-section h3 { margin: 0 0 12px; font-size: 1.1rem; }
.behavior-pattern-context-note { margin: 0 0 12px; }
.behavior-pattern-status-line { margin: 0 0 12px; font-size: 0.85rem; }
.behavior-pattern-detected-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 20px; }
.behavior-pattern-detected-card {
  padding: 14px 16px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid var(--border, rgba(0,0,0,.08));
}
.behavior-pattern-detected-summary { font-size: 0.95rem; margin-bottom: 8px; }
.behavior-pattern-detected-meta { font-size: 0.85rem; margin-bottom: 10px; }
.behavior-pattern-detected-count { color: var(--muted, #6b6b6b); }
.behavior-pattern-detected-confidence {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}
.behavior-pattern-confidence--high { background: #e0f0e0; color: #2a6b2a; }
.behavior-pattern-confidence--medium { background: #fff0e0; color: #8b4513; }
.behavior-pattern-detected-label { font-size: 0.9rem; font-weight: 600; margin: 10px 0 6px; }
.behavior-pattern-detected-suggestions { margin: 0; padding-left: 20px; font-size: 0.9rem; color: var(--muted, #555); }
.behavior-pattern-detected-suggestions li { margin-bottom: 4px; }
.behavior-support-ideas-section { margin-top: 20px; }
.behavior-support-ideas-list { margin: 0; padding-left: 20px; font-size: 0.95rem; }
.behavior-support-ideas-list li { margin-bottom: 6px; }
.behavior-pattern-risk-summary { margin-top: 12px; margin-bottom: 0; font-style: italic; }
.behavior-support-idea-item { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.behavior-support-idea-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,.08);
}
.behavior-support-idea-badge--adaptive { background: #e0f0e0; color: #2a6b2a; }
.behavior-support-idea-note { margin: 0 0 10px; }
.behavior-strongest-pattern-action-section { margin: 12px 0 16px; }
.behavior-strongest-pattern-action { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.behavior-strongest-pattern-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.behavior-strongest-pattern-action .btn { min-height: 40px; }
.behavior-strongest-pattern-note { margin: 0; }
.behavior-pattern-existing-plan-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e0f0e0;
  color: #2a6b2a;
}
.behavior-duplicate-plan-summary { margin: 8px 0 16px; font-size: 0.95rem; }
.behavior-duplicate-plan-summary p { margin: 4px 0; }
.behavior-duplicate-plan-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.behavior-daily-forecast-section { margin-top: 20px; }
.behavior-forecast-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.behavior-forecast-child { padding: 12px 14px; background: var(--card-bg, #fff); border: 1px solid var(--border, rgba(0,0,0,.1)); border-radius: 10px; min-width: 200px; }
.behavior-forecast-child-name { margin: 0 0 8px; font-size: 1rem; }
.behavior-forecast-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.behavior-forecast-list li { margin-bottom: 6px; padding-left: 0; }
/* Phase 4 — Family Regulation Forecast */
.behavior-forecast-section { margin-top: 24px; }
.behavior-forecast-section h3 { margin-bottom: 12px; }
.behavior-forecast-cards-wrapper { display: flex; flex-direction: column; gap: 20px; }
.behavior-forecast-child-group { padding: 12px 0; border-bottom: 1px solid var(--border, rgba(0,0,0,.08)); }
.behavior-forecast-child-group:last-child { border-bottom: none; }
.behavior-forecast-child-group .behavior-forecast-child-name { margin: 0 0 12px; font-size: 1.1rem; }
.behavior-forecast-cards-inner { display: flex; flex-wrap: wrap; gap: 12px; }
.behavior-forecast-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0,0,0,.1));
  background: var(--card-bg, #fff);
  min-width: 260px;
  max-width: 360px;
}
.behavior-forecast-card--medium { background: #fff8f0; border-color: #e0c0a0; }
.behavior-forecast-card--high { background: #fff0e8; border-color: #e0a0a0; }
.behavior-forecast-card-label { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.behavior-forecast-time { font-size: 0.9rem; color: var(--muted, #6b6b6b); margin-bottom: 6px; }
.behavior-forecast-risk { font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--primary); }
.behavior-forecast-summary { font-size: 0.9rem; margin-bottom: 8px; }
.behavior-forecast-try { font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.behavior-forecast-try-second { font-weight: 500; font-size: 0.88rem; }
.behavior-forecast-why { font-size: 0.85rem; color: var(--muted, #6b6b6b); margin-bottom: 6px; }
.behavior-forecast-trend { font-size: 0.85rem; margin-bottom: 8px; }
.behavior-forecast-feedback { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.1); }
.behavior-forecast-feedback-label { font-size: 0.85rem; margin-right: 6px; }
.behavior-forecast-feedback-btn { margin-right: 4px; margin-bottom: 4px; }
/* Phase 5 — Review and learning */
.behavior-forecast-review { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.1); }
.behavior-review-question { font-size: 0.9rem; display: block; margin-bottom: 6px; }
.behavior-review-actions { margin-bottom: 6px; }
.behavior-review-actions .btn { margin-right: 6px; margin-bottom: 4px; }
.behavior-review-outcome .btn { margin-right: 6px; margin-bottom: 4px; }
.behavior-learning-note { font-size: 0.88rem; color: var(--muted, #6b6b6b); }
.behavior-review-saved .behavior-learning-note { font-style: italic; }
.behavior-support-plan-prompt { margin-top: 8px; }
.behavior-support-plan-prompt .btn { margin-top: 4px; }
.behavior-family-forecast-widget p { margin: 6px 0; font-size: 0.9rem; }
.behavior-family-forecast-widget a { font-weight: 600; }
.behavior-insights-widget p { margin: 6px 0; font-size: 0.9rem; }
.behavior-insights-widget a { font-weight: 600; }
.behavior-history-section { margin-top: 24px; }
.behavior-history-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.behavior-history-filters label { margin-right: 4px; }
.behavior-history-filters select { min-width: 120px; }
.behavior-incident-list { min-height: 80px; }
.behavior-incident-items { list-style: none; margin: 0; padding: 0; }
.behavior-incident-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.08));
  font-size: 0.9rem;
}
.behavior-incident-meta { color: var(--muted, #6b6b6b); margin-right: 8px; }
.behavior-incident-abc { font-weight: 600; }
.behavior-incident-intensity { margin-left: 6px; color: var(--muted, #6b6b6b); }

/* Behavior Dashboard */
.behavior-dashboard-card { margin-bottom: 24px; }
.behavior-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.behavior-dashboard-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.behavior-dashboard-summary-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
}
.behavior-dashboard-summary-card h3 { margin: 0 0 6px; font-size: 0.95rem; }
.behavior-dashboard-summary-value { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.behavior-dashboard-section {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
}
.behavior-dashboard-section h3 { margin: 0 0 8px; font-size: 1rem; }

/* Behavior Insights panel */
.behavior-insights-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.behavior-insights-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
}
.behavior-insights-card h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}
.behavior-insights-list,
.behavior-alerts-list,
.behavior-actions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.behavior-insights-list li,
.behavior-alerts-list li,
.behavior-actions-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.9rem;
}
.behavior-insight-badge,
.behavior-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.behavior-insight-badge {
  background: var(--bg-soft, #f5f5f5);
  color: var(--muted, #555);
}
.behavior-alert-badge--high {
  background: #ffe5e5;
  color: #a61b1b;
}
.behavior-alert-badge--medium {
  background: #fff3cd;
  color: #856404;
}
.behavior-alert-badge--low {
  background: #e0f0e0;
  color: #2a6b2a;
}
.behavior-action-link {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--primary, #b5838d);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
}
.behavior-action-link:hover {
  text-decoration: none;
}

/* Compact mode (Behavior Progress page) — single-column, tighter spacing */
.behavior-insights-panel--compact {
  gap: 6px;
}
.behavior-insights-panel--compact .behavior-insights-card {
  padding: 8px 10px;
}
.behavior-insights-panel--compact h4 {
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.behavior-insights-panel--compact li {
  font-size: 0.85rem;
}

/* Streak badge — positive / green tone */
.behavior-insight-badge--streak {
  background: #e0f0e0;
  color: #2a6b2a;
}

@media (min-width: 900px) {
  .behavior-dashboard-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }
  .behavior-dashboard-summary-cards { grid-column: 1 / -1; }
}

/* Behavior ABC Modal */
.behavior-modal-wrap { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.behavior-modal-wrap.behavior-modal-open { pointer-events: auto; }
.behavior-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: none;
}
.behavior-modal-open .behavior-modal-backdrop { display: block; }
.behavior-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  display: none;
  z-index: 10000;
}
.behavior-modal-open .behavior-modal { display: block; }
.behavior-modal-inner { padding: 20px; }
.behavior-modal-inner h2 { margin: 0 0 16px; font-size: 1.25rem; }
.behavior-form-group { margin-bottom: 16px; }
.behavior-form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.behavior-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.behavior-form-row .behavior-form-group { flex: 1; min-width: 100px; }
.behavior-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.behavior-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--border, rgba(0,0,0,.15));
  background: var(--card-bg, #fff);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.behavior-chip:hover { background: #f5f0ee; border-color: var(--accent, #b5838d); }
.behavior-chip.selected,
.behavior-chip[data-selected="1"] { background: var(--accent, #b5838d); color: #fff; border-color: var(--accent, #b5838d); }
.behavior-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border, rgba(0,0,0,.08)); }
.behavior-modal-actions .btn { min-height: 44px; padding: 10px 20px; }
@media (max-width: 520px) {
  .behavior-modal { max-width: 100%; margin: 10px; width: calc(100% - 20px); max-height: 85vh; }
}

/* Phase 9 — Focused Support Plan modal */
.behavior-plan-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: none;
  z-index: 9999;
}
.behavior-modal-open .behavior-plan-modal-backdrop { display: block; }
.behavior-plan-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  display: none;
  z-index: 10000;
}
.behavior-modal-open .behavior-plan-modal { display: block; }
.behavior-plan-editor { padding: 20px; }
.behavior-plan-editor h2 { margin: 0 0 16px; font-size: 1.25rem; }
.behavior-plan-editor-grid { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 20px; }
.behavior-plan-editor-group { min-width: 140px; }
.behavior-plan-editor-group.full-width { width: 100%; min-width: 100%; }
.behavior-plan-editor-group label { display: block; font-weight: 700; margin-bottom: 4px; font-size: 0.9rem; }
.behavior-plan-readonly { margin: 0; font-size: 0.95rem; color: var(--muted, #555); }
.behavior-plan-editor-group textarea.input { width: 100%; min-height: 60px; resize: vertical; }
.behavior-plan-editor-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--border, rgba(0,0,0,.08)); }
.behavior-plan-editor-actions .btn { min-height: 44px; }

/* Phase 9 — Active Support Plans */
.behavior-active-plans-section { margin-bottom: 24px; }
.behavior-active-plans-section h3 { margin: 0 0 12px; font-size: 1.1rem; }
.behavior-active-plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.behavior-active-plan-card {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
}
.behavior-active-plan-meta { margin-bottom: 8px; }
.behavior-active-plan-summary { font-size: 0.95rem; margin: 0 0 10px; color: var(--muted, #555); }
.behavior-active-plan-label { font-size: 0.9rem; font-weight: 600; margin: 8px 0 4px; }
.behavior-active-plan-prevention { margin: 0 0 8px; padding-left: 20px; font-size: 0.9rem; }
.behavior-active-plan-detail { font-size: 0.9rem; margin: 0 0 6px; }
.behavior-active-plan-updated { margin: 10px 0 8px; }
.behavior-active-plan-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.behavior-pattern-detected-card .behavior-create-plan-btn { margin-top: 12px; }
@media (max-width: 520px) {
  .behavior-plan-modal { max-width: 100%; margin: 10px; width: calc(100% - 20px); max-height: 85vh; }
}

/* Phase 9.8 — Plan effectiveness review */
.behavior-plan-review-section { margin: 8px 0 10px; }
.behavior-plan-review-summary { margin: 0 0 6px; }
.behavior-plan-review-note { margin: 4px 0 0; }
.behavior-plan-review-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.behavior-plan-review-actions .btn { font-size: 0.8rem; }
.behavior-plan-review-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.behavior-plan-review-badge--worked { background: #e0f0e0; color: #2a6b2a; }
.behavior-plan-review-badge--partly-worked { background: #fff3cd; color: #856404; }
.behavior-plan-review-badge--needs-changes { background: #ffe5e5; color: #a61b1b; }
.behavior-plan-review-selected { margin: 8px 0 12px; }
.behavior-plan-review-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* Phase 10.1 — Behavior Labels page */
.behavior-labels-page { padding: 0; max-width: 100%; overflow-x: hidden; }
.behavior-labels-header { margin-bottom: 20px; }
.behavior-labels-header h2 { margin: 0 0 6px; font-size: 1.5rem; }
.behavior-labels-subtitle { margin: 0; font-size: 0.95rem; color: var(--muted, #555); }
.behavior-labels-sections { display: flex; flex-direction: column; gap: 24px; }
.behavior-labels-section { padding: 16px; border-radius: 12px; background: var(--card-bg, #fff); border: 1px solid var(--border, rgba(0,0,0,.08)); }
.behavior-labels-section h3 { margin: 0 0 12px; font-size: 1.1rem; }
.behavior-labels-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; min-height: 24px; }
.behavior-label-empty { margin: 0; font-style: italic; }
.behavior-label-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 12px; border-radius: 8px; background: var(--bg, #fafafa); border: 1px solid var(--border, rgba(0,0,0,.06));
}
.behavior-label-custom { font-weight: 600; }
.behavior-label-meta { font-size: 0.9rem; color: var(--muted, #555); }
.behavior-label-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.behavior-label-add-btn { margin-top: 4px; }
.behavior-label-editor-backdrop { display: none; background: rgba(0,0,0,.4); position: fixed; inset: 0; z-index: 10001; align-items: center; justify-content: center; padding: 16px; }
.behavior-label-editor-backdrop.active { display: flex !important; }
.behavior-label-form-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 16px; }
.behavior-label-form {
  background: var(--card-bg, #fff); border-radius: 12px; padding: 20px; max-width: 400px; width: 100%;
  border: 1px solid var(--border, rgba(0,0,0,.08)); box-shadow: 0 12px 32px rgba(0,0,0,.15);
}
.behavior-label-form h3 { margin: 0 0 16px; font-size: 1.2rem; }
.behavior-label-form .behavior-form-group { margin-bottom: 14px; }
.behavior-label-form .behavior-form-group label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.9rem; }
.behavior-label-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border, rgba(0,0,0,.08)); }
.behavior-chip-custom { font-style: italic; }

/* Phase 10.2 — Behavior Progress Analytics Dashboard */
.behavior-progress-page { padding: 0; max-width: 100%; overflow-x: hidden; }
.behavior-progress-header { margin-bottom: 16px; }
.behavior-progress-header h2 { margin: 0 0 4px; font-size: 1.5rem; }
.behavior-progress-subtitle { margin: 0; font-size: 0.95rem; color: var(--muted, #555); }
.behavior-progress-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 20px; padding: 12px 0;
}
.behavior-progress-filters label { font-weight: 600; font-size: 0.9rem; }
.behavior-progress-filters .input { min-width: 140px; }
.behavior-progress-summary-cards { margin-bottom: 20px; }
.behavior-progress-metric-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.behavior-progress-metric-card {
  padding: 14px; border-radius: 10px; background: var(--card-bg, #fff); border: 1px solid var(--border, rgba(0,0,0,.08));
  position: relative; min-height: 70px;
}
.behavior-progress-metric-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.behavior-progress-metric-title { font-size: 0.85rem; color: var(--muted, #555); margin-top: 4px; }
.behavior-progress-metric-sub { font-size: 0.75rem; color: var(--muted, #777); margin-top: 2px; }
.behavior-progress-metric-trend { font-size: 0.8rem; margin-top: 4px; font-weight: 600; }
.behavior-progress-trend-down { color: #2a6b2a; }
.behavior-progress-trend-up { color: #a61b1b; }
.behavior-progress-sparkline {
  display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-bottom: 6px;
}
.behavior-progress-spark-bar { flex: 1; min-width: 3px; background: var(--accent, #b5838d); opacity: 0.7; border-radius: 1px; }
.behavior-progress-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.behavior-progress-chart-card {
  padding: 16px; border-radius: 12px; background: var(--card-bg, #fff); border: 1px solid var(--border, rgba(0,0,0,.08));
}
.behavior-progress-chart-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.behavior-progress-chart-card.behavior-progress-chart-large { grid-column: 1 / -1; }
.behavior-progress-chart { min-height: 120px; }
.behavior-progress-chart-svg { width: 100%; height: auto; max-height: 180px; }
.behavior-progress-line { vector-effect: non-scaling-stroke; }
.behavior-progress-bar-fill { fill: var(--accent, #b5838d); }
.behavior-progress-bar-list { display: flex; flex-direction: column; gap: 8px; }
.behavior-progress-bar-row { display: flex; align-items: center; gap: 8px; }
.behavior-progress-bar-label { flex: 0 0 100px; font-size: 0.9rem; }
.behavior-progress-bar-track { flex: 1; height: 20px; background: var(--border, rgba(0,0,0,.08)); border-radius: 4px; overflow: hidden; }
.behavior-progress-bar-track .behavior-progress-bar-fill { height: 100%; width: 0; border-radius: 0; background: var(--accent, #b5838d); }
.behavior-progress-bar-value { flex: 0 0 28px; text-align: right; font-size: 0.9rem; font-weight: 600; }
.behavior-progress-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 0 8px; }
.behavior-progress-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; }
.behavior-progress-bar-wrap .behavior-progress-bar-fill { width: 100%; min-height: 4px; border-radius: 4px 4px 0 0; background: var(--accent, #b5838d); }
.behavior-progress-bar-wrap .behavior-progress-bar-label { font-size: 0.7rem; margin-top: 4px; text-align: center; }
.behavior-progress-donut-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; font-size: 0.85rem; }
.behavior-progress-donut-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.behavior-progress-donut-ring {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.behavior-progress-donut-segment {
  width: 12px; height: 12px; border-radius: 2px;
}
.behavior-progress-heatmap { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.behavior-progress-heatmap th, .behavior-progress-heatmap td { padding: 4px 6px; text-align: center; }
.behavior-progress-heatmap-cell {
  background: rgba(181, 131, 141, calc(0.15 + var(--intensity, 0) * 0.85)); border-radius: 2px;
}
.behavior-progress-empty { margin: 0; padding: 16px; text-align: center; color: var(--muted, #555); font-size: 0.9rem; }
.behavior-progress-stacked { display: flex; flex-direction: column; gap: 6px; }
.behavior-progress-stacked-row { display: flex; align-items: center; gap: 8px; }
.behavior-progress-stacked-label { flex: 0 0 60px; font-size: 0.8rem; }
.behavior-progress-stacked-bars { flex: 1; display: flex; height: 20px; border-radius: 4px; overflow: hidden; }
.behavior-progress-stacked-segment { display: inline-block; height: 100%; min-width: 2px; }
.behavior-progress-list { margin: 0; padding-left: 20px; }
.behavior-progress-summary { margin-top: 20px; padding: 16px; border-radius: 12px; background: var(--card-bg, #fff); border: 1px solid var(--border, rgba(0,0,0,.08)); }
.behavior-progress-insights h4 { margin: 0 0 8px; font-size: 1rem; }
.behavior-progress-insights ul { margin: 0; padding-left: 20px; }
@media (max-width: 640px) {
  .behavior-progress-metric-cards { grid-template-columns: repeat(2, 1fr); }
  .behavior-progress-filters { flex-direction: column; align-items: stretch; }
}

/* Phase 10.3 — Behavior Reports */
.behavior-reports-page { padding: 0; max-width: 100%; overflow-x: hidden; }
.behavior-report-header { margin-bottom: 16px; }
.behavior-report-header h2 { margin: 0 0 4px; font-size: 1.5rem; }
.behavior-report-subtitle { margin: 0; font-size: 0.95rem; color: var(--muted, #555); }
.behavior-report-builder { margin-bottom: 16px; }
.behavior-report-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 12px; }
.behavior-report-filters label { font-weight: 600; font-size: 0.9rem; }
.behavior-report-filters .input { min-width: 140px; }
.behavior-report-sections { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.9rem; margin-bottom: 12px; }
.behavior-report-sections label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.behavior-report-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.behavior-report-preview { padding: 16px; border-radius: 12px; background: var(--card-bg, #fff); border: 1px solid var(--border, rgba(0,0,0,.08)); }
.behavior-report-section { margin-bottom: 16px; }
.behavior-report-section h3 { margin: 0 0 8px; font-size: 1.15rem; }
.behavior-report-section h4 { margin: 0 0 6px; font-size: 1rem; }
.behavior-report-meta { margin: 0 0 8px; font-size: 0.9rem; color: var(--muted, #555); }
.behavior-report-summary { font-size: 0.95rem; line-height: 1.4; }
.behavior-report-list { margin: 0; padding-left: 20px; }
.behavior-report-plan { margin-bottom: 12px; padding: 8px 0; border-bottom: 1px solid var(--border, rgba(0,0,0,.06)); }
.behavior-report-plan ul { margin: 4px 0 0; padding-left: 18px; }
.behavior-report-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.behavior-report-table th, .behavior-report-table td { border: 1px solid var(--border, rgba(0,0,0,.1)); padding: 6px 8px; text-align: left; }
.behavior-report-table th { background: var(--bg, #f5f5f5); font-weight: 600; }
.behavior-report-title { margin: 0 0 4px; font-size: 1.25rem; }
.behavior-report-header-block { margin-bottom: 12px; }
.behavior-report-chart { min-height: 60px; margin-bottom: 8px; }
#printReportContainer .behavior-progress-chart-svg { max-height: 100px; }

/* ── Report preview: SVG-based bar charts (print-safe) ─────────────── */
/* Bars are rendered as SVG <rect> fills — immune to the print CSS
   background:#ffffff override that kills CSS-background bars.          */

.rpt-bar-svg { display: block; width: 100%; height: auto; margin: 4px 0; }
.rpt-donut-svg { display: block; margin: 8px auto; }
.rpt-timeline-svg { display: block; width: 100%; height: auto; }
.rpt-timeline-wrap { margin: 0 0 2px; }

/* ── Spending totals footer row ─────────────────────────────────────── */
.rpt-spending-totals {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--border, rgba(0,0,0,.08));
  font-size: 0.875rem;
}
.rpt-spending-total-label {
  font-weight: 600;
  color: var(--muted, #555);
}
.rpt-spending-total-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #1a1a1a);
  flex: 1;
}
.rpt-spending-top-chip {
  padding: 4px 12px;
  background: var(--bg-soft, #f5f5f5);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted, #555);
  border: 1px solid var(--border, rgba(0,0,0,.06));
}

/* ── Report incident count callout ─────────────────────────────────── */
.rpt-incident-count { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; }
.rpt-count-number { font-size: 2rem; font-weight: 700; color: var(--text, #222); line-height: 1; }
.rpt-count-label { font-size: 0.9rem; color: var(--muted, #555); }

/* ── Section dividers ──────────────────────────────────────────────── */
.behavior-report-section + .behavior-report-section {
  border-top: 1px solid var(--border, rgba(0,0,0,.07));
  padding-top: 14px;
  margin-top: 2px;
}

/* ── Report title ──────────────────────────────────────────────────── */
.rpt-title { font-size: 1.2rem; margin: 0 0 2px; }

/* ── Progress summary box ──────────────────────────────────────────── */
.rpt-summary-section { background: var(--bg-soft, #f9f6f4); border-radius: 8px; padding: 12px 14px; }
.rpt-summary-text { font-size: 0.93rem; line-height: 1.55; color: var(--text, #222); }

/* ── Plan list ─────────────────────────────────────────────────────── */
.rpt-plan-list { margin: 6px 0 0; padding-left: 18px; font-size: 0.9rem; }
.rpt-plan-list li { margin-bottom: 4px; }

/* ── SVG charts: force color printing in all browsers ─────────────── */
.rpt-bar-svg,
.rpt-donut-svg,
.rpt-timeline-svg {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
  color-adjust: exact;
}

/* FCC print baseline: preserve compact report print layout; refine page fit and chart containment, not replace structure. */
/* ── Print overrides ───────────────────────────────────────────────── */
@media print {
  .rpt-summary-section { background: #f5f5f5 !important; }
  .behavior-report-section + .behavior-report-section { border-top-color: #ccc !important; }
  .rpt-incident-count { margin-bottom: 4px; }
  .rpt-count-number { color: #111 !important; }
  .rpt-spending-totals { border-top-color: #ddd !important; }
  .rpt-spending-top-chip { background: #f0ede8 !important; }
}
@media print {
  body {
    margin: 0;
    padding: 0;
  }

  .behavior-report-screen-only { display: none !important; }

  body.printing-report * {
    visibility: hidden;
  }

  #printReportContainer,
  #printReportContainer * {
    visibility: visible;
  }

  #printReportContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 12px;
    background: #fff;
  }

  .behavior-report-section,
  .fcc-report-section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 10px;
  }

  .behavior-report-preview,
  #printReportContainer,
  .fcc-report-card {
    font-size: 13px;
    line-height: 1.35;
  }

  .behavior-report-table td,
  .behavior-report-table th,
  .fcc-report-table td,
  .fcc-report-table th,
  .fcc-report-table-wrap td,
  .fcc-report-table-wrap th {
    padding: 4px 6px;
    font-size: 12px;
  }

  h3,
  .fcc-report-header {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .fcc-report-chart-wrap {
    break-inside: avoid;
    page-break-inside: avoid;
    text-align: center;
    margin-top: 6px;
    margin-bottom: 6px;
  }
  .fcc-report-chart-wrap .reports-donut { width: 120px; height: 120px; }
  .fcc-report-chart-wrap .reports-bar-chart { height: 100px; }
  .fcc-report-chart-wrap .reports-chart-legend { font-size: 0.7rem; gap: 6px; }

  .fcc-report-summary-row { gap: 8px; margin-bottom: 10px; }
}
/* Tip: For cleanest PDF, turn OFF "Headers and footers" in the browser print dialog. */

/* ══════════════════════════════════════════════════════════════════════════
   PHASE 10.5 — Behavior Sharing & Support-Team Access
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Page layout ─────────────────────────────────────────────────────────── */
.behavior-sharing-page {
  max-width: 720px;
}
.behavior-sharing-header {
  margin-bottom: 20px;
}
.behavior-sharing-header h2 {
  margin: 0 0 4px;
}
.behavior-support-readonly-note {
  margin: 6px 0 0;
  font-style: italic;
}
.behavior-sharing-actions-top {
  margin-bottom: 16px;
}

/* ── Contact list ────────────────────────────────────────────────────────── */
.behavior-sharing-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Contact card ────────────────────────────────────────────────────────── */
.behavior-sharing-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.behavior-sharing-card-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.behavior-sharing-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #222);
  margin-right: 8px;
}
.behavior-sharing-email {
  margin-top: 2px;
}

/* ── Status badges ───────────────────────────────────────────────────────── */
.behavior-sharing-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 6px;
}
.behavior-sharing-status--active {
  background: #e0f0e0;
  color: #2a6b2a;
}
.behavior-sharing-status--inactive {
  background: var(--bg-soft, #f5f5f5);
  color: var(--muted, #666);
}

/* ── Meta row ────────────────────────────────────────────────────────────── */
.behavior-sharing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 0.875rem;
  color: var(--muted, #555);
  margin-bottom: 10px;
}

/* ── Section label inside support active-plans view ─────────────────────── */
.behavior-sharing-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted, #666);
  margin: 8px 0 4px;
}

/* ── Card action buttons ─────────────────────────────────────────────────── */
.behavior-sharing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ── Read-only support badge (shown on progress/reports pages) ───────────── */
.behavior-support-readonly-badge {
  display: inline-block;
  padding: 3px 10px;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe080;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 10px;
  vertical-align: middle;
}

/* ── Modal form helpers ──────────────────────────────────────────────────── */
.behavior-sharing-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.behavior-sharing-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}
.behavior-sharing-required {
  color: var(--danger, #c0392b);
  font-weight: 700;
}
.behavior-sharing-validation {
  background: #fff0f0;
  border: 1px solid #fcc;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--danger, #a61b1b);
  margin-bottom: 8px;
}

/* ── Danger button (remove) ──────────────────────────────────────────────── */
.btn-danger {
  background: transparent;
  border: 1px solid var(--danger, #c0392b);
  color: var(--danger, #c0392b);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-danger:hover {
  background: #fff0f0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .behavior-sharing-card-header {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }
}

/* ── Phase 10.5.1 — Behavior Sharing loading / error states ─────────────── */
.behavior-sharing-loading {
  padding: 12px 0;
  color: var(--muted, #666);
  font-style: italic;
}
.behavior-sharing-error {
  padding: 10px 14px;
  background: #fff0f0;
  border: 1px solid #fcc;
  border-radius: 8px;
  color: var(--danger, #a61b1b);
  font-size: 0.875rem;
}

/* ── Phase 10.5.2 — Behavior Report Share Picker ────────────────────────── */
.behavior-report-share-picker {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  max-width: 520px;
}
.behavior-report-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.behavior-report-share-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--muted, #666);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.behavior-report-share-close:hover { background: var(--bg-soft, #f5f5f5); }
.behavior-report-share-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.behavior-report-share-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: var(--bg-soft, #f9f9f9);
  border-radius: 8px;
  border: 1px solid var(--border, rgba(0,0,0,.06));
}
.behavior-report-share-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.behavior-report-share-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text, #222);
}
.behavior-report-share-email {
  font-size: 0.8rem;
  color: var(--muted, #666);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.behavior-report-share-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.behavior-report-share-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.behavior-report-share-empty {
  margin: 0 0 12px;
  font-style: italic;
}

/* ── Phase 10.5.3 — Report Handoff History ──────────────────────────────── */
.behavior-report-handoff-history {
  margin-top: 24px;
}
.behavior-report-handoff-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 2px;
}
.behavior-report-handoff-subtitle {
  margin: 0 0 12px;
}
.behavior-report-handoff-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.behavior-report-handoff-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.behavior-report-handoff-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.875rem;
  min-width: 0;
}
.behavior-report-handoff-contact {
  font-size: 0.9rem;
}
.behavior-report-handoff-detail,
.behavior-report-handoff-range,
.behavior-report-handoff-date {
  font-size: 0.82rem;
  color: var(--muted, #666);
}
.behavior-report-handoff-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  align-items: flex-end;
}
.behavior-report-handoff-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.behavior-report-handoff-badge--delivery {
  background: var(--bg-soft, #f0f4ff);
  color: var(--muted, #555);
}
.behavior-report-handoff-badge--status {
  background: #e0f0e0;
  color: #2a6b2a;
}
.behavior-report-handoff-empty,
.behavior-report-handoff-loading,
.behavior-report-handoff-error {
  font-size: 0.875rem;
  padding: 8px 0;
}
.behavior-report-handoff-error {
  color: var(--danger, #a61b1b);
}

@media (max-width: 480px) {
  .behavior-report-handoff-item {
    flex-direction: column;
    gap: 8px;
  }
  .behavior-report-handoff-badges {
    flex-direction: row;
    align-items: center;
  }
}

/* ── Phase 10.5.4 — Support Preview Mode Banner + Access Notes ──────────── */
.behavior-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff3cd;
  border: 1px solid #ffe080;
  border-radius: 0;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #856404;
  position: sticky;
  top: 0;
  z-index: 200;
}
.behavior-preview-banner-label { flex: 1; }
.behavior-preview-banner-exit {
  flex-shrink: 0;
  border-color: #856404;
  color: #856404;
}
.behavior-preview-banner-exit:hover { background: #ffeaa0; }

/* Access note details/summary inside contact card */
.behavior-sharing-access-note {
  margin-top: 10px;
  border-top: 1px solid var(--border, rgba(0,0,0,.06));
  padding-top: 8px;
}
.behavior-sharing-access-note summary {
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
  list-style: none;
}
.behavior-sharing-access-note summary::-webkit-details-marker { display: none; }
.behavior-sharing-access-note summary::before {
  content: '+ ';
  font-weight: 600;
}
.behavior-sharing-access-note[open] summary::before { content: '- '; }
.behavior-sharing-access-note-body {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.behavior-sharing-access-note-text {
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--text, #333);
  resize: none;
  background: var(--bg-soft, #f9f9f9);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.5;
}

/* ── Phase 10.5.5 — Report History Page ─────────────────────────────────── */
.behavior-report-history-page {
  max-width: 760px;
}
.behavior-report-history-header {
  margin-bottom: 16px;
}
.behavior-report-history-header h2 { margin: 0 0 4px; }
.behavior-report-history-subtitle { margin: 0; }

/* Filter bar */
.behavior-report-history-filters {
  background: var(--bg-soft, #f5f5f5);
  border: 1px solid var(--border, rgba(0,0,0,.07));
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.behavior-report-history-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}
.behavior-report-history-filter-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted, #555);
  display: block;
  margin-bottom: 3px;
}
.behavior-report-history-filter-row .input {
  min-width: 140px;
}

/* Stats row */
.behavior-history-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  align-items: center;
}
.behavior-history-stat-chip {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-soft, #f0f4f8);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #555);
}
.behavior-history-stat-chip--total {
  background: var(--primary-soft, #e8f0fe);
  color: var(--primary, #2563eb);
}

/* Item right column (badges + actions) */
.behavior-report-handoff-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.behavior-report-handoff-item-actions {
  display: flex;
  gap: 6px;
}

/* Summary line inside item */
.behavior-report-handoff-summary {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted, #666);
  font-style: italic;
}

/* Empty state */
.behavior-report-handoff-empty {
  padding: 24px 0;
  text-align: center;
  color: var(--muted, #666);
}
.behavior-report-handoff-empty p { margin: 0 0 12px; }

@media (max-width: 540px) {
  .behavior-report-history-filter-row { flex-direction: column; align-items: stretch; }
  .behavior-report-history-filter-row .input { min-width: 0; width: 100%; }
  .behavior-report-handoff-item { flex-direction: column; }
  .behavior-report-handoff-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* ── Phase 10.5.6 — History date filters, load-more, sharing handoff count ─ */

/* Second filter row for date inputs */
.behavior-report-history-filter-row--dates {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border, rgba(0,0,0,.06));
}
.behavior-report-history-filter-row--dates .input {
  min-width: 130px;
}

/* Load more button */
.behavior-history-load-more-wrap {
  text-align: center;
  padding: 16px 0 4px;
}
.bh-load-more-btn {
  min-width: 120px;
}

/* Handoff count badge on Sharing page contact cards */
.behavior-sharing-handoff-count {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  background: var(--bg-soft, #eef2ff);
  color: var(--muted, #555);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

/* ── Phase 10.5.7 — Export / Delete / Mark-shared / Dashboard widget ──────── */

/* History page toolbar (stats + export button) */
.behavior-history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

/* Mark-as-shared button — muted green tint */
.bh-mark-shared-btn {
  border-color: #2a6b2a !important;
  color: #2a6b2a !important;
}
.bh-mark-shared-btn:hover { background: #e0f0e0 !important; }

/* Dashboard recent-shares widget */
.behavior-dashboard-handoff-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.05));
  font-size: 0.875rem;
}
.behavior-dashboard-handoff-item:last-of-type { border-bottom: none; }
.behavior-dashboard-handoff-contact {
  font-weight: 600;
  flex-shrink: 0;
}
.behavior-dashboard-handoff-range {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.behavior-dashboard-handoff-date { flex-shrink: 0; }
.behavior-dashboard-handoff-more {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--primary, #2563eb);
  text-decoration: none;
}
.behavior-dashboard-handoff-more:hover { text-decoration: underline; }

/* ── Phase 10.6 — Behavior Intelligence Engine ──────────────────────────── */
.behavior-intelligence-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.behavior-intelligence-panel--compact {
  gap: 10px;
}

/* Section headers */
.behavior-intelligence-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted, #666);
  margin: 0 0 8px;
}

/* Insight items */
.behavior-intelligence-list,
.behavior-alert-list,
.behavior-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.behavior-intelligence-item,
.behavior-alert-item,
.behavior-action-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  line-height: 1.45;
}
.behavior-intelligence-text {
  flex: 1;
  color: var(--text, #222);
}

/* Intelligence badges */
.behavior-intelligence-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--bg-soft, #f0f4f8);
  color: var(--muted, #555);
}
.behavior-intelligence-badge--trend    { background: #e8f0fe; color: #1a56db; }
.behavior-intelligence-badge--plan     { background: #fef3c7; color: #92400e; }
.behavior-intelligence-badge--intensity{ background: #fee2e2; color: #b91c1c; }
.behavior-intelligence-badge--streak   { background: #dcfce7; color: #166534; }
.behavior-intelligence-badge--info     { background: var(--bg-soft, #f0f4f8); color: var(--muted, #555); }

/* Alert badges */
.behavior-alert-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.behavior-alert-badge--high   { background: #fee2e2; color: #b91c1c; }
.behavior-alert-badge--medium { background: #fef3c7; color: #92400e; }
.behavior-alert-badge--low    { background: #f0fdf4; color: #166534; }

/* Child focus card */
.behavior-child-focus-card {
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 12px 14px;
}
.behavior-child-focus-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: #3730a3;
}
.behavior-child-focus-summary {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text, #333);
  line-height: 1.5;
}

/* Action buttons */
.behavior-action-btn {
  background: none;
  border: 1px solid var(--border, rgba(0,0,0,.15));
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text, #222);
  text-align: left;
  width: 100%;
  transition: background 0.12s, border-color 0.12s;
}
.behavior-action-btn:hover {
  background: var(--bg-soft, #f5f5f5);
  border-color: var(--primary, #2563eb);
  color: var(--primary, #2563eb);
}
.behavior-action-btn[data-nav-page]:after {
  content: ' →';
  opacity: 0.5;
  font-size: 0.8rem;
}

/* Dashboard section highlight for intelligence */
.behavior-dashboard-section--intelligence {
  background: var(--bg-soft, #f9fafb);
  border-radius: 10px;
  padding: 12px 14px;
}

/* ── Phase 10.6.1 — Sharing page intelligence nudge ────────────────────── */
.behavior-sharing-intelligence-nudge {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.behavior-sharing-nudge-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.behavior-sharing-nudge-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.behavior-sharing-nudge-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text, #333);
  min-width: 160px;
}

/* ── Phase 10.6.2 — Behavior Guidance ("What You Can Try") ──────────────── */
.behavior-guidance-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Section heading via CSS so no extra markup needed in full mode */
.behavior-guidance-section:not(.behavior-guidance-section--compact) {
  margin-top: 4px;
}

.behavior-guidance-item {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.behavior-guidance-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #166534;
}
.behavior-guidance-text {
  font-size: 0.875rem;
  color: var(--text, #333);
  margin: 0;
  line-height: 1.5;
}
.behavior-guidance-try {
  font-size: 0.82rem;
  color: #166534;
  margin-top: 3px;
}
.behavior-guidance-try-label {
  font-weight: 600;
}
.behavior-guidance-empty {
  font-style: italic;
  color: var(--muted, #666);
  padding: 4px 0;
}

/* Compact single-line (Progress page) */
.behavior-guidance-section--compact {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.behavior-guidance-compact-label {
  font-weight: 700;
  color: #166534;
  flex-shrink: 0;
}
.behavior-guidance-compact-text {
  color: var(--text, #333);
}

@media (max-width: 540px) {
  .behavior-guidance-section--compact {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Phase 10.6.3 — Guidance Personalization Layer ──────────────────────── */

/* Item header: title + badges side by side */
.behavior-guidance-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.behavior-guidance-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Confidence badge */
.behavior-guidance-confidence {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.behavior-guidance-confidence--high   { background: #dcfce7; color: #166534; }
.behavior-guidance-confidence--medium { background: #fef9c3; color: #854d0e; }
.behavior-guidance-confidence--low    { background: #f1f5f9; color: #64748b; }
.behavior-guidance-confidence--inline {
  margin-left: 6px;
  vertical-align: middle;
  font-size: 0.68rem;
}

/* Freshness indicator */
.behavior-guidance-freshness {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #94a3b8;
}
.behavior-guidance-freshness--stale {
  background: #fff7ed;
  color: #c2410c;
}

/* Reason line */
.behavior-guidance-reason {
  font-size: 0.8rem;
  color: var(--muted, #555);
  font-style: italic;
  margin-top: 2px;
}

/* Item confidence variant borders */
.behavior-guidance-item--high   { border-color: #86efac; }
.behavior-guidance-item--medium { border-color: #fde68a; background: #fefce8; }
.behavior-guidance-item--low    { border-color: #e2e8f0; background: #f8fafc; }

/* Compact reason line (Progress page) */
.behavior-guidance-compact-reason {
  padding: 3px 12px 6px;
  font-style: italic;
}

/* ── Phase 10.6.3 additions — nextStep + positive guidance ──────────────── */
.behavior-guidance-next-step {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #1e40af;
  padding: 5px 10px;
  background: #eff6ff;
  border-radius: 6px;
  border-left: 3px solid #93c5fd;
}
.behavior-guidance-next-step-label {
  font-weight: 700;
}

/* Positive / "what's working" items — softer green tint */
.behavior-guidance-item--positive {
  background: #f0fdf4;
  border-color: #86efac;
}
.behavior-guidance-item--positive .behavior-guidance-title {
  color: #15803d;
}

/* ── Phase 10.7 — Predictive Behavior Guidance ("Looking Ahead") ─────────── */
.behavior-predictions-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.behavior-prediction-item {
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.behavior-prediction-item--high   { border-color: #93c5fd; background: #eff6ff; }
.behavior-prediction-item--medium { border-color: #fde68a; background: #fffbeb; }
.behavior-prediction-item--low    { border-color: #e2e8f0; background: #f8fafc; }

.behavior-prediction-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.behavior-prediction-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.behavior-prediction-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1e40af;
  flex: 1;
}
.behavior-prediction-text {
  font-size: 0.875rem;
  color: var(--text, #333);
  margin: 0;
  line-height: 1.5;
}
.behavior-prediction-reason {
  font-size: 0.8rem;
  color: var(--muted, #555);
  font-style: italic;
}
.behavior-prediction-recommendation {
  font-size: 0.85rem;
  color: #1e40af;
  padding: 5px 10px;
  background: #dbeafe;
  border-radius: 6px;
  border-left: 3px solid #93c5fd;
}
.behavior-prediction-recommendation-label {
  font-weight: 700;
}

/* Confidence badge */
.behavior-prediction-confidence {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}
.behavior-prediction-confidence--high   { background: #dcfce7; color: #166534; }
.behavior-prediction-confidence--medium { background: #fef9c3; color: #854d0e; }
.behavior-prediction-confidence--low    { background: #f1f5f9; color: #64748b; }

/* Timeframe badge */
.behavior-prediction-timeframe {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}

/* Dashboard section highlight */
.behavior-dashboard-section--predictions {
  background: #f0f9ff;
  border-radius: 10px;
  padding: 12px 14px;
}

/* Compact mode (Progress page) */
.behavior-prediction-item--compact {
  padding: 8px 12px;
  gap: 4px;
}
.behavior-prediction-recommendation--compact {
  font-size: 0.8rem;
  padding: 3px 8px;
}
.behavior-progress-prediction-slot {
  margin-top: 8px;
}

/* Empty state */
.behavior-predictions-empty {
  font-style: italic;
  color: var(--muted, #666);
}

@media (max-width: 540px) {
  .behavior-prediction-header { flex-direction: column; }
}

/* ── Phase 10.7 / Plans page — intelligence + predictions blocks ─────────── */
.behavior-plans-intelligence-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}
.behavior-plans-intelligence-block {
  background: var(--bg-soft, #f9fafb);
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border, rgba(0,0,0,.07));
}

/* 🔐 Supabase Parent Auth UI */

.fcc-parent-auth-card {
  background: var(--card);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.fcc-auth-field {
  margin-bottom: 10px;
}

.fcc-auth-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.fcc-auth-status {
  margin-top: 8px;
  font-size: 0.85rem;
}

.fcc-auth-status.error { color: var(--danger); }
.fcc-auth-status.success { color: var(--success); }
.fcc-auth-status.info { color: var(--muted); }
.fcc-auth-status.warn { color: var(--warning, #c47c1a); }

/* ── Multi-household login: tabs ────────────────────────────────────────────── */

.login-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--border, rgba(0,0,0,.1));
  padding-bottom: 2px;
}

.login-tab-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, background 0.15s;
  position: relative;
  bottom: -2px;
}

.login-tab-btn:hover {
  color: var(--text);
  background: var(--hover, rgba(0,0,0,.05));
}

.login-tab-btn.active {
  color: var(--accent, #b5838d);
  border-bottom: 2px solid var(--accent, #b5838d);
  background: none;
}

.login-tab-content {
  padding-top: 4px;
}

/* ── Generic modal overlay & card (PIN setup, Add Profile) ──────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-card {
  background: var(--card, #fff);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
}

.modal-close-btn:hover { color: var(--text); background: var(--hover, rgba(0,0,0,.06)); }

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.modal-form-grid .fcc-auth-field {
  grid-column: span 1;
}

/* Full-width fields in the add-profile modal */
.add-profile-modal .fcc-auth-field:has(#apName),
.add-profile-modal .fcc-auth-field:has(#apHousehold),
.add-profile-modal .fcc-auth-field:has(#apSendInvite) {
  grid-column: span 2;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.required {
  color: var(--danger);
  margin-left: 2px;
}

@media (max-width: 520px) {
  .modal-card { padding: 20px 16px 18px; }
  .modal-form-grid { grid-template-columns: 1fr; }
  .add-profile-modal .fcc-auth-field:has(#apName),
  .add-profile-modal .fcc-auth-field:has(#apHousehold),
  .add-profile-modal .fcc-auth-field:has(#apSendInvite) { grid-column: span 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NEW LOGIN CARD  (.lv-*)
   Two-column card: blue left panel + white right panel
   ═══════════════════════════════════════════════════════════════════════════ */

/* Shell: full-viewport centering */
.lv-shell {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg, #f6f8ff);
  overflow: hidden;
  z-index: 1;
}
.lv-shell::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(47,114,232,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 25%, rgba(249,197,35,0.10) 0%, transparent 50%);
  pointer-events: none;
}
.lv-bc { position: fixed; border-radius: 50%; pointer-events: none; }
.lv-bc1 { width: 320px; height: 320px; background: rgba(47,114,232,0.06); top: -80px; right: -60px; }
.lv-bc2 { width: 200px; height: 200px; background: rgba(249,197,35,0.10); bottom: -40px; left: -40px; }

/* Card */
.lv-card {
  width: min(900px, 96vw);
  height: min(600px, 94vh);
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 2px 4px rgba(13,31,74,0.04), 0 8px 24px rgba(13,31,74,0.08), 0 32px 80px rgba(13,31,74,0.12);
  display: flex; overflow: hidden; position: relative;
  animation: lvCardIn 0.55s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes lvCardIn { from{opacity:0;transform:translateY(20px) scale(0.98)} to{opacity:1;transform:none} }

/* ── Left panel ── */
.lv-left {
  width: 42%; background-color: var(--blue, #2F72E8);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden; flex-shrink: 0;
  transition: background-color 0.3s ease;
}
.lv-left-deco { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lv-left-deco::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.lv-left-deco::after {
  content: ''; position: absolute; bottom: -80px; left: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.lv-left-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,0.1); pointer-events: none; }
.lvr1 { width: 180px; height: 180px; bottom: 40px; right: -50px; }
.lvr2 { width: 100px; height: 100px; top: 120px; right: 30px; }

/* Adult left */
.lv-adult-left {
  display: flex; flex-direction: column;
  padding: 40px 36px; height: 100%; position: relative; z-index: 1;
}
.lv-logo-block { display: flex; align-items: center; gap: 11px; margin-bottom: auto; }
.lv-logo-svg { width: 46px; height: 46px; flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2)); }
.lv-wm-family { display: block; font-size: 17px; font-weight: 900; color: #ffffff; letter-spacing: -0.01em; }
.lv-wm-cmd { display: block; font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.6); letter-spacing: 0.07em; text-transform: uppercase; }
.lv-left-body { margin-bottom: 28px; }
.lv-left-body h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 900; color: #ffffff; line-height: 1.18; margin-bottom: 10px; letter-spacing: -0.02em; }
.lv-left-body h1 .lv-yl { color: var(--yellow, #F9C523); }
.lv-left-body p { font-size: 14px; color: rgba(255,255,255,0.6); font-weight: 500; line-height: 1.55; }

/* Mode toggle pill (shared) */
.lv-mode-toggle {
  display: flex; background: rgba(0,0,0,0.2); border-radius: 14px; padding: 4px; gap: 4px;
}
.lv-mode-btn {
  flex: 1; padding: 10px 8px; border-radius: 10px; border: none; background: transparent;
  color: rgba(255,255,255,0.6); font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.22s;
  display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
}
.lv-mode-btn:hover { color: rgba(255,255,255,0.9); }
.lv-mode-btn.active { background: #ffffff; color: var(--blue, #2F72E8); box-shadow: 0 2px 10px rgba(0,0,0,0.15); }

/* Kid left */
.lv-kid-left {
  display: none; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 28px 24px; position: relative; z-index: 1; gap: 16px;
}
.lv-card.lv-kid-mode .lv-kid-left  { display: flex; animation: lvFadeUp 0.4s ease both; }
.lv-card.lv-kid-mode .lv-adult-left { display: none; }
.lv-card.lv-kid-mode .lv-left { background-color: var(--blue-dark, #1d55c4); }
@keyframes lvFadeUp { from{opacity:0;transform:translateY(14px)} to{opacity:1;transform:none} }

.lv-kid-left-top { display: flex; align-items: center; gap: 9px; }
.lv-stars-display { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lv-star-row { display: flex; gap: 10px; }
.lv-star-item {
  font-size: 28px; animation: lvStarBob 2.5s ease-in-out infinite;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.18));
}
.lv-star-item:nth-child(2) { animation-delay: 0.35s; }
.lv-star-item:nth-child(3) { animation-delay: 0.7s; }
.lv-star-item:nth-child(4) { animation-delay: 1.05s; }
@keyframes lvStarBob { 0%,100%{transform:translateY(0) rotate(-3deg)} 50%{transform:translateY(-7px) rotate(3deg)} }
.lv-kid-left-msg { text-align: center; }
.lv-kid-left-msg h2 { font-size: 22px; font-weight: 900; color: #ffffff; line-height: 1.25; margin-bottom: 5px; }
.lv-kid-left-msg h2 .lv-yl { color: var(--yellow, #F9C523); }
.lv-kid-left-msg p { font-size: 13px; color: rgba(255,255,255,0.6); font-weight: 500; line-height: 1.5; }

/* ── Right panel ── */
.lv-right {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
  padding: 40px 44px; overflow-y: auto; position: relative; background: #ffffff;
}
/* Vertically center the sign-in form (short) but not the taller signup form */
#loginTabSignIn { margin: auto 0; }
#loginSignupForm { padding-top: 4px; }

/* Parent view */
.lv-parent-view { display: flex; flex-direction: column; }
.lv-parent-view.lv-hidden { display: none; }

.lv-view-title { font-size: 26px; font-weight: 900; color: var(--text, #0d1f4a); letter-spacing: -0.02em; margin-bottom: 3px; }
.lv-view-sub { font-size: 14px; color: var(--muted, #7a95c8); font-weight: 500; margin-bottom: 22px; }

/* Field styles */
.lv-field-label {
  display: block; font-size: 11.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: #3a5080; margin-bottom: 6px;
}
.lv-field-row-lbl { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lv-field-row-lbl .lv-field-label { margin-bottom: 0; }
.lv-forgot-link { font-size: 12px; color: var(--blue, #2F72E8); font-weight: 700; cursor: pointer; }
.lv-forgot-link:hover { text-decoration: underline; }

.lv-field-input {
  width: 100%; padding: 13px 16px;
  border: 2px solid var(--blue-mid, #ccdaf7); border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 600;
  color: var(--text, #0d1f4a); background: var(--bg, #f6f8ff); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.lv-field-input:focus {
  border-color: var(--blue, #2F72E8);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(47,114,232,0.12);
}
.lv-field-input::placeholder { color: var(--muted, #7a95c8); font-weight: 500; }
.lv-field-sub { font-size: 13px; color: var(--muted, #7a95c8); font-weight: 600; margin-bottom: 8px; }

.lv-remember-row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.lv-remember-row input[type=checkbox] { accent-color: var(--blue, #2F72E8); width: 16px; height: 16px; cursor: pointer; }
.lv-remember-row label { font-size: 13.5px; font-weight: 600; color: #3a5080; cursor: pointer; user-select: none; }

/* Buttons */
.lv-primary-btn {
  width: 100%; padding: 15px;
  background: var(--blue, #2F72E8); color: #ffffff;
  border: none; border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 800;
  cursor: pointer; transition: all 0.18s;
  box-shadow: 0 4px 18px rgba(47,114,232,0.35);
}
.lv-primary-btn:hover { background: var(--blue-dark, #1d55c4); box-shadow: 0 6px 24px rgba(47,114,232,0.45); transform: translateY(-1px); }
.lv-primary-btn:active { transform: scale(0.99); }

.lv-secondary-btn {
  width: 100%; padding: 13px;
  background: transparent; color: var(--blue, #2F72E8);
  border: 2px solid var(--blue-mid, #ccdaf7); border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.18s; margin-top: 8px;
}
.lv-secondary-btn:hover { background: var(--blue-pale, #e8f0fd); border-color: var(--blue, #2F72E8); }

.lv-btn-link {
  background: none; border: none; padding: 0;
  color: var(--blue, #2F72E8); font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.lv-btn-link:hover { text-decoration: underline; }

.lv-pw-wrap {
  position: relative; display: flex; align-items: center;
}
.lv-pw-wrap .lv-field-input {
  padding-right: 44px; width: 100%;
}
.lv-eye-btn {
  position: absolute; right: 12px;
  background: none; border: none; padding: 4px;
  cursor: pointer; color: var(--muted, #7a95c8);
  display: flex; align-items: center; line-height: 1;
  transition: color 0.15s;
}
.lv-eye-btn:hover { color: var(--blue, #2F72E8); }
.lv-eye-icon { width: 18px; height: 18px; display: block; }

.lv-ghost-btn {
  width: 100%; padding: 11px;
  background: transparent; color: var(--muted, #7a95c8);
  border: 1.5px dashed var(--blue-mid, #ccdaf7); border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.18s;
}
.lv-ghost-btn:hover { color: var(--blue, #2F72E8); border-color: var(--blue, #2F72E8); background: var(--blue-pale, #e8f0fd); }

/* Signup mode: hide mode toggle and kid content, show welcome message instead */
.lv-card.lv-signup-mode .lv-mode-toggle,
.lv-card.lv-signup-mode .login-tabs,
.lv-card.lv-signup-mode .lv-kid-left { display: none !important; }
.lv-card.lv-signup-mode .lv-adult-left .lv-tagline { display: none; }
.lv-card.lv-signup-mode .lv-adult-left::after {
  content: "Let's get your family set up 🎉";
  display: block; color: rgba(255,255,255,0.9);
  font-size: 15px; font-weight: 600; margin-top: 12px;
  text-align: center; padding: 0 16px;
}

.lv-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.lv-divider::before, .lv-divider::after { content: ''; flex: 1; height: 1.5px; background: var(--blue-mid, #ccdaf7); }
.lv-divider span { font-size: 12px; font-weight: 700; color: var(--muted, #7a95c8); white-space: nowrap; }

/* OAuth buttons */
.lv-oauth-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.lv-oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px;
  border-radius: 14px; border: 1.5px solid #d0d9ea;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.18s;
}
.lv-oauth-btn svg { flex-shrink: 0; }
.lv-oauth-google { background: #ffffff; color: #1f2937; }
.lv-oauth-google:hover { background: #f3f6ff; border-color: #4285F4; }

.lv-status-msg { font-size: 13px; font-weight: 600; margin-top: 10px; min-height: 18px; }
.lv-status-msg.error { color: #e03c3c; }
.lv-status-msg.success { color: #22c55e; }
.lv-status-msg.info { color: var(--muted, #7a95c8); }

/* ============================================================
   Calendar 2.0 Styles (cal2-* prefix — isolated from cal1)
   ============================================================ */

/* Toolbar */
.cal2-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:18px; }
.cal2-view-switcher { display:flex; background:#f0f4ff; border-radius:10px; padding:3px; gap:2px; }
.cal2-view-btn { background:transparent; border:none; padding:7px 14px; border-radius:8px; font-family:inherit; font-size:13px; font-weight:700; color:#5a7ab8; cursor:pointer; transition:all .15s; }
.cal2-view-btn.active { background:#fff; color:#2F72E8; box-shadow:0 1px 4px rgba(47,114,232,.18); }
.cal2-nav { display:flex; align-items:center; gap:6px; }
.cal2-nav button { background:#f0f4ff; border:none; padding:7px 13px; border-radius:8px; font-size:13px; font-weight:700; color:#2F72E8; cursor:pointer; }
.cal2-nav button:hover { background:#dde8ff; }
#cal2DateLabel { font-size:16px; font-weight:800; color:#1a2e52; min-width:160px; text-align:center; }
.cal2-actions { display:flex; gap:8px; margin-left:auto; }
.cal2-add-btn { background:#2F72E8; color:#fff; border:none; padding:9px 18px; border-radius:10px; font-family:inherit; font-size:13px; font-weight:800; cursor:pointer; }
.cal2-add-btn:hover { background:#1d55c4; }
.cal2-toolbar > button { background:#f0f4ff; color:#2F72E8; border:none; padding:8px 14px; border-radius:8px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; }
#cal2Error { color:#e03c3c; font-size:13px; font-weight:600; margin-bottom:8px; }

/* Month grid */
.cal2-month-header { display:grid; grid-template-columns:repeat(7,1fr); margin-bottom:4px; }
.cal2-month-header-cell { text-align:center; font-size:12px; font-weight:800; color:#7a95c8; padding:4px 0; text-transform:uppercase; }
.cal2-month-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.cal2-day-cell { background:#f8faff; border-radius:8px; min-height:90px; padding:6px; cursor:pointer; transition:background .12s; position:relative; }
.cal2-day-cell:hover { background:#eef3ff; }
.cal2-day-other-month { background:#fafafa; opacity:.6; }
.cal2-day-today { background:#e8f0fd !important; outline:2px solid #2F72E8; outline-offset:-2px; }
.cal2-day-today .cal2-day-num { background:#2F72E8; color:#fff; border-radius:50%; width:24px; height:24px; display:flex; align-items:center; justify-content:center; }
.cal2-day-num { font-size:13px; font-weight:800; color:#2a3f6b; width:24px; height:24px; display:flex; align-items:center; justify-content:center; margin-bottom:4px; }
.cal2-day-events { display:flex; flex-direction:column; gap:2px; }
.cal2-event-chip { border-radius:5px; padding:2px 6px; font-size:11px; font-weight:700; color:#fff; cursor:pointer; display:flex; align-items:center; gap:4px; overflow:hidden; white-space:nowrap; }
.cal2-event-chip:hover { filter:brightness(1.12); }
.cal2-chip-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.cal2-chip-recur-dot { font-size:10px; opacity:.8; flex-shrink:0; }
.cal2-chip-private { opacity:.7; outline:1px dashed rgba(255,255,255,.6); }
.cal2-day-overflow { font-size:11px; color:#7a95c8; font-weight:700; cursor:pointer; padding:1px 4px; }
.cal2-day-overflow:hover { color:#2F72E8; }
.cal2-loading { text-align:center; padding:40px; color:#7a95c8; font-weight:700; font-size:15px; }

/* Week view */
.cal2-week-header { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; margin-bottom:4px; }
.cal2-week-col-head { text-align:center; padding:8px 4px; background:#f0f4ff; border-radius:8px; }
.cal2-week-col-head.cal2-day-today { background:#e8f0fd; outline:2px solid #2F72E8; outline-offset:-2px; }
.cal2-week-dow { display:block; font-size:11px; font-weight:800; color:#7a95c8; text-transform:uppercase; }
.cal2-week-date-num { display:block; font-size:18px; font-weight:800; color:#1a2e52; }
.cal2-week-body { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.cal2-week-col { background:#f8faff; border-radius:8px; min-height:200px; padding:6px; display:flex; flex-direction:column; gap:4px; }
.cal2-week-col.cal2-day-today { background:#e8f0fd; }
.cal2-week-event { background:#fff; border-radius:6px; padding:6px 8px; cursor:pointer; display:flex; flex-direction:column; gap:2px; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.cal2-week-event:hover { box-shadow:0 2px 8px rgba(47,114,232,.18); }
.cal2-week-event-time { font-size:10px; color:#7a95c8; font-weight:700; }
.cal2-week-event-title { font-size:12px; font-weight:700; color:#1a2e52; }

/* Agenda view */
.cal2-agenda-list { display:flex; flex-direction:column; gap:12px; }
.cal2-agenda-empty { text-align:center; padding:40px; color:#7a95c8; font-weight:700; }
.cal2-agenda-day { background:#fff; border-radius:12px; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.cal2-agenda-date-head { padding:10px 16px; background:#f0f4ff; font-size:13px; font-weight:800; color:#2a3f6b; display:flex; align-items:center; gap:8px; }
.cal2-agenda-date-head.cal2-day-today { background:#e8f0fd; color:#2F72E8; }
.cal2-today-badge { background:#2F72E8; color:#fff; border-radius:20px; padding:2px 8px; font-size:11px; }
.cal2-agenda-event { display:flex; align-items:stretch; cursor:pointer; padding:10px 14px; gap:10px; border-bottom:1px solid #f0f4ff; }
.cal2-agenda-event:last-child { border-bottom:none; }
.cal2-agenda-event:hover { background:#f8faff; }
.cal2-agenda-event-bar { width:4px; border-radius:4px; flex-shrink:0; }
.cal2-agenda-event-info { flex:1; }
.cal2-agenda-event-title { font-size:14px; font-weight:700; color:#1a2e52; }
.cal2-agenda-event-meta { font-size:12px; color:#7a95c8; margin-top:2px; }
.cal2-recur-tag { background:#f0f4ff; border-radius:20px; padding:1px 7px; font-size:11px; font-weight:700; color:#5a7ab8; }

/* Event detail panel */
.cal2-event-panel { position:fixed; top:80px; right:0; width:340px; max-width:95vw; background:#fff; border-radius:16px 0 0 16px; box-shadow:-4px 0 32px rgba(47,114,232,.14); z-index:200; display:flex; flex-direction:column; max-height:calc(100vh - 100px); overflow:hidden; }
.cal2-panel-color-bar { height:6px; flex-shrink:0; }
.cal2-panel-body { flex:1; overflow-y:auto; padding:16px; }
.cal2-panel-title { font-size:18px; font-weight:800; color:#1a2e52; margin:0 0 12px; }
.cal2-panel-row { display:flex; align-items:flex-start; gap:8px; font-size:13px; color:#3a5080; margin-bottom:8px; }
.cal2-panel-icon { font-size:16px; flex-shrink:0; }
.cal2-panel-desc { background:#f8faff; border-radius:8px; padding:10px; font-size:13px; color:#3a5080; margin:10px 0; }
.cal2-panel-section { margin-top:12px; }
.cal2-panel-section-title { font-size:12px; font-weight:800; color:#7a95c8; text-transform:uppercase; margin-bottom:6px; }
.cal2-attendee-row { font-size:13px; color:#3a5080; padding:4px 0; display:flex; align-items:center; gap:6px; }
.cal2-attendee-status { font-size:11px; color:#7a95c8; }
.cal2-panel-actions { display:flex; gap:8px; padding:12px 16px; border-top:1px solid #f0f4ff; flex-wrap:wrap; }
.cal2-tag { background:#f0f4ff; border-radius:20px; padding:2px 9px; font-size:11px; font-weight:700; color:#5a7ab8; }
.cal2-tag-muted { background:#f5f5f5; color:#9aa0b0; }
.cal2-tag-recur { background:#e8f0fd; color:#2F72E8; }
.cal2-tag-parent { background:#fff0f6; color:#db2777; }

/* Shared buttons */
.cal2-btn-primary  { background:#2F72E8; color:#fff; border:none; padding:8px 16px; border-radius:9px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.cal2-btn-primary:hover { background:#1d55c4; }
.cal2-btn-secondary{ background:#f0f4ff; color:#2F72E8; border:none; padding:8px 14px; border-radius:9px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.cal2-btn-secondary:hover { background:#dde8ff; }
.cal2-btn-danger   { background:#fee2e2; color:#dc2626; border:none; padding:8px 14px; border-radius:9px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.cal2-btn-danger:hover { background:#fecaca; }
.cal2-btn-accept   { background:#dcfce7; color:#16a34a; border:none; padding:8px 14px; border-radius:9px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.cal2-btn-decline  { background:#fee2e2; color:#dc2626; border:none; padding:8px 14px; border-radius:9px; font-family:inherit; font-size:13px; font-weight:700; cursor:pointer; }

/* Event form overlay */
.cal2-overlay { position:fixed; inset:0; background:rgba(15,25,55,.45); z-index:300; display:flex; align-items:flex-start; justify-content:center; padding-top:40px; overflow-y:auto; }
.cal2-form-card { background:#fff; border-radius:18px; width:520px; max-width:95vw; box-shadow:0 8px 40px rgba(47,114,232,.18); margin-bottom:40px; overflow:hidden; }
.cal2-form-header { display:flex; align-items:center; justify-content:space-between; padding:18px 20px 14px; border-bottom:1px solid #f0f4ff; }
.cal2-form-title { font-size:18px; font-weight:800; color:#1a2e52; margin:0; }
.cal2-form-close { background:none; border:none; font-size:22px; color:#9aa0b0; cursor:pointer; line-height:1; padding:0; }
.cal2-form-close:hover { color:#2F72E8; }
.cal2-form-body { padding:16px 20px; display:flex; flex-direction:column; gap:12px; }
.cal2-form-row { display:flex; flex-direction:column; gap:4px; }
.cal2-form-row-inline { flex-direction:row; align-items:center; gap:10px; }
.cal2-form-row-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.cal2-form-label { font-size:12px; font-weight:800; color:#7a95c8; text-transform:uppercase; }
.cal2-required { color:#e03c3c; }
.cal2-field { padding:10px 12px; border:1.5px solid #dde8ff; border-radius:9px; font-family:inherit; font-size:14px; color:#1a2e52; background:#fff; width:100%; box-sizing:border-box; }
.cal2-field:focus { outline:none; border-color:#2F72E8; box-shadow:0 0 0 3px rgba(47,114,232,.12); }
.cal2-textarea { resize:vertical; min-height:72px; }
.cal2-form-hint { font-size:11px; color:#9aa0b0; }
.cal2-time-col { display:flex; flex-direction:column; gap:4px; }
.cal2-weekday-row { margin-top:4px; }
.cal2-weekday-checks { display:flex; flex-wrap:wrap; gap:6px; }
.cal2-day-pill { display:inline-flex; align-items:center; gap:4px; background:#f0f4ff; border-radius:20px; padding:4px 10px; font-size:12px; font-weight:700; color:#3a5080; cursor:pointer; }
.cal2-day-pill input { cursor:pointer; accent-color:#2F72E8; }
.cal2-form-status { min-height:18px; font-size:13px; font-weight:600; padding:0 20px; }
.cal2-form-status.error { color:#e03c3c; }
.cal2-form-status.info { color:#7a95c8; }
.cal2-form-footer { display:flex; gap:10px; padding:14px 20px; border-top:1px solid #f0f4ff; }

/* Filter panel */
.cal2-filter-panel-card { background:#fff; border-radius:14px; padding:20px; width:320px; max-width:95vw; box-shadow:0 4px 20px rgba(47,114,232,.14); }
.cal2-filter-panel-card h3 { font-size:16px; font-weight:800; color:#1a2e52; margin:0 0 14px; }
.cal2-filter-section { margin-bottom:14px; }
.cal2-filter-section h4 { font-size:12px; font-weight:800; color:#7a95c8; text-transform:uppercase; margin:0 0 8px; }
.cal2-filter-body { margin-bottom:14px; }
.cal2-filter-pill { display:inline-flex; align-items:center; gap:5px; background:#f0f4ff; border-radius:20px; padding:4px 10px; font-size:12px; font-weight:700; color:#3a5080; cursor:pointer; margin:3px; }
.cal2-filter-pill input { cursor:pointer; }
.cal2-filter-actions { display:flex; gap:8px; margin-top:8px; }

/* Responsive */
@media (max-width: 600px) {
  .cal2-month-grid { grid-template-columns: repeat(7, 1fr); }
  .cal2-day-cell { min-height: 54px; padding: 4px 2px; }
  .cal2-event-chip { font-size: 9px; padding: 1px 4px; }
  .cal2-event-panel { width: 100%; border-radius: 16px 16px 0 0; top: auto; bottom: 0; max-height: 60vh; }
  .cal2-form-row-grid { grid-template-columns: 1fr; }
}

/* Kid view */
.lv-kid-view { display: flex; flex-direction: column; align-items: center; width: 100%; }
.lv-kid-step { width: 100%; display: flex; flex-direction: column; align-items: center; }
.lv-kid-view-title { font-size: 22px; font-weight: 900; color: var(--text, #0d1f4a); text-align: center; letter-spacing: -0.02em; margin-bottom: 3px; }
.lv-kid-view-sub { font-size: 13.5px; font-weight: 600; color: var(--muted, #7a95c8); text-align: center; margin-bottom: 16px; }

/* Avatar grid */
.lv-avatar-grid { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; width: 100%; }
.lv-avatar-item { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.lv-avatar-circle {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  border: 3px solid transparent;
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1); position: relative;
}
.lv-avatar-circle:hover { transform: scale(1.09); }
.lv-avatar-circle.selected { border-color: var(--blue, #2F72E8); transform: scale(1.12); box-shadow: 0 0 0 5px rgba(47,114,232,0.18); }
.lv-avatar-circle.selected::after {
  content: '✓'; position: absolute; bottom: -2px; right: -2px;
  width: 22px; height: 22px; background: var(--blue, #2F72E8); color: white; border-radius: 50%;
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid white;
}
.lv-avatar-name { font-size: 12.5px; font-weight: 700; color: #3a5080; }

/* PIN dots row */
.lv-pin-dots-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 16px; }
.lv-pin-dot {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2.5px solid var(--blue-mid, #ccdaf7); background: transparent;
  transition: all 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.lv-pin-dot.filled { background: var(--blue, #2F72E8); border-color: var(--blue, #2F72E8); transform: scale(1.15); }
.lv-pin-dot.error { background: #e03c3c; border-color: #e03c3c; animation: lvShake 0.3s ease; }
@keyframes lvShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

/* PIN pad */
.lv-pin-pad { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; width: 216px; margin: 0 auto 12px; }
.lv-pin-key {
  aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--blue-mid, #ccdaf7); background: var(--bg, #f6f8ff);
  font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 800; color: var(--text, #0d1f4a);
  cursor: pointer; transition: all 0.13s; display: flex; align-items: center; justify-content: center; user-select: none;
}
.lv-pin-key:hover { background: var(--blue-pale, #e8f0fd); border-color: var(--blue-light, #5a95f5); color: var(--blue, #2F72E8); }
.lv-pin-key:active { transform: scale(0.89); background: var(--blue, #2F72E8); color: #ffffff; border-color: var(--blue, #2F72E8); }
.lv-pin-key-empty { border-color: transparent; background: transparent; pointer-events: none; }

/* Back button */
.lv-back-btn {
  display: flex; align-items: center; gap: 5px; background: none; border: none;
  color: var(--muted, #7a95c8); font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; padding: 0; margin-bottom: 14px; align-self: flex-start; transition: color 0.15s;
}
.lv-back-btn:hover { color: var(--blue, #2F72E8); }

/* Selected avatar display */
.lv-selected-avatar { display: flex; flex-direction: column; align-items: center; gap: 5px; margin-bottom: 12px; }
.lv-selected-avatar-big {
  width: 68px; height: 68px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  animation: lvPopIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
  box-shadow: 0 4px 16px rgba(47,114,232,0.2);
}
@keyframes lvPopIn { from{transform:scale(0.4);opacity:0} to{transform:scale(1);opacity:1} }
.lv-selected-avatar-name { font-size: 16px; font-weight: 800; color: var(--text, #0d1f4a); }

.lv-pin-entry-title { font-size: 18px; font-weight: 900; color: var(--text, #0d1f4a); margin-bottom: 3px; text-align: center; }
.lv-pin-entry-sub { font-size: 13px; font-weight: 600; color: var(--muted, #7a95c8); margin-bottom: 14px; text-align: center; }
.lv-pin-error { font-size: 12.5px; font-weight: 700; color: #e03c3c; text-align: center; }
.lv-cooldown-msg { font-size: 12.5px; font-weight: 600; color: var(--muted, #7a95c8); text-align: center; }
.lv-locked-msg { font-size: 14px; font-weight: 600; color: #e03c3c; text-align: center; margin-bottom: 8px; }
.lv-locked-wrap { width: 100%; }

.lv-parent-pin-wrap { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; width: 216px; }

/* Success overlay */
.lv-success-overlay {
  position: absolute; inset: 0; background: var(--blue, #2F72E8); border-radius: 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease; z-index: 100;
}
.lv-success-overlay.show { opacity: 1; pointer-events: all; }
.lv-success-icon {
  width: 80px; height: 80px; background: var(--yellow, #F9C523); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  animation: lvPopIn 0.5s 0.15s cubic-bezier(0.34,1.56,0.64,1) both; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.lv-success-text { font-size: 30px; font-weight: 900; color: #ffffff; letter-spacing: -0.02em; animation: lvFadeUp 0.4s 0.35s ease both; }
.lv-success-sub { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.6); animation: lvFadeUp 0.4s 0.5s ease both; }

/* login-view wrapper: full viewport when logged out */
body.logged-out .login-view {
  position: fixed; inset: 0;
  overflow: hidden;
  padding: 0; max-width: none;
  display: flex; align-items: center; justify-content: center;
}

/* Mobile */
@media (max-width: 640px) {
  .lv-card { flex-direction: column; height: 100vh; height: 100dvh; border-radius: 0; width: 100%; }
  .lv-left { width: 100%; flex-shrink: 0; }
  .lv-adult-left { flex-direction: row; align-items: center; padding: 18px 22px; }
  .lv-left-body, .lvr1, .lvr2, .lv-left-deco { display: none; }
  .lv-logo-block { margin-bottom: 0; }
  .lv-mode-toggle { width: auto; }
  .lv-right { padding: 24px 24px 32px; flex: 1; overflow-y: auto; justify-content: flex-start; }
  .lv-kid-left { flex-direction: row; gap: 10px; padding: 16px 20px; justify-content: space-between; }
  .lv-stars-display { flex-direction: row; }
  .lv-star-row { gap: 6px; }
  .lv-star-item { font-size: 20px; }
  .lv-kid-left-msg h2 { font-size: 15px; }
  .lv-kid-left-msg p { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   HOUSEHOLD PICKER  (.hp-*)
   Full-page with frosted topbar, household cards, invite banner, modal
   ═══════════════════════════════════════════════════════════════════════════ */

#householdPickerView {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg, #f6f8ff);
  overflow-y: auto;
  z-index: 50;
}
#householdPickerView.active { display: block; }

/* Background blobs */
#householdPickerView::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 10% 20%, rgba(47,114,232,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(249,197,35,0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.hp-blob { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; }
.hp-blob1 { width: 400px; height: 400px; background: rgba(47,114,232,0.05); top: -120px; right: -80px; }
.hp-blob2 { width: 280px; height: 280px; background: rgba(249,197,35,0.07); bottom: -60px; left: -60px; }

/* Topbar */
.hp-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--blue-mid, #ccdaf7);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
  animation: hpSlideDown 0.4s ease both;
}
@keyframes hpSlideDown { from{opacity:0;transform:translateY(-12px)} to{opacity:1;transform:none} }
.hp-topbar-logo { display: flex; align-items: center; gap: 10px; }
.hp-topbar-logo svg { width: 36px; height: 36px; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.15)); }
.hp-wm-title { font-size: 15px; font-weight: 900; color: var(--text, #0d1f4a); display: block; }
.hp-wm-sub { font-size: 10px; font-weight: 600; color: var(--muted, #7a95c8); text-transform: uppercase; letter-spacing: 0.08em; display: block; }
.hp-topbar-user {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 6px 12px; border-radius: 100px; transition: background 0.2s;
}
.hp-topbar-user:hover { background: var(--blue-pale, #e8f0fd); }
.hp-topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue, #2F72E8); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
}
.hp-topbar-name { font-size: 14px; font-weight: 700; color: var(--text, #0d1f4a); }
.hp-sign-out-btn {
  font-size: 13px; font-weight: 700; color: var(--muted, #7a95c8);
  cursor: pointer; padding: 8px 14px; border-radius: 8px;
  border: 1.5px solid var(--blue-mid, #ccdaf7); background: transparent;
  font-family: 'Nunito', sans-serif; transition: all 0.2s;
}
.hp-sign-out-btn:hover { color: var(--blue, #2F72E8); border-color: var(--blue, #2F72E8); background: var(--blue-pale, #e8f0fd); }

/* Page content area */
.hp-page {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 100px 24px 60px;
  position: relative; z-index: 1;
}

/* Page header */
.hp-page-header {
  text-align: center; margin-bottom: 40px;
  animation: hpFadeUp 0.5s 0.1s ease both;
}
@keyframes hpFadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }
.hp-greeting {
  font-size: 13px; font-weight: 700; color: var(--blue, #2F72E8);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.hp-greeting::before, .hp-greeting::after { content: ''; width: 24px; height: 1.5px; background: var(--blue-mid, #ccdaf7); }
.hp-page-header h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 900; color: var(--text, #0d1f4a); letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 10px; }
.hp-page-header p { font-size: 15px; font-weight: 500; color: var(--muted, #7a95c8); line-height: 1.5; }

/* Invite banner */
.hp-invite-banner {
  width: 100%; max-width: 680px;
  background: linear-gradient(135deg, var(--yellow, #F9C523) 0%, #f5b800 100%);
  border-radius: 16px; padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; cursor: pointer;
  animation: hpFadeUp 0.5s 0.15s ease both;
  box-shadow: 0 4px 20px rgba(249,197,35,0.35);
  transition: all 0.2s;
}
.hp-invite-banner:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(249,197,35,0.45); }
.hp-invite-banner-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.hp-invite-banner-body { flex: 1; }
.hp-invite-banner-title { font-size: 14px; font-weight: 800; color: #0d1f4a; margin-bottom: 2px; }
.hp-invite-banner-sub { font-size: 12.5px; font-weight: 600; color: rgba(13,31,74,0.65); }
.hp-invite-banner-cta {
  font-size: 13px; font-weight: 800; color: #0d1f4a;
  background: rgba(255,255,255,0.4); border-radius: 8px;
  padding: 8px 14px; white-space: nowrap; transition: background 0.2s;
}
.hp-invite-banner:hover .hp-invite-banner-cta { background: rgba(255,255,255,0.6); }

/* Households grid */
.hp-grid { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }

.hp-card {
  background: #ffffff; border: 2px solid var(--blue-mid, #ccdaf7);
  border-radius: 20px; padding: 22px 24px;
  cursor: pointer; transition: all 0.22s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 2px 8px rgba(13,31,74,0.06), 0 8px 32px rgba(13,31,74,0.08);
  display: flex; align-items: center; gap: 18px; position: relative;
  animation: hpFadeUp 0.5s ease both;
}
.hp-card:nth-child(1) { animation-delay: 0.2s; }
.hp-card:nth-child(2) { animation-delay: 0.28s; }
.hp-card:nth-child(3) { animation-delay: 0.36s; }
.hp-card:hover { border-color: var(--blue, #2F72E8); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(47,114,232,0.15), 0 16px 48px rgba(13,31,74,0.12); }
.hp-card.selected { border-color: var(--blue, #2F72E8); background: var(--blue-pale, #e8f0fd); box-shadow: 0 4px 16px rgba(47,114,232,0.15), 0 16px 48px rgba(13,31,74,0.12); }

.hp-card-icon { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; transition: transform 0.2s; }
.hp-card:hover .hp-card-icon { transform: scale(1.08); }

.hp-card-info { flex: 1; min-width: 0; }
.hp-card-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hp-card-name { font-size: 18px; font-weight: 900; color: var(--text, #0d1f4a); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 100px; white-space: nowrap; flex-shrink: 0; }
.hp-badge-primary { background: var(--blue, #2F72E8); color: white; }
.hp-badge-owner { background: var(--yellow, #F9C523); color: #0d1f4a; }
.hp-badge-pending { background: #fff0c0; color: #a07000; border: 1px solid #f0d060; }
.hp-badge-guardian { background: var(--blue-pale, #e8f0fd); color: var(--blue, #2F72E8); border: 1px solid var(--blue-mid, #ccdaf7); }

.hp-card-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hp-card-meta-item { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted, #7a95c8); }

.hp-member-pips { display: flex; align-items: center; }
.hp-pip { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #ffffff; display: flex; align-items: center; justify-content: center; font-size: 12px; margin-left: -6px; background: var(--blue-pale, #e8f0fd); }
.hp-pip:first-child { margin-left: 0; }
.hp-pip-count { font-size: 10px; font-weight: 800; color: var(--muted, #7a95c8); background: var(--bg, #f6f8ff); border: 2px solid #ffffff; }

.hp-card-last { font-size: 11.5px; font-weight: 600; color: var(--muted, #7a95c8); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.hp-recency-dot { width: 6px; height: 6px; border-radius: 50%; }
.hp-recency-today { background: #22c55e; }
.hp-recency-recent { background: var(--yellow, #F9C523); }
.hp-recency-old { background: var(--blue-mid, #ccdaf7); }

.hp-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.hp-enter-btn { padding: 10px 20px; border-radius: 12px; border: none; font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; cursor: pointer; transition: all 0.18s; white-space: nowrap; }
.hp-btn-blue { background: var(--blue, #2F72E8); color: white; box-shadow: 0 3px 14px rgba(47,114,232,0.32); }
.hp-btn-blue:hover { background: var(--blue-dark, #1d55c4); transform: translateY(-1px); box-shadow: 0 5px 18px rgba(47,114,232,0.4); }
.hp-btn-outline { background: transparent; color: var(--blue, #2F72E8); border: 2px solid var(--blue-mid, #ccdaf7); }
.hp-btn-outline:hover { background: var(--blue-pale, #e8f0fd); border-color: var(--blue, #2F72E8); }
.hp-role-pill { font-size: 11px; font-weight: 700; color: var(--muted, #7a95c8); background: var(--bg, #f6f8ff); border: 1.5px solid var(--blue-mid, #ccdaf7); border-radius: 100px; padding: 3px 10px; text-align: center; }

.hp-selected-check {
  position: absolute; top: 16px; right: 16px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue, #2F72E8); color: white;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
  opacity: 0; transform: scale(0.6); transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.hp-card.selected .hp-selected-check { opacity: 1; transform: scale(1); }

/* Bottom actions */
.hp-bottom { width: 100%; max-width: 680px; animation: hpFadeUp 0.5s 0.45s ease both; }
.hp-remember-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  padding: 14px 18px; background: #ffffff; border-radius: 12px; border: 1.5px solid var(--blue-mid, #ccdaf7);
}
.hp-remember-row input[type=checkbox] { accent-color: var(--blue, #2F72E8); width: 16px; height: 16px; cursor: pointer; }
.hp-remember-row label { font-size: 13.5px; font-weight: 600; color: #3a5080; cursor: pointer; user-select: none; flex: 1; }
.hp-remember-row .hp-remember-note { font-size: 11.5px; font-weight: 600; color: var(--muted, #7a95c8); text-align: right; }

.hp-enter-main {
  width: 100%; padding: 17px;
  background: var(--blue, #2F72E8); color: white;
  border: none; border-radius: 16px;
  font-family: 'Nunito', sans-serif; font-size: 17px; font-weight: 800;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(47,114,232,0.38);
  opacity: 0.45; pointer-events: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.hp-enter-main.ready { opacity: 1; pointer-events: all; }
.hp-enter-main:hover { background: var(--blue-dark, #1d55c4); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(47,114,232,0.45); }

.hp-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.hp-divider::before, .hp-divider::after { content: ''; flex: 1; height: 1.5px; background: var(--blue-mid, #ccdaf7); }
.hp-divider span { font-size: 12px; font-weight: 700; color: var(--muted, #7a95c8); white-space: nowrap; }

.hp-add-btn {
  width: 100%; padding: 14px;
  background: transparent; color: var(--blue, #2F72E8);
  border: 2px dashed var(--blue-mid, #ccdaf7); border-radius: 16px;
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.hp-add-btn:hover { background: var(--blue-pale, #e8f0fd); border-color: var(--blue, #2F72E8); color: var(--blue-dark, #1d55c4); }

/* Success overlay */
.hp-success-overlay {
  position: fixed; inset: 0; background: var(--blue, #2F72E8); z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.hp-success-overlay.show { opacity: 1; pointer-events: all; }
.hp-success-icon {
  width: 88px; height: 88px; background: var(--yellow, #F9C523); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 44px;
  animation: hpPopIn 0.5s 0.15s cubic-bezier(0.34,1.56,0.64,1) both; box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
@keyframes hpPopIn { from{transform:scale(0.3);opacity:0} to{transform:scale(1);opacity:1} }
.hp-success-name { font-size: 32px; font-weight: 900; color: white; letter-spacing: -0.025em; animation: hpFadeUp 0.4s 0.35s ease both; }
.hp-success-sub { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.6); animation: hpFadeUp 0.4s 0.5s ease both; }

/* Invite modal */
.hp-modal-bg {
  position: fixed; inset: 0; background: rgba(13,31,74,0.5);
  z-index: 150; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
  backdrop-filter: blur(4px);
}
.hp-modal-bg.show { opacity: 1; pointer-events: all; }
.hp-modal {
  background: white; border-radius: 24px; width: min(440px, 92vw);
  padding: 32px; position: relative;
  box-shadow: 0 24px 80px rgba(13,31,74,0.2);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.hp-modal-bg.show .hp-modal { transform: none; }
.hp-modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg, #f6f8ff); border: none; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  color: var(--muted, #7a95c8); transition: background 0.2s;
}
.hp-modal-close:hover { background: var(--blue-pale, #e8f0fd); color: var(--blue, #2F72E8); }
.hp-modal-icon { font-size: 36px; margin-bottom: 14px; }
.hp-modal-title { font-size: 22px; font-weight: 900; color: var(--text, #0d1f4a); letter-spacing: -0.02em; margin-bottom: 6px; }
.hp-modal-sub { font-size: 14px; font-weight: 500; color: var(--muted, #7a95c8); line-height: 1.5; margin-bottom: 20px; }
.hp-modal-hh-name { background: var(--blue-pale, #e8f0fd); border-radius: 12px; padding: 14px 18px; font-size: 16px; font-weight: 800; color: var(--blue, #2F72E8); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.hp-modal-actions { display: flex; gap: 10px; }
.hp-modal-btn { flex: 1; padding: 13px; border-radius: 12px; border: none; font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; cursor: pointer; transition: all 0.18s; }
.hp-modal-btn-primary { background: var(--blue, #2F72E8); color: white; box-shadow: 0 3px 14px rgba(47,114,232,0.35); }
.hp-modal-btn-primary:hover { background: var(--blue-dark, #1d55c4); }
.hp-modal-btn-secondary { background: var(--bg, #f6f8ff); color: #3a5080; border: 2px solid var(--blue-mid, #ccdaf7); }
.hp-modal-btn-secondary:hover { background: var(--blue-pale, #e8f0fd); border-color: var(--blue-mid, #ccdaf7); color: var(--blue, #2F72E8); }

@media (max-width: 600px) {
  .hp-topbar { padding: 0 20px; }
  .hp-topbar-name { display: none; }
  .hp-page { padding: 88px 16px 48px; }
  .hp-card { flex-wrap: wrap; padding: 18px; }
  .hp-card-right { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
}
