/*
 * EM Archive showcase design layer.
 *
 * The role tokens are intentionally independent of Tailwind's palette. Existing
 * module variables can be aliased to these roles as each surface is migrated.
 */
:root {
  color-scheme: light;
  --ema-navy-950: #041a2e;
  --ema-navy-900: #06243d;
  --ema-navy-800: #0a2c4a;
  --ema-navy-700: #0f3a5f;
  --ema-red: #e5342a;
  --ema-red-hover: #c92a22;
  --ema-danger: #b91c1c;

  --ema-page: #f7f9fb;
  --ema-surface: #ffffff;
  --ema-surface-subtle: #f3f6f8;
  --ema-surface-strong: #e8eef2;
  --ema-text: #17263a;
  --ema-text-muted: #5f7083;
  --ema-text-faint: #8a99a8;
  --ema-border: #dce4e9;
  --ema-border-strong: #c6d2da;
  --ema-link: #1d4ed8;
  --ema-focus: var(--ema-navy-900);

  --ema-success: #15803d;
  --ema-warning: #b45309;
  --ema-info: #1d4ed8;

  --ema-radius-control: 0.375rem;
  --ema-radius-surface: 0.625rem;
  --ema-radius-full: 999px;
  --ema-shadow-sm: 0 1px 2px rgb(4 26 46 / 0.06);
  --ema-shadow-md: 0 10px 28px -18px rgb(4 26 46 / 0.34);
  --ema-ease: cubic-bezier(0.2, 0, 0, 1);
}

:root.dark,
:root[data-theme="dark"] {
  color-scheme: dark;
  --ema-page: #04111f;
  --ema-surface: #08243b;
  --ema-surface-subtle: #0a2c4a;
  --ema-surface-strong: #123c5d;
  --ema-text: #f3f7fa;
  --ema-text-muted: #b2c0cc;
  --ema-text-faint: #8295a6;
  --ema-border: #1c4564;
  --ema-border-strong: #2c5a7b;
  --ema-link: #93c5fd;
  --ema-focus: #ffffff;
  --ema-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --ema-shadow-md: 0 14px 34px -18px rgb(0 0 0 / 0.7);
}

body.ema-app {
  background: var(--ema-page);
  color: var(--ema-text);
}

body.dark-mode.ema-app {
  background: var(--ema-page);
  color: var(--ema-text);
}

.ema-app :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ema-focus);
  outline-offset: 2px;
}

.ema-app a:not([class]) {
  color: var(--ema-link);
}

/* Shared controls ------------------------------------------------------- */
.ema-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--ema-radius-control);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 700;
  gap: 0.45rem;
  justify-content: center;
  line-height: 1.2;
  min-height: 2.5rem;
  padding: 0.625rem 1rem;
  text-decoration: none;
  transition: background-color 160ms var(--ema-ease), border-color 160ms var(--ema-ease), color 160ms var(--ema-ease), box-shadow 160ms var(--ema-ease), transform 160ms var(--ema-ease);
}

.ema-button:hover {
  text-decoration: none;
}

.ema-button:active {
  transform: translateY(1px);
}

.ema-button--compact {
  font-size: 0.8125rem;
  min-height: 2rem;
  padding: 0.4rem 0.75rem;
}

.ema-button--primary {
  background: var(--ema-navy-900);
  border-color: var(--ema-navy-900);
  color: #ffffff;
  box-shadow: var(--ema-shadow-sm);
}

.ema-button--primary:hover {
  background: var(--ema-navy-700);
  border-color: var(--ema-navy-700);
}

.ema-button--accent {
  background: var(--ema-red);
  border-color: var(--ema-red);
  color: #ffffff;
  box-shadow: var(--ema-shadow-sm);
}

.ema-button--accent:hover {
  background: var(--ema-red-hover);
  border-color: var(--ema-red-hover);
}

.ema-button--secondary {
  background: var(--ema-surface);
  border-color: var(--ema-border-strong);
  color: var(--ema-navy-900);
}

.ema-button--secondary:hover {
  background: var(--ema-surface-subtle);
  border-color: var(--ema-navy-700);
}

:root.dark .ema-button--secondary,
:root[data-theme="dark"] .ema-button--secondary {
  color: var(--ema-text);
}

.ema-button--on-dark {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.28);
  color: #ffffff;
}

.ema-button--on-dark:hover {
  background: rgb(255 255 255 / 0.16);
  border-color: rgb(255 255 255 / 0.42);
}

.ema-button--danger {
  background: var(--ema-danger);
  border-color: var(--ema-danger);
  color: #ffffff;
}

.ema-input {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border-strong);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text);
  min-height: 2.75rem;
  transition: border-color 160ms var(--ema-ease), box-shadow 160ms var(--ema-ease);
}

.ema-input:focus {
  border-color: var(--ema-navy-700);
  box-shadow: 0 0 0 3px rgb(15 58 95 / 0.14);
}

.ema-panel {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-sm);
}

/* Shared shell ---------------------------------------------------------- */
.sidebar-off #sidebar,
.sidebar-off #sidebar-toggle,
.sidebar-collapsed #sidebar {
  display: none;
}

#sidebar {
  background: var(--ema-surface);
  border-color: var(--ema-border);
  box-shadow: none;
  flex-shrink: 0;
  min-width: 14rem;
  width: 14rem;
}

.sidebar-brand-shell {
  align-items: center;
  background: var(--ema-navy-950);
  border-bottom: 1px solid var(--ema-navy-700);
  display: flex;
  min-height: 4.5rem;
  padding: 0.65rem 0.75rem;
}

.sidebar-brand-link {
  display: block;
  width: 100%;
}

.sidebar-brand-link:focus-visible {
  border-radius: var(--ema-radius-control);
  outline-color: #ffffff;
}

.sidebar-brand-logo {
  display: block;
  height: auto;
  max-height: 3.3rem;
  object-fit: contain;
  object-position: left center;
  width: 100%;
}

.sidebar-scroll {
  padding: 0.5rem 0.625rem 1.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-mode-switch {
  background: var(--ema-surface-subtle);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  display: grid;
  gap: 0.2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.8rem;
  padding: 0.2rem;
}

.sidebar-mode-switch button {
  align-items: flex-start;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--ema-radius-control);
  color: var(--ema-text-muted);
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  font-weight: 750;
  line-height: 1.15;
  min-height: 2.6rem;
  padding: 0.42rem 0.5rem;
}

.sidebar-mode-switch button small {
  color: var(--ema-text-faint);
  font-size: 0.625rem;
  font-weight: 600;
  margin-top: 0.18rem;
}

.sidebar-mode-switch button[aria-pressed="true"] {
  background: var(--ema-surface);
  border-color: var(--ema-border);
  box-shadow: var(--ema-shadow-sm);
  color: var(--ema-navy-900);
}

:root.dark .sidebar-mode-switch button[aria-pressed="true"],
:root[data-theme="dark"] .sidebar-mode-switch button[aria-pressed="true"] {
  color: var(--ema-text);
}

.sidebar-archive-link {
  align-items: center;
  display: flex;
  font-size: 0.8125rem;
  font-weight: 650;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
}

.sidebar-archive-dot {
  background: var(--ema-border-strong);
  border-radius: 999px;
  height: 0.38rem;
  width: 0.38rem;
}

.sidebar-archive-link.bg-blue-100 .sidebar-archive-dot {
  background: var(--ema-red);
}

body[data-sidebar-mode="archive"] .sidebar-workspace-nav,
body[data-sidebar-mode="archive"] .sidebar-workspace-tools,
body[data-sidebar-mode-default="archive"]:not([data-sidebar-mode]) .sidebar-workspace-nav,
body[data-sidebar-mode-default="archive"]:not([data-sidebar-mode]) .sidebar-workspace-tools {
  display: none;
}

body[data-sidebar-mode="workspace"] .sidebar-archive-nav,
body[data-sidebar-mode-default="workspace"]:not([data-sidebar-mode]) .sidebar-archive-nav {
  display: none;
}

.sidebar-quick-actions {
  background: var(--ema-surface-subtle);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  overflow: hidden;
}

.sidebar-quick-actions[open] {
  padding-bottom: 0.125rem;
}

.sidebar-quick-summary {
  align-items: center;
  color: var(--ema-text-muted);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  min-height: 2rem;
  padding: 0 0.55rem;
}

.sidebar-quick-summary::-webkit-details-marker {
  display: none;
}

.sidebar-quick-summary-icon {
  color: var(--ema-text-faint);
  transition: transform 150ms var(--ema-ease);
}

.sidebar-quick-actions[open] .sidebar-quick-summary-icon {
  transform: rotate(180deg);
}

.sidebar-heading {
  color: var(--ema-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.sidebar-quick-actions .sidebar-heading {
  color: inherit;
  font-size: 0.6875rem;
}

.sidebar-quick-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0 0.25rem 0.25rem;
}

.sidebar-action,
.sidebar-link {
  border-radius: var(--ema-radius-control);
  color: var(--ema-text-muted);
  min-height: 2.25rem;
}

.sidebar-action {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  font-size: 0.75rem;
  min-height: 2rem;
}

.sidebar-action:hover,
.sidebar-link:hover {
  background: var(--ema-surface-subtle);
  color: var(--ema-navy-900);
}

.sidebar-action .sidebar-icon {
  color: var(--ema-navy-700);
}

.sidebar-action-chevron,
.sidebar-link .sidebar-icon {
  color: var(--ema-text-faint);
}

.sidebar-link.bg-blue-100,
.sidebar-link[aria-current="page"] {
  background: var(--ema-surface-subtle) !important;
  box-shadow: inset 3px 0 0 var(--ema-red);
  color: var(--ema-navy-900) !important;
}

.sidebar-link.bg-blue-100 .sidebar-icon,
.sidebar-link[aria-current="page"] .sidebar-icon {
  color: var(--ema-navy-900) !important;
}

.sidebar-section-rule {
  border-color: var(--ema-border);
  margin: 0.25rem 0;
}

.app-shell-header {
  background: color-mix(in srgb, var(--ema-surface) 96%, transparent);
  border-color: var(--ema-border);
  box-shadow: var(--ema-shadow-sm);
  min-height: 4rem;
}

.app-shell-header > div:first-child h1,
.app-shell-header > div:first-child .text-gray-900 {
  color: var(--ema-text);
}

#sidebar-toggle,
#cmdk-trigger,
#global-theme-toggle,
#avatar-menu-button {
  border-color: var(--ema-border);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text-muted);
}

#cmdk-trigger,
#global-theme-toggle,
#avatar-menu-button {
  background: var(--ema-surface-subtle);
}

#cmdk-trigger:hover,
#global-theme-toggle:hover,
#avatar-menu-button:hover {
  background: var(--ema-surface-strong);
  color: var(--ema-text);
}

@media (max-width: 639px) {
  .app-shell-header {
    padding-inline: 0.75rem !important;
  }

  .app-shell-header > div:first-child {
    min-width: 0;
  }

  .app-shell-header > div:last-child {
    gap: 0.5rem;
  }

  #cmdk-trigger {
    min-width: 2.5rem;
    padding-inline: 0.7rem;
  }

  .cmdk-trigger-label {
    display: none;
  }
}

.app-main {
  background: var(--ema-page);
}

body.dark-mode #sidebar,
body.dark-mode #sidebar .bg-white,
body.dark-mode #sidebar .shrink-0.border-t {
  background: var(--ema-surface) !important;
}

body.dark-mode .app-shell-header {
  background: var(--ema-surface);
  border-color: var(--ema-border);
}

.cmdk-panel {
  background: var(--ema-surface) !important;
  border-color: var(--ema-border) !important;
  color: var(--ema-text);
}

.cmdk-mode-switch {
  background: var(--ema-surface-subtle);
  border-bottom: 1px solid var(--ema-border);
  display: grid;
  gap: 0.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.35rem;
}

.cmdk-mode-switch button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--ema-radius-control);
  color: var(--ema-text-muted);
  font-size: 0.75rem;
  font-weight: 750;
  min-height: 2.25rem;
}

.cmdk-mode-switch button[aria-selected="true"] {
  background: var(--ema-surface);
  border-color: var(--ema-border);
  box-shadow: var(--ema-shadow-sm);
  color: var(--ema-navy-900);
}

:root.dark .cmdk-mode-switch button[aria-selected="true"],
:root[data-theme="dark"] .cmdk-mode-switch button[aria-selected="true"] {
  color: var(--ema-text);
}

#cmdk-input {
  color: var(--ema-text);
}

#cmdk-input::placeholder {
  color: var(--ema-text-faint);
}

.cmdk-group-label {
  color: var(--ema-text-faint);
  font-size: 0.6875rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  padding: 0.8rem 0.75rem 0.3rem;
  text-transform: uppercase;
}

.cmdk-result {
  align-items: center;
  border-radius: var(--ema-radius-control);
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  min-height: 3.25rem;
  padding: 0.55rem 0.75rem;
}

.cmdk-result:hover,
.cmdk-result.is-active {
  background: var(--ema-surface-subtle);
}

.cmdk-result__copy {
  min-width: 0;
}

.cmdk-result__title,
.cmdk-result__subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmdk-result__title {
  color: var(--ema-text);
  font-size: 0.875rem;
  font-weight: 700;
}

.cmdk-result__subtitle {
  color: var(--ema-text-muted);
  font-size: 0.75rem;
  margin-top: 0.1rem;
}

.cmdk-result__key {
  border: 1px solid var(--ema-border);
  border-radius: 0.25rem;
  color: var(--ema-text-faint);
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
}

.cmdk-empty {
  color: var(--ema-text-muted);
  font-size: 0.875rem;
  padding: 2rem 0.75rem;
  text-align: center;
}

.cmdk-hint {
  border-top: 1px solid var(--ema-border);
  color: var(--ema-text-faint);
  font-size: 0.6875rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
}

.cmdk-toast {
  background: var(--ema-navy-900);
  border-radius: var(--ema-radius-full);
  bottom: 1.25rem;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 650;
  left: 50%;
  padding: 0.55rem 1rem;
  position: fixed;
  transform: translateX(-50%);
  z-index: 70;
}

/* Login --------------------------------------------------------------- */
body[data-page="login"] .ema-shell-layout {
  display: block;
}

body[data-page="login"] #sidebar,
body[data-page="login"] .app-shell-header {
  display: none !important;
}

body[data-page="login"] .app-main {
  min-height: 100vh;
  padding: 0;
}

body[data-page="login"] .app-content-container {
  max-width: none;
}

.ema-login-shell {
  display: grid;
  min-height: 100vh;
  width: 100%;
}

.ema-login-brand {
  background: var(--ema-navy-950);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 18rem;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 4.5rem);
  position: relative;
}

.ema-login-brand::after {
  background: var(--ema-red);
  bottom: 0;
  content: "";
  height: 3px;
  left: clamp(1.5rem, 4vw, 4.5rem);
  position: absolute;
  width: 4rem;
}

.ema-login-logo {
  height: auto;
  max-width: 29rem;
  width: min(100%, 29rem);
}

.ema-login-kicker {
  color: #a9bfd0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ema-login-brand h1 {
  font-size: clamp(2rem, 5vw, 4.25rem);
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin-top: 1rem;
  max-width: 10ch;
}

.ema-login-brand p {
  color: #b9cad6;
  line-height: 1.65;
  max-width: 34rem;
}

.ema-login-form-wrap {
  align-items: center;
  background: var(--ema-page);
  display: flex;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 5rem);
}

.ema-login-card {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-md);
  max-width: 28rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  width: 100%;
}

.ema-login-card h2 {
  color: var(--ema-navy-900);
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

:root.dark .ema-login-card h2,
:root[data-theme="dark"] .ema-login-card h2 {
  color: var(--ema-text);
}

.ema-login-card .ema-login-kicker {
  color: var(--ema-red);
}

.ema-login-card label {
  color: var(--ema-text);
}

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

@media (min-width: 900px) {
  .ema-login-shell {
    grid-template-columns: minmax(25rem, 1.05fr) minmax(26rem, 0.95fr);
  }
}

/* Home ---------------------------------------------------------------- */
.ema-home {
  padding-bottom: 3rem;
}

.ema-home-hero {
  margin-inline: auto;
  max-width: 54rem;
  padding: 1.5rem 0 1.25rem;
}

.ema-home-hero__brand {
  background: var(--ema-navy-950);
  border: 1px solid var(--ema-navy-800);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-sm);
  margin-inline: auto;
  max-width: 49rem;
  overflow: hidden;
  padding: 0.45rem 0.7rem;
}

.ema-home-hero__wordmark {
  margin-inline: auto;
}

.ema-home-hero__copy {
  color: var(--ema-text-muted);
  font-size: clamp(0.95rem, 2vw, 1.075rem);
  line-height: 1.55;
  margin: 1rem auto 0;
  max-width: 43rem;
}

.ema-home-search {
  align-items: stretch;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.15rem auto 0;
  max-width: 42rem;
}

.ema-home-search .ema-input {
  flex: 1 1 auto;
  min-width: 0;
}

.ema-module-card {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-sm);
  overflow: hidden;
  transition: border-color 180ms var(--ema-ease), box-shadow 180ms var(--ema-ease), transform 180ms var(--ema-ease);
}

.ema-module-card:hover {
  border-color: var(--ema-border-strong);
  box-shadow: var(--ema-shadow-md);
  transform: translateY(-0.2rem);
}

.ema-home-destinations {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  margin-top: 0.5rem;
}

.ema-destination-card {
  color: var(--ema-text);
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
}

.ema-destination-card:hover {
  text-decoration: none;
}

.ema-destination-card .home-module-banner {
  background: var(--ema-navy-950);
  display: block;
  height: clamp(7rem, 11vw, 9rem);
  overflow: hidden;
  width: 100%;
}

.ema-destination-card .home-module-banner img {
  height: 100%;
  object-fit: cover;
  transition: transform 240ms var(--ema-ease);
  width: 100%;
}

.ema-destination-card:hover .home-module-banner img {
  transform: scale(1.02);
}

.ema-module-card__body {
  background: linear-gradient(180deg, var(--ema-surface), var(--ema-surface-subtle));
}

.ema-destination-card .ema-module-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 1rem 1.1rem 1.05rem;
}

.ema-destination-card__heading {
  align-items: baseline;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.ema-module-card__title {
  color: var(--ema-navy-900);
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
}

.ema-module-card__copy {
  color: var(--ema-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0.4rem 0 0;
}

.ema-destination-card__count {
  color: var(--ema-text-faint);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.ema-destination-card__link,
.ema-text-link {
  color: var(--ema-link);
  font-size: 0.8125rem;
  font-weight: 700;
}

.ema-destination-card__link {
  margin-top: 0.85rem;
}

.ema-home-section {
  border-top: 1px solid var(--ema-border);
  margin-top: clamp(2.25rem, 5vw, 3.5rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
}

.ema-home-section__header {
  align-items: flex-end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.ema-home-section__eyebrow {
  color: var(--ema-red);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
}

.ema-home-section-title {
  color: var(--ema-navy-900);
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

.ema-home-recent-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
}

.ema-home-recent-card {
  align-items: center;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  color: var(--ema-text);
  display: flex;
  gap: 0.9rem;
  min-height: 6.25rem;
  overflow: hidden;
  padding: 0.65rem;
  text-decoration: none;
  transition: border-color 180ms var(--ema-ease), box-shadow 180ms var(--ema-ease), transform 180ms var(--ema-ease);
}

.ema-home-recent-card:hover {
  border-color: var(--ema-border-strong);
  box-shadow: var(--ema-shadow-md);
  text-decoration: none;
  transform: translateY(-0.12rem);
}

.ema-home-recent-card__image,
.ema-home-recent-card__placeholder {
  border-radius: calc(var(--ema-radius-surface) - 0.15rem);
  flex: 0 0 5rem;
  height: 5rem;
  width: 5rem;
}

.ema-home-recent-card__image {
  object-fit: cover;
}

.ema-home-recent-card__placeholder {
  align-items: center;
  background: var(--ema-navy-900);
  color: #ffffff;
  display: flex;
  font-size: 1.35rem;
  font-weight: 800;
  justify-content: center;
}

.ema-home-recent-card__body {
  min-width: 0;
}

.ema-home-recent-card__type {
  color: var(--ema-red);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ema-home-recent-card h3 {
  color: var(--ema-text);
  display: -webkit-box;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.15rem 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ema-home-recent-card p {
  color: var(--ema-text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0.25rem 0 0;
}

.ema-home-action-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.ema-home-action {
  align-items: center;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text);
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 700;
  gap: 0.55rem;
  min-height: 2.65rem;
  padding: 0.55rem 0.8rem;
  text-align: left;
  text-decoration: none;
  transition: background-color 160ms var(--ema-ease), border-color 160ms var(--ema-ease), transform 160ms var(--ema-ease);
}

.ema-home-action:hover {
  background: var(--ema-surface-subtle);
  border-color: var(--ema-border-strong);
  text-decoration: none;
  transform: translateY(-0.08rem);
}

.ema-home-action svg {
  color: var(--ema-red);
  flex: 0 0 auto;
  height: 1.1rem;
  width: 1.1rem;
}

.ema-home-notices {
  display: grid;
  gap: 0.65rem;
}

.ema-home-notice {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-left: 0.25rem solid var(--ema-info);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text);
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.8rem 1rem;
}

.ema-home-notice--success {
  border-left-color: var(--ema-success);
}

.ema-home-notice--warning {
  border-left-color: var(--ema-warning);
}

.ema-home-notice--danger {
  border-left-color: var(--ema-danger);
}

.ema-home-notice p {
  margin: 0;
}

.ema-home-notice ul {
  margin: 0.45rem 0 0 1.1rem;
}

.ema-home-notice a {
  color: var(--ema-link);
  font-weight: 700;
}

.ema-home-master-tools {
  align-items: center;
  background: var(--ema-surface-subtle);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}

.ema-home-master-tools > div > p:last-child {
  color: var(--ema-text-muted);
  font-size: 0.875rem;
  margin: 0.3rem 0 0;
}

body.dark-mode .ema-module-card__title,
body.dark-mode .ema-home-section-title {
  color: var(--ema-text);
}

@media (max-width: 560px) {
  .ema-home-search {
    flex-direction: column;
    gap: 0.65rem;
  }

  .ema-home-search .ema-button {
    width: 100%;
  }

  .ema-home-hero {
    padding-top: 1.25rem;
  }

  .ema-home-hero__brand {
    max-width: 28rem;
    padding: 0.35rem 0.5rem;
  }

  .ema-home-destinations {
    margin-top: 0.75rem;
  }

  .ema-destination-card .home-module-banner {
    height: 7.5rem;
  }

  .ema-home-section__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ema-home-action-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ema-home-master-tools {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Dashboard ------------------------------------------------------------ */
.ema-dashboard-hero {
  background: var(--ema-navy-900);
  border: 1px solid var(--ema-navy-700);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-md);
  color: #ffffff;
}

.ema-dashboard-search {
  align-items: center;
  background: rgb(4 26 46 / 0.48);
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: var(--ema-radius-control);
  display: flex;
  padding: 0.4rem 0.75rem;
}

.ema-dashboard-search:focus-within {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.2);
}

.ema-dashboard-search input:focus-visible {
  outline: none;
}

.ema-dashboard-hero .ema-dashboard-date {
  color: #a9bfd0;
}

.ema-dashboard-hero .ema-dashboard-status-row {
  border-color: rgb(255 255 255 / 0.16);
}

.ema-dashboard-tools {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-sm);
  overflow: hidden;
}

.ema-dashboard-tools__summary {
  align-items: center;
  color: var(--ema-text);
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  list-style: none;
  min-height: 4.5rem;
  padding: 0.8rem 1rem;
  transition: background-color 160ms var(--ema-ease);
}

.ema-dashboard-tools__summary:hover {
  background: var(--ema-surface-subtle);
}

.ema-dashboard-tools__summary::-webkit-details-marker {
  display: none;
}

.ema-dashboard-tools__lead {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  min-width: 0;
}

.ema-dashboard-tools__mark {
  align-items: center;
  background: var(--ema-navy-900);
  border-radius: var(--ema-radius-control);
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.5rem;
  justify-content: center;
  width: 2.5rem;
}

.ema-dashboard-tools__mark svg {
  height: 1.2rem;
  width: 1.2rem;
}

.ema-dashboard-tools__copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.ema-dashboard-tools__copy strong {
  color: var(--ema-text);
  font-size: 0.9rem;
}

.ema-dashboard-tools__copy > span {
  color: var(--ema-text-muted);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ema-dashboard-tools__control {
  align-items: baseline;
  display: flex;
  flex: 0 0 auto;
  gap: 0.45rem;
}

.ema-dashboard-tools__count {
  align-items: center;
  background: var(--ema-surface-strong);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 800;
  height: 1.45rem;
  justify-content: center;
  min-width: 1.45rem;
  padding: 0 0.35rem;
}

.ema-dashboard-tools__closed-label,
.ema-dashboard-tools__open-label {
  color: var(--ema-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.ema-dashboard-tools__open-label {
  display: none;
}

.ema-dashboard-tools__control > svg {
  color: var(--ema-text-faint);
  height: 1rem;
  transition: transform 160ms var(--ema-ease);
  width: 1rem;
}

.ema-dashboard-tools[open] .ema-dashboard-tools__summary {
  border-bottom: 1px solid var(--ema-border);
}

.ema-dashboard-tools[open] .ema-dashboard-tools__closed-label {
  display: none;
}

.ema-dashboard-tools[open] .ema-dashboard-tools__open-label {
  display: inline;
}

.ema-dashboard-tools[open] .ema-dashboard-tools__control > svg {
  transform: rotate(180deg);
}

.ema-dashboard-tools__body {
  padding: 0.9rem;
}

.ema-dashboard-tools__intro {
  align-items: baseline;
  display: flex;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  padding: 0 0.15rem;
}

.ema-dashboard-tools__intro > span {
  color: var(--ema-navy-700);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

:root.dark .ema-dashboard-tools__intro > span,
:root[data-theme="dark"] .ema-dashboard-tools__intro > span {
  color: #9fc9e8;
}

.ema-dashboard-tools__intro p {
  color: var(--ema-text-muted);
  font-size: 0.75rem;
  margin: 0;
}

.ema-dashboard-tools__groups {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ema-dashboard-tools__group {
  background: var(--ema-surface-subtle);
  border: 1px solid transparent;
  border-radius: calc(var(--ema-radius-surface) - 0.1rem);
  min-width: 0;
  padding: 0.75rem;
}

.ema-dashboard-tools__group-header {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.ema-dashboard-tools__group-header > span:first-child {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  min-width: 0;
}

.ema-dashboard-tools__group-header strong {
  color: var(--ema-text);
  font-size: 0.75rem;
  font-weight: 800;
}

.ema-dashboard-tools__group-header > span:last-child {
  color: var(--ema-text-faint);
  font-size: 0.68rem;
  font-weight: 800;
}

.ema-dashboard-tools__group-dot {
  background: var(--ema-red);
  border-radius: var(--ema-radius-full);
  flex: 0 0 auto;
  height: 0.42rem;
  width: 0.42rem;
}

.ema-dashboard-tools__group-desc {
  color: var(--ema-text-muted);
  font-size: 0.68rem;
  line-height: 1.4;
  margin: 0.22rem 0 0.65rem 0.85rem;
  min-height: 1.9em;
}

.ema-dashboard-tools__links {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.ema-dashboard-tool {
  align-items: center;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text);
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 2.15rem minmax(0, 1fr) auto auto;
  min-height: 3.6rem;
  padding: 0.45rem 0.5rem;
  text-decoration: none;
  transition: border-color 160ms var(--ema-ease), box-shadow 160ms var(--ema-ease), transform 160ms var(--ema-ease);
}

.ema-dashboard-tool:hover {
  border-color: var(--ema-border-strong);
  box-shadow: 0 5px 16px -12px rgb(4 26 46 / 0.55);
  color: var(--ema-text);
  text-decoration: none;
  transform: translateY(-1px);
}

.ema-dashboard-tool__icon {
  align-items: center;
  align-self: center;
  background: var(--ema-surface-subtle);
  border-radius: var(--ema-radius-control);
  display: inline-flex;
  font-size: 1rem;
  height: 2.15rem;
  justify-content: center;
  width: 2.15rem;
}

.ema-dashboard-tool__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ema-dashboard-tool__copy strong {
  color: var(--ema-text);
  font-size: 0.75rem;
  font-weight: 780;
  line-height: 1.25;
}

.ema-dashboard-tool__copy > span {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  color: var(--ema-text-muted);
  display: -webkit-box;
  font-size: 0.65rem;
  line-height: 1.35;
  overflow: hidden;
}

.ema-dashboard-tool__badge {
  background: var(--ema-surface-strong);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.2;
  max-width: 6rem;
  overflow: hidden;
  padding: 0.25rem 0.4rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ema-dashboard-tool__arrow {
  color: var(--ema-text-faint);
  height: 0.85rem;
  opacity: 0;
  transform: translateX(-0.15rem);
  transition: opacity 160ms var(--ema-ease), transform 160ms var(--ema-ease);
  width: 0.85rem;
}

.ema-dashboard-tool:hover .ema-dashboard-tool__arrow,
.ema-dashboard-tool:focus-visible .ema-dashboard-tool__arrow {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 1100px) {
  .ema-dashboard-tools__groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ema-dashboard-tools__summary {
    min-height: 4rem;
    padding: 0.65rem 0.75rem;
  }

  .ema-dashboard-tools__mark {
    height: 2.25rem;
    width: 2.25rem;
  }

  .ema-dashboard-tools__copy > span {
    max-width: 11rem;
  }

  .ema-dashboard-tools__closed-label,
  .ema-dashboard-tools__open-label {
    display: none;
  }

  .ema-dashboard-tools__body {
    padding: 0.75rem;
  }

  .ema-dashboard-tools__intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }

  .ema-dashboard-tools__groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .ema-dashboard-tools__group-desc {
    min-height: 0;
  }

  .ema-dashboard-tool {
    min-height: 3.4rem;
  }
}

/* Dashboard daily plan ------------------------------------------------- */
.ema-today-plan {
  background: var(--ema-surface-subtle);
  border: 1px solid var(--ema-border);
  border-radius: calc(var(--ema-radius-surface) + 0.25rem);
  box-shadow: var(--ema-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  position: relative;
}

.ema-today-plan [data-today-plan-block="toolbar"] {
  order: 1;
}

.ema-today-plan [data-today-plan-block="focus"] {
  order: 2;
}

.ema-today-plan [data-today-plan-block="quick-add"] {
  order: 3;
}

.ema-today-plan [data-today-plan-block="today-list"] {
  order: 4;
}

.ema-today-plan [data-today-plan-block="nudge"] {
  order: 5;
}

.ema-today-plan [data-today-plan-block="backlog"] {
  order: 6;
}

.ema-today-plan [data-today-plan-block="upcoming"] {
  order: 7;
}

.ema-today-plan [data-today-plan-block="wins"] {
  order: 8;
}

.ema-today-plan [data-today-plan-block="planner"] {
  order: 9;
}

.ema-today-toolbar {
  align-items: center;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.65rem 0.75rem;
}

.ema-today-toolbar__title {
  min-width: 8.5rem;
}

.ema-today-toolbar__title h2 {
  color: var(--ema-text);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.ema-today-toolbar__title p {
  color: var(--ema-text-muted);
  font-size: 0.68rem;
  margin: 0.16rem 0 0;
}

.ema-today-date-nav {
  align-items: center;
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  min-width: 0;
}

.ema-today-date-nav button,
.ema-today-date-nav label,
.ema-today-toolbar__actions > :is(button, a) {
  align-items: center;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 750;
  gap: 0.35rem;
  justify-content: center;
  min-height: 1.85rem;
  padding: 0.28rem 0.65rem;
  text-decoration: none;
  white-space: nowrap;
}

.ema-today-date-nav button:hover,
.ema-today-toolbar__actions > :is(button, a):hover {
  border-color: var(--ema-border-strong);
  color: var(--ema-text);
  text-decoration: none;
}

.ema-today-date-nav button.is-active {
  background: var(--ema-navy-900);
  border-color: var(--ema-navy-900);
  color: #ffffff;
}

.ema-today-date-nav label {
  padding-right: 0.42rem;
}

.ema-today-date-nav label > span {
  color: var(--ema-text-faint);
}

.ema-today-date-nav input {
  background: transparent;
  border: 0;
  color: var(--ema-text);
  font-size: 0.68rem;
  max-width: 7rem;
  padding: 0;
}

.ema-today-date-nav input:focus {
  box-shadow: none;
  outline: none;
}

.ema-today-date-nav .ema-today-date-nav__go {
  background: var(--ema-surface-subtle);
  padding-inline: 0.5rem;
}

.ema-today-toolbar__actions {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.ema-today-toolbar__actions svg {
  height: 0.85rem;
  width: 0.85rem;
}

.ema-today-toolbar__actions > a {
  background: var(--ema-navy-900);
  border-color: var(--ema-navy-900);
  color: #ffffff !important;
}

.ema-today-toolbar__actions > a:hover {
  background: var(--ema-navy-700);
  border-color: var(--ema-navy-700);
  color: #ffffff !important;
}

.ema-today-focus {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-top: 3px solid var(--ema-navy-900);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-sm);
  padding: 0.9rem;
}

.ema-today-focus > div:first-child {
  margin-bottom: 0.65rem;
}

.ema-today-focus__eyebrow {
  color: var(--ema-red);
  display: block;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  margin-bottom: 0.12rem;
  text-transform: uppercase;
}

.ema-today-focus h3,
.ema-today-list h3 {
  color: var(--ema-text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0;
}

.ema-today-focus h3 + p,
.ema-today-list h3 + p {
  color: var(--ema-text-muted);
  font-size: 0.69rem;
  margin: 0.16rem 0 0;
}

.ema-today-focus-row,
.ema-today-task-row {
  align-items: flex-start;
  display: flex;
  gap: 0.7rem;
  min-width: 0;
}

.ema-today-focus-row {
  background: var(--ema-surface-subtle);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-control);
  padding: 0.65rem 0.7rem;
}

.ema-today-focus-empty {
  background: var(--ema-surface-subtle);
  border: 1px dashed var(--ema-border-strong);
  border-radius: var(--ema-radius-control);
  margin-bottom: 0.45rem;
  padding: 0.55rem 0.65rem;
}

.ema-today-focus-empty p {
  color: var(--ema-text-muted);
  font-size: 0.7rem;
  margin: 0;
}

.ema-today-focus-slots {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.55rem;
}

.ema-today-focus-slots > div {
  align-items: center;
  border: 1px dashed var(--ema-border);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text-faint);
  display: flex;
  font-size: 0.64rem;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.38rem 0.48rem;
}

.ema-today-focus-slots > div > span:first-child {
  align-items: center;
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-full);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 800;
  height: 1.15rem;
  justify-content: center;
  width: 1.15rem;
}

.ema-today-quick-add {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  overflow: hidden;
}

.ema-today-quick-add__row {
  align-items: center;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.48rem;
}

.ema-today-quick-add__icon {
  align-items: center;
  background: var(--ema-surface-subtle);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text-muted);
  display: inline-flex;
  font-size: 1rem;
  font-weight: 600;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.ema-today-quick-add__row input {
  background: transparent;
  border: 0;
  color: var(--ema-text);
  font-size: 0.8rem;
  min-width: 0;
  padding: 0.45rem 0.25rem;
}

.ema-today-quick-add__row input:focus {
  box-shadow: none;
  outline: none;
}

.ema-today-quick-add__row input::placeholder {
  color: var(--ema-text-faint);
}

.ema-today-quick-add__row button {
  background: var(--ema-navy-900);
  border: 1px solid var(--ema-navy-900);
  border-radius: var(--ema-radius-control);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
}

.ema-today-quick-add__details {
  border-top: 1px solid var(--ema-border);
  padding: 0.45rem 0.65rem;
}

.ema-today-quick-add__details > summary {
  align-items: center;
  color: var(--ema-text-muted);
  cursor: pointer;
  display: flex;
  font-size: 0.67rem;
  font-weight: 750;
  justify-content: space-between;
  list-style: none;
}

.ema-today-quick-add__details > summary::-webkit-details-marker {
  display: none;
}

.ema-today-quick-add__details > summary > span:last-child {
  color: var(--ema-text-faint);
  font-weight: 600;
}

.ema-today-list {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  padding: 0.75rem;
}

.ema-today-list > div:first-child {
  margin-bottom: 0.55rem;
}

.ema-today-list .ema-today-task-row {
  border-top: 1px solid var(--ema-border);
  padding: 0.65rem 0.15rem;
}

.ema-today-list .ema-today-task-row:first-child {
  border-top: 0;
}

.ema-today-secondary,
.ema-today-wins {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  overflow: hidden;
}

.ema-today-secondary > summary,
.ema-today-wins > summary {
  min-height: 3.2rem;
}

.ema-today-wins {
  background: var(--ema-surface-subtle);
}

@media (max-width: 900px) {
  .ema-today-toolbar {
    grid-template-areas:
      "title actions"
      "nav nav";
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ema-today-toolbar__title {
    grid-area: title;
  }

  .ema-today-date-nav {
    grid-area: nav;
    justify-content: flex-start;
  }

  .ema-today-toolbar__actions {
    grid-area: actions;
  }
}

@media (max-width: 640px) {
  .ema-today-plan {
    border-left: 0;
    border-radius: 0.75rem;
    border-right: 0;
    gap: 0.65rem;
    margin-inline: -0.25rem;
    padding: 0.75rem;
  }

  .ema-today-toolbar {
    gap: 0.55rem;
    padding: 0.6rem;
  }

  .ema-today-toolbar__actions > :is(button, a) {
    font-size: 0.64rem;
    padding-inline: 0.5rem;
  }

  .ema-today-date-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ema-today-date-nav button,
  .ema-today-date-nav label {
    width: 100%;
  }

  .ema-today-date-nav label {
    grid-column: 1 / 2;
  }

  .ema-today-date-nav .ema-today-date-nav__go {
    grid-column: 2 / 3;
  }

  .ema-today-focus {
    padding: 0.75rem;
  }

  .ema-today-focus-slots {
    grid-template-columns: minmax(0, 1fr);
  }

  .ema-today-quick-add__row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ema-today-quick-add__row button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* Dashboard attention system ----------------------------------------- */
.ema-dashboard-attention-row__label {
  color: #91a8b9;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ema-dashboard-attention-chip,
.ema-dashboard-attention-clear {
  align-items: center;
  background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: var(--ema-radius-full);
  color: #d9e4ec;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 700;
  gap: 0.35rem;
  min-height: 1.75rem;
  padding: 0.25rem 0.65rem;
  text-decoration: none;
  white-space: nowrap;
}

.ema-dashboard-attention-chip:hover,
.ema-dashboard-attention-clear:hover {
  background: rgb(255 255 255 / 0.11);
  border-color: rgb(255 255 255 / 0.26);
  color: #ffffff;
  text-decoration: none;
}

.ema-dashboard-attention-chip.is-urgent {
  background: rgb(229 52 42 / 0.16);
  border-color: rgb(248 113 113 / 0.4);
  color: #fecaca;
}

.ema-dashboard-attention-chip.is-warning {
  background: rgb(245 158 11 / 0.12);
  border-color: rgb(251 191 36 / 0.34);
  color: #fde68a;
}

.ema-dashboard-attention-clear::before {
  color: #86efac;
  content: "✓";
  font-weight: 900;
}

.ema-attention {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: calc(var(--ema-radius-surface) + 0.2rem);
  box-shadow: var(--ema-shadow-sm);
  overflow: hidden;
}

.ema-attention__header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1rem;
}

.ema-attention__eyebrow {
  color: var(--ema-red);
  display: block;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
}

.ema-attention__header h2 {
  color: var(--ema-text);
  font-size: 1.05rem;
  font-weight: 820;
  line-height: 1.2;
  margin: 0;
}

.ema-attention__header p {
  color: var(--ema-text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
  margin: 0.25rem 0 0;
}

.ema-attention__header-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 0.4rem;
}

.ema-attention__header-actions a {
  align-items: center;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 750;
  min-height: 1.9rem;
  padding: 0.3rem 0.65rem;
  text-decoration: none;
}

.ema-attention__header-actions a:hover {
  border-color: var(--ema-border-strong);
  color: var(--ema-text);
  text-decoration: none;
}

.ema-attention__header-actions a.is-primary {
  background: var(--ema-navy-900);
  border-color: var(--ema-navy-900);
  color: #ffffff !important;
}

.ema-attention__tabs {
  background: var(--ema-surface-subtle);
  border-bottom: 1px solid var(--ema-border);
  border-top: 1px solid var(--ema-border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 0.75rem;
}

.ema-attention__tabs button {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ema-text-muted);
  display: flex;
  font-size: 0.72rem;
  font-weight: 750;
  gap: 0.45rem;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.55rem;
}

.ema-attention__tabs button:hover {
  color: var(--ema-text);
}

.ema-attention__tabs button.is-active {
  border-bottom-color: var(--ema-red);
  color: var(--ema-text);
}

.ema-attention__tabs button span:last-child {
  align-items: center;
  background: var(--ema-surface-strong);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  display: inline-flex;
  font-size: 0.62rem;
  height: 1.25rem;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0 0.3rem;
}

.ema-attention__panels {
  padding: 0.85rem;
}

.ema-attention__panel-intro {
  align-items: center;
  color: var(--ema-text-muted);
  display: flex;
  font-size: 0.67rem;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  padding: 0 0.1rem;
}

.ema-attention__panel-intro span:last-child {
  color: var(--ema-text-faint);
}

.ema-attention__list {
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  overflow: visible;
}

.ema-attention-row {
  align-items: flex-start;
  background: var(--ema-surface);
  border-top: 1px solid var(--ema-border);
  display: grid;
  gap: 0.7rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: 0.72rem;
  position: relative;
}

.ema-attention-row:first-child {
  border-top: 0;
  border-radius: var(--ema-radius-surface) var(--ema-radius-surface) 0 0;
}

.ema-attention-row:last-child {
  border-radius: 0 0 var(--ema-radius-surface) var(--ema-radius-surface);
}

.ema-attention-row:only-child {
  border-radius: var(--ema-radius-surface);
}

.ema-attention-row__signal {
  background: var(--ema-border-strong);
  border-radius: var(--ema-radius-full);
  height: 0.55rem;
  margin-top: 0.32rem;
  width: 0.55rem;
}

.ema-attention-row.is-urgent .ema-attention-row__signal {
  background: var(--ema-red);
  box-shadow: 0 0 0 3px rgb(229 52 42 / 0.11);
}

.ema-attention-row.is-warning .ema-attention-row__signal {
  background: #d97706;
  box-shadow: 0 0 0 3px rgb(217 119 6 / 0.11);
}

.ema-attention-row__content {
  min-width: 0;
}

.ema-attention-row__context {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.24rem;
}

.ema-attention-row__context span {
  color: var(--ema-text-faint);
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ema-attention-row__context span.is-note {
  color: var(--ema-warning);
}

.ema-attention-row__context span.is-focus {
  color: var(--ema-success);
}

.ema-attention-row__title {
  color: var(--ema-text) !important;
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ema-attention-row__title:hover {
  color: var(--ema-link) !important;
  text-decoration: none;
}

.ema-attention-row__meta {
  color: var(--ema-text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.66rem;
  gap: 0.35rem 0.65rem;
  margin-top: 0.2rem;
}

.ema-attention-row__meta span + span::before {
  color: var(--ema-border-strong);
  content: "·";
  margin-right: 0.65rem;
}

.ema-attention-row__content p {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  color: var(--ema-text-muted);
  display: -webkit-box;
  font-size: 0.69rem;
  line-height: 1.45;
  margin: 0.3rem 0 0;
  overflow: hidden;
}

.ema-attention-row__content p strong {
  color: var(--ema-text);
  font-weight: 750;
}

.ema-attention-row__primary {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ema-attention-row__runway {
  background: var(--ema-surface-subtle);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.2rem 0.45rem;
  white-space: nowrap;
}

.ema-attention-row.is-urgent .ema-attention-row__runway {
  background: rgb(229 52 42 / 0.1);
  color: var(--ema-danger);
}

.ema-attention-row__primary > a {
  color: var(--ema-link);
  font-size: 0.68rem;
  font-weight: 750;
  text-decoration: none;
}

.ema-attention-row__more {
  position: relative;
}

.ema-attention-row__more > summary {
  align-items: center;
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.75rem;
  height: 1.6rem;
  justify-content: center;
  letter-spacing: 0.05em;
  list-style: none;
  width: 1.9rem;
}

.ema-attention-row__more > summary::-webkit-details-marker {
  display: none;
}

.ema-attention-row__more[open] > summary {
  background: var(--ema-surface-strong);
  border-color: var(--ema-border-strong);
}

.ema-attention-row__menu {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-md);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  width: 14rem;
  z-index: 20;
}

.ema-attention-row__menu form {
  margin: 0;
}

.ema-attention-row__menu button {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text-muted);
  font-size: 0.67rem;
  font-weight: 750;
  min-height: 1.8rem;
  padding: 0.3rem 0.5rem;
  text-align: left;
  width: 100%;
}

.ema-attention-row__menu button:hover {
  background: var(--ema-surface-subtle);
  border-color: var(--ema-border-strong);
  color: var(--ema-text);
}

.ema-attention-row__menu button.is-success {
  color: var(--ema-success);
}

.ema-attention-row__snooze {
  border-top: 1px solid var(--ema-border);
  display: grid;
  gap: 0.3rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.15rem;
  padding-top: 0.45rem;
}

.ema-attention-row__snooze > span {
  color: var(--ema-text-faint);
  font-size: 0.6rem;
  font-weight: 750;
  grid-column: 1 / -1;
}

.ema-attention-row__pick-date {
  display: grid;
  gap: 0.3rem;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
}

.ema-attention-row__pick-date input {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-control);
  color: var(--ema-text);
  font-size: 0.65rem;
  min-width: 0;
  padding: 0.3rem;
}

.ema-attention__empty {
  align-items: center;
  background: var(--ema-surface-subtle);
  border: 1px dashed var(--ema-border);
  border-radius: var(--ema-radius-surface);
  display: flex;
  gap: 0.65rem;
  padding: 0.75rem;
}

.ema-attention__empty > span {
  align-items: center;
  background: rgb(21 128 61 / 0.1);
  border-radius: var(--ema-radius-full);
  color: var(--ema-success);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.75rem;
  height: 1.7rem;
  justify-content: center;
  width: 1.7rem;
}

.ema-attention__empty strong {
  color: var(--ema-text);
  display: block;
  font-size: 0.72rem;
}

.ema-attention__empty p {
  color: var(--ema-text-muted);
  font-size: 0.67rem;
  margin: 0.1rem 0 0;
}

.ema-attention__more {
  align-items: center;
  color: var(--ema-text-muted);
  display: flex;
  font-size: 0.67rem;
  justify-content: space-between;
  padding: 0.65rem 0.1rem 0.05rem;
}

.ema-attention__more a {
  color: var(--ema-link);
  font-weight: 750;
  text-decoration: none;
}

.ema-attention__done {
  border-top: 1px solid var(--ema-border);
}

.ema-attention__done > summary {
  align-items: center;
  color: var(--ema-text-muted);
  cursor: pointer;
  display: flex;
  font-size: 0.67rem;
  font-weight: 750;
  justify-content: space-between;
  list-style: none;
  min-height: 2.7rem;
  padding: 0.55rem 1rem;
}

.ema-attention__done > summary::-webkit-details-marker {
  display: none;
}

.ema-attention__done > summary span:last-child {
  background: var(--ema-surface-strong);
  border-radius: var(--ema-radius-full);
  padding: 0.15rem 0.4rem;
}

.ema-attention__done > div {
  border-top: 1px solid var(--ema-border);
  padding: 0.5rem 1rem 0.75rem;
}

.ema-attention__done a {
  align-items: center;
  color: var(--ema-text-muted);
  display: flex;
  font-size: 0.67rem;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.3rem 0;
  text-decoration: none;
}

@media (max-width: 640px) {
  .ema-dashboard-attention-row {
    gap: 0.4rem;
  }

  .ema-dashboard-attention-row__label {
    position: sticky;
    left: 0;
  }

  .ema-attention__header {
    align-items: stretch;
    flex-direction: column;
    padding: 0.85rem;
  }

  .ema-attention__header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ema-attention__header-actions a {
    justify-content: center;
  }

  .ema-attention__tabs {
    padding-inline: 0.45rem;
  }

  .ema-attention__panels {
    padding: 0.7rem;
  }

  .ema-attention-row {
    gap: 0.55rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.65rem;
  }

  .ema-attention-row__primary {
    align-items: center;
    flex-direction: row;
    grid-column: 2 / 3;
    justify-content: flex-end;
  }

  .ema-attention-row__primary > a {
    margin-right: auto;
  }

  .ema-attention-row__menu {
    max-width: calc(100vw - 3.5rem);
    right: 0;
    width: 15.5rem;
  }

  .ema-attention__panel-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }
}

.ema-popover {
  border-color: var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-md);
}

/* Cross-module search --------------------------------------------------- */
.ema-search-page {
  margin: 0 auto;
  max-width: 76rem;
  width: 100%;
}

.ema-search-summary {
  border-bottom: 1px solid var(--ema-border);
  padding: 0.25rem 0 1.25rem;
}

.ema-search-summary__eyebrow {
  color: var(--ema-red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

.ema-search-summary h1 {
  color: var(--ema-text);
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0;
}

.ema-search-summary h1 span {
  color: var(--ema-text-muted);
  font-weight: 650;
}

.ema-search-summary > p:last-child {
  color: var(--ema-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0.55rem 0 0;
}

.ema-search-section {
  padding: clamp(1.4rem, 3vw, 2rem) 0;
}

.ema-search-section + .ema-search-section {
  border-top: 1px solid var(--ema-border);
}

.ema-search-section__header,
.ema-search-section__heading {
  align-items: center;
  display: flex;
}

.ema-search-section__header {
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.ema-search-section__heading {
  gap: 0.55rem;
}

.ema-search-section h2,
.ema-search-empty h2 {
  color: var(--ema-text);
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  margin: 0;
}

.ema-search-section__count {
  align-items: center;
  background: var(--ema-surface-strong);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 750;
  height: 1.45rem;
  justify-content: center;
  min-width: 1.45rem;
  padding-inline: 0.4rem;
}

.ema-search-section__link {
  color: var(--ema-link);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.ema-search-section__link:hover {
  text-decoration: underline;
  text-underline-offset: 0.16rem;
}

.ema-result-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.ema-result-card {
  align-items: center;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-sm);
  color: var(--ema-text);
  display: flex;
  gap: 0.8rem;
  min-height: 6.25rem;
  overflow: hidden;
  padding: 0.7rem;
  position: relative;
  text-decoration: none;
  transition: border-color 160ms var(--ema-ease), box-shadow 160ms var(--ema-ease), transform 160ms var(--ema-ease);
}

.ema-result-card:hover {
  border-color: var(--ema-navy-700);
  box-shadow: var(--ema-shadow-md);
  text-decoration: none;
  transform: translateY(-1px);
}

.ema-result-card__media,
.ema-result-card__icon {
  align-items: center;
  background: var(--ema-surface-subtle);
  border: 1px solid var(--ema-border);
  border-radius: calc(var(--ema-radius-surface) - 0.12rem);
  display: flex;
  flex: 0 0 4.75rem;
  height: 4.75rem;
  justify-content: center;
  overflow: hidden;
  width: 4.75rem;
}

.ema-result-card__media img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.ema-result-card__media img.ema-result-card__fallback {
  height: 2.5rem;
  object-fit: contain;
  width: 2.5rem;
}

.ema-result-card__icon {
  color: var(--ema-navy-700);
}

.ema-result-card__icon svg,
.ema-result-card__icon img {
  height: 2.25rem;
  object-fit: contain;
  width: 2.25rem;
}

.ema-result-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.ema-result-card__kind {
  color: var(--ema-text-faint);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  margin: 0 0 0.2rem;
  text-transform: uppercase;
}

.ema-result-card h3,
.ema-result-row h3 {
  color: var(--ema-text);
  display: -webkit-box;
  font-size: 0.9rem;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
  margin: 0;
  overflow: hidden;
}

.ema-result-card__copy {
  color: var(--ema-text-muted);
  display: -webkit-box;
  font-size: 0.78rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.4;
  margin: 0.3rem 0 0;
  overflow: hidden;
}

.ema-result-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.45rem;
  max-height: 1.5rem;
  overflow: hidden;
}

.ema-result-chip {
  background: var(--ema-surface-subtle);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-full);
  color: var(--ema-text-muted);
  display: inline-flex;
  font-size: 0.64rem;
  line-height: 1.2;
  max-width: 10rem;
  overflow: hidden;
  padding: 0.17rem 0.4rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ema-result-chip--type {
  background: var(--ema-surface-strong);
  color: var(--ema-navy-900);
  font-weight: 700;
}

:root.dark .ema-result-chip--type,
:root[data-theme="dark"] .ema-result-chip--type {
  color: var(--ema-text);
}

.ema-result-card__arrow {
  color: var(--ema-text-faint);
  flex: 0 0 auto;
  font-size: 1rem;
  padding-right: 0.2rem;
  transition: color 160ms var(--ema-ease), transform 160ms var(--ema-ease);
}

.ema-result-card:hover .ema-result-card__arrow {
  color: var(--ema-red);
  transform: translateX(2px);
}

.ema-result-list {
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-sm);
  overflow: hidden;
}

.ema-result-row {
  align-items: center;
  display: flex;
  gap: 0.85rem;
  padding: 0.8rem;
}

.ema-result-row + .ema-result-row {
  border-top: 1px solid var(--ema-border);
}

.ema-result-row__date {
  color: var(--ema-text-faint);
  flex: 0 0 3rem;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.ema-result-row__date span {
  color: var(--ema-navy-900);
  display: block;
  font-size: 1rem;
  letter-spacing: 0;
}

:root.dark .ema-result-row__date span,
:root[data-theme="dark"] .ema-result-row__date span {
  color: var(--ema-text);
}

.ema-search-section__empty {
  background: var(--ema-surface-subtle);
  border: 1px dashed var(--ema-border-strong);
  border-radius: var(--ema-radius-surface);
  color: var(--ema-text-muted);
  font-size: 0.85rem;
  margin: 0;
  padding: 0.85rem 1rem;
}

.ema-search-empty {
  align-items: center;
  background: var(--ema-surface);
  border: 1px solid var(--ema-border);
  border-radius: var(--ema-radius-surface);
  box-shadow: var(--ema-shadow-sm);
  display: flex;
  flex-direction: column;
  margin-top: 1.5rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.ema-search-empty__icon {
  align-items: center;
  background: var(--ema-surface-subtle);
  border-radius: var(--ema-radius-full);
  color: var(--ema-navy-700);
  display: flex;
  height: 3.5rem;
  justify-content: center;
  margin-bottom: 0.85rem;
  width: 3.5rem;
}

.ema-search-empty__icon svg {
  height: 1.6rem;
  width: 1.6rem;
}

.ema-search-empty p {
  color: var(--ema-text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0.4rem 0 0;
  max-width: 30rem;
}

@media (min-width: 900px) {
  .ema-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .ema-search-section__header {
    align-items: flex-start;
  }

  .ema-result-card__media,
  .ema-result-card__icon {
    flex-basis: 4rem;
    height: 4rem;
    width: 4rem;
  }

  .ema-result-row {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .ema-dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .ema-dashboard-actions .ema-dashboard-search {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ema-dashboard-actions .ema-dashboard-search input {
    width: 100%;
  }

  .ema-dashboard-actions .ema-button {
    width: 100%;
  }

  .ema-dashboard-actions #customise-button span {
    display: inline;
  }
}

/* Preserve the mobile table contract that previously lived in base.html. */
@media (max-width: 640px) {
  table.stack-table {
    display: block;
  }

  table.stack-table thead {
    display: none;
  }

  table.stack-table tbody,
  table.stack-table tr {
    display: block;
  }

  table.stack-table tr {
    border-bottom: 1px solid var(--ema-border);
  }

  table.stack-table td {
    display: flex;
    padding: 0.5rem 0.75rem;
  }

  table.stack-table td::before {
    color: var(--ema-text-muted);
    content: attr(data-label);
    font-weight: 600;
    margin-right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ema-button,
  .ema-module-card,
  .sidebar-quick-summary-icon {
    transition: none;
  }

  .ema-button:active,
  .ema-module-card:hover {
    transform: none;
  }
}
