/*
 * Signed-in Assignment Center board.
 * Loaded after assignment-center-shell.css. Scoped to #acShell so the
 * workspace reads as ink, paper, and brass — a short desk, not a neon HUD.
 * 8px space. 1px paper borders. Inner highlight only. No glow.
 */

#acShell {
  --board-ink: #12110e;
  --board-ink-2: #161410;
  --board-paper: #f4efe6;
  --board-paper-dim: #d9d2c6;
  --board-muted: #a39c91;
  --board-brass: #d7b074;
  --board-brass-ink: #1c170f;
  --board-line: rgba(244, 239, 230, 0.14);
  --board-wash: rgba(215, 176, 116, 0.1);
  --board-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --board-card: #1c1915;
  --board-card-2: #242019;

  --bg: var(--board-ink);
  --bg-2: var(--board-ink-2);
  --bg-3: #221f1a;
  --card: var(--board-card);
  --card-2: var(--board-card-2);
  --card-solid: var(--board-card);
  --line: var(--board-line);
  --line-2: rgba(244, 239, 230, 0.24);
  --text: var(--board-paper);
  --muted: var(--board-muted);
  --accent: var(--board-brass);
  --accent-2: #e7d3ae;
  --accent-glow: transparent;
  --accent-warm: var(--board-brass);
  --grad-main: var(--board-brass);
  --shadow-glow: none;
  --focus: rgba(215, 176, 116, 0.7);

  --ac-bg-app: var(--board-ink);
  --ac-bg-shell: var(--board-ink-2);
  --ac-bg-surface-1: var(--board-card);
  --ac-bg-surface-2: var(--board-card-2);
  --ac-bg-surface-3: #2c271f;
  --ac-bg-elevated: #2a261f;
  --ac-border-subtle: var(--board-line);
  --ac-border: rgba(244, 239, 230, 0.18);
  --ac-border-strong: rgba(244, 239, 230, 0.32);
  --ac-text-primary: var(--board-paper);
  --ac-text-secondary: var(--board-paper-dim);
  --ac-text-muted: var(--board-muted);
  --ac-accent: var(--board-brass);
  --ac-accent-soft: var(--board-wash);
  --ac-accent-sec: #c4a574;
  --ac-glow: none;
  --ac-r-lg: 14px;

  background: var(--board-ink);
  color: var(--board-paper);
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  grid-template-columns: minmax(168px, 220px) minmax(0, 1fr) minmax(220px, 300px);
  grid-template-rows: 44px minmax(0, 1fr) auto;
  grid-template-areas:
    "topbar topbar topbar"
    "rail canvas aipanel"
    "bottom bottom bottom";
  box-shadow: none;
}

html.ac-demo-mode #acShell {
  grid-template-rows: auto 44px minmax(0, 1fr) auto;
  grid-template-areas:
    "demobanner demobanner demobanner"
    "topbar topbar topbar"
    "rail canvas aipanel"
    "bottom bottom bottom";
}

#acShell.ai-collapsed {
  grid-template-columns: minmax(168px, 220px) minmax(0, 1fr) minmax(0, 0px);
}

#acShell .ac-ws-hero-aurora,
#acShell .ac-ws-shell-aurora,
#acShell .ac-ws-shell-aurora span {
  opacity: 0;
  animation: none;
  filter: none;
  background-image: none;
}

/* Top bar — one short quiet strip */
#acShell #acTopbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  padding: 0 16px;
  background: var(--board-ink-2);
  color: var(--board-paper);
  border: 0;
  border-bottom: 1px solid var(--board-line);
  box-shadow: var(--board-highlight);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: none;
  position: relative;
  z-index: 5;
  min-width: 0;
  overflow: visible;
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
}

#acShell #acTopbar .ac-topbar-left,
#acShell #acTopbar .ac-topbar-center,
#acShell #acTopbar .ac-topbar-right {
  min-width: 0;
}

#acShell #acTopbar .ac-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
}

#acShell #acTopbar .ac-topbar-center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

#acShell #acTopbar .ac-topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

#acShell .ac-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #efe6d6;
  color: var(--board-brass-ink);
  box-shadow: none;
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-weight: 650;
  font-size: 10px;
  letter-spacing: 0.04em;
}

#acShell .ac-breadcrumb {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--board-muted);
  text-shadow: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#acShell .ac-cmdbar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(420px, 100%);
  min-width: 0;
}

#acShell .ac-cmdbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--board-line);
  background: rgba(244, 239, 230, 0.04);
  color: var(--board-muted);
  box-shadow: var(--board-highlight);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-shadow: none;
}

#acShell .ac-cmdbar:hover {
  border-color: rgba(244, 239, 230, 0.28);
  color: var(--board-paper);
}

#acShell .ac-cmdbar kbd {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 11px;
  color: var(--board-muted);
  background: transparent;
  border: 1px solid var(--board-line);
  border-radius: 4px;
  box-shadow: none;
}

#acShell .ac-cmdbar-dismiss,
#acShell #acTopbar .ac-topbar-assist-btn,
#acShell #acTopbar .ac-notif-btn,
#acShell #acTopbar .ac-mobile-menu-btn,
#acShell #acTopbar .ac-mobile-filter-btn {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  border: 1px solid var(--board-line);
  background: transparent;
  color: var(--board-paper-dim);
  border-radius: 8px;
  box-shadow: none;
  text-shadow: none;
}

#acShell #acTopbar .ac-topbar-assist-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
}

#acShell #acTopbar .ac-topbar-assist-btn:hover,
#acShell #acTopbar .ac-topbar-assist-btn[data-open="1"] {
  background: var(--board-wash);
  border-color: rgba(215, 176, 116, 0.45);
  color: var(--board-paper);
}

#acShell #acTopbar .ac-topbar-assist-btn--unread::after {
  background: var(--board-brass);
  box-shadow: none;
}

#acShell .ac-quarter-chip,
#acShell .ac-sync-pill {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 550;
  color: var(--board-paper-dim);
  background: transparent;
  border: 1px solid var(--board-line);
  border-radius: 8px;
  box-shadow: none;
  padding: 4px 8px;
}

#acShell .ac-sync-pill {
  color: var(--board-paper-dim);
  border-color: rgba(215, 176, 116, 0.45);
}

#acShell .ac-profile-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--board-paper-dim);
}

#acShell #acProfileName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12rem;
}

#acShell #acProfileCluster.is-menu-open {
  z-index: 40;
}

#acShell #acProfileMenu {
  background: var(--board-card);
  border: 1px solid var(--board-line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  z-index: 40;
}

#acShell #acProfileMenu button,
#acShell #acProfileMenuName {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  color: var(--board-paper);
}

#acShell #acProfileMenu button {
  display: block;
  min-height: 40px;
}

/* Rail — full rows, brass tick on the active one */
#acShell #acRail {
  grid-area: rail;
  background: var(--board-ink-2);
  color: var(--board-paper);
  border: 0;
  border-right: 1px solid var(--board-line);
  box-shadow: var(--board-highlight);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#acShell #acRail .ac-rail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 16px;
  border: 0;
  border-radius: 0;
  border-left: 3px solid transparent;
  background: transparent;
  background-image: none;
  box-shadow: none;
  color: var(--board-paper-dim);
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: 0;
  text-shadow: none;
  text-align: left;
}

#acShell #acRail .ac-rail-item:hover {
  background: rgba(244, 239, 230, 0.04);
  color: var(--board-paper);
  border-left-color: rgba(215, 176, 116, 0.35);
  box-shadow: none;
}

#acShell #acRail .ac-rail-item.active {
  background: var(--board-wash);
  color: var(--board-paper);
  border-left-color: var(--board-brass);
  box-shadow: none;
  font-weight: 650;
}

#acShell #acRail .ac-rail-item--sub {
  padding-left: 32px;
  font-size: 13px;
}

#acShell #acRail .ac-rail-ctx-title,
#acShell #acRail .ac-scope-panel-title {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  color: var(--board-brass);
  text-shadow: none;
  letter-spacing: 0.12em;
}

#acShell #acRail .ac-rail-ctx-hint,
#acShell #acRail .ac-scope-hint,
#acShell #acRail .ac-scope-lbl {
  color: var(--board-paper-dim);
  text-shadow: none;
  font-size: 13px;
}

#acShell #acRail .ac-rail-ctx-chip,
#acShell #acRail .ac-scope-select,
#acShell #acRail .ac-seg {
  background: var(--board-card);
  border: 1px solid var(--board-line);
  color: var(--board-paper);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 8px;
}

#acShell #acRail .ac-seg-btn.active {
  background: var(--board-wash);
  color: var(--board-paper);
  box-shadow: none;
  border-radius: 6px;
}

/* Canvas follows the selected board theme, including native form controls. */
#acShell #acCanvas {
  color-scheme: dark;
  grid-area: canvas;
  position: relative;
  z-index: 1;
  background: var(--board-ink);
  color: var(--board-paper);
  min-width: 0;
  min-height: 0;
  margin-top: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 22px 72px;
  box-shadow: none;
}

#acShell #acCanvas:has(.ac-ws-detail-v2) {
  background: var(--board-ink);
  background-image: none;
}

html[data-ac-background="planner"] #acShell #acCanvas:not(:has(.ac-ws-detail-v2)),
html[data-ac-background="scene"].ac-ambient-ready #acShell #acCanvas:not(:has(.ac-ws-detail-v2)) {
  background: transparent;
}

html[data-ac-background="scene"].ac-ambient-ready #acShell {
  background: color-mix(in srgb, var(--ac-color-canvas) 88%, transparent);
}

#acShell #acCanvas .ac-pill--urgent,
#acShell #acCanvas .ac-pill--due-soon {
  color: var(--ac-warn);
  background: rgba(138, 90, 34, 0.1);
  border-color: rgba(138, 90, 34, 0.28);
}

#acShell #acCanvas .ac-pill--urgent.ac-pill--overdue,
#acShell #acCanvas .ac-pill--overdue {
  color: var(--ac-danger);
  background: rgba(163, 59, 44, 0.1);
  border-color: rgba(163, 59, 44, 0.28);
}

#acShell #acCanvas .ac-btn-primary {
  background: var(--board-brass);
  color: var(--board-brass-ink);
  border-color: var(--board-brass);
}

#acShell #acCanvas .ac-sk-block,
#acShell #acCanvas .ac-skeleton,
#acShell #acCanvas .skeleton {
  background: var(--bg-3);
  border: 1px solid var(--board-line);
  box-shadow: none;
}

#acShell .ac-overview,
#acShell .ac-assignments-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  color: var(--board-paper);
  font-size: 14px;
  line-height: 1.5;
}

#acShell .ac-card,
#acShell .ac-overview .ac-hero-strip,
#acShell .ac-overview .ac-dash-brief,
#acShell .ac-overview .ac-quick-tile,
#acShell .ac-assignments-page .ac-assign-card {
  background: var(--board-card);
  background-image: none;
  border: 1px solid var(--board-line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--board-highlight);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--board-paper);
  text-shadow: none;
}

/* Legacy setup slabs (.card) use the same paper sheet as .ac-card. */
#acShell #acCanvas .card,
#acShell #acCanvas .card:hover {
  background: var(--board-card);
  background-image: none;
  color: var(--board-paper);
  border: 1px solid var(--board-line);
  box-shadow: var(--board-highlight);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-shadow: none;
}

#acShell #acCanvas .card .muted {
  color: var(--board-paper-dim);
}

#acShell .ac-card p,
#acShell .ac-overview p,
#acShell .ac-assignments-page,
#acShell .ac-assignments-page .ac-asgn-title,
#acShell .ac-empty-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--board-paper-dim);
}

#acShell .ac-card-title,
#acShell .ac-overview .ac-section-title,
#acShell .ac-overview h1,
#acShell .ac-overview h2,
#acShell .ac-overview h3,
#acShell .ac-overview .ac-dash-brief__greeting {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-weight: 560;
  letter-spacing: -0.02em;
  color: var(--board-paper);
  text-shadow: none;
  text-transform: none;
}

#acShell .ac-card-title {
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 8px;
}

#acShell .ac-section-title {
  font-size: 13px;
  line-height: 1.35;
  margin: 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--board-line);
  position: relative;
  z-index: 1;
  top: auto;
}

#acShell .ac-overview .ac-section-title {
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 8px;
}

/* Rows and metric tiles: 13px type, 8px rhythm, 1px edge, under the top bar */
#acShell .ac-asgn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 16px;
  border: 1px solid var(--board-line);
  border-radius: 8px;
  background: var(--board-card);
  background-image: none;
  position: relative;
  z-index: 1;
  top: auto;
}

#acShell .ac-asgn-class,
#acShell .ac-asgn-meta,
#acShell .ac-asgn-actions button,
#acShell .ac-asgn-row .ac-pill,
#acShell .ac-hero-metric-lbl,
#acShell .ac-quick-tile-label {
  font-size: 13px;
  line-height: 1.4;
}

#acShell .ac-hero-metric {
  gap: 8px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--board-line);
  border-radius: 8px;
  background-image: none;
  position: relative;
  z-index: 1;
  top: auto;
}

#acShell .ac-quick-tile {
  border-width: 1px;
  margin-top: 0;
  position: relative;
  z-index: 1;
  top: auto;
}

#acShell .ac-ws-detail-v2 .ac-ws-title {
  background: none;
  background-image: none;
  -webkit-text-fill-color: currentColor;
  color: var(--board-paper);
}

#acShell .ac-overview .ac-dash-brief__greeting {
  font-size: 22px;
  line-height: 1.2;
}

#acShell .ac-overview .ac-hero-metric-val,
#acShell .ac-overview .ac-quick-tile-label,
#acShell .ac-assignments-page input,
#acShell .ac-assignments-page select,
#acShell .ac-assignments-page button,
#acShell .ac-btn {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
}

#acShell .ac-assignments-page .ac-asgn-topstrip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

#acShell .ac-assignments-page .ac-asgn-topstrip input,
#acShell .ac-assignments-page .ac-asgn-topstrip select {
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
  color: var(--board-paper);
  background: var(--board-card);
  border: 1px solid var(--board-line);
  border-radius: 8px;
}

#acShell .ac-btn-primary {
  background: var(--board-brass);
  color: var(--board-brass-ink);
  border-color: var(--board-brass);
  box-shadow: none;
}

#acShell .ac-overview .ac-quick-tiles,
#acShell .ac-overview .ac-hero-strip {
  gap: 8px;
}

#acShell .ac-overview .ac-quick-tile:hover,
#acShell .ac-assignments-page .ac-assign-card:hover,
#acShell .ac-action-card:hover,
#acShell .ac-class-card:hover {
  transform: none;
  box-shadow: var(--board-highlight);
  border-color: rgba(215, 176, 116, 0.4);
}

/* Assistant column stays in the grid; quiet, not a glowing drawer */
#acShell #acAiPanel {
  grid-area: aipanel;
  background: var(--board-ink-2);
  color: var(--board-paper);
  border: 0;
  border-left: 1px solid var(--board-line);
  box-shadow: var(--board-highlight);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  min-width: 0;
}

#acShell #acAiPanel .ac-ai-header,
#acShell #acAiPanel .ac-ai-footer {
  border-color: var(--board-line);
}

#acShell #acAiPanel .ac-ai-mode-btn,
#acShell #acAiPanel .ac-ai-close-btn,
#acShell #acAiPanel .ac-ai-input,
#acShell #acAiPanel .ac-ai-state {
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  text-shadow: none;
}

#acShell #acAiPanel .ac-ai-mode-btn {
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--board-paper-dim);
  box-shadow: none;
}

#acShell #acAiPanel .ac-ai-mode-btn.active {
  background: var(--board-wash);
  color: var(--board-paper);
  border-color: rgba(215, 176, 116, 0.45);
}

#acShell #acAiPanel .ac-ai-input,
#acShell #acAiPanel .ac-ai-msg,
#acShell #acAiPanel .ac-ai-panel-intro {
  background: var(--board-card);
  border: 1px solid var(--board-line);
  color: var(--board-paper);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#acShell #acAiPanel .ac-ai-msg.user {
  background: var(--board-wash);
  border-color: rgba(215, 176, 116, 0.28);
}

/* Status strip */
#acShell #acBottomRail,
#acShell .ac-bottom-rail {
  grid-area: bottom;
  background: var(--board-ink-2);
  color: var(--board-muted);
  border: 0;
  border-top: 1px solid var(--board-line);
  box-shadow: var(--board-highlight);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  min-height: 32px;
  padding: 4px 16px;
  gap: 8px 16px;
  font-family: Inter, system-ui, "Segoe UI", sans-serif;
  font-size: 12px;
  text-shadow: none;
}

#acShell :focus-visible {
  outline: 2px solid #d7b074;
  outline-offset: 2px;
}

/* Light board: warm paper field, ink type */
:root[data-theme="light"] #acShell {
  --board-ink: #f6f3ec;
  --board-ink-2: #efeae1;
  --board-paper: #12110e;
  --board-paper-dim: #3f3a33;
  --board-muted: #6d675e;
  --board-brass: #8a5a22;
  --board-brass-ink: #fffdf8;
  --board-line: rgba(18, 17, 14, 0.14);
  --board-wash: rgba(138, 90, 34, 0.1);
  --board-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  --board-card: #fffdf8;
  --board-card-2: #f7f2ea;
  --ac-success: #3f6b45;
  --ac-danger: #a33b2c;
  background: #f6f3ec;
  color: #12110e;
}

:root[data-theme="light"] #acShell #acTopbar,
:root[data-theme="light"] #acShell #acRail,
:root[data-theme="light"] #acShell #acAiPanel,
:root[data-theme="light"] #acShell #acBottomRail,
:root[data-theme="light"] #acShell .ac-bottom-rail {
  background: #efeae1;
  color: #12110e;
  border-color: rgba(18, 17, 14, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

:root[data-theme="light"] #acShell #acCanvas {
  --board-ink: #f4efe6;
  --board-paper: #12110e;
  --board-paper-dim: #3f3a33;
  --board-muted: #6d675e;
  --board-brass: #8a5a22;
  --board-brass-ink: #fffdf8;
  --board-line: rgba(18, 17, 14, 0.12);
  --board-wash: rgba(138, 90, 34, 0.1);
  --board-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --board-card: #fffdf8;
  --board-card-2: #f7f2ea;
  /* Legacy account/setup inputs use these tokens, while newer cards use
     --ac-*. Keep both palettes on the same paper surface. */
  color-scheme: light;
  --bg: #f4efe6;
  --bg-2: #efeae1;
  --bg-3: #e7e1d6;
  --card: var(--board-card);
  --card-2: var(--board-card-2);
  --card-solid: var(--board-card);
  --line: var(--board-line);
  --line-2: rgba(18, 17, 14, 0.24);
  --accent: var(--board-brass);
  --text: #12110e;
  --muted: #6d675e;
  --ac-bg-app: #f4efe6;
  --ac-bg-surface-1: #fffdf8;
  --ac-bg-surface-2: #f7f2ea;
  --ac-bg-surface-3: #efe8dc;
  --ac-bg-elevated: #fffdf8;
  --ac-border-subtle: rgba(18, 17, 14, 0.1);
  --ac-border: rgba(18, 17, 14, 0.14);
  --ac-border-strong: rgba(18, 17, 14, 0.28);
  --ac-text-primary: #12110e;
  --ac-text-secondary: #3f3a33;
  --ac-text-muted: #6d675e;
  --ac-accent: #8a5a22;
  --ac-danger: #a33b2c;
  --ac-warn: #8a5a22;
  --ac-success: #3f6b45;
  background: #f6f3ec;
  color: #12110e;
}

:root[data-theme="light"] #acShell .ac-card,
:root[data-theme="light"] #acShell .ac-overview .ac-hero-strip,
:root[data-theme="light"] #acShell .ac-overview .ac-dash-brief,
:root[data-theme="light"] #acShell .ac-overview .ac-quick-tile,
:root[data-theme="light"] #acShell .ac-assignments-page .ac-assign-card,
:root[data-theme="light"] #acShell .ac-cmdbar,
:root[data-theme="light"] #acShell #acProfileMenu,
:root[data-theme="light"] #acShell #acAiPanel .ac-ai-input {
  background: #fffdf8;
  color: #12110e;
  border-color: rgba(18, 17, 14, 0.14);
}

:root[data-theme="light"] #acShell .ac-card-title,
:root[data-theme="light"] #acShell .ac-overview .ac-section-title,
:root[data-theme="light"] #acShell .ac-overview h1,
:root[data-theme="light"] #acShell .ac-overview h2,
:root[data-theme="light"] #acShell .ac-overview h3,
:root[data-theme="light"] #acShell .ac-overview .ac-dash-brief__greeting,
:root[data-theme="light"] #acShell .ac-profile-cluster,
:root[data-theme="light"] #acShell #acRail .ac-rail-ctx-title {
  color: #12110e;
  text-shadow: none;
}

:root[data-theme="light"] #acShell #acRail .ac-rail-item {
  color: #3f3a33 !important;
  background: transparent !important;
  background-image: none !important;
  border-left: 3px solid transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

:root[data-theme="light"] #acShell #acRail .ac-rail-item:hover {
  color: #12110e !important;
  background: rgba(18, 17, 14, 0.04) !important;
  border-left-color: rgba(138, 90, 34, 0.35) !important;
}

:root[data-theme="light"] #acShell #acRail .ac-rail-item.active {
  color: #12110e !important;
  background: rgba(138, 90, 34, 0.1) !important;
  border-left-color: #8a5a22 !important;
  font-weight: 650 !important;
}

:root[data-theme="light"] #acShell#acShell button {
  color: #12110e;
  border-color: rgba(18, 17, 14, 0.16);
}

:root[data-theme="light"] #acShell#acShell .ac-btn-primary,
:root[data-theme="light"] #acShell#acShell #acAiSend {
  background: #8a5a22;
  color: #fffdf8;
  border-color: #8a5a22;
}

:root[data-theme="light"] #acShell .ac-sync-pill {
  color: #3f6b45;
  border-color: rgba(63, 107, 69, 0.35);
}

/* Light shell still paints cyan-to-mint gradients. Flatten them to paper. */
:root[data-theme="light"] #acShell .ac-ws-head,
:root[data-theme="light"] #acShell .ac-ws-hero-card,
:root[data-theme="light"] #acShell .ac-ws-tab-indicator,
:root[data-theme="light"] #acShell .ac-ws-security-strip,
:root[data-theme="light"] #acShell .ac-ws-security-card,
:root[data-theme="light"] #acShell .ac-ws-act-btn.ac-ws-assist-btn,
:root[data-theme="light"] #acShell .ac-ws-stat-cell--due,
:root[data-theme="light"] #acShell .ac-ws-stat-cell--grade,
:root[data-theme="light"] #acShell .ac-ws-nav-tile--ai,
:root[data-theme="light"] #acShell .ac-ws-nav-tile--secure,
:root[data-theme="light"] #acShell .ac-ws-step--current,
:root[data-theme="light"] #acShell .seg-btn.active,
:root[data-theme="light"] #acShell .nav-link.active,
:root[data-theme="light"] #acShell .au-master-panel {
  background-color: var(--board-card);
  background-image: none;
  box-shadow: var(--board-highlight);
}

:root[data-theme="light"] #acShell #acCanvas:has(.ac-ws-detail-v2) {
  background-color: var(--board-ink);
  background-image: none;
}

:root[data-theme="light"] #acShell .ac-ws-tab-indicator,
:root[data-theme="light"] #acShell .seg-btn.active {
  background-color: var(--board-wash);
}

:root[data-theme="light"] #acShell .ac-ws-progress-ring--empty {
  background-color: var(--board-card-2) !important;
  background-image: none !important;
}

/* Narrow: stack the top bar, keep the rail out of the canvas */
@media (max-width: 768px) {
  #acShell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  #acShell #acTopbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "search"
      "actions";
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    gap: 8px;
    padding: 8px;
  }

  #acShell #acTopbar .ac-topbar-left { grid-area: brand; }
  #acShell #acTopbar .ac-topbar-center {
    grid-area: search;
    width: 100%;
    justify-content: stretch;
  }
  #acShell #acTopbar .ac-topbar-right {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: 100%;
    overflow: visible;
  }

  #acShell .ac-cmdbar-wrap,
  #acShell .ac-cmdbar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #acShell #acProfileName {
    max-width: 8rem;
  }

  #acShell #acCanvas,
  #acShell .ac-overview,
  #acShell .ac-assignments-page,
  #acShell .ac-card {
    max-width: 100%;
    min-width: 0;
  }

  #acShell .ac-overview .ac-quick-tiles,
  #acShell .ac-overview .ac-hero-strip {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  }
}

#acShell,
#acShell *,
#acShell *::before,
#acShell *::after {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation-iteration-count: 1;
}

@media (prefers-reduced-motion: reduce) {
  #acShell,
  #acShell *,
  #acShell *::before,
  #acShell *::after {
    animation: none !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}

#acShell .ac-ext-sheet {
  background: #fffdf8;
  color: #12110e;
  border: 1px solid rgba(18, 17, 14, 0.12);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: none;
}
#acShell .ac-ext-sheet h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #12110e;
  font-family: "Source Serif 4", Georgia, "Iowan Old Style", Palatino, serif;
}
#acShell .ac-ext-sheet p,
#acShell .ac-ext-sheet li {
  margin: 0;
  color: #12110e;
  line-height: 1.5;
}
#acShell .ac-ext-sheet ol {
  margin: 8px 0 0;
  padding-left: 1.2em;
  color: #12110e;
}
#acShell .ac-ext-sheet code {
  color: #12110e;
}
#acShell .ac-ext-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
#acShell .ac-ext-btn {
  min-height: 44px;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  background: #d7b074;
  color: #12110e;
  border: 1px solid #12110e;
}
#acShell .ac-ext-btn-ghost {
  background: #fffdf8;
  color: #12110e;
  border: 1px solid #d7b074;
}
#acShell .ac-ext-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
#acShell .ac-ext-code {
  display: block;
  margin-top: 12px;
  padding: 10px 12px;
  background: #ebe4d8;
  color: #12110e;
  border: 1px solid #d7b074;
  border-radius: 8px;
  word-break: break-all;
}
#acShell .ac-ext-status {
  margin: 8px 0 0;
  color: #3f3a33;
}
#acShell .ac-ext-link-out {
  display: none;
  margin-top: 8px;
}
#acShell .ac-ext-link-out.is-open {
  display: block;
}
#acShell .ac-ext-code-link {
  margin-top: 0;
  cursor: pointer;
}


#acShell .ac-class-heading {
  margin: 0;
  color: var(--ac-color-ink);
  font: 560 var(--ac-type-page) var(--ac-font-heading);
  overflow-wrap: anywhere;
}

#acShell .ac-class-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ac-grid-space-6);
  padding: var(--ac-grid-space-4);
  background: var(--ac-color-surface);
  border: 1px solid var(--ac-color-line);
  border-radius: var(--ac-panel-radius);
}

#acShell .ac-class-summary-value {
  color: var(--ac-color-ink);
  font: 560 var(--ac-type-page) var(--ac-font-heading);
  font-variant-numeric: tabular-nums;
}

#acShell .ac-class-trend-data summary {
  min-height: var(--ac-action-size);
  padding: var(--ac-grid-space-3) 0;
  cursor: pointer;
}

#acShell .ac-class-trend-data table { width: 100%; border-collapse: collapse; }
#acShell .ac-class-trend-data :is(th, td) {
  padding: var(--ac-grid-space-2);
  border-bottom: 1px solid var(--ac-color-line);
  text-align: start;
}
#acShell .ac-class-trend-data :is(th, td):last-child { text-align: end; font-variant-numeric: tabular-nums; }

#acShell button.ac-asgn-title {
  padding: 0;
  min-height: var(--ac-action-size);
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  font: 650 var(--ac-type-control) var(--ac-font-ui);
  cursor: pointer;
}
#acShell button.ac-asgn-title:hover { text-decoration: underline; text-underline-offset: 0.17em; }
#acShell .ac-asgn-page-feedback:not(:empty) { padding-block: var(--ac-grid-space-2); }
#acShell .ac-asgn-page-feedback button,
#acShell #asgnListError button { margin-inline-start: var(--ac-grid-space-2); }
#acShell .ac-rail-credit,
#acShell .ac-contact-footer--rail .ac-contact-compact-label {
  color: var(--ac-color-secondary);
  opacity: 1;
}
#acShell .ac-rail-credit { font: 400 var(--ac-type-meta) var(--ac-font-ui); }
