/* Details page card style: reserved as .detail-card, not .card */
.detail-card {
  background: var(--neutral-layer-1, #fff);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  padding: 1.5rem;
  margin: 0 auto;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.detail-card .card-header {
  margin-bottom: 0.5rem;
}
.detail-card .card-body {
  padding: 0;
}
.detail-card .challenge-actions {
  margin-top: 1.5rem;
  padding-top: 12px;
  border-top: none;
}
.challenge-actions .actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 12px !important;
  margin-top: 0 !important;
}
/* Aggressively clear all outer border, box-shadow, and outline from anchor and Fluent UI part inside challenger, including all states */
.person-sub.challenger a.control,
.person-sub.challenger a.control[part="control"],
.person-sub.challenger [part="control"],
.person-sub.challenger a.control:focus,
.person-sub.challenger a.control:active,
.person-sub.challenger a.control:hover,
.person-sub.challenger [part="control"]:focus,
.person-sub.challenger [part="control"]:active,
.person-sub.challenger [part="control"]:hover {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent !important;
}
/* Remove border, box-shadow, and outline from anchor and Fluent UI part inside challenger */
.person-sub.challenger a.control,
.person-sub.challenger a.control[part="control"],
.person-sub.challenger [part="control"] {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
/* Remove border from anchor inside challenger person-sub */
.person-sub.challenger a.control {
  border: none !important;
}
/* Remove border from challenger person-sub */
.person-sub.challenger {
  border: none !important;
}
.card {
  height: 255px !important;
  min-height: 255px !important;
  max-height: 255px !important;
}
.challengers {
  height: 120px !important;
  min-height: 120px !important;
  max-height: 120px !important;
}
@media (min-width: 481px) {
  .desktop-history-table th:first-child,
  .desktop-history-table td:first-child {
    width: 5%;
    min-width: 32px;
    max-width: 40px;
    text-align: center;
  }
  .desktop-history-table th:nth-child(2),
  .desktop-history-table td:nth-child(2) {
    width: 32%;
    min-width: 120px;
    max-width: 260px;
    word-break: break-word;
  }
}
@media (max-width: 480px) {
  .history-label {
    font-weight: bold;
  }
}
/* History table responsive switch: show table on desktop, flex on mobile */
.history-table-row.table-row { display: table-row; }
.history-table-row.flex-row { display: none; }
@media (max-width: 480px) {
  .history-table-row.table-row { display: none !important; }
  .history-table-row.flex-row { display: flex !important; flex-direction: row; align-items: flex-start; gap: 12px; border-bottom: 1px solid #eee; padding: 8px 0; }
}
/* Responsive history table: two-line layout for small screens */
@media (max-width: 480px) {
  .history-table-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
  }
  .history-table-row .history-col.index {
    min-width: 36px;
    font-weight: 600;
    color: #222;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2px;
  }
  .history-table-row .history-col.body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .history-table-row .history-main,
  .history-table-row .history-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .history-table-row .history-main {
    font-size: 1em;
  }
  .history-table-row .history-meta {
    font-size: 0.95em;
    color: #555;
  }
}
.ns-nowrap {
  white-space: nowrap;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.actions {
  margin: 0 !important;
  padding: 0 !important;
  margin-top: auto !important;
}
.actions {
  margin: 0 !important;
  padding: 0 !important;
  margin-top: auto !important;
}
/* .actions: Remove all margin and padding */
.actions {
  margin: 0 !important;
  padding: 0 !important;
}
#menuSignOut:hover::part(control),
#menuSignOut:focus-visible::part(control) {
  background: var(--neutral-layer-3) !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
#mobileMenu,
#mobileMenu::part(control),
#mobileMenu::part(content),
#mobileMenu::part(start),
#mobileMenu::part(end),
#mobileMenu fluent-menu-item,
#mobileMenu fluent-menu-item::part(control),
#mobileMenu fluent-menu-item::part(content),
#mobileMenu fluent-menu-item::part(start),
#mobileMenu fluent-menu-item::part(end) {
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  outline: none !important;
}

#mobileMenu fluent-menu-item:not(:last-of-type),
#mobileMenu fluent-menu-item:not(:last-of-type)::part(control) {
  border-bottom: none !important;
  box-shadow: none !important;
}

#mobileMenu #menuSignOut,
#mobileMenu #menuSignOut::part(control) {
  border: none !important;
  border-top: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  outline: none !important;
}
#mobileMenu fluent-menu-item::part(separator),
#mobileMenu [role="separator"],
#mobileMenu slot[name="separator"] {
  display: none !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}
#mobileMenu {
  border: none !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.10) !important;
  outline: none !important;
}
#mobileMenu fluent-menu-item,
#mobileMenu fluent-menu-item::part(control) {
  margin-bottom: 0 !important;
  border-bottom: none !important;
}
#mobileMenu fluent-menu-item,
#mobileMenu fluent-menu-item::part(control),
#mobileMenu fluent-menu-item:last-of-type,
#mobileMenu fluent-menu-item:last-of-type::part(control) {
  border: none !important;
  border-top: none !important;
  box-shadow: none !important;
  outline: none !important;
}
#mobileMenu #menuSignOut,
#mobileMenu #menuSignOut::part(control) {
  border-top: none !important;
  box-shadow: none !important;
}
#mobileMenu #menuSignOut:hover,
#mobileMenu #menuSignOut:focus-visible,
#mobileMenu #menuSignOut:hover::part(control),
#mobileMenu #menuSignOut:focus-visible::part(control) {
  background: var(--neutral-layer-3) !important;
}
#menuSignOut:hover::part(control),
#menuSignOut:focus-visible::part(control) {
  background: var(--neutral-layer-3) !important;
}
#mobileMenu fluent-menu-item::part(control) {
  background: transparent !important;
  transition: background 0.18s;
}
#mobileMenu fluent-menu-item:hover::part(control),
#mobileMenu fluent-menu-item:focus-visible::part(control) {
  background: var(--neutral-layer-3) !important;
}
/* Shrink the start slot in fluent-menu-item for compactness */
#mobileMenu fluent-menu-item::part(start),
fluent-menu-item::part(start) {
  min-width: 0 !important;
  width: 1.2em !important;
  max-width: 1.2em !important;
  flex: 0 0 1.2em !important;
  padding: 0 !important;
  overflow: hidden !important;
}
/* Nav bar styles unified from nav_bar.html */
:root { --design-unit: 4; }
/* Utility grid for card collections */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}
body { margin: 0; background: var(--fill-color); color: var(--neutral-foreground-rest); }
html, body { overflow-x: hidden; }

/* Ensure the HTML hidden attribute wins over other display rules */
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 5000;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 12px; padding: 8px 12px;
  background: var(--neutral-layer-2);
  box-shadow: var(--elevation-shadow-card);
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: inherit;
}

.brand fluent-avatar { --avatar-size: 28px; }
/* Top-right nav avatar sizing */
.utils #navAvatar { --avatar-size: 28px; }

.links {
  display: flex; align-items: center; gap: 4px; justify-content: center;
}

.utils {
  display: inline-flex; align-items: center; gap: 6px;
}

/* Mobile menu: hidden by default; JS toggles it */
#mobileMenu {
  display: none;
  position: fixed;
  right: 8px;
  top: 56px;
  min-width: 180px; /* more compact */
  background: #fff; /* strong contrast for menu */
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1.5px 6px rgba(0,0,0,0.10); /* deeper shadow */
  border-radius: 12px;
  z-index: 5500;
  text-align: left; /* ensure left alignment by default */
  padding: 4px; /* less breathing room for compactness */
  height: auto;
}

/* Ensure all mobile menu items are left-aligned like other entries */
#mobileMenu fluent-menu-item,
#mobileMenu fluent-menu-item::part(control),
#mobileMenu fluent-menu-item::part(content) {
  justify-content: flex-start;
  text-align: left;
}

/* Specifically ensure Sign out menu item is left-aligned */
#mobileMenu #menuSignOut,
#mobileMenu #menuSignOut::part(control),
#mobileMenu #menuSignOut::part(content) {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

#mobileMenu #menuSignOut {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
  text-align: left !important;
  justify-content: flex-start !important;
}

/* Additional Fluent UI specific overrides for menu items */
#mobileMenu fluent-menu-item {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  text-align: left !important;
  padding: 6px 8px !important; /* reduced left/right padding */
  margin: 0 !important;
  height: auto !important;
  min-height: 28px !important; /* reduced height */
  line-height: 1.2 !important;
  border-radius: 4px !important;
  background: transparent !important;
}

/* Hover/active feedback */
#mobileMenu fluent-menu-item:hover,
#mobileMenu fluent-menu-item:focus-visible {
  background: var(--neutral-layer-3) !important;
}

/* Override any Fluent UI default centering and ensure identical styling */
#mobileMenu fluent-menu-item::part(positioning-region),
#mobileMenu fluent-menu-item::part(content),
#mobileMenu fluent-menu-item::part(start),
#mobileMenu fluent-menu-item::part(end) {
  justify-content: flex-start !important;
  text-align: left !important;
  display: flex !important;
  align-items: center !important;
  padding: 8px 6px !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure all menu items have identical font and spacing */
#mobileMenu fluent-menu-item,
#mobileMenu #menuSignOut {
  font-size: 14px !important;
  font-weight: 400 !important;
  font-family: inherit !important;
  padding: 6px 8px !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  width: 100% !important;
  text-align: left !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  white-space: nowrap !important; /* keep labels in one line */
}

/* Soft spacing between items */
#mobileMenu fluent-menu-item:not(:last-of-type) {
  margin-bottom: 2px !important;
}

#mobileMenu fluent-menu-item[hidden] {
  display: none !important;
}

/* ------------------ Home page styles (scoped) ------------------ */
.home-panel {
  padding: 28px 0 48px;
  background: linear-gradient(180deg, var(--neutral-layer-1, #fff) 0%, var(--neutral-layer-2, #f7f7f8) 100%);
}
.home-panel .hero {
  padding: 48px 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(100,116,139,0.06), rgba(255,255,255,0));
}
.home-panel .hero .hero-title {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.08;
  font-weight: 700;
}
.home-panel .hero .hero-sub { color: #475569; margin: 0 0 1rem; }
.home-panel .carousel { display: block; max-width: 980px; margin: 0 auto; }
.carousel-slide { padding: 18px 12px; border-radius: 12px; }
.carousel-slide--active { background: rgba(255,255,255,0.96); box-shadow: 0 6px 20px rgba(16,24,40,0.06); }

/* Carousel visuals */
.carousel-viewport { overflow: hidden; width: 100%; }

/* New carousel component: horizontal track with flexible slides */
.carousel-component { position: relative; max-width: 980px; margin: 0 auto; }
.carousel-track { display: flex; gap: 16px; transition: transform 520ms cubic-bezier(.2,.8,.2,1); will-change: transform; }
.carousel-viewport [data-track] { align-items: stretch; }
.carousel-slide { flex: 0 0 100%; box-sizing: border-box; padding: 18px 12px; background: transparent; border-radius: 12px; opacity: 0.0; transition: opacity 360ms ease; }
.carousel-slide[data-active] { opacity: 1; background: rgba(255,255,255,0.96); box-shadow: 0 6px 20px rgba(16,24,40,0.06); }

/* Controls */
.carousel-controls { position: absolute; top: 50%; left: 0; right: 0; display: flex; justify-content: space-between; transform: translateY(-50%); pointer-events: none; }
.carousel-btn { pointer-events: auto; background: rgba(255,255,255,0.6); border: 1px solid rgba(15,23,42,0.16); width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #0f172a; box-shadow: 0 8px 20px rgba(15,23,42,0.2); backdrop-filter: blur(2px); opacity: 0.4; }
.carousel-btn:hover { background: rgba(255,255,255,0.82); }
.carousel-btn:focus-visible { outline: 2px solid rgba(15,23,42,0.4); outline-offset: 2px; }
.carousel-btn.prev { margin-left: 8px; }
.carousel-btn.next { margin-right: 8px; }

/* Indicators */
.carousel-indicators { display:flex; gap:8px; justify-content:center; margin-top:12px; }
.carousel-indicators button { width:12px; height:12px; border-radius:50%; border:none; background:rgba(16,24,40,0.12); cursor:pointer; }
.carousel-indicators button[aria-current="true"] { background: rgba(16,24,40,0.88); }

/* Small screens: reduce gaps and controls size */
@media (max-width: 640px) {
  .carousel-track { gap: 8px; }
  .carousel-btn { width: 36px; height: 36px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .carousel-track { transition: none !important; }
}


.home-panel .cta { display:flex; justify-content:center; padding: 28px 12px; }
.home-panel .cta-inner { max-width: 920px; text-align: center; }
.home-panel .cta-title { font-size: 1.5rem; margin-bottom: 6px; }
.home-panel .cta-copy { color: #475569; margin-bottom: 14px; }
.home-panel .cta-actions .fluent-button {
  display: inline-block; margin: 0 6px; padding: 10px 16px; border-radius: 8px; text-decoration: none;
  border: none; cursor: pointer; font: inherit;
}
.home-panel .cta-actions .fluent-button:focus-visible {
  outline: 2px solid var(--accent-fill-rest, #0078d4);
  outline-offset: 2px;
}
.home-panel .cta-actions .primary { background: var(--accent-fill-rest, #0078d4); color: #fff; }
.home-panel .cta-actions .outline { border: 1px solid rgba(0,0,0,0.08); background: transparent; color: inherit; }

.home-panel .home-challenges {
  padding: 32px 12px 16px;
  transition: opacity 200ms ease;
}
.home-panel .home-challenges[hidden] {
  display: none;
}
.home-challenges__header {
  max-width: 840px;
  margin: 0 auto 24px;
  text-align: center;
}
.home-challenges__header .lead {
  margin: 8px auto 0;
  color: #334155;
  max-width: 640px;
}
.home-challenges__carousel {
  max-width: 960px;
  width: 100%;
}
.challenge-slide {
  position: relative;
  --challenge-accent: #2563eb;
  border-left: 6px solid var(--challenge-accent);
  padding: 26px 22px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(15,23,42,0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.challenge-slide[data-active] {
  box-shadow: 0 16px 44px rgba(15,23,42,0.18);
}
.challenge-slide__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.challenge-slide__badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(15,23,42,0.14);
  color: #0f172a;
}
.challenge-slide__title {
  margin: 6px 0 4px;
  font-size: 1.5rem;
  line-height: 1.25;
}
.challenge-slide__purpose {
  margin: 0;
  color: #1f2937;
}
.challenge-slide__subhead {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}
.challenge-slide__list {
  margin: 0;
  padding-left: 20px;
  color: #1f2937;
}
.challenge-slide__how,
.challenge-slide__conditions {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(148,163,184,0.18);
}
.challenge-slide__list li {
  margin-bottom: 6px;
}
.challenge-slide__list li:last-child {
  margin-bottom: 0;
}
.challenge-slide__actions {
  margin-top: auto;
}
.challenge-slide__cta {
  min-width: 148px;
}
.challenge-slide__cta::part(control) {
  min-width: 148px;
}
.challenge-slide__cta::part(control):focus-visible {
  outline: 2px solid var(--challenge-accent, #2563eb);
  outline-offset: 2px;
}
.challenge-slide--empty {
  padding: 24px;
  border-radius: 12px;
  background: rgba(15,23,42,0.05);
  text-align: center;
  color: #475569;
}

.home-panel .about { padding: 28px 12px; }
.home-panel .container { max-width: 1000px; margin: 0 auto; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.feature { background: var(--neutral-layer-1, #fff); padding: 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(16,24,40,0.04); }
.feature h3 { margin: 0 0 8px; }

.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.team-member { background: var(--neutral-layer-1, #fff); padding: 14px; border-radius: 10px; text-align: center; }
.team-member .avatar { width:56px; height:56px; border-radius:50%; background: #e6eef9; display:inline-flex; align-items:center; justify-content:center; margin:0 auto 8px; font-weight:700; color:#0b3c5d; }

.testimonials-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
.testimonial { padding: 14px; background: #fff; border-radius: 10px; box-shadow: 0 6px 20px rgba(16,24,40,0.04); }
.testimonial p { margin: 0 0 8px; }
.testimonial cite { color: #6b7280; font-size: 0.95rem; }

.site-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.05); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; max-width: 1000px; margin: 0 auto; }
.site-credits { text-align:center; padding: 12px 0 0; color: #667085; }

@media (max-width: 880px) {
  .features-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
  .home-panel .hero .hero-title { font-size: 1.5rem; }
}

/* end home styles */


#mobileMenu .nav-auth-hidden {
  display: none !important;
}

/* Ensure the Sign out item (#menuSignOut) hides when requested even though
   it has an overly specific display rule elsewhere. These selectors are as
   specific or more specific than `#mobileMenu #menuSignOut` so they win. */
#mobileMenu #menuSignOut[hidden],
#mobileMenu #menuSignOut.nav-auth-hidden {
  display: none !important;
}

/* Remove visual divider above Sign out - prefer spacing only */
#mobileMenu #menuSignOut {
  margin-top: 6px !important;
  padding-top: 6px !important; /* reduced spacing, no border */
  border-top: none !important;
}

/* Defensive: hide any pseudo-elements that might draw a hairline
   inside the fluent-menu-item parts when hovered/active. This targets
   control/content/start parts for the Sign out item specifically. */
#mobileMenu #menuSignOut::part(control)::before,
#mobileMenu #menuSignOut::part(control)::after,
#mobileMenu #menuSignOut::part(content)::before,
#mobileMenu #menuSignOut::part(content)::after,
#mobileMenu #menuSignOut::part(start)::before,
#mobileMenu #menuSignOut::part(start)::after {
  display: none !important;
  content: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border: none !important;
}

.nav-auth-hidden {
  display: none !important;
}

/* --- Details confirm section: align with card view styles --- */
#challengeActions { padding: 0.25rem 0 1rem; }
#challengeActions fluent-text { display:block; text-align:center; }

@media (max-width: 720px) {
  .links { display: none; }
  #menuButton { display: inline-flex; margin-left: auto; }
  #themeSwitch { display: none; }
  /* On small screens, keep only the hamburger menu visible.
    Force-hide the desktop sign-out button (#navSignOut) even if JS toggles it. */
  .utils { justify-self: end; }
  #navSignOut { display: none !important; }
  .brand { justify-self: start; }
}

@media (min-width: 721px) {
  #menuButton { display: none; }
}

.navbtn::part(control) { padding-inline: 10px; }
.navbtn[aria-current="page"]::part(control) {
  background: var(--neutral-layer-3);
  border-radius: calc(var(--control-corner-radius) * 1px);
}
/* Site-wide default font and font size */
body {
  font-family: "Segoe UI", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #222;
}
/* Footer links: default font and font size */
.footer-links, .footer-links a {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}
/* Default link styles: keep simple to avoid load-time flicker */
a {
  color: inherit;
  text-decoration: none;
  font-family: inherit;
  font-size: inherit;
}

/* Use accent color on hover. For Fluent web components we can't set attributes via CSS, so style their parts to the accent color */
:root {
  --fluent-accent-color: #0063b1; /* adjust to match your Fluent "accent" */
}

.footer-hover-link:hover, .footer-hover-link:focus {
  color: #fff;
  background: linear-gradient(90deg, #036ac4 90%, #024885 100%);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(3,106,196,0.08);
  border: none;
  outline: none;
  font-size: 1rem;
  transition: color 0.2s, background 0.2s, border-radius 0.2s, box-shadow 0.2s;
}

/* Ensure footer links have consistent horizontal padding and margin */
.footer-links .footer-hover-link {
  font-family: "Segoe UI", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #222;
  margin: 4px 0;
  padding: 6px 16px; /* set same horizontal padding as hover */
  border-radius: 4px;
  transition: background 0.2s, border-radius 0.2s, box-shadow 0.2s;
}

/* On hover, only change background and border-radius, not padding */
.footer-links .footer-hover-link:hover,
.footer-links .footer-hover-link:focus {
  background: #e0e6ed;
  color: #222;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(3,106,196,0.08);
  border: none;
  outline: none;
  /* padding and margin remain unchanged */
}

a.custom-anchor:hover {
  color: #0078d4 !important;
  transition: none;
}

a.custom-anchor,
a.custom-anchor:visited,
.custom-anchor {
  color: #0078d4 !important;
  text-decoration: none !important;
  padding: 4px 6px;
  transition: color 0.2s;
  border: none !important;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  position: relative;
  gap: 4px;
}

.custom-anchor::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: transparent;
  transition: background 0.2s;
  pointer-events: none;
}

.custom-anchor:hover::before {
  background: rgba(0,0,0,0.08);
}

a.custom-anchor::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  background: var(--neutral-layer-4, rgba(0,0,0,0.05));
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

a.custom-anchor:hover::before {
  opacity: 1;
}

a.custom-anchor,
a.custom-anchor:visited,
fluent-anchor,
fluent-anchor::part(content),
fluent-anchor::part(control),
fluent-anchor a {
  text-decoration: none !important;
}

fluent-anchor {
  --neutral-stroke-layer-rest: transparent;
  --neutral-stroke-layer-hover: transparent;
  --neutral-stroke-layer-active: transparent;
  --neutral-stroke-layer-focus: transparent;
}

#challengers {
  color: #333;
  transition: color 0.2s;
}
fluent-card:hover #challengers {
  color: #111;
}

.badge-topright {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Fixed height for challenge card */
fluent-card.card {
  display: flex;
  flex-direction: column;
  height: var(--card-height, 350px); /* increased to avoid inner scrollbars */
  box-sizing: border-box;
  overflow: hidden;
}

/* Card layout refinements: keep title, challengers and actions consistent */
.card .title-row {
  height: 40px; /* fixed header height */
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card .title-row .custom-anchor {
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* .card .challengers flexbox growth removed; fixed height applies via .challengers */

.card .person-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
  max-width: 100%;
}

/* Also ensure the anchor content inside challenger items truncates cleanly */
.card .challengers .custom-anchor {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .actions {
  height: 48px; /* consistent actions height */
  min-height: 48px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Ensure avatar sizing inside card is compact */
.card fluent-avatar {
  --avatar-size: 28px;
}

/* Details view: allow full height for the card inside the details panel */
#detailPanel fluent-card.card,
.detail-body fluent-card.card {
  height: auto !important;
  overflow: visible !important;
}

fluent-card.card .actions {
  margin-top: auto;
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* Ensure cards stretch full column width in the grid */
.card-grid fluent-card.card {
  width: 300px;
  /* Optional: lock basis to 300px to avoid flex grow/shrink surprises */
  flex: 0 0 300px;
}


/* --- My wall layout --- */
.my-panel {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  box-sizing: border-box;
}

.my-panel-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.my-panel .panel-title {
  margin: 0;
}

.my-panel .panel-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--neutral-foreground-2-rest, #6b7280);
}

.my-wall-status {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--neutral-foreground-2-rest, #6b7280);
}

.my-wall-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.call-challenge-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

fluent-card.my-wall-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
}

.my-wall-card-header {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.75rem;
}

.my-wall-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neutral-foreground-rest, #111827);
}

.my-wall-role {
  font-size: 0.9rem;
  color: var(--neutral-foreground-2-rest, #6b7280);
}

.my-wall-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  align-items: start;
  text-align: left;
}

.my-wall-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.my-wall-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--neutral-foreground-2-rest, #6b7280);
}

.my-wall-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--neutral-foreground-rest, #111827);
}

.my-wall-sub {
  font-size: 0.85rem;
  color: var(--neutral-foreground-2-rest, #6b7280);
}

.my-wall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#profilePanel .my-wall-actions {
  justify-content: flex-end;
}

.my-wall-actions fluent-button {
  flex: 0 0 auto;
}

.my-wall-actions fluent-button::part(control) {
  min-width: 140px;
}

#profilePanel .friend-list-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--neutral-stroke-rest, #d1d5db);
  border-radius: 10px;
  background: var(--neutral-layer-1, #f9fafb);
}

.friend-list-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.friend-list-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  background: var(--neutral-layer-floating, #ffffff);
  border-radius: 999px;
  border: 1px solid var(--neutral-stroke-rest, #d1d5db);
  flex: 0 0 auto;
  max-width: 100%;
  white-space: nowrap;
  min-height: 2.2rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.friend-list-entry:focus-within,
.friend-list-entry:hover {
  border-color: var(--accent-foreground-rest, #1d4ed8);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.friend-list-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--accent-foreground-rest, #1d4ed8);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  min-width: 1.15rem;
  min-height: 1.15rem;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.friend-list-add-icon:hover,
.friend-list-add-icon:focus-visible {
  background: rgba(29, 78, 216, 0.12);
  color: var(--accent-foreground-rest, #153eaa);
}

.friend-list-add-icon:active {
  background: rgba(29, 78, 216, 0.18);
}

.friend-list-entry a {
  font-size: 0.95rem;
  color: var(--neutral-foreground-rest, #1f2937);
  word-break: break-word;
  text-decoration: none;
}
.friend-list-entry a:hover,
.friend-list-entry a:focus {
  text-decoration: underline;
  color: var(--accent-foreground-rest, #1d4ed8);
}

.add-friend-panel {
  margin: 1.5rem 0;
}

.add-friend-panel[hidden] {
  display: none !important;
}

fluent-card.add-friend-card::part(control) {
  background: none;
}

#addFriendPanel {
  border: 1px solid var(--neutral-stroke-rest, #d1d5db);
  border-radius: 14px;
  background: var(--neutral-layer-1, #f9fafb);
  padding: 1.25rem;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.add-friend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.add-friend-title {
  margin: 0;
  font-size: 1.1rem;
  color: var(--neutral-foreground-rest, #111827);
}

.add-friend-close {
  background: transparent;
  border: none;
  color: var(--neutral-foreground-2-rest, #6b7280);
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.add-friend-close:hover,
.add-friend-close:focus {
  background: rgba(15, 23, 42, 0.08);
  color: var(--neutral-foreground-rest, #111827);
  outline: none;
}

.add-friend-search {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.add-friend-search fluent-text-field {
  width: 100%;
}

.add-friend-status {
  margin: 0;
  font-size: 0.95rem;
  color: var(--neutral-foreground-2-rest, #6b7280);
}

.add-friend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
}

.add-friend-item {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--neutral-stroke-rest, #d1d5db);
  border-radius: 12px;
  background: var(--neutral-layer-floating, #ffffff);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  flex: 1 1 260px;
  max-width: 320px;
}

.add-friend-item:hover {
  border-color: var(--accent-foreground-rest, #1d4ed8);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.add-friend-avatar {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  font-size: 1rem;
}

.add-friend-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.add-friend-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.add-friend-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--neutral-foreground-rest, #111827);
}

.add-friend-name a {
  color: inherit;
  text-decoration: none;
}

.add-friend-name a:hover,
.add-friend-name a:focus {
  color: var(--accent-foreground-rest, #1d4ed8);
  text-decoration: underline;
}

.add-friend-quote {
  margin: 0;
  font-size: 0.9rem;
  color: var(--neutral-foreground-2-rest, #4b5563);
  line-height: 1.4;
  white-space: pre-line;
}

.add-friend-action {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  border: none;
  background: rgba(29, 78, 216, 0.12);
  color: var(--accent-foreground-rest, #1d4ed8);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.add-friend-action:hover,
.add-friend-action:focus {
  background: var(--accent-foreground-rest, #1d4ed8);
  color: #fff;
  outline: none;
}

.add-friend-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .add-friend-item {
    flex-basis: 100%;
    max-width: none;
    padding-right: 3rem;
  }
}

#friendSessionsPanel {
  padding: 1.2rem;
  border: 1px solid var(--neutral-stroke-rest, #d1d5db);
  border-radius: 12px;
  background: var(--neutral-layer-1, #f9fafb);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow: visible !important;
}

fluent-card.friend-sessions-card {
  position: relative;
  overflow: visible !important;
  contain: none !important;
  min-height: 500px;
}

fluent-card.friend-sessions-card::part(control) {
  overflow: visible !important;
  contain: none !important;
  clip-path: none !important;
}

#friendSessionsPanel > * + * {
  margin-top: 0.9rem;
}

@supports (gap: 0.9rem) {
  #friendSessionsPanel > * + * {
    margin-top: 0;
  }
}

.friend-sessions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 10;
  overflow: visible;
}

.activity-action-label {
  font-weight: 600;
  color: var(--neutral-foreground-rest, #111827);
}

.activity-action-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  row-gap: 0.5rem;
  padding: 0;
  background: var(--neutral-layer-floating, #ffffff);
  border: 1px solid var(--neutral-stroke-rest, #d1d5db);
  border-radius: 10px;
  flex: 1 1 240px;
  position: relative;
  overflow: visible !important;
  z-index: 1002;
  clip-path: none !important;
}

.activity-filter-field {
  position: relative;
  flex: 1 1 150px;
  min-width: 150px;
  display: flex;
}

.activity-filter-field fluent-select {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}

.activity-filter-field fluent-select::part(control) {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

#activityChallengeFilter {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
}

#activityChallengeFilter::part(control) {
  width: 100%;
  max-width: none;
}

.activity-filter-field fluent-combobox {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  display: flex;
}

.activity-filter-field fluent-combobox::part(control) {
  flex: 1 1 auto;
  min-width: 0;
}

.activity-action-control fluent-switch {
  white-space: nowrap;
}

.activity-action-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.activity-action-toggle--owner {
  margin-left: auto;
  gap: 0.35rem;
}

#activityChallengeButton {
  margin-left: auto;
  align-self: stretch;
  min-width: 7rem;
}

@media (max-width: 640px) {
  .activity-action {
    flex-direction: column;
    align-items: stretch;
  }

  .activity-action-control {
    flex: 1 1 auto;
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem;
  }

  .activity-filter-field {
    flex: 1 1 100%;
    min-width: 100%;
    order: -1;
    width: 100%;
    margin-bottom: 0.75rem;
  }

  .activity-action-control > *:not(.activity-filter-field) {
    width: 100%;
  }

  .activity-action-toggle {
    flex: 1 1 48%;
    justify-content: flex-start;
    min-width: 0;
  }

  .activity-action-toggle--owner {
    justify-content: flex-start;
    margin-left: 0;
    flex: 1 1 48%;
  }

  #activityChallengeButton {
    width: 100%;
    margin-left: 0;
  }
}

body[data-template="user"] main.container {
  overflow: visible !important;
  contain: none !important;
  position: static;
  isolation: auto;
}

body[data-template="user"] main.container > .panel {
  overflow: visible !important;
  contain: none !important;
  position: relative;
  z-index: auto;
}

.friend-activity-panel {
  position: relative;
  overflow: visible !important;
  z-index: 2000;
  contain: none !important;
  isolation: isolate;
}

.friend-activity-panel,
#friend_activity,
#friend_activity fluent-card.friend-sessions-card,
#friend_activity fluent-card.friend-sessions-card::part(control),
#friend_activity fluent-card.friend-sessions-card::part(content),
#friend_activity .activity-action-control,
#friend_activity .activity-filter-field {
  overflow: visible !important;
  contain: none !important;
  position: relative;
  z-index: auto;
}

.friend-activity-panel,
#friend_activity {
  z-index: 2000;
}

.my-panel {
  overflow: visible !important;
  position: relative;
  z-index: 1000;
  contain: none !important;
}

.friend-sessions-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--neutral-foreground-rest, #111827);
}

.friend-sessions-status {
  font-size: 0.95rem;
  color: var(--neutral-foreground-2-rest, #6b7280);
  position: relative;
  z-index: 1;
}

.friend-sessions-list {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.friend-sessions-list[data-loading="1"] {
  opacity: 0.65;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.friend-sessions-list[data-loading="1"]::after {
  content: 'Loading activity…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 250, 251, 0.85);
  color: var(--neutral-foreground-rest, #111827);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
}

.friend-sessions-list > * + * {
  margin-top: 1rem;
}

@supports (gap: 1rem) {
  .friend-sessions-list {
    display: grid;
    gap: 1rem;
  }

  .friend-sessions-list > * + * {
    margin-top: 0;
  }
}

.friend-sessions-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.friend-sessions-pagination[hidden] {
  display: none;
}

.friend-sessions-page-label {
  font-size: 0.95rem;
  color: var(--neutral-foreground-2-rest, #4b5563);
}

.activity-challenge-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 3000;
}

.activity-challenge-modal[data-open="true"] {
  display: flex;
}

.activity-challenge-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.activity-challenge-modal__panel {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  padding: 1.5rem;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.activity-challenge-modal__title {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
}

.activity-challenge-modal__hint {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
}

.activity-challenge-modal__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
}

.activity-challenge-modal__select {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 1rem;
  background: #f8fafc;
  color: #0f172a;
}

.activity-challenge-modal__select:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
  border-color: rgba(37, 99, 235, 0.75);
}

.activity-challenge-modal__rest {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: #f1f5f9;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
}

.activity-challenge-modal__rest[data-loading="true"] {
  opacity: 0.75;
}

.activity-challenge-modal__rest-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.95rem;
}

.activity-challenge-modal__rest-label {
  font-weight: 600;
  color: #1f2937;
}

.activity-challenge-modal__rest-value {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: #0f172a;
}

.activity-challenge-modal__rest-status {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.activity-challenge-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.activity-challenge-modal__cancel,
.activity-challenge-modal__confirm {
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.activity-challenge-modal__cancel {
  background: rgba(148, 163, 184, 0.18);
  color: #1f2937;
}

.activity-challenge-modal__cancel:hover,
.activity-challenge-modal__cancel:focus-visible {
  background: rgba(148, 163, 184, 0.28);
  outline: none;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.26);
}

.activity-challenge-modal__confirm {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f8fafc;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28);
}

.activity-challenge-modal__confirm[disabled] {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.activity-challenge-modal__confirm:not([disabled]):hover,
.activity-challenge-modal__confirm:not([disabled]):focus-visible {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 16px 30px rgba(29, 78, 216, 0.32);
}

.activity-session-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 20000;
}

.activity-session-overlay[hidden] {
  display: none;
}

.activity-session-panel {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.35);
  padding: 24px;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.activity-session-records {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.activity-session-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-session-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.activity-session-bar-label {
  flex: 0 0 64px;
  font-size: 0.85rem;
  color: #475569;
}

.activity-session-bar-track {
  flex: 1 1 auto;
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.activity-session-bar-fill {
  position: absolute;
  inset: 0;
  right: auto;
  width: 0;
  border-radius: inherit;
  transition: width 0.2s ease;
}

.activity-session-bar-fill--best {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.activity-session-bar-fill--last {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

.activity-session-bar-fill--current {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
}

.activity-session-bar-value {
  flex: 0 0 48px;
  text-align: right;
  font-size: 0.8rem;
  color: #334155;
}

.activity-session-title {
  margin: 0;
  font-size: 1.25rem;
  color: #0f172a;
}

.activity-session-timer {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  color: #1d4ed8;
}

.activity-session-help {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
  text-align: center;
}

.activity-session-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.activity-session-stop {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.activity-session-stop:hover,
.activity-session-stop:focus-visible {
  outline: none;
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.activity-session-stop:disabled {
  background: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.activity-session-pause {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(250, 204, 21, 0.22);
  color: #92400e;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.activity-session-pause:hover,
.activity-session-pause:focus-visible {
  outline: none;
  background: rgba(250, 204, 21, 0.34);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.22);
  transform: translateY(-1px);
}

.activity-session-pause--resume {
  background: rgba(16, 185, 129, 0.25);
  color: #065f46;
}

.activity-session-pause--resume:hover,
.activity-session-pause--resume:focus-visible {
  background: rgba(16, 185, 129, 0.33);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.24);
}

.activity-session-pause:disabled {
  background: rgba(148, 163, 184, 0.26);
  color: #475569;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.activity-session-cancel {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.18);
  color: #1f2937;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.activity-session-cancel:hover,
.activity-session-cancel:focus-visible {
  background: rgba(148, 163, 184, 0.26);
  outline: none;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.24);
}

.friend-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  padding: 1.25rem;
}

.friend-confirm-overlay[hidden] {
  display: none;
}

.friend-confirm-panel {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  padding: 24px;
  width: 90%;
  max-width: 420px;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
}

.friend-confirm-title {
  margin: 0 0 12px 0;
  font-size: 1.3rem;
  color: #0f172a;
}

.friend-confirm-message {
  margin: 0 0 20px 0;
  color: #475569;
}

.friend-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.friend-confirm-button {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.friend-confirm-button--neutral {
  border: 1px solid #cbd5f5;
  background: #ffffff;
  color: #1f2937;
}

.friend-confirm-button--neutral:hover,
.friend-confirm-button--neutral:focus-visible {
  background: #eef2ff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.24);
}

.friend-confirm-button--primary {
  border: none;
  background: #2563eb;
  color: #ffffff;
}

.friend-confirm-button--primary:hover,
.friend-confirm-button--primary:focus-visible {
  background: #1d4ed8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.friend-confirm-button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.friend-session-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  background: var(--friend-session-bg, var(--neutral-layer-floating, #ffffff));
  border: 1px solid var(--friend-session-border, var(--neutral-stroke-rest, #d1d5db));
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  color: var(--friend-session-text, var(--neutral-foreground-rest, #1f2937));
}

.friend-session-card--new {
  animation: friend-session-flash 0.9s ease-out;
}

@keyframes friend-session-flash {
  0% {
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.32);
    border-color: rgba(37, 99, 235, 0.45);
  }
  60% {
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
  }
  100% {
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    border-color: var(--neutral-stroke-rest, #d1d5db);
  }
}

.friend-session-card > * + * {
  margin-top: 0.6rem;
}

@supports (gap: 0.6rem) {
  .friend-session-card > * + * {
    margin-top: 0;
  }
}

.friend-session-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.friend-session-header > * + * {
  margin-left: 0.5rem;
}

@supports (gap: 0.5rem) {
  .friend-session-header > * + * {
    margin-left: 0;
  }
}

.friend-session-start-wrap {
  position: relative;
  width: 100%;
  margin-top: 0.35rem;
  min-height: 32px;
}

.friend-session-start {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  font-size: 0;
}

.friend-session-start-meter {
  position: relative;
  width: 100%;
  height: 32px;
  border-radius: 16px;
  background: rgba(59, 130, 246, 0.12);
  overflow: hidden;
}

.friend-session-start-bar {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.32), rgba(99, 102, 241, 0.42));
  border-radius: inherit;
  transition: width 0.3s ease;
}

.friend-session-start-display {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e3a8a;
  pointer-events: none;
  background: transparent;
  z-index: 1;
  white-space: nowrap;
}

.time_txt {
  pointer-events: none;
}

/* Allow interactive links inside the start display (we keep container non-interactive
   for drag/gesture layout but enable anchors explicitly). */
.friend-session-start-display a,
.friend-session-start-display .friend-session-link {
  pointer-events: auto;
  cursor: pointer;
}

.friend-session-start-primary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-session-start-secondary {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.friend-session-start-display--compact {
  justify-content: flex-start;
  gap: 0.15rem;
}

.friend-session-start-display--compact .friend-session-start-primary,
.friend-session-start-display--compact .friend-session-start-secondary {
  display: inline;
}

.friend-session-start-display--compact .friend-session-start-secondary {
  margin-left: 0;
}

.friend-session-start-display--compact .friend-session-start-secondary::before {
  content: ', ';
}

.friend-session-name {
  font-weight: 600;
  color: var(--neutral-foreground-rest, #1f2937);
}

.friend-session-name .friend-session-link {
  color: inherit;
  text-decoration: none;
}

.friend-session-name .friend-session-link[href]:hover,
.friend-session-name .friend-session-link[href]:focus-visible {
  text-decoration: underline;
}

.friend-session-name .friend-session-link--challenge {
  color: var(--accent-foreground-rest, #1d4ed8);
}

.friend-session-body {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  color: var(--neutral-foreground-rest, #1f2937);
}

.friend-session-body > * + * {
  margin-top: 0.35rem;
}

@supports (gap: 0.35rem) and (display: grid) {
  .friend-session-body {
    display: grid;
    gap: 0.35rem;
  }

  .friend-session-body > * + * {
    margin-top: 0;
  }
}

.friend-session-body a {
  color: var(--accent-foreground-rest, #1d4ed8);
  text-decoration: none;
}

.friend-session-body a:hover,
.friend-session-body a:focus {
  text-decoration: underline;
}

.friend-session-identity {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.friend-session-message {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--neutral-foreground-rest, #1f2937);
  white-space: pre-line;
}

.friend-session-message-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  background: var(--neutral-layer-1, #ffffff);
  background: color-mix(in srgb, var(--neutral-layer-1, #ffffff) 92%, #0f172a 8%);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.friend-session-message-input {
  width: 100%;
  max-width: 100%;
  min-height: 108px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: var(--neutral-layer-1, #ffffff);
  color: var(--neutral-foreground-rest, #0f172a);
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.friend-session-message-input:focus-visible {
  outline: none;
  border-color: rgba(37, 99, 235, 0.75);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.friend-session-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.friend-session-message-save,
.friend-session-message-cancel {
  appearance: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.friend-session-message-save {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #f8fafc;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.28);
}

.friend-session-message-save:hover,
.friend-session-message-save:focus-visible {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 16px 28px rgba(29, 78, 216, 0.32);
}

.friend-session-message-save:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.friend-session-message-cancel {
  background: rgba(148, 163, 184, 0.16);
  color: var(--neutral-foreground-rest, #1f2937);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.friend-session-message-cancel:hover,
.friend-session-message-cancel:focus-visible {
  background: rgba(148, 163, 184, 0.26);
  outline: none;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.28);
}

.friend-session-message-status {
  font-size: 0.85rem;
  color: rgba(37, 99, 235, 0.9);
  min-height: 1.2em;
}

.friend-session-gallery {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.4rem;
  width: 100%;
  grid-auto-flow: dense;
  grid-auto-rows: minmax(60px, 1fr);
}

.friend-session-gallery--count-1 {
  grid-auto-rows: auto;
}

.friend-session-gallery--layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.friend-session-gallery--layout-single .friend-session-image {
  aspect-ratio: auto;
  min-height: 0;
}

.friend-session-gallery--layout-single .friend-session-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.friend-session-gallery--layout-double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.friend-session-gallery--layout-dominant-left {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(2, minmax(60px, 1fr));
  grid-template-areas:
    "item0 item1"
    "item0 item2";
}

.friend-session-gallery--layout-dominant-left .friend-session-image:nth-child(1) {
  grid-area: item0;
}

.friend-session-gallery--layout-dominant-left .friend-session-image:nth-child(2) {
  grid-area: item1;
}

.friend-session-gallery--layout-dominant-left .friend-session-image:nth-child(3) {
  grid-area: item2;
}

.friend-session-gallery--layout-dominant-top {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(60px, 1.6fr) minmax(60px, 1fr);
  grid-template-areas:
    "item0 item0"
    "item1 item2";
}

.friend-session-gallery--layout-dominant-top .friend-session-image:nth-child(1) {
  grid-area: item0;
}

.friend-session-gallery--layout-dominant-top .friend-session-image:nth-child(2) {
  grid-area: item1;
}

.friend-session-gallery--layout-dominant-top .friend-session-image:nth-child(3) {
  grid-area: item2;
}

.friend-session-gallery--layout-quad {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.friend-session-gallery--layout-mosaic {
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
}

.friend-session-image {
  position: relative;
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--neutral-layer-1, #f9fafb);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(60px, 22vw, 220px);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  outline: none;
}

.friend-session-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.friend-session-image--video {
  cursor: default;
}

.friend-session-image--video video,
.friend-session-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
  border-radius: inherit;
}

.friend-session-image:focus-visible {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45);
}

.friend-session-image--portrait {
  aspect-ratio: 3 / 4;
}

.friend-session-image--square {
  aspect-ratio: 1 / 1;
}

.friend-session-image--broken {
  background: var(--neutral-layer-2, #e5e7eb);
}

.friend-session-image--broken::after {
  content: 'Image unavailable';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--neutral-foreground-rest, #1f2937);
  text-align: center;
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.85), rgba(209, 213, 219, 0.7));
}

.friend-session-gallery-editor {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.friend-session-gallery-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 70px);
  grid-auto-rows: 70px;
  gap: 0.5rem;
  justify-content: flex-start;
}

.friend-session-gallery-edit-item,
.friend-session-gallery-edit-addtile {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 0.65rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-layer-1, #f9fafb);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.friend-session-gallery-edit-item.is-new::after {
  content: 'new';
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(59, 130, 246, 0.9);
  background: rgba(59, 130, 246, 0.12);
  border-radius: 999px;
  padding: 0.1rem 0.35rem;
}

.friend-session-gallery-edit-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.friend-session-gallery-edit-thumb--video {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--neutral-layer-2, #e5e7eb);
  color: var(--neutral-foreground-rest, #1f2937);
}

.friend-session-gallery-edit-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.friend-session-gallery-edit-remove:hover,
.friend-session-gallery-edit-remove:focus-visible {
  background: #ef4444;
}

.friend-session-gallery-edit-remove:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 1px;
}

.friend-session-gallery-edit-addtile {
  appearance: none;
  border: 1px dashed rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.friend-session-gallery-edit-addtile:hover,
.friend-session-gallery-edit-addtile:focus-visible {
  border-color: rgba(37, 99, 235, 0.9);
  background: rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.friend-session-gallery-edit-addtile:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 1px;
}

.friend-session-gallery-edit-add-count {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  pointer-events: none;
}

.friend-session-gallery-edit-add-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  pointer-events: none;
}

.session-photo-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300000;
  cursor: default;
}

.session-photo-lightbox[hidden] {
  display: none;
}

.session-photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  cursor: default;
}

.session-photo-lightbox-stage {
  position: relative;
  z-index: 300001;
  max-width: calc(100vw - 64px);
  max-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.session-photo-lightbox-image {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: 18px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.session-photo-lightbox-image:active {
  cursor: grabbing;
}

.session-photo-lightbox-image img {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  transition: transform 0.18s ease;
  user-select: none;
  pointer-events: none;
}

.session-photo-lightbox-controls {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 300002;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.session-photo-lightbox-button {
  appearance: none;
  border: none;
  border-radius: 999px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.45);
  transition: background 0.18s ease, transform 0.18s ease;
}

.session-photo-lightbox-button:hover,
.session-photo-lightbox-button:focus-visible {
  background: rgba(59, 130, 246, 0.9);
  transform: translateY(-2px);
  outline: none;
}

.session-photo-lightbox-button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.friend-session-motivation {
  border-top: none;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.friend-session--messages-hidden .friend-session-motivation,
.friend-session--messages-hidden .friend-session-message {
  display: none;
}

.friend-session-motivation-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--neutral-foreground-rest, #1f2937);
}

.motivation-root-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.motivation-root-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.motivation-root-form .motivation-reply-input {
  width: 100%;
}

.motivation-status {
  font-size: 0.85rem;
}


/* Footer brand spacing */
.foot-brand {
  margin-left: 5px;
}

/* Reduce flicker on brand link by disabling animations on its parts */
#brandTitle::part(control),
#brandTitle::part(content) {
  transition: none;
}

/* Enforce nav font family and size to match body */
#brandTitle::part(content),
#brandTitle::part(control),
.navbtn::part(control),
.topbar, .topbar * {
  font-family: "Segoe UI", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
}

.foot-brand {
  font-family: inherit;
}
.foot-brand {
  font-family: inherit;
}

/* --- Login modal (moved from login.html inline <style>) --- */
:root {
  --accent-fill-rest: #2563eb;
  --accent-fill-hover: #1d4ed8;
  --accent-fill-active: #1e40af;
  --neutral-layer-1: #ffffff;
  color-scheme: light dark;
}
/* Fullscreen backdrop for login modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, #000 40%, transparent);
  z-index: 1000;
}
body.modal-open { overflow: hidden; }
@media (prefers-color-scheme: dark) {
  :root {
    --neutral-layer-1: #1f1f1f;
  }
}
.modal {
  background: var(--neutral-layer-1);
  padding: 0;
  border: none;
  box-shadow: none;
}
fluent-card.login-card {
  width: min(350px, 90vw);
  height: auto;
  max-height: 90vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: .75rem .85rem .85rem;
  gap: .35rem;
  border-radius: 14px;
}

/* Optional: small bottom margin for actions so they don't stick to edge */
fluent-card.login-card .login-actions {
  margin-top: .3rem;
  padding-top: .05rem;
  margin-bottom: .15rem; /* added */
  gap: .45rem;
}

fluent-card.login-card h3 {
  margin: 0 0 .2rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .1px;
}

fluent-card.login-card > p {
  margin: 0 0 .5rem;
  font-size: .8rem;
  line-height: 1.22;
  color: #555;
}

fluent-card.login-card form {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  flex: 0 0 auto;
}

fluent-card.login-card .field { margin: 0; }

/* Reserve space at bottom so buttons sit consistently */
fluent-card.login-card .login-actions {
  margin-top: .3rem;
  padding-top: .05rem;
  padding-bottom: 0;
  margin-bottom: 0;
  gap: .45rem;
}

/* Status area pinned just below buttons for consistent overall height */
fluent-card.login-card #loginStatus { margin-top: .25rem; }
.field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
#loginStatus {
  min-height: 1.25rem;
  font-size: .85rem;
}
#loginStatus.error {
  color: var(--accent-fill-active);
}
/* Native input styling */
.fluent-input {
  font: inherit;
  padding: 5px 8px;
  border: 1px solid var(--neutral-stroke-rest, #ccc);
  border-radius: 4px;
  background: var(--neutral-layer-1);
  color: inherit;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

fluent-card.login-card .login-actions fluent-button::part(control) {
  padding: 4px 10px;
  font-size: .8rem;
  line-height: 1.1;
}
fluent-card.login-card .login-actions fluent-button {
  margin: 0; /* remove extra space from default margins if any */
}
.fluent-input:focus {
  border-color: var(--accent-fill-rest);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-fill-rest) 40%, transparent);
}
.fluent-input:invalid {
  border-color: var(--accent-fill-active);
}
/* PIN eye inside input */
.pin-wrapper {
  position: relative;
}
#loginPin,
#loginPinConfirm {
  padding-right: 46px;
}
.pin-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.pin-toggle:hover,
.pin-toggle:focus-visible {
  background: color-mix(in srgb, var(--accent-fill-rest) 12%, transparent);
  outline: none;
}
.pin-toggle svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}
.pin-toggle[data-visible="true"] .eye-line {
  display: block;
}
.pin-toggle .eye-line {
  display: none;
}
/* Centered login form action buttons */
.login-actions {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin-top: .75rem;
}
/* Subtle helper text under fields */
.field-hint {
  margin-top: .25rem;
  font-size: .8rem;
  color: color-mix(in srgb, currentColor 70%, transparent);
}
/* --- End login modal styles --- */

/* Profile card and grid styles */
:root {
  --profile-gap: 16px;
  --profile-max-width: 880px;
  --profile-grid-min: 240px;
}

.profile-card {
  max-width: var(--profile-max-width);
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
}

/* Remove the divider line for actions inside the profile card; keep small top spacing */
.profile-card .actions {
  border-top: none !important;
  padding-top: 12px !important;
}

/* Shared card style for user page panels (profile, activity, call) */
.panel-card {
  max-width: var(--profile-max-width);
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  border-radius: 12px;
  background: var(--neutral-layer-1, #fff);
}

.profile-card .panel-title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 600;
}

.profile-grid {
  display: flex;
  flex-direction: column;
  gap: var(--profile-gap);
  align-items: stretch;
}

/* Two-column layout for the profile view: avatar left, meta right */
.profile-grid.profile-view {
  display: flex;
  flex-direction: row;
  gap: var(--profile-gap);
  align-items: flex-start;
}

.profile-grid.profile-view .avatar-field {
  flex: 0 0 120px; /* fixed-ish column for avatar */
  max-width: 160px;
}

.profile-grid.profile-view .profile-meta {
  flex: 1 1 auto; /* take remaining space */
  display: flex;
  align-items: stretch;
}

.profile-grid.profile-view .profile-meta .meta-right {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}
#profNickLabel,
#profQuote {
  margin-bottom: 0;
  margin-top: 0; /* remove top margin to align bottom */
}


/* Responsive: stack vertically on small screens */
@media (max-width: 640px) {
  .profile-grid.profile-view {
    flex-direction: column;
  }
  .profile-grid.profile-view .avatar-field {
    flex: 0 0 auto;
    max-width: none;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* .span-2 no longer needed with single-column layout */

.readonly-box {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--neutral-stroke-rest);
  border-radius: var(--control-corner-radius);
  background: var(--neutral-layer-2);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-weight: 500;
  overflow-wrap: anywhere;
  text-align: left;
}

.nick-label {
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

#profNickLabel {
  align-self: auto;
}

#profNickLabel.readonly-box {
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  min-height: 0;
  font-weight: 600;
}

.nick-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end; /* align children to bottom */
  gap: 8px;
}
.nick-row label {
  font-weight: 600;
  margin: 0;
}
/* Make profile quote simple text (no background or border) */
#profQuote {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: 0;
  margin-top: 0.5em;
  white-space: pre-wrap; /* preserve line breaks */
  color: #444; /* slightly muted */
  font-weight: 400;
  font-style: italic;
  padding-left: 6px;
  padding-right: 6px;
  position: relative;
  font-family: inherit;
}
#profQuote::before {
  /* left double quotation mark (curly) — larger for decorative impact */
  content: '“';
  position: absolute;
  left: -8px;
  top: -6px;
  font-family: Georgia, 'Times New Roman', serif; /* use a serif glyph for the mark */
  color: #666;
  font-size: 2.4rem;
  line-height: 0.85;
}

.hint {
  font-size: 0.7rem;
  opacity: 0.7;
  line-height: 1.2;
}
.hint.error {
  color: var(--error-foreground, #c42b1c);
  opacity: 1;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 25px; /* changed from 8px */
  border-top: 1px solid var(--neutral-stroke-rest);
}

.status {
  min-height: 20px;
  font-size: 0.75rem;
  color: var(--accent-foreground-rest);
}

.status.error {
  color: var(--error-foreground, #c42b1c);
}

.avatar-edit {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  background: var(--neutral-layer-2);
  outline: 1px solid var(--neutral-stroke-rest);
  transition: background .15s, outline-color .15s;
}

.avatar-edit:hover,
.avatar-edit:focus {
  background: var(--neutral-layer-3);
  outline-color: var(--accent-fill-rest);
}

.avatar-edit fluent-avatar {
  --avatar-size: 88px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
}

/* --- Plank v1 page styles (ns- prefix) --- */
.ns-page { padding: 16px; box-sizing: border-box; }
.ns-container { width: 100%; max-width: 960px; display: grid; gap: 16px; margin: 0 auto; }
fluent-card.ns-card .card-content { padding: 16px; display: grid; gap: 12px; }
.ns-title { margin: 0; }
.ns-subtle { opacity: .85; }
.ns-center { display: flex; align-items: center; justify-content: center; }
.ns-center-text { text-align: center; }
.ns-small { font-size: .95rem; }
.ns-clock-big {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: 'Roboto Mono', 'Segoe UI Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.ns-clock-small {
  font-size: 28px;
  font-weight: 600;
  font-family: 'Roboto Mono', 'Segoe UI Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.ns-minh-160 { min-height: 160px; }
.ns-minh-96 { min-height: 96px; }
.ns-gap-12 { gap: 12px; }
.ns-gap-10 { gap: 10px; }
.ns-gap-8 { gap: 8px; }
.ns-gap-6 { gap: 6px; }
.ns-h3 { font-size: 1.1rem; margin: .25rem 0; }
.ns-form { display: grid; align-items: end; grid-template-columns: 1fr; }
.ns-form-row { display: grid; gap: 8px; grid-template-columns: auto 120px 160px 1fr; align-items: end; }
.ns-form-row fluent-text-field {
  width: 100%;
}
.ns-form-row fluent-text-field::part(root) {
  width: 100%;
}
.ns-form-row .message-cell {
  grid-column: 4;
  display: flex;
  flex-direction: column;
}
@media (max-width: 640px) {
.ns-form-row {
  grid-template-columns: 120px 1fr 1fr;
}
  .ns-form-row .message-cell {
    grid-column: 1 / -1;
    width: 100%;
  }
}
.ns-label { display:block; margin-bottom: 4px; }
.ns-actions-right { display:flex; gap:8px; justify-content:flex-end; }
.ns-scroll-x { overflow: auto; }
.ns-table { width: 100%; border-collapse: collapse; }
.ns-left { text-align: left; }
#plankHistory th, #plankHistory td { padding: 8px 6px; border-bottom: 1px solid rgba(0,0,0,.06); }
.ns-mt-6 { margin-top: 6px; }

/* Emoji panel overlay */
.ns-emoji-panel {
  position: fixed;
  z-index: 1500;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  padding: 8px;
  width: 320px;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  background: var(--neutral-layer-1, #fff);
  border: 1px solid var(--neutral-stroke-rest, #ccc);
  border-radius: 10px;
  box-shadow: 0 6px 24px -2px rgba(0,0,0,.2), 0 2px 6px rgba(0,0,0,.18);
}
.ns-emoji-panel button {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: background .15s, border-color .15s;
}
.ns-emoji-panel button:hover,
.ns-emoji-panel button:focus-visible {
  background: var(--neutral-layer-2, #f3f3f3);
  border-color: var(--neutral-stroke-rest, #c8c8c8);
  outline: none;
}
.ns-emoji-panel button:active { background: var(--neutral-layer-3, #e5e5e5); }

.avatar-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--neutral-layer-4);
  color: var(--neutral-foreground-rest);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px var(--neutral-stroke-rest);
  transition: background .15s, color .15s;
}

.avatar-remove:hover {
  background: var(--accent-fill-rest);
  color: var(--accent-foreground-rest);
}

.avatar-field .hint {
  margin-top: 4px;
}

.profile-card fluent-text-field,
.profile-card fluent-text-area {
  width: 100%;
}

.profile-card fluent-button[appearance="accent"] {
  min-width: 110px;
}

@media (prefers-reduced-motion: no-preference) {
  .profile-card {
    animation: fadeInProfile .25s ease;
  }
  @keyframes fadeInProfile {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  display: inline-block;
  /* remove the blue focus/border so avatar appears as a plain circle */
  box-shadow: none;
  overflow: hidden;
}

.auth-body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(160deg, rgba(37,99,235,0.12), rgba(14,116,144,0.08)),
    linear-gradient(180deg, var(--neutral-layer-1), var(--neutral-layer-2));
  display: flex;
  flex-direction: column;
}

.auth-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 8vw, 72px) 16px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  display: flex;
  box-sizing: border-box;
}

.auth-card::part(control) {
  padding: 0;
  border-radius: 28px;
  background: transparent;
  box-shadow: none;
}

.auth-card__body {
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 5vw, 36px);
  padding: clamp(28px, 7vw, 48px);
  background: var(--neutral-layer-1);
  border-radius: 28px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.14);
  position: relative;
  overflow: hidden;
}

.auth-card__body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 55%);
  pointer-events: none;
}

.auth-card__body > * {
  position: relative;
  z-index: 1;
}

.auth-card__header {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 4vw, 24px);
}

.auth-card__header-media {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(60px, 12vw, 80px);
  aspect-ratio: 1;
}

.auth-card__brand-glow {
  position: absolute;
  inset: 8px;
  border-radius: 22px;
  background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.45), transparent 70%),
    radial-gradient(circle at 70% 75%, rgba(14, 116, 144, 0.4), transparent 75%);
  filter: blur(0.5px);
  opacity: 0.9;
}

.auth-card__avatar {
  --avatar-size: clamp(52px, 12vw, 72px);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.25);
}

.auth-card__heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-card__eyebrow {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.6);
}

.auth-card__title {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 1.75rem);
  font-weight: 650;
  color: var(--neutral-foreground-rest);
}

.auth-card__subtitle {
  margin: 0;
  color: rgba(15, 23, 42, 0.68);
  font-size: 0.98rem;
  line-height: 1.4;
}

.auth-card__section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px clamp(20px, 4vw, 28px);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(248, 250, 252, 0.35));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.auth-card__section--primary {
  border-color: rgba(37, 99, 235, 0.28);
  background: linear-gradient(150deg, rgba(37, 99, 235, 0.16), rgba(37, 99, 235, 0.06));
}

.auth-card__section--entra {
  background: linear-gradient(160deg, rgba(37, 99, 235, 0.18), rgba(59, 130, 246, 0.08));
  border-color: rgba(37, 99, 235, 0.32);
}

.auth-section__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-card__message {
  margin: 4px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: #b42318;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.22);
  line-height: 1.35;
}

.auth-section__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-section__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neutral-foreground-rest);
}

.auth-section__hint {
  margin: 0;
  color: rgba(15, 23, 42, 0.6);
  font-size: 0.92rem;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  color: rgba(15, 76, 168, 0.95);
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-section__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-button {
  width: 100%;
  min-height: 52px;
}

.auth-button::part(control) {
  font-size: 1rem;
  font-weight: 600;
  justify-content: center;
}

.auth-provider-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.auth-provider-button {
  width: 100%;
  min-height: 48px;
}

.auth-provider-button::part(control) {
  justify-content: flex-start;
  gap: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  padding-inline: 16px;
}

.auth-button--entra::part(control) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.25);
}

.auth-button--entra::part(control):hover {
  background: linear-gradient(135deg, #1e4fc5, #1c3faa);
}

.auth-reassurance {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.05);
  color: rgba(15, 23, 42, 0.7);
  font-size: 0.85rem;
  line-height: 1.5;
}

.auth-reassurance svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: rgba(14, 116, 144, 0.9);
}

.auth-reassurance span {
  flex: 1;
}

.auth-card__footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.auth-footer__text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--neutral-foreground-hint, #6b7280);
}

.auth-footer__support {
  margin: 0;
  font-size: 0.85rem;
  color: var(--neutral-foreground-hint, #6b7280);
}

.auth-footer__support a {
  color: #2563eb;
  font-weight: 600;
}

.auth-separator {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--neutral-foreground-hint, #6b7280);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  justify-content: center;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.8), transparent);
}

.auth-separator span {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

@media (max-width: 540px) {
  .auth-card__body {
    padding: 28px 22px;
    border-radius: 22px;
  }

  .auth-card__section {
    padding: 20px;
  }

  .auth-card__header {
    align-items: flex-start;
  }

  .auth-card__title {
    font-size: 1.45rem;
  }
}

@media (prefers-color-scheme: dark) {
  .auth-card__body {
    background: #1f2937;
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: 0 28px 50px rgba(0, 0, 0, 0.45);
  }

  .auth-card__section {
    background: linear-gradient(150deg, rgba(30, 41, 59, 0.92), rgba(30, 41, 59, 0.7));
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: 0 18px 30px rgba(2, 6, 23, 0.55);
  }

  .auth-card__section--primary {
    background: linear-gradient(150deg, rgba(37, 99, 235, 0.38), rgba(37, 99, 235, 0.14));
    border-color: rgba(96, 165, 250, 0.45);
  }

  .auth-card__section--entra {
    background: linear-gradient(150deg, rgba(37, 99, 235, 0.38), rgba(59, 130, 246, 0.18));
    border-color: rgba(147, 197, 253, 0.42);
  }

.auth-card__eyebrow {
  color: rgba(203, 213, 225, 0.7);
}

.auth-card__subtitle {
  color: rgba(226, 232, 240, 0.7);
}

/* Motivation feed */
.motivation-feed {
  gap: 10px;
}
.motivation-thread {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Single-line input used as compact editor before expanding to textarea */
.mot-input-singleline {
  width: 100%;
  padding: 8px 10px;
  font-size: 1rem;
  border: 1px solid rgba(203,213,225,0.6);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
}
.mot-input-singleline:focus {
  outline: none;
  border-color: rgba(59,130,246,0.8);
  box-shadow: 0 0 0 4px rgba(59,130,246,0.08);
}

.motivation-entry {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: flex-start;
  gap: 12px;
  /* keep top and side padding, but no bottom padding */
  padding: 8px 0 0 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* subtle divider between motivation entries */
.motivation-feed .motivation-entry:not(:last-child) {
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

/* Child motivation entries (replies) should be visually lightweight: no background,
   no extra margin or bottom padding and no divider. */
.motivation-entry.motivation-child {
  /* Replies: no background, no margin, keep top/side padding but remove bottom padding */
  background: none !important;
  margin: 0 !important;
  padding: 8px 0 0 0 !important;
  border-bottom: none !important;
}

/* child-specific author spacing */
.motivation-entry.motivation-child .motivation-author {
  margin-left: 20px;
}

.motivation-author {
  font-weight: 600;
  color: #1d4ed8;
  letter-spacing: 0.01em;
  /* center the author label within its allocated column */
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  padding-right: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.motivation-message {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  color: #1f2937;
  line-height: 1.4;
  word-break: break-word;
  min-width: 0;
}

.motivation-message-text {
  flex: 1 1 auto;
  min-width: 0;
  display: inline;
}

.reply_message {
  padding-left: 10pt;
}

.motivation-empty {
  padding: 16px;
  text-align: center;
  color: #64748b;
  background: none;
  border: none;
  border-radius: 0;
}

.motivation-reply-btn {
  align-self: flex-start;
  appearance: none;
  border: none;
  background: none;
  color: var(--accent-foreground-rest, #1d4ed8);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  text-decoration: none;
}

.motivation-reply-btn:hover,
.motivation-reply-btn:focus-visible {
  text-decoration: underline;
  color: var(--accent-foreground-rest, #153eaa);
  outline: none;
}

.motivation-reply-btn:disabled {
  color: #94a3b8;
  cursor: not-allowed;
}

.motivation-send-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  box-shadow: 0 10px 18px -10px rgba(37, 99, 235, 0.7);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.motivation-send-btn:hover,
.motivation-send-btn:focus-visible {
  background: linear-gradient(135deg, #1e3fae, #1b3a99);
  box-shadow: 0 12px 22px -10px rgba(30, 64, 175, 0.75);
  outline: none;
}

.motivation-send-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), 0 12px 22px -10px rgba(30, 64, 175, 0.75);
}

.motivation-send-btn:active {
  transform: translateY(1px);
  box-shadow: 0 6px 12px -8px rgba(30, 64, 175, 0.7);
}

.motivation-send-btn:disabled {
  background: rgba(191, 219, 254, 0.8);
  color: #475569;
  cursor: not-allowed;
  box-shadow: none;
}
.motivation-reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  margin-top: 6px;
}

.motivation-reply-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.motivation-reply-row .motivation-reply-input {
  flex: 1 1 auto;
  min-width: 0;
}

.motivation-reply-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: var(--neutral-layer-1, #fff);
  color: var(--neutral-foreground-rest, #111827);
  box-shadow: none;
  font-size: 0.95rem;
}

.motivation-reply-cancel {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
  color: var(--neutral-foreground-rest, #374151);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

/* Child messages (replies) should visually align with parent but be indented and muted */
.motivation-child {
  margin-left: 25px; /* reduced indent to 25px as requested */
  background: none;
  /* keep only the left padding so children align without extra vertical space */
  padding: 0 0 0 10px;
}
.motivation-child .motivation-author {
  color: #0f172a; /* slightly darker than muted message */
  font-weight: 600;
}
.motivation-child .motivation-message {
  color: #475569; /* muted text for child */
}

/* Post-plank form styles */
.post-plank-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--neutral-layer-1, #fff);
  padding: 12px;
  border-radius: 10px;
  box-shadow: var(--elevation-shadow-card, 0 6px 18px rgba(0,0,0,0.06));
  max-width: 720px;
  margin: 12px 0;
}
.post-plank-message {
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15,23,42,0.06);
  resize: vertical;
}
.post-plank-files {
  width: 100%;
  background: #fff;
  color: #0f172a;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15,23,42,0.06);
  box-sizing: border-box;
}
/* Make file input button match site style where supported */
.post-plank-files::-webkit-file-upload-button {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.post-plank-files::-ms-browse {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.post-plank-thumbs {
  display: flex;
  gap: 8px;
  align-items: center;
}
.post-plank-thumb {
  width: 160px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(15,23,42,0.06);
}
.post-plank-thumb-small {
  width: 64px !important;
  opacity: 0.9;
}
.post-plank-send, .post-plank-cancel {
  /* Reuse visual style for motivation buttons */
  appearance: none;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
  box-shadow: 0 10px 18px -10px rgba(37, 99, 235, 0.7);
}
.post-plank-cancel {
  /* secondary style for cancel matches reply cancel */
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
  color: var(--neutral-foreground-rest, #374151);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* Ensure motivation input form is always visible and styled */
.mot-input-singleline {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15,23,42,0.06);
}

  .auth-section__hint {
    color: rgba(226, 232, 240, 0.68);
  }

  .auth-badge {
    background: rgba(59, 130, 246, 0.28);
    color: rgba(191, 219, 254, 0.95);
  }

  .auth-reassurance {
    background: rgba(148, 163, 184, 0.18);
    color: rgba(226, 232, 240, 0.8);
  }

  .auth-reassurance svg {
    color: rgba(96, 165, 250, 0.9);
  }

  .auth-footer__support a {
    color: #60a5fa;
  }
}

/* --- Simple white theme for login page ---------------------------------- */
body.auth-body.auth-body--login { background: #ffffff; }

/* Use outer card for border/radius/shadow; make inner body transparent */
body.auth-body.auth-body--login .auth-card::part(control) {
  padding: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb; /* slate-200 */
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

body.auth-body.auth-body--login .auth-card__body {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* remove decorative glow + header orb for crisp edges */
body.auth-body.auth-body--login .auth-card__body::before { display: none; }
body.auth-body.auth-body--login .auth-card__brand-glow { display: none; }

/* Increase text contrast */
body.auth-body.auth-body--login .auth-card__title { color: #0f172a; }
body.auth-body.auth-body--login .auth-card__subtitle { color: #475569; }
body.auth-body.auth-body--login .auth-section__hint { color: #475569; }

/* Panels */
body.auth-body.auth-body--login .auth-card__section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: none;
  padding: 16px 18px;
}

/* Reassurance panel contrast */
body.auth-body.auth-body--login .auth-reassurance {
  background: #f8fafc;
  color: #334155;
}

/* Separator */
body.auth-body.auth-body--login .auth-separator { color: #64748b; }
body.auth-body.auth-body--login .auth-separator::before,
body.auth.body.auth-body--login .auth-separator::after { background: #e5e7eb; }
body.auth-body.auth-body--login .auth-separator span {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Buttons */
body.auth-body.auth-body--login .auth-button::part(control) { border-radius: 10px; }
body.auth-body.auth-body--login .auth-provider-button::part(control) { border-color: #e5e7eb; }
body.auth-body.auth-body--login .auth-provider-button::part(control):hover { border-color: #cbd5e1; }
body.auth-body.auth-body--login .auth-button--entra::part(control) {
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22);
}

/* White theme accessibility tweaks */
body.auth-body.auth-body--login .auth-card__eyebrow {
  color: #334155; /* stronger contrast on white */
}

body.auth-body.auth-body--login .auth-badge {
  background: #e0edff;      /* light blue chip for visibility on white */
  color: #1e40af;           /* deep indigo text */
  border: 1px solid #93c5fd;/* defined edge */
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
}

/* Ensure badge contrast even if theme class changes */
.auth-card--login .auth-badge {
  background: #eef2ff;      /* solid, high-contrast on white */
  color: #1e3a8a;           /* strong indigo */
  border: 1px solid #c7d2fe;
  font-weight: 700;
}

/* --- Login card-scoped white theme (works when injected) --------------- */
.auth-card--login::part(control) {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.auth-card--login .auth-card__body {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.auth-card--login .auth-card__body::before,
.auth-card--login .auth-card__brand-glow { display: none; }

.auth-card--login .auth-card__title { color: #0f172a; }
.auth-card--login .auth-card__subtitle { color: #475569; }
.auth-card--login .auth-section__hint { color: #475569; }

.auth-card--login .auth-card__section {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: none;
  padding: 16px 18px;
}

.auth-card--login .auth-reassurance {
  background: #f8fafc;
  color: #334155;
}

.auth-card--login .auth-separator { color: #64748b; }
.auth-card--login .auth-separator::before,
.auth-card--login .auth-separator::after { background: #e5e7eb; }
.auth-card--login .auth-separator span {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.auth-card--login .auth-button::part(control) { border-radius: 10px; }
.auth-card--login .auth-provider-button::part(control) { border-color: #e5e7eb; }
.auth-card--login .auth-provider-button::part(control):hover { border-color: #cbd5e1; }
.auth-card--login .auth-button--entra::part(control) { box-shadow: 0 6px 14px rgba(37, 99, 235, 0.22); }

/* #menuSignOut hover/focus styles */
#menuSignOut:hover,
#menuSignOut:focus-visible,
#menuSignOut::part(control):hover,
#menuSignOut::part(control):focus-visible {
  background: var(--neutral-layer-3) !important;
}
