/**
 * AITYKE Platform UI Standard v1 — Champagne Gold + Deep Water.
 * This file is loaded after the legacy Morandi layer and provides the shared
 * visual contract for Admin, Manager, Learner and feature workspaces.
 */
:root {
  --platform-navy-950: #06131f;
  --platform-navy-900: #0b1f33;
  --platform-navy-800: #123b55;
  --platform-water-700: #1f6f8b;
  --platform-water-500: #3a91aa;
  --platform-water-100: #dceef3;
  --platform-gold-700: #8f6b2e;
  --platform-gold-600: #ad843d;
  --platform-gold-500: #c6a15b;
  --platform-gold-300: #ddc58f;
  --platform-gold-100: #f3e9d2;
  --platform-gold-action: #86652f;
  --platform-gold-action-hover: #705326;
  --platform-on-gold: #ffffff;
  --platform-canvas: #f6f8fa;
  --platform-surface: #ffffff;
  --platform-ink: #15202b;
  --platform-muted: #617181;
  --platform-line: #d8e1e8;
  --platform-danger: #b42318;
  --platform-success: #177245;
  --platform-warning: #9a6700;
  --platform-space-1: 4px;
  --platform-space-2: 8px;
  --platform-space-3: 12px;
  --platform-space-4: 16px;
  --platform-space-5: 24px;
  --platform-space-6: 32px;
  --platform-radius-sm: 6px;
  --platform-radius-md: 10px;
  --platform-radius-lg: 14px;
  --platform-radius-xl: 16px;
  --platform-control-height: 44px;
  --platform-icon-size: 20px;
  --platform-tag-icon-size: 16px;
  --platform-feature-icon-size: 24px;
  --platform-control-padding-y: 10px;
  --platform-control-padding-x: 16px;
  --platform-shadow-sm: 0 1px 2px rgba(6, 19, 31, .05), 0 8px 24px rgba(6, 19, 31, .035);
  --platform-shadow-lg: 0 18px 48px rgba(6, 19, 31, .11);
  --platform-focus: 0 0 0 3px rgba(31, 111, 139, .24);
  --platform-font-latin: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --platform-font-cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --platform-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* Bridge existing portal tokens onto the platform standard. */
  --aityke-brand: var(--platform-water-700);
  --aityke-card: var(--platform-surface);
  --aityke-bg: var(--platform-canvas);
  --aityke-ink: var(--platform-ink);
  --aityke-muted: var(--platform-muted);
  --aityke-line: var(--platform-line);
  --orange-500: var(--platform-gold-500);
  --primary: var(--platform-water-700);
}

.aityke-release-preview {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    min-height: 44px;
    padding: 8px 16px;
    border-bottom: 1px solid #9f7b37;
    border-radius: 2px;
    background: #0b1f33;
    color: #f3e9d2;
    font-size: 13px;
    line-height: 1.35;
}

.aityke-release-preview .material-symbols-outlined { font-size: 18px; color: #c6a15b; }
.aityke-release-preview span:last-child { color: #dceef3; }

html { max-width: 100%; overflow-x: hidden; background: var(--platform-canvas); color: var(--platform-ink); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body,
button,
input,
select,
textarea { font-family: var(--platform-font-latin); }
body { max-width: 100%; margin: 0; overflow-x: hidden; background: var(--platform-canvas); color: var(--platform-ink); font-feature-settings: "kern" 1, "liga" 1, "tnum" 1; }
html:lang(zh),
html:lang(zh-CN),
html:lang(zh-SG),
[lang^="zh"] { font-family: var(--platform-font-cjk); font-synthesis: none; }
[lang^="zh"] button,
[lang^="zh"] input,
[lang^="zh"] select,
[lang^="zh"] textarea { font-family: inherit; }
p, li, td, label, input, select, textarea { line-height: 1.55; }
code, kbd, samp, .platform-code { font-family: var(--platform-font-mono); }

/* Feature layout primitives. */
.platform-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.platform-shell__sidebar { position: relative; padding: 16px; background: var(--platform-sidebar,var(--platform-canvas)); color: var(--platform-ink); border-right: 1px solid var(--platform-line); }
.platform-brand { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 76px; margin: 0 0 20px; padding: 12px; background: var(--platform-navy-950); color: #fff; text-decoration: none; }
.platform-brand__logo { display: block; flex: 0 1 auto; width: 150px; max-width: 100%; height: auto; aspect-ratio: 5 / 2; object-fit: contain; object-position: left center; }
.platform-brand__mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(221,197,143,.65); border-radius: 2px; background: linear-gradient(145deg, var(--platform-gold-300), var(--platform-gold-600) 52%, var(--platform-water-700)); color: var(--platform-navy-950); box-shadow: inset 0 1px rgba(255,255,255,.55), 0 0 18px rgba(58,145,170,.16); }
.platform-nav { display: grid; gap: 6px; margin-top: 0; }
.platform-nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--platform-radius-md); color: var(--platform-ink); text-decoration: none; font-weight: 650; }
.platform-nav a:hover { background: var(--platform-hover); }
.platform-nav a[aria-current="page"] { color: #fff; background: var(--platform-navy-900); box-shadow: inset 3px 0 0 var(--platform-gold-500); }
.platform-shell__main { min-width: 0; }
.platform-toolbar { min-height: 68px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 32px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--platform-line); backdrop-filter: blur(16px) saturate(120%); }
.platform-mobile-brand { display: none; min-width: 0; padding: 4px 0; }
.platform-mobile-brand img { display: block; width: 112px; height: auto; aspect-ratio: 5 / 2; object-fit: contain; object-position: left center; }
.platform-page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 36px 0 64px; }
.platform-page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px 24px; margin-bottom: 24px; }
.platform-page-header > * { min-width: 0; }
.platform-page-header > :first-child { flex: 1 1 360px; }
.platform-page-header h1 { margin: 8px 0 6px; color: var(--platform-navy-900); font-size: clamp(28px, 4vw, 38px); font-weight: 760; line-height: 1.12; letter-spacing: -.035em; }
[lang^="zh"] .platform-page-header h1 { font-weight: 700; line-height: 1.28; letter-spacing: .015em; }
[lang^="zh"] .platform-page-subtitle,
[lang^="zh"] .platform-card__header p { line-height: 1.75; letter-spacing: .01em; }
.platform-page-subtitle { max-width: 72ch; margin: 0; color: var(--platform-muted); line-height: 1.6; overflow-wrap: anywhere; }
.platform-breadcrumb { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--platform-muted); font-size: 13px; overflow-wrap: anywhere; }
.platform-breadcrumb a { color: var(--platform-water-700); }
.platform-grid { display: grid; min-width: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.platform-grid > * { min-width: 0; }
.platform-col-4 { grid-column: span 4; }
.platform-col-8 { grid-column: span 8; }
.platform-col-12 { grid-column: 1 / -1; }
.platform-card { position: relative; padding: 20px; background: linear-gradient(180deg, #fff, #fdfefe); border: 1px solid var(--platform-line); border-radius: var(--platform-radius-lg); box-shadow: var(--platform-shadow-sm); }
.platform-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.platform-card__header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.platform-card__header > * { min-width: 0; }
.platform-card__header > :first-child { flex: 1 1 220px; }
.platform-card__header h2 { margin: 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
[lang^="zh"] .platform-card__header h2 { font-weight: 650; line-height: 1.5; letter-spacing: .01em; }
.platform-card__header p { margin: 5px 0 0; color: var(--platform-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.platform-button { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: var(--platform-control-height); padding: var(--platform-control-padding-y) var(--platform-control-padding-x); border: 1px solid transparent; border-radius: 2px; font: inherit; font-weight: 750; line-height: 22px; text-align: center; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.platform-button--primary { background: var(--platform-navy-900); border-color: var(--platform-navy-900); color: #fff; box-shadow: none; }
.platform-button--gold { background: var(--platform-gold-action); border-color: var(--platform-gold-action); color: var(--platform-on-gold); box-shadow: none; }
.platform-button--gold:is(:hover,:active) { background: var(--platform-gold-action-hover); border-color: var(--platform-gold-action-hover); }
.platform-button--gold :is(span,.material-symbols-outlined) { color: inherit; }
.platform-button--secondary { background: var(--platform-surface); border-color: var(--platform-line); color: var(--platform-navy-900); }
.platform-button--danger { background: #fff5f4; border-color: rgba(180,35,24,.25); color: var(--platform-danger); }
.platform-button:hover { filter: brightness(.97); box-shadow: 0 3px 10px rgba(6,19,31,.1); transform: translateY(-1px); }
.platform-button:active { transform: translateY(0); box-shadow: none; }
.platform-field { display: grid; gap: 7px; font-weight: 700; font-size: 13px; }
.platform-field input,
.platform-field select,
.platform-field textarea { box-sizing: border-box; width: 100%; min-height: var(--platform-control-height); padding: var(--platform-control-padding-y) 12px; border: 1px solid var(--platform-line) !important; border-radius: 2px !important; line-height: 22px; }
.platform-field textarea { min-height: 104px; resize: vertical; }
.platform-field input:hover,
.platform-field select:hover,
.platform-field textarea:hover { border-color: #b8c9d4 !important; }
.platform-field small { color: var(--platform-muted); font-weight: 400; }
.platform-form { display: grid; gap: 16px; }
.platform-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.platform-table { width: 100%; min-width: 680px; }
.platform-table th, .platform-table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--platform-line); }
.platform-table th { color: #526473; background: #f0f5f7; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.platform-table td { max-width: 320px; font-size: 14px; overflow-wrap: anywhere; vertical-align: middle; }
.platform-table tbody tr:last-child td { border-bottom: 0; }
.platform-badge { display: inline-flex; align-items: center; max-width: 100%; min-height: 26px; padding: 3px 9px; border: 1px solid transparent; border-radius: 2px; background: #eef1f4; color: var(--platform-muted); font-size: 12px; font-weight: 800; line-height: 18px; letter-spacing: .03em; text-transform: uppercase; white-space: normal; overflow-wrap: anywhere; }
.platform-badge--live { background: #e4f4eb; color: var(--platform-success); }
.platform-badge--testing { background: var(--platform-gold-100); color: #765719; }
.platform-badge--locked, .platform-badge--expired { background: #f4e9e8; color: var(--platform-danger); }

/* AI identity contract. AI marks never inherit arbitrary heading/button sizes,
   rotate with surrounding controls, or collapse when labels wrap. */
.platform-ai-mark,
.aityke-ai-mark,
.learner-ai-icon,
.insight-ai-badge {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--platform-icon-size);
  width: var(--platform-icon-size);
  height: var(--platform-icon-size);
  margin: 0;
  font-size: var(--platform-icon-size) !important;
  line-height: 1 !important;
  direction: ltr;
  writing-mode: horizontal-tb;
  transform: none !important;
  vertical-align: middle;
}

.platform-ai-tag,
.aityke-ai-tag,
.genai-badge {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 8px !important;
  border: 1px solid rgba(31,111,139,.22);
  border-radius: 2px !important;
  background: linear-gradient(135deg, var(--platform-water-100), var(--platform-gold-100));
  color: var(--platform-navy-900) !important;
  font-size: 11px !important;
  font-weight: 800;
  line-height: 18px !important;
  letter-spacing: .035em;
  direction: ltr;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  transform: none !important;
}
.platform-ai-tag .material-symbols-outlined,
.aityke-ai-tag .material-symbols-outlined,
.genai-badge .material-symbols-outlined {
  flex: 0 0 var(--platform-tag-icon-size);
  width: var(--platform-tag-icon-size);
  height: var(--platform-tag-icon-size);
  font-size: var(--platform-tag-icon-size) !important;
  line-height: 1 !important;
  transform: none !important;
}
.platform-stat { position: relative; overflow: hidden; padding: 18px; background: linear-gradient(125deg, rgba(243,233,210,.92), rgba(220,238,243,.95)); border: 1px solid rgba(143,107,46,.34); border-radius: var(--platform-radius-lg); box-shadow: inset 0 1px rgba(255,255,255,.7); }
.platform-stat::after { content: ""; position: absolute; width: 70px; height: 70px; top: -40px; right: -22px; transform: rotate(45deg); border: 1px solid rgba(31,111,139,.22); }
.platform-stat strong { display: block; color: var(--platform-navy-900); font-size: 28px; }
.platform-stat strong { font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.platform-stat span { color: var(--platform-muted); font-size: 13px; }
.platform-mobile-nav { display: none; }

@media (min-width: 1440px) {
  .platform-shell { grid-template-columns: 264px minmax(0, 1fr); }
  .platform-page { width: min(1240px, calc(100% - 72px)); padding-top: 44px; }
  .platform-grid { gap: 24px; }
}

@media (max-width: 1024px) {
  .platform-shell { grid-template-columns: 216px minmax(0, 1fr); }
  .platform-shell__sidebar { padding-inline: 12px; }
  .platform-brand { height: 64px; padding-inline: 6px; }
  .platform-brand__logo { width: 138px; height: auto; }
  .platform-page { width: calc(100% - 40px); }
  .platform-toolbar { padding-inline: 20px; }
  .platform-col-4 { grid-column: span 6; }
  .platform-col-8 { grid-column: span 12; }
  .platform-grid > .platform-col-4:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Shared app chrome. */
.admin-sidebar,
.sidebar,
.managed-sidebar {
  background: linear-gradient(180deg, var(--platform-navy-950), var(--platform-navy-900)) !important;
  color: #fff !important;
  border-right: 0 !important;
  box-shadow: 8px 0 28px rgba(7, 21, 33, .12);
}
.admin-sidebar-nav,
.sidebar-nav,
.managed-sidebar-nav { padding-inline: 12px; }
.admin-nav-item,
.sidebar-nav-item,
.managed-nav-item,
.admin-sidebar-link,
.sidebar-footer-link,
.sidebar-logout-btn,
.managed-sidebar-footer-link,
.managed-sidebar-logout-btn {
  min-height: 44px;
  border-radius: var(--platform-radius-md) !important;
  color: rgba(255,255,255,.72) !important;
}
.admin-nav-item:hover,
.sidebar-nav-item:hover,
.managed-nav-item:hover,
.admin-sidebar-link:hover,
.sidebar-footer-link:hover,
.managed-sidebar-footer-link:hover { color: #fff !important; background: rgba(255,255,255,.08) !important; }
.admin-nav-item.active,
.sidebar-nav-item.active,
.managed-nav-item.active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(198,161,91,.28), rgba(31,111,139,.42)) !important;
  box-shadow: inset 3px 0 0 var(--platform-gold-500);
}
.admin-sidebar-version,
.sidebar-version-tag,
.managed-sidebar-version-tag { color: rgba(255,255,255,.52) !important; letter-spacing: .02em; }

.admin-topbar,
.app-header,
.managed-mobile-header {
  background: rgba(255,255,255,.94) !important;
  border-color: var(--platform-line) !important;
  backdrop-filter: blur(14px);
}
.admin-content,
.main-content,
.managed-main-content { background: var(--platform-canvas) !important; }

/* Shared typography and surfaces. */
h1, h2, h3, h4,
.admin-section-title,
.page-title,
.managed-page-title { color: var(--platform-navy-900) !important; letter-spacing: -.025em; text-shadow: 0 1px 0 rgba(255,255,255,.9); }
[lang^="zh"] h1,
[lang^="zh"] h2,
[lang^="zh"] h3,
[lang^="zh"] h4 { letter-spacing: .01em; }
.admin-section-sub,
.page-subtitle,
.managed-page-subtitle { color: var(--platform-muted) !important; }
.admin-card,
.card,
.feat-card,
.managed-card,
.flat-card {
  background: var(--platform-surface) !important;
  border: 1px solid var(--platform-line) !important;
  border-radius: var(--platform-radius-lg) !important;
  box-shadow: var(--platform-shadow-sm) !important;
}

/* Buttons: one hierarchy everywhere. */
.btn,
.admin-btn,
button[class*="btn"] {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--platform-control-height) !important;
  padding: var(--platform-control-padding-y) var(--platform-control-padding-x) !important;
  border-radius: 2px !important;
  line-height: 22px;
  font-weight: 700;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.btn > .material-symbols-outlined,
.admin-btn > .material-symbols-outlined,
button[class*="btn"] > .material-symbols-outlined {
  flex: 0 0 var(--platform-icon-size);
  width: var(--platform-icon-size);
  height: var(--platform-icon-size);
  font-size: var(--platform-icon-size) !important;
  line-height: 1 !important;
  direction: ltr;
}
button[class*="icon-btn"],
.admin-icon-btn {
  width: var(--platform-control-height) !important;
  min-width: var(--platform-control-height) !important;
  padding: 0 !important;
  flex: 0 0 var(--platform-control-height);
}

/* Portal interaction contract: every visible action owns a full 44px touch
   target and the same precise 2px geometry, including legacy icon controls. */
#aityke-app button,
#managed-portal button,
.admin-app button,
.parent-app button,
.learner-app button {
  box-sizing: border-box;
  min-height: var(--platform-control-height) !important;
  border-radius: 2px !important;
}
.btn-primary,
.admin-btn-primary,
.encourage-send-btn {
  background: var(--platform-water-700) !important;
  border-color: var(--platform-water-700) !important;
  color: #fff !important;
}
.btn-primary:hover,
.admin-btn-primary:hover { background: var(--platform-navy-800) !important; transform: translateY(-1px); }
.admin-btn-soft-danger,
.admin-icon-btn-danger,
.btn-danger { color: var(--platform-danger) !important; border-color: rgba(180,35,24,.24) !important; background: #fff5f4 !important; }

/* Forms and filters. */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.admin-input,
.admin-select,
.form-input,
.form-select,
.form-textarea {
  box-sizing: border-box;
  min-height: var(--platform-control-height);
  padding: var(--platform-control-padding-y) 12px !important;
  border: 1px solid var(--platform-line) !important;
  border-radius: 2px !important;
  background: #fff !important;
  color: var(--platform-ink) !important;
  max-width: 100%;
}
textarea { min-height: 104px; line-height: 22px; }
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none !important;
  border-color: var(--platform-water-700) !important;
  box-shadow: var(--platform-focus) !important;
}

/* Tables and status. */
table { border-collapse: separate; border-spacing: 0; }
th { color: var(--platform-muted) !important; background: #f0f4f7 !important; font-size: 12px; letter-spacing: .035em; text-transform: uppercase; }
th, td { border-color: var(--platform-line) !important; }
tbody tr:hover td { background: #f8fbfc; }
.admin-badge,
.feat-card__badge,
.feat-chip { border-radius: 2px !important; }
.feat-card__icon { background: linear-gradient(135deg, var(--platform-gold-100), var(--platform-water-100)) !important; color: var(--platform-navy-900) !important; }
.feat-card:hover { border-color: var(--platform-gold-500) !important; box-shadow: var(--platform-shadow-lg) !important; }

.platform-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 800;
  background: var(--platform-water-100);
  color: var(--platform-navy-800);
}
.platform-state--live { background: #e4f4eb; color: var(--platform-success); }

/* Portal home experience: shared structure, role-specific emphasis. */
.portal-home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr);
  min-height: 330px;
  margin: 0 0 28px;
  overflow: hidden;
  border: 1px solid rgba(198,161,91,.36);
  border-radius: 2px;
  background:
    radial-gradient(circle at 82% 18%, rgba(58,145,170,.28), transparent 29%),
    radial-gradient(circle at 68% 110%, rgba(198,161,91,.20), transparent 38%),
    linear-gradient(128deg, #071827 0%, #0b2940 57%, #123f55 100%);
  color: #fff;
  box-shadow: 0 24px 64px rgba(6,19,31,.18);
}
.portal-home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .22;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, transparent 25%, #000 100%);
}
.portal-home-hero--manager { background-color: #0b2639; }
.portal-home-hero--learner { background-color: #0a2538; }
.portal-home-hero--admin { min-height: 310px; background-color: #081b2a; }
.portal-home-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: clamp(28px, 4vw, 54px);
}
.portal-home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  margin-bottom: 18px;
  padding: 4px 9px;
  border: 1px solid rgba(221,197,143,.38);
  border-radius: 2px;
  background: rgba(243,233,210,.10);
  color: #f3dfb2;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.portal-home-eyebrow .material-symbols-outlined { width: 17px; height: 17px; font-size: 17px !important; line-height: 1; }
.portal-home-hero__title {
  max-width: 720px;
  margin: 0;
  color: #fff !important;
  font-size: clamp(32px, 4.1vw, 58px) !important;
  font-weight: 850 !important;
  line-height: 1.04 !important;
  letter-spacing: -.035em !important;
  text-wrap: balance;
  text-shadow: 0 4px 24px rgba(0,0,0,.24);
}
.portal-home-hero__title span { color: #e5ca91; }
.portal-home-hero__copy {
  max-width: 670px;
  margin: 20px 0 0;
  color: rgba(238,247,250,.78) !important;
  font-size: clamp(15px, 1.45vw, 18px);
  line-height: 1.65;
}
.portal-home-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.portal-home-hero__actions .platform-button { text-decoration: none; }
.portal-home-hero__actions .platform-button--secondary { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.08); color: #fff; backdrop-filter: blur(10px); }
.portal-home-proof { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 22px; color: rgba(232,244,248,.68); font-size: 12px; font-weight: 700; }
.portal-home-proof > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.portal-home-proof .material-symbols-outlined { width: 16px; height: 16px; color: #ddc58f; font-size: 16px !important; line-height: 1; }
.portal-home-hero__visual { position: relative; min-width: 0; min-height: 290px; overflow: hidden; }
.portal-robot-core {
  position: absolute;
  top: 50%; left: 50%;
  display: grid;
  place-items: center;
  width: clamp(116px, 12vw, 160px);
  aspect-ratio: 1;
  border: 1px solid rgba(221,197,143,.7);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #4d9db3, #123e55 56%, #071827 100%);
  box-shadow: 0 0 0 12px rgba(58,145,170,.08), 0 0 64px rgba(58,145,170,.36), inset 0 0 30px rgba(255,255,255,.10);
  transform: translate(-50%, -50%);
}
.portal-robot-core .material-symbols-outlined { color: #f0d9a7; font-size: clamp(50px, 5vw, 68px) !important; filter: drop-shadow(0 8px 20px rgba(0,0,0,.26)); }
.portal-orbit { position: absolute; top: 50%; left: 50%; border: 1px solid rgba(220,238,243,.22); border-radius: 50%; transform: translate(-50%,-50%); }
.portal-orbit--one { width: 230px; height: 230px; }
.portal-orbit--two { width: 330px; height: 330px; border-color: rgba(198,161,91,.17); }
.portal-float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  max-width: calc(100% - 24px);
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 2px;
  background: rgba(6,19,31,.72);
  color: #eef7fa;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
  backdrop-filter: blur(12px);
}
.portal-float-chip .material-symbols-outlined { width: 16px; height: 16px; color: #ddc58f; font-size: 16px !important; }
.portal-float-chip--a { top: 17%; left: 4%; }
.portal-float-chip--b { top: 34%; right: 3%; }
.portal-float-chip--c { bottom: 17%; left: 10%; }
#tab-home > .portal-home-hero { margin: 18px var(--page-gutter, 32px) 28px; }

@media (prefers-reduced-motion: no-preference) {
  .portal-robot-core { animation: portal-core-float 5s ease-in-out infinite; }
  .portal-orbit--one { animation: portal-orbit-pulse 4s ease-in-out infinite; }
  .portal-float-chip--a { animation: portal-chip-float 4.5s ease-in-out infinite; }
  .portal-float-chip--b { animation: portal-chip-float 5.2s ease-in-out -.8s infinite; }
  .portal-float-chip--c { animation: portal-chip-float 4.8s ease-in-out -1.5s infinite; }
}
@keyframes portal-core-float { 0%,100% { transform: translate(-50%,-50%); } 50% { transform: translate(-50%,calc(-50% - 7px)); } }
@keyframes portal-orbit-pulse { 0%,100% { opacity: .6; } 50% { opacity: 1; } }
@keyframes portal-chip-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -6px; } }

@media (max-width: 900px) {
  .portal-home-hero { grid-template-columns: 1fr minmax(190px,.45fr); }
  .portal-home-hero__content { padding: 34px 28px; }
  .portal-home-hero__visual { min-height: 270px; }
  .portal-orbit--two { width: 280px; height: 280px; }
}
@media (max-width: 640px) {
  .portal-home-hero { grid-template-columns: 1fr; min-height: 0; }
  .portal-home-hero__content { padding: 28px 20px 24px; }
  .portal-home-hero__visual { min-height: 215px; }
  .portal-home-hero__title { font-size: clamp(30px, 10vw, 42px) !important; }
  .portal-home-hero__copy { margin-top: 16px; }
  .portal-home-hero__actions { width: 100%; margin-top: 22px; }
  .portal-home-hero__actions .platform-button { flex: 1 1 150px; }
  .portal-home-proof { gap: 8px 12px; }
  .portal-robot-core { width: 112px; }
  .portal-orbit--one { width: 180px; height: 180px; }
  .portal-orbit--two { width: 240px; height: 240px; }
  #tab-home > .portal-home-hero { margin: 12px 14px 22px; }
}

/* Legacy workspace adapter. Projects, My Learning and every existing Tool
   keep their unique interaction engine while consuming one shared UI shell. */
.platform-workspace {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: var(--platform-ink);
  background: var(--platform-canvas);
  font-family: var(--platform-font-latin);
}
.platform-workspace *,
.platform-workspace *::before,
.platform-workspace *::after { box-sizing: border-box; }
.platform-workspace > main,
.platform-workspace .lpage-main,
.platform-workspace .tool-main { min-width: 0; max-width: 100%; }
.platform-workspace .lpage-container,
.platform-workspace .tool-container,
.platform-workspace .page-container { width: min(100%, 1440px); min-width: 0; margin-inline: auto; }
.platform-workspace .lpage-page-header,
.platform-workspace .tool-page-header,
.platform-workspace .tool-header,
.platform-workspace .page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  min-width: 0;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--platform-line);
}
.platform-workspace .lpage-page-title,
.platform-workspace .tool-title,
.platform-workspace .page-title {
  margin: 0;
  color: var(--platform-navy-900) !important;
  font-size: clamp(26px, 3vw, 38px) !important;
  font-weight: 820 !important;
  line-height: 1.15 !important;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.platform-workspace .lpage-page-subtitle,
.platform-workspace .tool-subtitle,
.platform-workspace .page-subtitle { max-width: 760px; margin: 7px 0 0; color: var(--platform-muted) !important; line-height: 1.6; }
.platform-workspace [class$="-toolbar"],
.platform-workspace [class*=" toolbar"],
.platform-workspace [class$="-actions"] { min-width: 0; max-width: 100%; flex-wrap: wrap; }
.platform-workspace [class$="-card"],
.platform-workspace [class*="-card "] { border-radius: 2px !important; }
.platform-workspace [class$="-modal"],
.platform-workspace [class*="-modal "] { max-width: min(100% - 24px, 720px); border-radius: 2px !important; }
.platform-workspace [class$="-pill"],
.platform-workspace [class*="-pill "] { border-radius: 2px !important; }
.platform-workspace button,
.platform-workspace [role="button"] { min-height: var(--platform-control-height); border-radius: 2px !important; }
.platform-workspace input:not([type="checkbox"]):not([type="radio"]),
.platform-workspace select,
.platform-workspace textarea { border-radius: 2px !important; }
.platform-workspace img,
.platform-workspace svg,
.platform-workspace canvas { max-width: 100%; }
.platform-workspace pre,
.platform-workspace code,
.platform-workspace [class*="editor"],
.platform-workspace [class*="canvas"] { min-width: 0; }

/* Feature Header Standard v1.1 — one recognizable navy/gold/water banner for
   legacy and new workspaces. JS adds this class to the first known header and
   provides a consistent Exit action without changing each tool's engine. */
.platform-workspace .platform-feature-banner {
  position: relative;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px 20px !important;
  width: 100%;
  min-width: 0;
  min-height: 88px;
  height: auto !important;
  margin-bottom: 18px !important;
  padding: 18px 20px !important;
  overflow: hidden;
  border: 1px solid rgba(198, 161, 91, .38) !important;
  border-radius: 2px !important;
  background: radial-gradient(circle at 84% 18%, rgba(31,111,139,.34), transparent 34%), linear-gradient(112deg,#081a2b 0%,#0b1f33 58%,#123d50 100%) !important;
  box-shadow: 0 14px 38px rgba(7,30,49,.15) !important;
}
.platform-workspace .platform-feature-banner::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -100px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(198,161,91,.18);
  border-radius: 50%;
  pointer-events: none;
}
.platform-workspace .platform-feature-banner > * { position: relative; z-index: 1; min-width: 0; }
.platform-workspace .platform-feature-banner :is(.lpage-page-title,.tool-title,.tool-header__title,.learner-tool-title h1,.page-title,h1) {
  color: #fff !important;
  text-shadow: none !important;
}
.platform-workspace .platform-feature-banner :is(.lpage-page-subtitle,.tool-subtitle,.tool-header__subtitle,.learner-tool-subtitle,.page-subtitle,p) {
  color: #c5d5dd !important;
  text-shadow: none !important;
}
.platform-workspace .platform-feature-banner :is(.learner-tool-actions,.tool-header__actions,.tool-actions,.platform-feature-banner__actions) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.platform-workspace .platform-feature-exit,
.platform-workspace .aityke-agile-exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(231,189,122,.62) !important;
  border-radius: 2px !important;
  background: rgba(255,255,255,.08) !important;
  color: #f3e9d2 !important;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
}
.platform-workspace .platform-feature-banner__actions > a:not(.platform-feature-exit) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(231,189,122,.62) !important;
  border-radius: 2px !important;
  background: rgba(255,255,255,.08) !important;
  color: #f3e9d2 !important;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none !important;
  white-space: nowrap;
}
.platform-workspace .platform-feature-banner__actions > a:not(.platform-feature-exit):hover {
  border-color: #c6a15b !important;
  background: #c6a15b !important;
  color: #0b1f33 !important;
}
.platform-workspace .platform-feature-exit:hover,
.platform-workspace .aityke-agile-exit:hover { background: #c6a15b !important; border-color: #c6a15b !important; color: #0b1f33 !important; }
.platform-workspace .platform-feature-exit .material-symbols-outlined,
.platform-workspace .aityke-agile-exit .material-symbols-outlined { font-size: 17px; }

@media (max-width: 768px) {
  .platform-workspace .lpage-container,
  .platform-workspace .tool-container,
  .platform-workspace .page-container { padding-inline: 16px; }
  .platform-workspace .lpage-page-header,
  .platform-workspace .tool-page-header,
  .platform-workspace .tool-header,
  .platform-workspace .page-header { margin-bottom: 18px; }
  .platform-workspace .platform-feature-banner { min-height: 76px; padding: 14px !important; }
  .platform-workspace .platform-feature-banner :is(.learner-tool-actions,.tool-header__actions,.tool-actions,.platform-feature-banner__actions) { width: 100%; margin-left: 0; }
  body:has(.managed-portal .platform-workspace .platform-feature-banner) .managed-mobile-header { display: none !important; }
  .managed-portal .platform-workspace .platform-feature-banner {
    min-height: 64px;
    padding: 10px 10px 10px 66px !important;
    flex-wrap: nowrap !important;
  }
  .managed-portal .platform-workspace .platform-feature-banner :is(.learner-tool-actions,.tool-header__actions,.tool-actions,.platform-feature-banner__actions) {
    width: auto;
    min-width: 44px;
    flex: 0 0 44px;
    margin-left: auto;
    flex-wrap: nowrap;
  }
  .managed-portal .platform-workspace .platform-feature-exit,
  .managed-portal .platform-workspace .aityke-agile-exit {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px !important;
    max-height: 44px;
    margin: 0;
    padding: 0 !important;
    overflow: hidden;
    font-size: 0;
  }
  .managed-portal .platform-workspace .platform-feature-exit > span:not(.material-symbols-outlined),
  .managed-portal .platform-workspace .aityke-agile-exit > span:not(.material-symbols-outlined) { display: none !important; }
  .managed-portal .platform-workspace .platform-feature-exit .material-symbols-outlined,
  .managed-portal .platform-workspace .aityke-agile-exit .material-symbols-outlined {
    display: block;
    width: 19px;
    height: 19px;
    font-size: 19px;
    line-height: 19px;
    text-align: center;
  }
}

/* v1.13.197 — Manager Feature headers use one data-independent mobile frame.
   Secondary controls may wrap below the heading; navigation and Exit always
   retain their own symmetric 44px columns. */
@media (max-width: 768px) {
  .managed-portal .platform-workspace[class*="platform-workspace--"] .platform-feature-banner {
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    padding: 10px 66px !important;
  }
  .managed-portal .platform-workspace[class*="platform-workspace--"] .platform-feature-banner > :first-child {
    width: 100%;
    min-width: 0;
  }
  .managed-portal .platform-workspace[class*="platform-workspace--"] .platform-feature-banner > .platform-feature-banner__actions {
    width: 100%;
    margin: 4px 0 0 !important;
  }
  .managed-portal .platform-workspace[class*="platform-workspace--"] .platform-feature-banner > .platform-feature-banner__actions > :not(.platform-feature-exit) {
    max-width: 100%;
  }
  .managed-portal .platform-workspace[class*="platform-workspace--"] .platform-feature-banner :is(h1,p) {
    overflow-wrap: anywhere;
  }
}

/* v1.13.196 — Portal brand and home readability contract.
   The supplied wordmark is a light/gold asset: keep it on one dark surface,
   preserve its artwork ratio, and centre it independently from header actions. */
.managed-portal :is(.managed-sidebar-logo, .managed-mobile-header) {
  background: linear-gradient(112deg, #071827 0%, #0b1f33 58%, #123a4a 100%) !important;
  color: #fffaf4 !important;
}
.managed-portal :is(.managed-sidebar-logo-mark, .managed-mobile-logo-mark) {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  overflow: visible !important;
}
.managed-portal :is(.managed-sidebar-logo-img, .managed-mobile-logo-img) {
  display: block !important;
  width: 104px !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 38px !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: none !important;
}
.managed-portal .portal-home-hero {
  background:
    radial-gradient(circle at 92% 10%, rgba(198,161,91,.18), transparent 34%),
    linear-gradient(135deg, #071827 0%, #0b263b 62%, #124257 100%) !important;
}
.managed-portal .portal-home-hero__content { position: relative; z-index: 2; }
.managed-portal .portal-home-hero :is(.portal-home-hero__title, .portal-home-hero__copy) {
  opacity: 1 !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
.managed-portal .portal-home-hero__title {
  color: #fffdf9 !important;
  text-shadow: 0 2px 14px rgba(0,0,0,.34) !important;
}
.managed-portal .portal-home-hero__title span { color: #f0cf8b !important; }
.managed-portal .portal-home-hero__copy {
  color: #e7f0f4 !important;
  text-shadow: 0 1px 8px rgba(0,0,0,.28) !important;
}
.managed-portal .portal-home-eyebrow {
  color: #f3d99e !important;
  background: rgba(7,24,39,.58) !important;
  border-color: rgba(240,207,139,.58) !important;
}
@media (min-width: 769px) {
  .managed-portal .managed-sidebar-logo { min-height: 76px !important; padding: 14px 20px !important; }
  .managed-portal .managed-sidebar-logo-img { width: 112px !important; max-height: 42px !important; }
}
@media (max-width: 700px) {
  .managed-portal .managed-mobile-header { min-height: 58px !important; }
  .managed-portal .managed-mobile-header-inner { position: relative !important; min-height: 58px !important; }
  .managed-portal .managed-mobile-logo-mark {
    position: absolute !important;
    top: 50% !important;
    left: 50vw !important;
    width: 112px !important;
    height: 44px !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: none;
  }
  .managed-portal .managed-mobile-logo-img { width: 98px !important; max-height: 36px !important; }
  .managed-portal #tab-home > .portal-home-hero,
  .managed-portal #managed-tab-home .portal-home-hero {
    padding: 22px 18px !important;
  }
  .managed-portal #tab-home > .portal-home-hero .portal-home-hero__title,
  .managed-portal #managed-tab-home .portal-home-hero .portal-home-hero__title {
    font-size: clamp(28px, 8vw, 34px) !important;
    line-height: 1.1 !important;
  }
  .managed-portal #tab-home > .portal-home-hero .portal-home-hero__copy,
  .managed-portal #managed-tab-home .portal-home-hero .portal-home-hero__copy {
    font-size: 13px !important;
    line-height: 1.62 !important;
  }
}
@media (max-width: 390px) {
  .platform-workspace .lpage-container,
  .platform-workspace .tool-container,
  .platform-workspace .page-container { padding-inline: 12px; }
  .platform-workspace .lpage-page-title,
  .platform-workspace .tool-title,
  .platform-workspace .page-title { font-size: 28px !important; }
}

/* v1.13.46 — one Home-page geometry across Learner, Manager and Admin.
   Learner's lpage shell is the reference: 24/28 desktop and 10px phone. */
@media (min-width: 701px) {
  #tab-home {
    box-sizing: border-box;
    width: 100%;
    padding: 24px 28px 0;
  }
  #tab-home > .portal-home-hero { margin: 0 0 28px; }
  #tab-home > .px-section { padding-inline: 0 !important; }
  body:has(#section-overview.active) .admin-content { padding: 24px 28px; }
  #section-overview > .portal-home-hero { margin-bottom: 28px; }
}

@media (max-width: 700px) {
  #tab-home {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 10px calc(24px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }
  #tab-home > .portal-home-hero,
  #section-overview > .portal-home-hero {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0 0 18px !important;
    padding: 20px 16px !important;
    overflow: hidden;
  }
  #tab-home > .portal-home-hero .portal-home-hero__content,
  #section-overview > .portal-home-hero .portal-home-hero__content { min-width: 0; padding: 0 !important; }
  #tab-home > .portal-home-hero .portal-home-hero__visual,
  #section-overview > .portal-home-hero .portal-home-hero__visual { display: none !important; }
  #tab-home > .portal-home-hero .portal-home-eyebrow,
  #section-overview > .portal-home-hero .portal-home-eyebrow {
    max-width: 100%; margin-bottom: 0; padding: 6px 8px; font-size: 10px; line-height: 1.25; white-space: normal;
  }
  #tab-home > .portal-home-hero .portal-home-hero__title,
  #section-overview > .portal-home-hero .portal-home-hero__title {
    margin-top: 14px; font-size: clamp(27px, 8.2vw, 34px) !important; line-height: 1.08 !important; letter-spacing: -.025em !important;
  }
  #tab-home > .portal-home-hero .portal-home-hero__copy,
  #section-overview > .portal-home-hero .portal-home-hero__copy { margin-top: 11px; font-size: 13px !important; line-height: 1.55; }
  #tab-home > .portal-home-hero .portal-home-hero__actions,
  #section-overview > .portal-home-hero .portal-home-hero__actions { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; margin-top: 16px; }
  #tab-home > .portal-home-hero .portal-home-hero__actions .platform-button,
  #section-overview > .portal-home-hero .portal-home-hero__actions .platform-button { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 12px; }
  #tab-home > .portal-home-hero .portal-home-proof,
  #section-overview > .portal-home-hero .portal-home-proof { display: grid; grid-template-columns: 1fr; gap: 6px; width: 100%; margin-top: 14px; }
  #tab-home > .portal-home-hero .portal-home-proof span,
  #section-overview > .portal-home-hero .portal-home-proof span { width: 100%; min-height: 34px; padding: 7px 10px; font-size: 11px; }
  #tab-home > .px-section { padding-inline: 0 !important; }
  body:has(#section-overview.active) .admin-content {
    padding: 10px 10px calc(76px + env(safe-area-inset-bottom));
    overflow-x: clip;
  }
  /* Column count belongs to the Admin dashboard template, including phone pairs. */
  #section-overview .admin-kpi-grid { gap: 10px; }
  #section-overview .admin-card { min-width: 0; margin-top: 12px; }
  #tab-home .manager-home-trends,
  #tab-home .manager-home-support { margin-top: 14px; }
  #tab-home .manager-home-trends-card,
  #tab-home .manager-home-support-card { min-width: 0; overflow: hidden; }
  #tab-home .parent-tool-trends-chart-wrap,
  #tab-home canvas { max-width: 100%; }
}
.platform-state--testing { background: var(--platform-gold-100); color: #765719; }
.platform-state--draft { background: #eef1f4; color: var(--platform-muted); }
.platform-state--retired { background: #f4e9e8; color: var(--platform-danger); }

@media (max-width: 768px) {
  .platform-shell { display: block; }
  .platform-shell__sidebar { display: none; }
  .platform-toolbar { min-height: 58px; justify-content: space-between; padding: 0 16px; background: var(--platform-navy-950); color: #fff; }
  .platform-mobile-brand { display: flex; align-items: center; flex: 0 1 auto; }
  .platform-page { width: calc(100% - 32px); padding: 24px 0 calc(88px + env(safe-area-inset-bottom)); }
  .platform-page-header { display: grid; }
  .platform-page-header > .platform-button { width: 100%; }
  .platform-col-4, .platform-col-8 { grid-column: 1 / -1; }
  .platform-mobile-nav { position: fixed; z-index: 20; inset: auto 0 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); min-height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--platform-navy-900); }
  .platform-mobile-nav a { display: grid; place-items: center; min-width: 0; min-height: 56px; padding: 4px; color: rgba(255,255,255,.68); text-align: center; text-decoration: none; font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
  .platform-mobile-nav a[aria-current="page"] { color: var(--platform-gold-500); }
  .admin-content,
  .main-content,
  .managed-main-content { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .admin-card,
  .card,
  .feat-card,
  .managed-card,
  .flat-card { border-radius: var(--platform-radius-md) !important; }
  .admin-container,
  .lpage-container,
  .px-section { padding-inline: 16px !important; }
  .feat-grid { grid-template-columns: 1fr !important; }
  .admin-bottom-nav,
  .bottom-nav,
  .managed-bottom-nav {
    min-height: calc(64px + env(safe-area-inset-bottom));
    background: rgba(11,31,51,.97) !important;
    border-top: 1px solid rgba(255,255,255,.12) !important;
  }
}

@media (max-width: 390px) {
  .platform-page { width: calc(100% - 24px); padding-top: 18px; }
  .platform-page-header { gap: 12px; }
  .platform-page-header h1 { font-size: 28px; }
  [lang^="zh"] .platform-page-header h1 { font-size: 27px; }
  .platform-grid { gap: 14px; }
  .platform-card { padding: 16px; }
  .platform-toolbar { flex-wrap: wrap; height: auto; padding-block: 8px; }
  .platform-button { width: 100%; }
  .platform-table .platform-button { width: auto; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .platform-shell__sidebar { overflow-y: auto; }
  .platform-mobile-nav { min-height: calc(52px + env(safe-area-inset-bottom)); }
  .platform-mobile-nav a { min-height: 48px; }
  .platform-page { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* WordPress can emit its logged-in admin-bar offset before the custom portal
   disables the bar. The bar is absent on product pages, so never retain its
   32/46px document gap. */
html:has(.managed-portal) { margin-top: 0 !important; }

/* Feature-page mobile header geometry: navigation and Exit share the
   platform 44px touch target and vertical centre. */
@media (max-width: 768px) {
  .managed-portal .platform-workspace .platform-feature-banner {
    position: relative !important;
  }

  .managed-portal .platform-workspace :is(.platform-feature-exit, .aityke-agile-exit) {
    box-sizing: border-box !important;
    top: 50% !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 2px !important;
  }

  /* One mobile Feature-header invariant: the portal opener and Feature Exit
     always occupy the same 44px top row, regardless of banner copy height or
     the Feature's internal action-container layout. */
  .managed-portal .platform-workspace .platform-feature-banner
    :is(.learner-tool-actions,.tool-header__actions,.tool-actions,.platform-feature-banner__actions,.project-board-header-controls,.cs-header-controls):has(:is(.platform-feature-exit,.aityke-agile-exit)) {
    position: static !important;
  }
  .managed-portal .platform-workspace .platform-feature-banner
    :is(.platform-feature-exit,.aityke-agile-exit) {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    transform: none !important;
  }
  .managed-portal .platform-workspace .project-board-header:not(.cs-feature-header)
    :is(.platform-feature-exit,.aityke-agile-exit) {
    top: 0 !important;
    right: 0 !important;
  }
  .managed-portal .platform-workspace .project-board-header:not(.cs-feature-header) {
    padding: 52px 12px 12px !important;
  }
  .managed-portal .platform-workspace .project-board-header:not(.cs-feature-header) .project-board-heading {
    width: 100% !important;
    padding-inline: 0 !important;
  }
  body .managed-portal .platform-workspace.chinese-stroke-tool .cs-feature-header .cs-header-controls:has(.platform-feature-exit) {
    position: static !important;
    transform: none !important;
  }
  body .managed-portal .platform-workspace.chinese-stroke-tool .cs-feature-header .platform-feature-exit {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    transform: none !important;
  }
}

.dashboard-event-modal-overlay { position: fixed; inset: 0; z-index: 100200; display: grid; place-items: center; padding: 16px; background: rgba(6,24,39,.65); backdrop-filter: blur(5px); }
.dashboard-event-modal { display: flex; flex-direction: column; max-height: min(760px, 92vh); overflow: hidden; border: 1px solid rgba(198,161,91,.42); border-radius: 2px; background: #fff; box-shadow: 0 28px 72px rgba(5,22,35,.36); }
.dashboard-event-modal > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; border-bottom: 1px solid #d8e1e8; background: linear-gradient(100deg,#eef7f9,#fff 72%); }
.dashboard-event-modal > header > div > span { color: #1f6f8b; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.dashboard-event-modal > header h2 { margin: 3px 0 0; color: #0b1f33; font-size: 18px; }
.dashboard-event-modal > header button { display: grid; place-items: center; width: 40px; min-width: 40px; height: 40px; padding: 0; border: 1px solid #d8e1e8; border-radius: 2px; background: #fff; color: #68798a; cursor: pointer; }
.dashboard-event-modal > header button .material-symbols-outlined { color: inherit; font-size: 20px; }
.dashboard-event-modal-header-actions { display: flex; align-items: center; gap: 8px; }
.dashboard-event-modal-body { display: grid; gap: 10px; padding: 14px; overflow-y: auto; }
.dashboard-event-detail { padding: 15px; border: 1px solid #d8e1e8; border-left: 4px solid var(--event-color); background: #fff; }
.dashboard-event-detail > header { display: flex; align-items: center; gap: 10px; }
.dashboard-event-detail > header > .material-symbols-outlined { display: grid; place-items: center; width: 38px; height: 38px; background: #0b1f33; color: #e7bd7a; font-size: 20px; }
.dashboard-event-detail > header small { color: #1f6f8b; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.dashboard-event-detail > header h3 { margin: 2px 0 0; color: #0b1f33; font-size: 15px; overflow-wrap: anywhere; }
.dashboard-event-detail dl { display: grid; grid-template-columns: 1.5fr .8fr .7fr; gap: 8px; margin: 14px 0; }
.dashboard-event-detail dl > div { min-width: 0; padding: 9px; background: #f6f8fa; }
.dashboard-event-detail dt { color: #8493a2; font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.dashboard-event-detail dd { margin: 4px 0 0; color: #314656; font-size: 10px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.dashboard-event-notes { margin-bottom: 12px; padding: 10px; border: 1px solid #e7edf1; color: #566575; font-size: 10px; line-height: 1.55; }
.dashboard-event-notes > span { display: block; margin-bottom: 5px; color: #8493a2; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.dashboard-event-edit { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 2px; background: #0b1f33; color: #f3e9d2; font-size: 11px; font-weight: 750; text-decoration: none; }
.dashboard-event-edit .material-symbols-outlined { color: #e7bd7a; font-size: 17px; }
.dashboard-event-calendar { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; margin-left: 8px; padding: 0 14px; border: 1px solid #1f6f8b; border-radius: 2px; background: #f3e9d2; color: #0b1f33; font-size: 11px; font-weight: 750; text-decoration: none; }
.dashboard-event-calendar .material-symbols-outlined { color: #1f6f8b; font-size: 17px; }
.platform-workspace .dashboard-event-calendar-modal,
.dashboard-event-calendar-modal {
    width: min(1400px, calc(100vw - 40px));
    max-width: min(1400px, calc(100vw - 40px)) !important;
    max-height: min(900px, calc(100vh - 48px));
}
.dashboard-event-calendar-body { padding: 14px; overflow: auto; }
.dashboard-calendar-weekdays, .dashboard-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dashboard-calendar-weekdays { border: 1px solid #d8e1e8; border-bottom: 0; background: #f6f8fa; }
.dashboard-calendar-weekdays span { padding: 8px 4px; color: #68798a; font-size: 10px; font-weight: 800; text-align: center; text-transform: uppercase; }
.dashboard-calendar-grid { grid-auto-rows: minmax(140px, auto); border-left: 1px solid #d8e1e8; border-top: 1px solid #d8e1e8; }
.dashboard-calendar-day { min-width: 0; min-height: 140px; padding: 12px; border-right: 1px solid #d8e1e8; border-bottom: 1px solid #d8e1e8; background: #fff; overflow: visible; }
.dashboard-calendar-day.is-adjacent { background: #f7f9fc; color: #8a98a5; }
.dashboard-calendar-number { display: block; margin-bottom: 7px; color: #0b1f33; font-size: 14px; font-weight: 800; }
.dashboard-calendar-day.is-adjacent .dashboard-calendar-number { color: #8a98a5; }
.dashboard-calendar-event { display: block; min-width: 0; margin-top: 4px; padding: 6px 8px; border-left: 4px solid var(--event-color); background: #eef5f7; color: #15202b; font-size: 13px; font-weight: 750; line-height: 1.35; overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.dashboard-calendar-more { display: block; margin-top: 4px; color: #1f6f8b; font-size: 11px; font-weight: 800; }
.dashboard-event-week-modal { width: min(1280px, calc(100vw - 48px)); max-width: min(1280px, calc(100vw - 48px)) !important; }
.dashboard-event-week-modal .dashboard-calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(260px, auto); width: 100%; min-width: 0; }
.dashboard-event-week-modal .dashboard-calendar-day { min-height: 260px; padding: 14px; }
.dashboard-event-week-modal .dashboard-calendar-day > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 9px; border-bottom: 1px solid #d8e1e8; }
.dashboard-event-week-modal .dashboard-calendar-day > header span { color: #68798a; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.dashboard-event-week-modal .dashboard-calendar-day > header strong { color: #0b1f33; font-size: 18px; }
.dashboard-event-week-modal .dashboard-calendar-event strong { display: block; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.dashboard-event-week-modal .dashboard-calendar-event small { display: block; margin-top: 5px; color: #1f6f8b; font-size: 10px; font-weight: 800; }
.dashboard-event-week-modal .dashboard-event-calendar-body { display: grid; gap: 18px; padding: 18px; }
.dashboard-event-countdown { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(300px, 1.28fr); gap: 12px; }
.dashboard-event-countdown > div { min-width: 0; padding: 16px; border: 1px solid #d8e1e8; background: #f7fafb; }
.dashboard-event-countdown > div > span:not(.material-symbols-outlined),
.dashboard-event-range-heading span { display: block; color: #68798a; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.dashboard-event-countdown > div > strong { display: block; margin-top: 6px; color: #0b1f33; font-size: 15px; line-height: 1.35; }
.dashboard-event-countdown-status { position: relative; padding-left: 52px !important; background: linear-gradient(110deg, #eef7fa, #fff8eb) !important; border-color: #c8dce5 !important; }
.dashboard-event-countdown-status > .material-symbols-outlined { position: absolute; top: 16px; left: 16px; color: #1f6f8b; font-size: 24px; }
.dashboard-event-countdown-status small { display: block; margin-top: 5px; color: #56697a; font-size: 11px; font-weight: 650; line-height: 1.45; }
.dashboard-event-range-heading { padding-bottom: 8px; border-bottom: 1px solid #d8e1e8; }
.dashboard-event-range-weeks { display: grid; gap: 16px; }
.dashboard-event-range-week { min-width: 0; border: 1px solid #d8e1e8; background: #fff; }
.dashboard-event-range-week > h3 { margin: 0; padding: 9px 12px; border-bottom: 1px solid #d8e1e8; background: #f4f8fa; color: #0b1f33; font-size: 12px; font-weight: 800; }
.dashboard-event-range-days,
.dashboard-event-range-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dashboard-event-range-day { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; min-width: 0; min-height: 62px; padding: 9px 10px; border-right: 1px solid #d8e1e8; background: #fff; }
.dashboard-event-range-day:last-child { border-right: 0; }
.dashboard-event-range-day > span { min-width: 0; color: #68798a; font-size: 10px; font-weight: 800; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; }
.dashboard-event-range-day > strong { color: #0b1f33; font-size: 16px; }
.dashboard-event-range-day > small { grid-column: 1 / -1; color: #8a98a5; font-size: 9px; font-weight: 700; }
.dashboard-event-range-day.is-today { z-index: 1; box-shadow: inset 0 0 0 2px #0b1f33; background: #eef6f8; }
.dashboard-event-range-bars { grid-auto-rows: 38px; gap: 5px 0; min-height: calc(var(--event-lanes, 1) * 43px + 11px); padding: 8px 0; border-top: 1px solid #e4eaee; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(14.2857% - 1px), #edf1f4 calc(14.2857% - 1px), #edf1f4 14.2857%); }
.dashboard-event-range-bar { z-index: 1; display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0 3px; padding: 7px 10px; border-left: 4px solid var(--event-color); background: color-mix(in srgb, var(--event-color) 13%, #fff); color: #15202b; overflow: hidden; }
.dashboard-event-range-bar.is-focused { box-shadow: inset 0 0 0 2px var(--event-color); background: color-mix(in srgb, var(--event-color) 20%, #fff); }
.dashboard-event-range-bar.continues-before { margin-left: 0; border-left: 0; }
.dashboard-event-range-bar.continues-after { margin-right: 0; }
.dashboard-event-range-bar strong { min-width: 0; font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-event-range-bar .material-symbols-outlined { flex: 0 0 auto; color: var(--event-color); font-size: 15px; }
.dashboard-event-week-pager { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.dashboard-event-week-pager button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #c8d6df; border-radius: 2px; background: #fff; color: #0b1f33; cursor: pointer; }
.dashboard-event-week-pager button:disabled { opacity: .35; cursor: default; }
.dashboard-event-week-pager button:not(:disabled):hover { border-color: #1f6f8b; color: #1f6f8b; }
.dashboard-event-week-pager > span { color: #56697a; font-size: 11px; font-weight: 750; text-align: center; }
.dashboard-week-empty { color: #a8b3bd; font-size: 16px; }
@media (max-width: 620px) {
    .platform-workspace .dashboard-event-calendar-modal,
    .dashboard-event-calendar-modal { width: calc(100vw - 20px); max-width: calc(100vw - 20px) !important; max-height: calc(100vh - 24px); }
    .dashboard-event-calendar-body { padding: 8px; }
    .dashboard-calendar-grid { grid-auto-rows: minmax(56px, 1fr); }
    .dashboard-calendar-day { padding: 5px 3px; }
    .dashboard-calendar-event { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; color: transparent; }
    .dashboard-calendar-weekdays span { font-size: 8px; }
    .dashboard-event-week-modal .dashboard-calendar-grid { grid-template-columns: repeat(7, minmax(140px, 1fr)); grid-auto-rows: minmax(220px, auto); min-width: 980px; }
    .dashboard-event-week-modal .dashboard-calendar-day { min-height: 220px; padding: 10px; }
    .dashboard-event-week-modal .dashboard-calendar-event { width: auto; height: auto; padding: 6px 8px; border: 0; border-left: 4px solid var(--event-color); border-radius: 0; color: #15202b; }
    .dashboard-event-week-modal .dashboard-event-calendar-body { overflow-x: hidden; padding: 10px; }
    .dashboard-event-countdown { grid-template-columns: 1fr; }
    .dashboard-event-range-day { min-height: 52px; padding: 5px 3px; }
    .dashboard-event-range-day > span { font-size: 8px; text-align: left; }
    .dashboard-event-range-day > strong { font-size: 13px; }
    .dashboard-event-range-day > small { font-size: 7px; }
    .dashboard-event-range-bar { min-height: 34px; padding: 5px; }
    .dashboard-event-range-bar strong { font-size: 10px; }
}
.dashboard-event-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
