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

:root {
  --primary: #1e1e22;
  --accent: #EB0A1E;
  --accent-hover: #c5081a;
  --surface: #26262b;
  --surface-light: #2c2c32;
  --text: #e8e8ec;
  --text-muted: #9a9aa0;
  --card-bg: #2a2a30;
  --border: #3a3a42;
  --radius: 8px;
  --max-w: 1600px;
  --transition: 0.25s ease;
  --toyota-dark: #111114;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Toyota Type', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--primary);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ===== Header / Nav ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--toyota-dark);
  border-bottom: none;
}

#nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo:hover { color: #ffffff; }

.toyota-logo { flex-shrink: 0; }

.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a {
  color: #cccccc;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--transition);
}
.nav-links a:hover { color: #ffffff; }
.nav-links a.nav-active { color: #ffffff; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 24px;
  background: linear-gradient(160deg, var(--toyota-dark) 0%, #1f1f24 100%);
  color: #ffffff;
  overflow: hidden;
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  max-width: var(--max-w);
  width: 100%;
}

.hero-side-img {
  width: 220px;
  height: auto;
  flex-shrink: 0;
  opacity: 0.85;
  filter: drop-shadow(0 4px 16px rgba(96,165,250,0.15));
}

@media (max-width: 900px) {
  .hero-row { flex-direction: column; gap: 16px; }
  .hero-side-img { width: 140px; }
}
@media (max-width: 600px) {
  .hero-side-img { display: none; }
}

.hero-logo { margin-bottom: 8px; }
.hero-logo .toyota-logo { filter: drop-shadow(0 0 24px rgba(235,10,30,0.35)); height: 44px !important; }
.hero-inner { max-width: 720px; flex: 1; min-width: 0; }
.hero h1 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text, #ffffff);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.hero .tagline {
  font-size: 0.88rem;
  color: #cccccc;
  margin-bottom: 12px;
  line-height: 1.5;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--transition), transform var(--transition);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); color: #fff; }

/* ===== Section shared ===== */
section { padding: 40px 24px; }
section:nth-child(even) { background: var(--surface); }
section:nth-child(odd) { background: var(--primary); }
.section-heading {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 28px;
  position: relative;
}
.section-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ===== Services ===== */
.services-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.service-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(233,10,30,0.12); border-color: var(--accent); }
.service-card .icon { font-size: 2.4rem; margin-bottom: 16px; }
.service-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }
.service-card.has-image { padding: 0; overflow: hidden; }
.service-card.has-image .service-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.service-card.has-image h3 { padding: 18px 24px 0; }
.service-card.has-image p { padding: 0 24px 24px; }

/* ===== Team (MS Teams-style Org Chart) ===== */

.team-section {
  padding: 32px;
  max-width: 100%;
}

.org-chart {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
}

/* Shared card style (horizontal: avatar | info) */
.org-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  width: 380px;
  max-width: 90vw;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.org-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.org-card-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; font-weight: 700; color: #fff;
}
.org-card-img {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; border: 2px solid var(--accent);
}
.org-card-info { flex: 1; min-width: 0; }
.org-card-name { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.org-card-role { font-size: 0.78rem; font-weight: 600; color: var(--accent); margin-top: 1px; }
.org-card-bio { font-size: 0.73rem; color: var(--text-muted); margin-top: 3px; }

/* Focused person — accent border + glow */
.org-card-focus {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(0,200,255,0.1), 0 4px 20px rgba(0,0,0,0.1);
  background: var(--card-bg);
}
.org-card-focus .org-card-avatar { width: 60px; height: 60px; font-size: 1.2rem; }
.org-card-focus .org-card-img { width: 60px; height: 60px; }
.org-card-focus .org-card-name { font-size: 1.05rem; }
.org-card-focus .org-card-role { font-size: 0.84rem; }

/* Manager card (above) — slightly muted */
.org-card-manager { opacity: 0.85; }
.org-card-manager:hover { opacity: 1; }

/* Report cards in the row below */
.org-card-report {
  width: auto;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

/* Expand hint for people with children */
.org-card-expand {
  display: inline-block;
  font-size: 0.65rem;
  color: var(--accent);
  margin-left: 6px;
  opacity: 0.7;
}

/* Vertical connector line */
.org-connector {
  width: 2px;
  height: 24px;
  background: var(--accent);
  opacity: 0.3;
}

/* "People reporting to X" label */
.org-reports-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 4px 0 10px;
  text-align: center;
}

/* Row of direct reports */
.org-reports-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  max-width: 90vw;
}

@media (max-width: 700px) {
  .org-card { width: 100%; }
  .org-card-report { min-width: 0; max-width: 100%; }
  .org-reports-row { flex-direction: column; align-items: center; }
}

/* ===== Home Three-Column Layout (25% / 50% / 25%) ===== */
.home-columns {
  display: flex;
  align-items: stretch;
  max-width: 100%;
  margin: 0;
  gap: 0;
  padding: 20px 32px;
  background: var(--primary);
}
.home-col { padding: 0 16px; }
.home-col-left  { flex: 0 0 25%; max-width: 25%; border-right: 1px solid var(--border); padding-left: 0 !important; }
.home-col-center { flex: 0 0 50%; max-width: 50%; }
.home-col-right { flex: 0 0 25%; max-width: 25%; border-left: 1px solid var(--border); padding-right: 0 !important; }

/* Shared column heading */
.home-col .section-heading {
  font-size: 0.95rem;
  margin: 0 0 10px;
  padding: 0;
  text-align: left;
}
.home-col .section-heading::after { margin: 6px 0 0; }

/* Left column — resource tiles 3 per row, 12 max, square */
.home-col-left .resources-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 100%;
}
.home-col-left .resource-tile {
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}
.home-col-left .resource-tile-icon { font-size: 3rem; margin-bottom: 6px; }
.home-col-left .resource-tile h3 { font-size: 1.05rem; line-height: 1.25; font-weight: 700; }
.home-col-left .resource-tile p {
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
  text-align: center;
}
/* Hide the Type badge on home tiles — keeps tiles clean */
.home-col-left .resource-tile .badge { display: none; }
.home-col-left .resources-header { margin-bottom: 8px; }
.resources-count {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Center column — announcements carousel.
   Use absolute positioning so the carousel does NOT push the row height;
   the row height is determined by left/right columns and the carousel
   stretches to match it. */
.home-col-center {
  position: relative;
  min-height: 0;
  padding: 0 36px; /* room for prev/next arrows outside the image */
}
.home-col-center .carousel-viewport {
  position: absolute;
  top: 8px;
  left: 36px;
  right: 36px;
  bottom: 36px; /* room for dots */
  max-width: none;
  margin: 0;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
}
.home-col-center .carousel-track {
  display: flex;
  height: 100%;
}
.home-col-center .carousel-slide {
  padding: 0;
  min-height: 0 !important;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
  width: 100%;
  min-width: 100%;
}
.home-col-center .carousel-slide.has-image {
  display: flex !important;
  flex-direction: column;
  table-layout: auto;
}
.home-col-center .carousel-slide.has-image > .carousel-img-side,
.home-col-center .carousel-slide.has-image > .carousel-title-bar {
  display: flex;
  width: 100%;
}
.home-col-center .carousel-slide .carousel-img-side {
  flex: 1 1 auto;
  min-height: 0;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}
.home-col-center .carousel-slide .carousel-img-side img {
  width: 100%;
  height: 100%;
  min-height: 0 !important;
  object-fit: cover;
  display: block;
}
.home-col-center .carousel-slide .carousel-title-bar {
  flex: 0 0 auto;
  padding: 10px 16px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  text-align: center;
  align-items: center;
  justify-content: center;
  min-height: 56px;
}
.home-col-center .carousel-slide .carousel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
  font-family: 'Georgia', 'Times New Roman', serif;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-col-center .carousel-slide:hover .carousel-title { color: var(--accent); }
.home-col-center .carousel-slide:not(.has-image) .carousel-title-bar {
  flex: 1;
  border-top: none;
}
/* Full-frame layout when announcement has no image */
.home-col-center .carousel-slide:not(.has-image) .carousel-full-frame {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 32px 36px;
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--surface-light) 100%);
  border-radius: var(--radius);
  overflow: hidden;
}
.home-col-center .carousel-slide .carousel-full-date {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.home-col-center .carousel-slide .carousel-full-title {
  font-size: 3.2rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.15;
  font-family: 'Georgia', 'Times New Roman', serif;
}
.home-col-center .carousel-slide:hover .carousel-full-title { color: var(--accent); }
.home-col-center .carousel-slide .carousel-full-body {
  font-size: 1.9rem;
  color: var(--text);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-col-center .carousel-slide .carousel-full-details {
  font-size: 1.7rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-col-center .carousel-slide .carousel-full-cta {
  margin-top: 6px;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}
/* Dots stick to bottom of column */
.home-col-center .carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 36px;
  right: 36px;
  margin-top: 0;
}

/* Right column — What We Do tiles 1 per row, rectangular */
.home-services { display: flex; flex-direction: column; height: 100%; }
.home-services .section-heading { font-size: 0.95rem; margin-bottom: 10px; text-align: left; }
.home-services .section-heading::after { margin: 6px 0 0; }
.home-services-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 132px;
  gap: 7px;
  align-content: start;
  flex: 0 0 auto;
}
.home-service-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: min-content min-content;
  align-items: center;
  align-content: center;
  justify-items: start;
  justify-content: start;
  column-gap: 10px;
  row-gap: 0;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
  transition: border-color 0.15s;
  overflow: hidden;
}
.home-service-card:hover { border-color: var(--accent); }
.home-service-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-size: 2.35rem;
  margin: 0;
  line-height: 1;
}
.home-service-title {
  grid-column: 2;
  grid-row: 1;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.08;
  margin: 0;
}
.home-service-desc {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.99rem;
  line-height: 1.18;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}
/* When a service tile has its own custom image, swap the emoji icon for the image */
.home-service-card.has-image {
  padding: 6px;
  gap: 0;
  align-items: center;
  align-content: center;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  grid-template-rows: min-content min-content;
}
.home-service-image {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}
.home-service-card.has-image .home-service-title {
  grid-column: 2;
  grid-row: 1;
  padding: 0;
  font-size: 1.08rem;
}
.home-service-card.has-image .home-service-desc {
  grid-column: 2;
  grid-row: 2;
  padding: 0;
  font-size: 0.92rem;
  -webkit-line-clamp: 2;
}

/* ===== Home Articles (below columns, full width, stacked) ===== */
.home-articles {
  padding: 28px 32px;
  max-width: 100%;
}
.home-articles .section-heading {
  font-size: 1.6rem;
  margin-bottom: 18px;
}
.home-articles-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.home-article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 32px;
  display: flex;
  align-items: baseline;
  gap: 28px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-article-card:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(233,10,30,0.08); }
.home-article-card h3 { font-size: 1.65rem; margin: 0; white-space: nowrap; flex-shrink: 0; }
.home-article-meta { font-size: 1.25rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.home-article-summary {
  font-size: 1.3rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-article-link {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.home-article-link:hover { color: var(--accent-hover); }

@media (max-width: 1000px) {
  .home-columns { flex-direction: column; padding: 16px; }
  .home-col-left, .home-col-center, .home-col-right {
    flex: none !important;
    max-width: 100% !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 0 0 16px 0 !important;
    margin-bottom: 16px;
  }
  .home-col-right { border-bottom: none !important; margin-bottom: 0; }
  .home-col-left .resources-grid { grid-template-columns: repeat(3, 1fr); }
  .home-article-card { flex-direction: column; gap: 4px; }
  .home-article-summary { white-space: normal; }
}

/* ===== Resources (Tile Layout) ===== */
.resources-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.resource-tile {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
  cursor: pointer;
  min-height: 140px;
  justify-content: center;
}
.resource-tile:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(233,10,30,0.12); border-color: var(--accent); color: var(--text); }

.resource-tile-icon {
  font-size: 2rem;
  line-height: 1;
}
.resource-tile h3 {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}
.resource-tile p {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.resource-tile .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(235,10,30,0.12);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.resource-tile.resource-team-only { border-color: #283593; }
.resource-tile .badge-team {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(40, 53, 147, 0.2);
  color: #82b1ff;
  border: 1px solid #283593;
}
/* Favorite star */
.resource-fav-btn {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--transition), transform var(--transition);
  padding: 2px;
  line-height: 1;
}
.resource-fav-btn:hover { opacity: 0.8; transform: scale(1.2); }
.resource-fav-btn.is-fav { opacity: 1; }
.resource-home-indicator {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
}
/* See all resources link */
.resources-see-all {
  text-align: center;
  margin-top: 16px;
}
.resources-see-all a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.resources-see-all a:hover { color: var(--accent-hover); }

/* Resources header row (Edit / heading / See All) */
.resources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.resources-header .section-heading {
  margin-bottom: 0;
  flex: 1;
}
.resources-header .section-heading::after {
  display: none;
}
.resources-header-link {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  margin-left: 12px;
}
.resources-header-link:hover { color: var(--accent-hover); }

/* Personalizer Modal */
.personalizer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.personalizer-modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  position: relative;
}
.personalizer-header { margin-bottom: 16px; }
.personalizer-header h3 { margin: 0 0 4px; font-size: 1.1rem; }
.personalizer-header p { margin: 0; font-size: 0.82rem; color: var(--text-muted); }
.personalizer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}
.personalizer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.personalizer-tile {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.personalizer-tile:hover { border-color: var(--accent); }
.personalizer-tile.selected {
  border-color: var(--accent);
  background: rgba(233,10,30,0.06);
}
.personalizer-tile h4 { font-size: 0.72rem; margin: 6px 0 0; }
.personalizer-tile .resource-tile-icon { font-size: 1.3rem; }
.personalizer-check {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}
.personalizer-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.personalizer-done {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.personalizer-done:hover { background: var(--accent-hover); }

/* Legacy resource-card (kept for resource page) */
.resource-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.resource-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(233,10,30,0.1); border-color: var(--accent); }
.resource-card .badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(235,10,30,0.12);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.resource-card h3 { font-size: 1rem; margin-bottom: 6px; }
.resource-card h3 a { color: var(--text); transition: color var(--transition); }
.resource-card h3 a:visited { color: var(--text); }
.resource-card h3 a:hover { color: var(--accent); }
.resource-card p { color: var(--text-muted); font-size: 0.88rem; }

/* Team-only resource badge and card */
.resource-team-only { position: relative; border-color: #283593; }
.badge-team {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(40, 53, 147, 0.2);
  color: #82b1ff;
  border: 1px solid #283593;
}

/* ===== Announcements Carousel ===== */
.announcements-carousel { padding: 28px 24px 32px; background: var(--toyota-dark); }

.carousel-read-more {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.carousel-read-more:hover { color: var(--accent-hover); }

/* ===== Announcements List Page ===== */
.announcements-list-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px;
}

.announcements-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.announcement-list-card {
  display: block;
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 48px 24px 24px;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition);
}
.announcement-list-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.announcement-list-card.announcement-hidden {
  opacity: 0.6;
  border-left: 3px solid #ff5252;
}

.announcement-list-date {
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 600;
}

.announcement-list-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.announcement-list-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.announcement-list-meta {
  margin-top: 8px;
}

.announcement-hidden-badge {
  display: inline-block;
  background: #ff525230;
  color: #ff5252;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
}

.announcement-list-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.announcement-list-card:hover .announcement-list-arrow {
  color: var(--accent);
}

/* ===== Announcement Detail Page ===== */
.announcement-detail-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.announcement-detail-container {}

.announcement-back-link {
  display: inline-block;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color var(--transition);
}
.announcement-back-link:hover { color: var(--accent-hover); }

.announcement-detail-banner {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.announcement-detail-banner img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.announcement-detail-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.announcement-detail-date {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 16px;
}

.announcement-detail-body {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.announcement-detail-content {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}
.announcement-detail-content h2 { font-size: 1.5rem; margin: 24px 0 12px; }
.announcement-detail-content h3 { font-size: 1.25rem; margin: 20px 0 10px; }
.announcement-detail-content h4 { font-size: 1.1rem; margin: 16px 0 8px; }
.announcement-detail-content ul {
  margin: 12px 0;
  padding-left: 24px;
}
.announcement-detail-content li {
  margin-bottom: 6px;
  color: var(--text-muted);
}
.announcement-detail-content strong { color: var(--text); }

.announcement-detail-edit {
  margin-top: 32px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.announcement-detail-edit h3 {
  margin-bottom: 8px;
}

.announcement-detail-textarea {
  width: 100%;
  min-height: 300px;
  background: var(--primary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  margin-top: 12px;
}
.announcement-detail-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.announcement-detail-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.announcement-edit-btn {
  margin-top: 24px;
}

.btn-secondary {
  background: var(--surface-light);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
}

.text-muted { color: var(--text-muted); }

@media (max-width: 768px) {
  .announcement-detail-title { font-size: 1.4rem; }
  .announcement-list-card { padding: 16px 40px 16px 16px; }
}

.carousel-viewport {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  transition: transform 0.6s ease;
}

/* --- Slide: full-width text by default --- */
.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 220px;
}

/* --- When slide has an image, use table layout for 50/50 split --- */
.carousel-slide.has-image {
  display: table;
  table-layout: fixed;
  width: 100%;
}
.carousel-slide.has-image > .carousel-content,
.carousel-slide.has-image > .carousel-img-side {
  display: table-cell;
  width: 50%;
  vertical-align: middle;
}

.carousel-content {
  padding: 28px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.carousel-slide.has-image > .carousel-content {
  align-items: flex-start;
  text-align: left;
}

.carousel-img-side {
  overflow: hidden;
  background: var(--surface, #000);
}
.carousel-img-side img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  min-height: 300px;
}

.carousel-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.carousel-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.carousel-body {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 700px;
}

/* Navigation buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--transition);
  z-index: 2;
}
.carousel-btn:hover { background: var(--accent); }
.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.carousel-dot {
  border-color: #888;
}
.carousel-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .carousel-slide.has-image { display: block; }
  .carousel-slide.has-image > .carousel-content,
  .carousel-slide.has-image > .carousel-img-side { display: block; width: 100%; }
  .carousel-content { padding: 24px; }
  .carousel-img-side img { min-height: 200px; height: 200px; }
  .carousel-title { font-size: 1.1rem; }
  .carousel-body { font-size: 0.85rem; }
  .carousel-btn { width: 36px; height: 36px; font-size: 1.2rem; }
}


/* ===== Articles ===== */
.articles-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.article-title { font-size: 1.3rem; margin-bottom: 8px; }

.article-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 0.85rem;
}
.article-author { color: var(--accent); font-weight: 600; }
.article-date { color: var(--text-muted); }

.article-summary { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; }

.article-body {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 12px;
}
.article-body p { margin-bottom: 12px; }
.article-body strong { color: var(--text); }

.article-expand-btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 20px;
}
.article-expand-btn:hover { background: var(--accent); color: #fff; }

/* ===== Article List Page (blog.html) ===== */
.articles-list-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px;
  min-height: 80vh;
}

.article-list-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 16px;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), transform var(--transition);
}
.article-list-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--text);
}
.article-list-card.article-hidden {
  opacity: 0.55;
  border-style: dashed;
}

.article-list-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  margin-bottom: 8px;
}
.article-list-author { color: var(--accent); font-weight: 600; }
.article-list-date { color: var(--text-muted); }

.article-list-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.article-list-summary {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 12px;
}

.article-list-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-list-arrow {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== Article Detail Page ===== */
.article-detail-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px;
  min-height: 80vh;
}

.article-detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.article-back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--accent);
  font-size: 0.9rem;
}
.article-back-link:hover { color: var(--accent-hover); }

.article-detail-banner {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.article-detail-banner img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

.article-detail-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.article-detail-meta {
  display: flex;
  gap: 16px;
  font-size: 0.88rem;
  margin-bottom: 24px;
}
.article-detail-author { color: var(--accent); font-weight: 600; }
.article-detail-date { color: var(--text-muted); }

.article-detail-body {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 32px;
}
.article-detail-body p { margin-bottom: 14px; }
.article-detail-body strong { color: var(--text); }

.article-detail-content {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 32px;
}
.article-detail-content h2 { font-size: 1.5rem; margin: 24px 0 12px; color: var(--text); }
.article-detail-content h3 { font-size: 1.25rem; margin: 20px 0 10px; color: var(--text); }
.article-detail-content h4 { font-size: 1.1rem; margin: 16px 0 8px; color: var(--text); }
.article-detail-content ul { padding-left: 24px; margin-bottom: 12px; }
.article-detail-content li { margin-bottom: 6px; }
.article-detail-content strong { color: var(--text); }

.article-detail-edit { margin-bottom: 32px; }

/* ===== Comments ===== */
.comments-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.comments-section h4 {
  font-size: 1rem;
  margin-bottom: 14px;
  color: var(--text);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  border-radius: 8px;
  padding: 14px 18px;
}
.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.comment-header strong { color: var(--accent); }
.comment-time { color: var(--text-muted); font-size: 0.78rem; }
.comment p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

.comment-form textarea {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
  transition: border-color var(--transition);
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form textarea:disabled { opacity: 0.5; }

.btn-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.login-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 10px;
}

/* ===== Contact ===== */
.contact-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-inner .description {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1.05rem;
}

.contact-channels {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.channel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  text-align: center;
  min-width: 200px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.channel .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.channel .value { font-size: 1.1rem; font-weight: 600; }

/* ===== Auth Bar ===== */
#auth-bar {
  position: relative;
  background: var(--toyota-dark);
  border-bottom: 1px solid #333;
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: #cccccc;
}
.auth-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-bar-logo {
  height: 28px;
  width: auto;
}
.auth-bar-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.01em;
  white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 768px) {
  .auth-bar-title { font-size: 1rem; }
}
.auth-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#auth-login {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition);
}
#auth-login:hover { background: var(--accent-hover); }

#auth-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}
#auth-user-name { color: var(--accent); font-weight: 600; }
#auth-user button {
  background: none;
  border: 1px solid #555;
  color: #cccccc;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: border-color var(--transition);
}
#auth-user button:hover { border-color: var(--accent); color: #ffffff; }

/* ===== Quick Links (Home hub) ===== */
.quick-links { padding: 36px 24px 48px; background: var(--surface); }

.quick-links-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.quick-link-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: block;
}
.quick-link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(233,10,30,0.12);
  border-color: var(--accent);
  color: var(--text);
}
.quick-link-icon { font-size: 2.2rem; margin-bottom: 14px; }
.quick-link-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.quick-link-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* ===== Footer ===== */
footer {
  text-align: center;
  padding: 28px 24px;
  background: var(--toyota-dark);
  border-top: none;
  color: #aaaaaa;
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* ===== Admin Chatbot ===== */
#chatbot-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(235,10,30,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  z-index: 9999;
}
#chatbot-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(235,10,30,0.5); }
#chatbot-fab.hidden { opacity: 0; pointer-events: none; transform: scale(0.5); }

#deam-agent-fab {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(15,118,110,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  z-index: 9999;
}
#deam-agent-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(15,118,110,0.5); }

.deam-agent-fab-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.deam-agent-fab-icon {
  width: 34px;
  height: 34px;
  display: block;
}

#chatbot-panel {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 420px;
  height: 600px;
  max-height: calc(100vh - 56px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  overflow: hidden;
  color: var(--text);
}
#chatbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

#deam-agent-panel {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 420px;
  height: 600px;
  max-height: calc(100vh - 56px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  overflow: hidden;
  color: var(--text);
}
#deam-agent-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.deam-agent-header {
  background: linear-gradient(135deg, #0f766e 0%, #155e75 100%);
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff;
  flex-shrink: 0;
}
.chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.chatbot-icon { font-size: 1.3rem; }
.chatbot-title { font-weight: 700; font-size: 0.95rem; letter-spacing: 0.5px; }
.chatbot-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.chatbot-close:hover { background: rgba(255,255,255,0.35); }

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--card-bg);
}
.chatbot-messages::-webkit-scrollbar { width: 6px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.chatbot-msg { display: flex; }
.chatbot-msg-user { justify-content: flex-end; }
.chatbot-msg-bot { justify-content: flex-start; }

.chatbot-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}
.chatbot-bubble-user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chatbot-bubble-bot {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chatbot-bubble code {
  background: rgba(127,127,127,0.12);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
}
.chatbot-bubble strong { color: var(--text); }

/* Chatbot typing indicator */
.chatbot-typing {
  display: flex;
  gap: 5px;
  padding: 12px 18px !important;
}
.chatbot-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: chatbot-dot 1.2s infinite;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatbot-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* Chatbot tables */
.chatbot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 4px 0;
}
.chatbot-table th {
  background: var(--surface-light);
  color: var(--accent);
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chatbot-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.chatbot-table tr:hover td { background: rgba(127,127,127,0.06); }
.chatbot-row-active td { background: rgba(127,127,127,0.10) !important; }
.chatbot-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid var(--border);
}

/* Suggestions */
.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
  flex-shrink: 0;
}
.chatbot-suggestion {
  background: var(--surface-light);
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.chatbot-suggestion:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Input area */
.chatbot-input-wrap {
  display: flex;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}
#chatbot-input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
#chatbot-input:focus { border-color: var(--accent); }
#chatbot-input::placeholder { color: var(--text-muted); }

#deam-agent-input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
#deam-agent-input:focus { border-color: #0f766e; }
#deam-agent-input::placeholder { color: var(--text-muted); }

#chatbot-send {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
#chatbot-send:hover { background: var(--accent-hover); transform: scale(1.05); }

#deam-agent-send {
  background: #0f766e;
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
#deam-agent-send:hover { background: #115e59; transform: scale(1.05); }

.deam-agent-ref-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.deam-agent-ref {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15,118,110,0.08);
  border: 1px solid rgba(15,118,110,0.2);
  color: var(--text);
  text-decoration: none;
}

.deam-agent-ref:hover {
  background: rgba(15,118,110,0.14);
}

.deam-agent-ref-title {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.deam-agent-ref-type {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0f766e;
  margin-bottom: 6px;
}

.deam-agent-ref-summary {
  display: block;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* Autocomplete dropdown */
.chatbot-autocomplete {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 60px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  z-index: 10;
  margin-bottom: 4px;
}
.chatbot-ac-item {
  padding: 8px 14px;
  font-size: 0.84rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.chatbot-ac-item:last-child { border-bottom: none; }
.chatbot-ac-item:hover, .chatbot-ac-item.focused {
  background: var(--surface-light);
  color: var(--accent);
}
.chatbot-ac-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Clickable command links in help output */
.chatbot-cmd-link {
  cursor: pointer !important;
  color: var(--accent) !important;
  background: rgba(127,127,127,0.10) !important;
  padding: 1px 6px !important;
  border-radius: 4px !important;
  transition: background 0.15s !important;
  text-decoration: none;
}
.chatbot-cmd-link:hover {
  background: rgba(127,127,127,0.20) !important;
  text-decoration: underline;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--toyota-dark);
    border-bottom: 1px solid #333;
    padding: 16px 24px;
    gap: 16px;
  }
  .nav-toggle { display: block; }
  .hero { min-height: 100px; padding: 16px 20px; }
  .services-grid, .team-grid, .resources-grid { grid-template-columns: 1fr; }
  .contact-channels { flex-direction: column; align-items: center; }

  #chatbot-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 80px);
    bottom: 8px;
    right: 8px;
    border-radius: 12px;
  }
  #chatbot-fab { bottom: 16px; right: 16px; }

  #deam-agent-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 80px);
    bottom: 8px;
    left: 8px;
    border-radius: 12px;
  }
  #deam-agent-fab { bottom: 16px; left: 16px; }
}

/* ===== Role Badge (Auth Bar) ===== */
.auth-role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 4px;
}
.auth-role-badge:hover { opacity: 0.85; transform: scale(1.05); }
.role-user { background: #1e3a5f; color: #4fc3f7; border: 1px solid #2a5a8f; }
.role-team { background: #1a237e; color: #82b1ff; border: 1px solid #283593; }
.role-admin { background: #3e2723; color: #ffab40; border: 1px solid #5d4037; }
.role-siteadmin { background: #1b5e20; color: #69f0ae; border: 1px solid #2e7d32; }

/* ===== Role Picker Dialog ===== */
.role-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.role-picker-dialog {
  background: var(--card-bg, #1e1e22);
  border: 1px solid var(--border, #333);
  border-radius: 16px;
  padding: 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.role-picker-dialog h3 {
  margin: 0 0 8px;
  color: var(--text, #fff);
  font-size: 1.3rem;
}
.role-picker-dialog p {
  color: var(--text-muted, #999);
  margin: 0 0 20px;
  font-size: 0.9rem;
}
.role-picker-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--surface, #16161a);
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: var(--text, #e0e0e4);
  font-family: inherit;
}
.role-picker-btn:hover { border-color: var(--accent, #EB0A1E); background: rgba(235,10,30,0.08); }
.role-picker-icon { font-size: 1.6rem; flex-shrink: 0; }
.role-picker-info strong { display: block; font-size: 1rem; margin-bottom: 2px; }
.role-picker-info small { color: var(--text-muted, #999); font-size: 0.82rem; line-height: 1.4; }

.role-picker-cancel {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid var(--border, #333);
  border-radius: 10px;
  padding: 10px;
  margin-top: 6px;
  cursor: pointer;
  color: var(--text-muted, #999);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
}
.role-picker-cancel:hover { color: var(--text, #fff); border-color: #555; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Help / Documentation Page ===== */
.help-section {
  padding: 40px 24px 80px;
  min-height: 80vh;
  background: var(--bg, transparent);
}

.help-container {
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}

/* Sidebar TOC */
.help-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 16px;
}
.help-sidebar h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin: 0 0 14px;
  font-weight: 700;
}
#help-toc {
  list-style: none;
  padding: 0;
  margin: 0;
}
#help-toc li {
  margin: 0;
}
#help-toc li a {
  display: block;
  padding: 6px 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}
#help-toc li a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--surface-light);
}
.toc-h1 a { font-weight: 700; font-size: 1rem; color: var(--text) !important; }
.toc-h2 a { padding-left: 22px !important; font-size: 0.95rem; }
.toc-h3 a { padding-left: 36px !important; font-size: 0.88rem; color: var(--text-muted) !important; }

/* Collapsible TOC groups */
.toc-group { display: block; }
.toc-group-header {
  display: flex;
  align-items: center;
  gap: 4px;
}
.toc-group-header a {
  flex: 1;
  padding-left: 4px !important;
}
.toc-chevron {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 4px 6px;
  line-height: 1;
  transition: transform 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}
.toc-chevron:hover { color: var(--accent); }
.toc-group.is-open > .toc-group-header > .toc-chevron { transform: rotate(90deg); }
.toc-children {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.toc-group.is-open > .toc-children {
  max-height: 2000px;
}

/* Help content body */
.help-content {
  color: var(--text);
  line-height: 1.75;
  font-size: 1.05rem;
}
.help-content h1,
.help-content h2,
.help-content h3,
.help-content h4 {
  scroll-margin-top: 120px;
}
.help-content h1 {
  font-size: 2.2rem;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  font-weight: 700;
}
.help-content h2 {
  font-size: 1.7rem;
  color: var(--text);
  margin: 36px 0 12px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.help-content h3 {
  font-size: 1.3rem;
  color: var(--text);
  margin: 28px 0 10px;
  font-weight: 600;
}
.help-content h4 {
  font-size: 1.1rem;
  color: var(--text);
  margin: 20px 0 8px;
  font-weight: 600;
}
.help-content p {
  margin: 0 0 14px;
  color: var(--text);
}
.help-content code {
  background: var(--surface-light);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  border: 1px solid var(--border);
}
.help-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
}
.help-content pre code {
  background: none;
  color: var(--text);
  padding: 0;
  font-size: 0.92rem;
  border: none;
}
.help-content blockquote {
  border-left: 4px solid var(--accent);
  margin: 16px 0;
  padding: 10px 22px;
  background: var(--surface-light);
  color: var(--text);
  border-radius: 0 8px 8px 0;
}
.help-content ul, .help-content ol {
  padding-left: 26px;
  margin: 8px 0 16px;
  color: var(--text);
}
.help-content li {
  margin-bottom: 6px;
  color: var(--text);
}
.help-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}
.help-content strong {
  color: var(--text);
  font-weight: 700;
}
.help-content a {
  color: var(--accent);
  text-decoration: none;
}
.help-content a:hover { text-decoration: underline; }

/* Help tables */
.help-table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}
.help-table th {
  background: var(--surface-light);
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--accent);
}
.help-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.help-table tr:hover td { background: var(--surface-light); }

/* Collapsible sections */
.help-section-group {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  overflow: hidden;
}
.help-section-group > .help-section-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--surface-light);
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 700;
  font-family: inherit;
  transition: background 0.15s;
}
.help-section-group > .help-section-toggle:hover {
  background: var(--surface);
}
.help-section-group > .help-section-toggle .help-chevron {
  display: inline-block;
  width: 1.1em;
  transition: transform 0.2s ease;
  color: var(--accent);
  font-size: 0.9em;
}
.help-section-group.is-open > .help-section-toggle .help-chevron {
  transform: rotate(90deg);
}
.help-section-group.is-open > .help-section-toggle {
  border-bottom: 2px solid var(--accent);
}
.help-section-body {
  display: none;
  padding: 20px 24px 28px;
}
.help-section-group.is-open > .help-section-body {
  display: block;
}
/* Heading inside group already shown via toggle button — hide its inner h1 if any */
.help-section-body > h1:first-child { display: none; }

/* Responsive help */
@media (max-width: 768px) {
  .help-container { grid-template-columns: 1fr; }
  .help-sidebar { position: static; max-height: none; padding: 0 0 20px; border-bottom: 1px solid var(--border); }
  .help-content { font-size: 1rem; }
  .help-content h1 { font-size: 1.8rem; }
  .help-content h2 { font-size: 1.45rem; }
  .help-section-group > .help-section-toggle { font-size: 1.2rem; }
}

/* ===== Backup Management Page ===== */

/* Nav Site Admin badge */
.nav-siteadmin {
  position: relative;
}
.nav-siteadmin::after {
  content: '🔒';
  font-size: 0.6rem;
  position: absolute;
  top: -4px;
  right: -10px;
}

/* Settings dropdown menu (Site Admin) */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { cursor: pointer; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--bg-secondary, #161a36);
  border: 1px solid var(--border, #2a2f5a);
  border-radius: 8px;
  padding: 6px 0;
  margin: 6px 0 0;
  list-style: none;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li { padding: 0; }
.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--text-secondary, #aab);
  text-decoration: none;
  font-size: 0.92rem;
}
.nav-dropdown-menu a:hover { background: rgba(255,255,255,0.04); color: #fff; }
.nav-dropdown-menu a.nav-active { color: var(--accent, #e60012); background: rgba(230,0,18,0.06); }

/* Access guard */
.backup-guard {
  text-align: center;
  padding: 120px 24px;
}
.backup-guard-icon { font-size: 4rem; margin-bottom: 16px; }
.backup-guard h2 { color: var(--text, #fff); margin: 0 0 8px; }
.backup-guard p { color: var(--text-muted, #999); margin: 0 0 24px; }

/* Section */
.backup-section {
  padding: 40px 24px 80px;
  max-width: var(--max-w, 1200px);
  margin: 0 auto;
  min-height: 80vh;
}

/* Header row */
.backup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.backup-header .section-heading { margin-bottom: 4px; }
.backup-subtitle {
  color: var(--text-muted, #999);
  font-size: 0.95rem;
  margin: 0;
}
.backup-btn-create {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  white-space: nowrap;
}
.backup-btn-icon { font-size: 1.1rem; }

/* Stats row */
.backup-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.backup-stat-card {
  background: var(--surface, #16161a);
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}
.backup-stat-card:hover { border-color: var(--accent, #EB0A1E); }
.backup-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text, #fff);
  margin-bottom: 4px;
}
.backup-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tabs */
.backup-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border, #333);
  margin-bottom: 24px;
}
.backup-tab {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  font-size: 0.95rem;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
}
.backup-tab:hover { color: var(--text, #fff); }
.backup-tab.active {
  color: var(--accent, #EB0A1E);
  border-bottom-color: var(--accent, #EB0A1E);
}
.backup-tab-content { display: none; }
.backup-tab-content.active { display: block; animation: fadeIn 0.3s; }

/* Loading */
.backup-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--text-muted, #999);
}
.backup-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border, #333);
  border-top-color: var(--accent, #EB0A1E);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.backup-empty {
  text-align: center;
  padding: 60px 24px;
}
.backup-empty-icon { font-size: 3.5rem; margin-bottom: 12px; }
.backup-empty h3 { color: var(--text, #fff); margin: 0 0 8px; }
.backup-empty p { color: var(--text-muted, #999); margin: 0 0 20px; }

/* Backup cards */
.backup-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.backup-card {
  background: var(--surface, #16161a);
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  padding: 20px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.backup-card:hover {
  border-color: rgba(235, 10, 30, 0.3);
  box-shadow: 0 2px 16px rgba(235, 10, 30, 0.06);
}
.backup-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.backup-card-info { flex: 1; min-width: 0; }
.backup-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.backup-card-date {
  color: var(--text-muted, #999);
  font-size: 0.82rem;
}
.backup-card-name {
  font-size: 0.82rem;
  color: var(--text-muted, #777);
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.backup-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted, #999);
  display: flex;
  gap: 16px;
}

/* Backup labels */
.backup-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
}
.backup-label-manual {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}
.backup-label-scheduled {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}
.backup-label-safety {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

/* Card actions */
.backup-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.backup-action-btn {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #333);
  color: var(--text-muted, #999);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}
.backup-action-btn:hover { color: var(--text, #fff); border-color: #555; }
.backup-action-restore:hover { color: #60a5fa; border-color: rgba(59, 130, 246, 0.5); background: rgba(59, 130, 246, 0.08); }
.backup-action-delete:hover { color: #f87171; border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.08); }

/* Schedule card */
.backup-schedule-card {
  background: var(--surface, #16161a);
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
}
.backup-schedule-header h3 {
  color: var(--text, #fff);
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.backup-schedule-header p {
  color: var(--text-muted, #999);
  margin: 0 0 28px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.backup-schedule-form { display: flex; flex-direction: column; gap: 20px; }
.backup-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.backup-form-label {
  font-size: 0.9rem;
  color: var(--text, #e0e0e4);
  font-weight: 600;
  white-space: nowrap;
}
.backup-form-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.backup-form-input {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #333);
  color: var(--text, #e0e0e4);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  width: 120px;
  transition: border-color 0.2s;
}
.backup-form-input:focus {
  outline: none;
  border-color: var(--accent, #EB0A1E);
}
.backup-form-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #777);
}
.backup-form-hint code {
  background: rgba(235,10,30,0.1);
  color: #ff8a93;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.82em;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
}
.backup-form-select {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #333);
  color: var(--text, #e0e0e4);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  min-width: 200px;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.backup-form-select:focus {
  outline: none;
  border-color: var(--accent, #EB0A1E);
}
.backup-form-select option {
  background: var(--surface, #16161a);
  color: var(--text, #e0e0e4);
}
.backup-cron-help {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.backup-cron-examples {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.backup-cron-preset {
  display: inline-block;
  background: rgba(235,10,30,0.08);
  color: var(--accent, #EB0A1E);
  border: 1px solid rgba(235,10,30,0.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  cursor: pointer;
  transition: all 0.2s;
}
.backup-cron-preset:hover {
  background: rgba(235,10,30,0.16);
  border-color: rgba(235,10,30,0.4);
}
.backup-schedule-preview {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #34d399;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}
.backup-form-actions {
  padding-top: 8px;
}

/* Toggle switch */
.backup-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.backup-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--border, #333);
  border: none;
  border-radius: 13px;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s;
}
.backup-toggle.active { background: var(--accent, #EB0A1E); }
.backup-toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}
.backup-toggle.active .backup-toggle-slider { transform: translateX(22px); }
.backup-toggle-label {
  font-size: 0.85rem;
  color: var(--text-muted, #999);
}

/* Modals */
.backup-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s;
  backdrop-filter: blur(4px);
}
.backup-modal {
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border, #333);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.backup-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #333);
}
.backup-modal-header h3 {
  color: var(--text, #fff);
  margin: 0;
  font-size: 1.1rem;
}
.backup-modal-close {
  background: none;
  border: none;
  color: var(--text-muted, #999);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.backup-modal-close:hover { color: var(--text, #fff); }
.backup-modal-body {
  padding: 24px;
}
.backup-modal-body p {
  color: var(--text-muted, #ccc);
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.backup-modal-body .backup-form-label {
  display: block;
  margin-bottom: 8px;
}
.backup-modal-body .backup-form-input {
  width: 100%;
  box-sizing: border-box;
}
.backup-modal-body .backup-form-hint {
  display: block;
  margin-top: 6px;
}

/* Restore — section-scope selector */
.restore-scope-block { margin-top: 8px; }
.restore-scope-radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  background: var(--surface, #16161a);
  color: var(--text, #e0e0e4);
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.4;
}
.restore-scope-radio input { margin-top: 3px; accent-color: var(--accent, #EB0A1E); }
.restore-scope-radio span strong { color: var(--text, #fff); }

.restore-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 4px;
  padding: 14px 16px;
  background: var(--surface, #16161a);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
}
@media (max-width: 600px) {
  .restore-sections-grid { grid-template-columns: 1fr; }
}
.restore-section-group { display: flex; flex-direction: column; gap: 6px; }
.restore-section-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted, #888);
  margin-bottom: 4px;
}
.restore-section-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text, #e0e0e4);
  cursor: pointer;
  padding: 4px 2px;
}
.restore-section-check input { accent-color: var(--accent, #EB0A1E); }
.backup-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--border, #333);
}
.backup-btn-secondary {
  background: transparent !important;
  border: 1px solid var(--border, #333) !important;
  color: var(--text-muted, #999) !important;
}
.backup-btn-secondary:hover {
  border-color: #555 !important;
  color: var(--text, #fff) !important;
}
.backup-btn-danger {
  background: #dc2626 !important;
  border-color: #dc2626 !important;
}
.backup-btn-danger:hover {
  background: #b91c1c !important;
}

/* Warning box */
.backup-warning {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #fbbf24;
}
.backup-warning strong { color: #fbbf24; }

/* Toast */
.backup-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  z-index: 10000;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.backup-toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.backup-toast-success { background: #065f46; color: #6ee7b7; border: 1px solid #059669; }
.backup-toast-error { background: #7f1d1d; color: #fca5a5; border: 1px solid #dc2626; }
.backup-toast-info { background: #1e3a5f; color: #93c5fd; border: 1px solid #3b82f6; }

/* Responsive backup page */
@media (max-width: 768px) {
  .backup-header { flex-direction: column; }
  .backup-card-main { flex-direction: column; align-items: flex-start; }
  .backup-card-actions { width: 100%; }
  .backup-card-actions .backup-action-btn { flex: 1; text-align: center; }
  .backup-form-row { flex-direction: column; align-items: flex-start; }
  .backup-form-input { width: 100%; }
  .backup-stats { grid-template-columns: repeat(2, 1fr); }
  .backup-modal { width: 95%; }
}


/* ===== Light Theme Visibility Overrides ===== */
/* Applied automatically when active theme has a light primary color */
.theme-is-light .resource-tile,
.theme-is-light .home-service-tile,
.theme-is-light .home-article-card,
.theme-is-light .org-card,
.theme-is-light .announcement-card,
.theme-is-light .article-list-card,
.theme-is-light .service-card {
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.theme-is-light .resource-tile:hover,
.theme-is-light .home-service-tile:hover,
.theme-is-light .home-article-card:hover,
.theme-is-light .article-list-card:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 4px 12px rgba(233, 10, 30, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}
.theme-is-light section:nth-child(even) {
  background: var(--surface);
}
.theme-is-light #header,
.theme-is-light #footer,
.theme-is-light #nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.theme-is-light #auth-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.theme-is-light #auth-bar .auth-bar-title {
  color: var(--text);
}
.theme-is-light header {
  background: var(--surface) !important;
}
.theme-is-light .nav-logo,
.theme-is-light .nav-logo:hover {
  color: var(--text) !important;
}
.theme-is-light .nav-links a {
  color: var(--text-muted) !important;
}
.theme-is-light .nav-links a:hover,
.theme-is-light .nav-links a.nav-active {
  color: var(--accent) !important;
}
.theme-is-light .nav-toggle {
  color: var(--text) !important;
}
/* Toyota logo PNG (red+white) — works on both themes; no filter needed */
.theme-is-light #footer {
  color: var(--text-muted);
}
/* Dark themes — restore bright header text in case any prior override leaked */
:root:not(.theme-is-light) .nav-logo { color: #ffffff; }
:root:not(.theme-is-light) .nav-links a { color: #cccccc; }
:root:not(.theme-is-light) .nav-links a:hover,
:root:not(.theme-is-light) .nav-links a.nav-active { color: #ffffff; }
.theme-is-light .home-articles-grid > .home-article-card,
.theme-is-light .home-services-grid > .home-service-tile {
  background: var(--card-bg);
}
/* "View all articles" link */
.home-articles-more {
  margin-top: 16px;
  text-align: center;
}
.home-articles-more-link {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}
.home-articles-more-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
/* Archived articles section on blog page */
.archived-section {
  border-top: 2px dashed var(--border);
  padding-top: 24px;
}
.archived-section .article-list-card {
  opacity: 0.85;
}
.theme-is-light .archived-section .article-list-card {
  background: var(--surface);
}

/* ── Custom Resource Page ── */
.resource-custom-page-section {
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
  background: #fff;
  position: relative;
}
.resource-custom-iframe {
  width: 100%;
  min-height: 500px;
  height: 80vh;
  border: none;
  display: block;
  overflow: auto;
}
.resource-custom-page-fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  margin: 0;
  border-radius: 0;
  border: none;
  background: #fff;
}
.resource-custom-page-fullscreen .resource-custom-iframe {
  height: 100vh;
  min-height: 100vh;
}
.resource-fullscreen-toggle {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
}
.resource-custom-page-fullscreen .resource-fullscreen-toggle {
  position: fixed;
  top: 12px; right: 12px;
}
.resource-file-manage {
  margin: 20px 0;
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.resource-file-manage h3 { margin: 0 0 12px; }
.resource-file-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.resource-file-table th,
.resource-file-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.resource-file-table th { font-weight: 600; color: var(--text-muted); }
.resource-upload-area {
  display: flex;
  align-items: center;
  margin-top: 12px;
}
.resource-upload-label { cursor: pointer; }
.btn-sm { padding: 2px 8px; font-size: 0.8rem; min-width: auto; }
.btn-danger { background: #c62828; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.btn-danger:hover { background: #b71c1c; }

/* Draft / Published / Approved badges */
.badge-draft {
  background: #ff9800;
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-published {
  background: #2e7d32;
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-approved {
  background: #1565c0;
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 4px;
}
