/* Design system v2: compact application chrome around readable research content. */
.interface-shell {
  font-size: var(--font-size-ui);
  line-height: var(--line-height-ui);
}

.interface-shell :is(button, input, select, textarea) {
  font-family: var(--font-body);
}

.interface-shell :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.interface-shell :is(.prose, .project-dossier-reading, .project-index-summary) {
  font-family: var(--font-reading);
  font-size: var(--font-size-body);
  line-height: var(--line-height-reading);
}

.interface-shell .prose :is(h1, h2, h3, h4) {
  line-height: 1.3;
}

.interface-shell .prose p + p {
  margin-top: var(--space-s);
}

.interface-shell .lead {
  font-size: var(--font-size-body);
  color: var(--color-text-light);
}

.interface-shell .eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.interface-shell .page-main {
  padding-top: var(--space-base);
  padding-bottom: var(--space-xl);
}

/* The header has one predictable height for sticky panels and editor toolbars. */
.interface-shell .app-bar {
  height: var(--app-bar-height);
}

.interface-shell .app-bar-inner {
  height: calc(var(--app-bar-height) - var(--border-width));
  min-height: 0;
  padding-block: 0;
}

.interface-shell .brand-link {
  gap: var(--space-xxs);
  min-width: 0;
  max-width: 100%;
  color: var(--color-text);
}

.interface-shell .site-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.interface-shell .site-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interface-shell .site-tagline {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.interface-shell .desktop-nav {
  gap: var(--space-3xs);
}

.interface-shell .desktop-nav > .nav-link,
.interface-shell .desktop-nav > .nav-item-group > .nav-link {
  min-height: var(--interaction-height);
  padding: var(--space-xxs) var(--space-xs);
  border: 0;
  border-radius: var(--radius);
  font-size: var(--font-size-ui);
  font-weight: 500;
  color: var(--color-text-light);
  box-shadow: none;
}

.interface-shell .desktop-nav > .nav-link:hover,
.interface-shell .desktop-nav > .nav-item-group:hover > .nav-link,
.interface-shell .desktop-nav > .nav-item-group:focus-within > .nav-link {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

.interface-shell .desktop-nav .nav-link[aria-current="page"] {
  background: var(--color-primary-alt-tint);
  color: var(--color-primary);
  font-weight: 600;
}

.interface-shell .desktop-nav .nav-link--admin {
  margin-left: var(--space-xxs);
  box-shadow: inset 0 0 0 1px var(--color-border-light);
}

.interface-shell .nav-submenu {
  border-color: var(--color-border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-overlay);
  padding: var(--space-xxs);
}

.interface-shell .nav-submenu .nav-link {
  min-height: var(--interaction-height);
  border-radius: var(--radius-small);
  font-weight: 500;
  font-size: var(--font-size-ui);
}

.interface-shell .icon-button {
  width: var(--interaction-height);
  height: var(--interaction-height);
  border-radius: var(--radius);
}

.interface-shell .mobile-drawer {
  background: var(--color-bg-surface);
}

.interface-shell .mobile-drawer .nav-link {
  min-height: var(--interaction-height);
  font-size: var(--font-size-ui);
}

.interface-shell .site-footer {
  margin-top: 0;
  padding-block: var(--space-base);
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border-light);
  color: var(--color-text-light);
  font-size: 0.8125rem;
}

/* Shared controls use stronger borders than decorative panel separators. */
.interface-shell .btn {
  min-height: var(--interaction-height);
  padding: var(--space-xxs) var(--space-xs);
  font-size: var(--font-size-ui);
  font-weight: 600;
  line-height: var(--line-height-ui);
  border-radius: var(--radius);
}

.interface-shell .btn-secondary,
.interface-shell .btn-outline,
.interface-shell .btn-neutral {
  color: var(--color-secondary);
  background: var(--color-bg-surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.interface-shell .btn-secondary:hover,
.interface-shell .btn-outline:hover,
.interface-shell .btn-neutral:hover {
  color: var(--color-text);
  background: var(--color-bg-hover);
}

.interface-shell .btn-secondary:hover {
  color: var(--color-secondary-tint);
  background: var(--color-bg-hover);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.interface-shell :is(.field-input, .field-select, .field-textarea) {
  min-height: var(--interaction-height);
  padding-inline: var(--space-xs);
  font-size: var(--font-size-ui);
  border-color: var(--color-border);
  border-radius: var(--radius);
}

.interface-shell .field-textarea {
  min-height: 8rem;
  padding-block: var(--space-xxs);
  line-height: 1.6;
}

.interface-shell .field-label {
  font-weight: 500;
}

.interface-shell .field-help {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.interface-shell :is(.status-pill, .project-progress, .mgmt-tab-badge) {
  border-radius: var(--radius-small);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.interface-shell .status-pill {
  padding: var(--space-3xs) var(--space-xxs);
}

.interface-shell .card,
.interface-shell :is(.mgmt-form, .mgmt-table-wrap, .workspace-project-card, .workspace-overview-card, .mgmt-inline-card) {
  border-color: var(--color-border-light);
  border-radius: var(--radius);
  box-shadow: none;
}

.interface-shell .card-body {
  padding: var(--space-base);
}

.interface-shell .hero {
  background: var(--color-bg-surface);
  border-color: var(--color-border-light);
}

.interface-shell .list-card {
  border-color: var(--color-border-light);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
}

.interface-shell .list-item {
  padding-block: var(--space-xs);
}

/* Public projects use a compact explorer beside a quiet reading panel. */
.interface-shell .project-dossier-breadcrumb {
  font-size: 0.8125rem;
  margin-bottom: var(--space-xs);
}

.interface-shell .project-dossier-breadcrumb a {
  min-height: var(--interaction-height);
}

.interface-shell .project-dossier-header {
  border-radius: var(--radius);
  margin-bottom: var(--space-s);
  padding: var(--space-base);
}

.interface-shell .project-dossier-header .eyebrow {
  margin-bottom: var(--space-xxs);
}

.interface-shell .project-dossier-header h1 {
  margin-bottom: var(--space-xs);
}

.interface-shell .project-dossier-header .lead {
  max-width: 48rem;
}

.interface-shell .project-dossier-meta {
  margin-top: var(--space-xs);
  font-size: 0.8125rem;
}

.interface-shell .project-dossier-cover img {
  max-height: 10rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-small);
}

.interface-shell .project-dossier-sidebar {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
}

.interface-shell .project-dossier-nav {
  background: transparent;
  border: 0;
  padding: var(--space-xxs);
}

.interface-shell .project-dossier-nav__caption {
  padding: var(--space-xxs);
  font-size: 0.75rem;
  font-weight: 500;
}

.interface-shell .project-dossier-nav a {
  min-height: var(--interaction-height);
  padding: var(--space-xxs) var(--space-xs);
  border: 0;
  border-radius: var(--radius-small);
  font-size: var(--font-size-ui);
}

.interface-shell .project-dossier-nav a:hover {
  background: var(--color-bg-hover);
}

.interface-shell .project-dossier-nav a[aria-current="page"] {
  background: var(--color-bg-selected);
  box-shadow: inset 2px 0 var(--color-primary);
  font-weight: 600;
}

.interface-shell .project-dossier-nav__child a {
  padding-left: var(--space-base);
  font-size: 0.8125rem;
}

.interface-shell .project-dossier-dates {
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-xs) var(--space-s);
  font-size: 0.75rem;
}

.interface-shell .project-dossier-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xxs);
  padding: var(--space-xs) var(--space-s);
  margin-bottom: var(--space-s);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: var(--color-bg-surface);
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

.interface-shell .project-dossier-context__current {
  color: var(--color-text);
  font-weight: 500;
}

.interface-shell .project-dossier-question {
  border: 1px solid var(--color-border-light);
  border-left: 2px solid var(--color-primary);
  border-radius: var(--radius-small);
  background: var(--color-bg-subtle);
  padding: var(--space-s);
}

.interface-shell .project-dossier-question h3 {
  color: var(--color-text-light);
  font-size: 0.8125rem;
  font-weight: 500;
}

.interface-shell .project-dossier-contents a {
  padding-block: var(--space-xs);
}

.interface-shell .project-dossier-contents strong {
  font-weight: 500;
}

.interface-shell .project-dossier-contents a:hover {
  background: var(--color-bg-subtle);
}

.interface-shell .project-index-header {
  margin-bottom: var(--space-base);
}

.interface-shell .project-index-list > * + * {
  margin-top: var(--space-s);
}

.interface-shell .project-index-card {
  overflow: hidden;
}

.interface-shell .project-index-card h2 {
  font-size: 1.125rem;
}

.interface-shell .project-index-card h2 a {
  color: var(--color-text);
  text-decoration: none;
}

.interface-shell .project-index-card h2 a:hover {
  color: var(--color-primary);
}

.interface-shell .project-index-summary {
  font-size: var(--font-size-ui);
  line-height: 1.6;
  margin-top: var(--space-xs);
}

.interface-shell .project-index-latest {
  font-size: 0.8125rem;
}

/* Content management uses the same explorer, panel and control vocabulary. */
.interface-shell .page-main--workspace {
  padding-top: var(--space-s);
}

.interface-shell .mgmt-layout {
  gap: var(--space-base);
}

.interface-shell .mgmt-main {
  gap: var(--space-base);
}

.interface-shell .mgmt-nav {
  background: var(--color-bg-subtle);
  border-radius: var(--radius);
  padding-bottom: var(--space-xxs);
}

.interface-shell :is(.mgmt-nav-title, .mgmt-nav-group-label) {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border: 0;
  padding: var(--space-xs) var(--space-s) var(--space-3xs);
}

.interface-shell .mgmt-nav-title {
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
  padding-block: var(--space-xs);
  margin-bottom: var(--space-xxs);
}

.interface-shell .mgmt-nav-list {
  padding-inline: var(--space-xxs);
}

.interface-shell .mgmt-nav-subgroup {
  border: 0;
}

.interface-shell :is(.mgmt-nav-link, .mgmt-nav-subgroup-toggle) {
  min-height: var(--interaction-height);
  padding: var(--space-xxs) var(--space-xs);
  border: 0;
  border-radius: var(--radius-small);
  font-size: var(--font-size-ui);
  font-weight: 400;
}

.interface-shell :is(.mgmt-nav-link, .mgmt-nav-subgroup-toggle):hover {
  background: var(--color-bg-hover);
}

.interface-shell .mgmt-nav-sublist .mgmt-nav-link {
  padding-left: var(--space-base);
}

.interface-shell .mgmt-nav-link.is-active {
  background: var(--color-bg-selected);
  box-shadow: inset 2px 0 var(--color-primary);
  font-weight: 600;
}

.interface-shell .mgmt-workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xxs);
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: var(--space-xs);
  font-size: 0.8125rem;
}

.interface-shell .mgmt-workspace-bar__label {
  color: var(--color-text-light);
}

.interface-shell .mgmt-workspace-bar__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--interaction-height);
  color: var(--color-text-light);
}

.interface-shell .mgmt-page-header h1 {
  font-size: 1.5rem;
}

.interface-shell .mgmt-stat-grid {
  gap: var(--space-xs);
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
}

.interface-shell .mgmt-stat {
  padding: var(--space-s);
  border-radius: var(--radius);
}

.interface-shell .mgmt-stat-number {
  color: var(--color-text);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.interface-shell .mgmt-stat-label {
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.5;
}

.interface-shell .mgmt-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-base);
}

.interface-shell .mgmt-dashboard-panel {
  min-width: 0;
}

.interface-shell .mgmt-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.interface-shell .mgmt-table :is(th, td) {
  padding: var(--space-xxs) var(--space-xs);
  font-size: var(--font-size-ui);
}

.interface-shell .mgmt-table th {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  background: var(--color-bg-subtle);
  border-bottom-color: var(--color-border-light);
}

.interface-shell .mgmt-table tbody tr:hover td {
  background: var(--color-bg-subtle);
}

.interface-shell .mgmt-tabs {
  padding-inline: var(--space-xs);
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border-light);
}

.interface-shell .mgmt-tab {
  min-height: calc(var(--interaction-height) + var(--space-xxs));
  padding-inline: var(--space-xs);
  margin-bottom: -1px;
  font-size: var(--font-size-ui);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-light);
}

.interface-shell .mgmt-tab.is-active {
  background: var(--color-bg-surface);
  color: var(--color-primary);
}

.interface-shell .mgmt-tab-badge {
  background: var(--color-bg-surface);
  font-variant-numeric: tabular-nums;
}

.interface-shell .mgmt-form-section {
  gap: var(--space-s);
  padding: var(--space-base);
}

.interface-shell .mgmt-form-section-title {
  font-size: var(--font-size-ui);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text);
}

.interface-shell .mgmt-form-footer {
  padding: var(--space-xs) var(--space-base);
  background: var(--color-bg-subtle);
}

.interface-shell .mgmt-form-footer--sticky {
  box-shadow: none;
}

.interface-shell :is(.mgmt-inline-card, .workspace-overview-card, .workspace-project-card, .mgmt-media-card) {
  padding: var(--space-s);
  background: var(--color-bg-surface);
  border-radius: var(--radius);
}

.interface-shell :is(.workspace-section-head, .workspace-intro) h2 {
  font-size: var(--font-size-h2);
}

.interface-shell .layout-choice-card {
  padding: var(--space-s);
  border-width: 1px;
  border-radius: var(--radius);
  background: var(--color-bg-subtle);
}

.interface-shell .layout-choice-card.is-selected {
  background: var(--color-primary-alt-tint);
  border-color: var(--color-primary);
}

.interface-shell .kanban-column {
  border-radius: var(--radius);
  background: var(--color-bg-subtle);
}

.interface-shell .kanban-task {
  border-radius: var(--radius);
  box-shadow: none;
}

.interface-shell :is(.status-pill--on_hold, .status-pill--archived) {
  color: var(--color-warning-tint);
}

.interface-shell .EasyMDEContainer .editor-toolbar {
  padding: var(--space-3xs);
  background: var(--color-bg-subtle);
  border-radius: var(--radius) var(--radius) 0 0;
  border-color: var(--color-border);
}

.interface-shell .EasyMDEContainer .editor-toolbar button {
  min-width: var(--interaction-height);
  min-height: var(--interaction-height);
  width: auto;
  height: var(--interaction-height);
  border-radius: var(--radius-small);
}

.interface-shell .EasyMDEContainer .CodeMirror {
  border-color: var(--color-border);
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-reading);
}

/* Image dialogs share the same controls and panel tokens as the CMS. */
.editor-image-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-s);
  background: var(--color-overlay);
}

.editor-image-dialog {
  width: 30rem;
  max-width: 100%;
  max-height: calc(100dvh - var(--space-xl));
  overflow-y: auto;
  padding: var(--space-base);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-overlay);
}

.editor-image-dialog h3 {
  margin-bottom: var(--space-s);
}

.editor-image-stack {
  display: grid;
  gap: var(--space-s);
}

.editor-image-row,
.editor-image-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-xxs);
}

.editor-image-row > .field-group {
  flex: 1 1 12rem;
  min-width: 0;
}

.editor-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
}

.editor-image-actions {
  justify-content: flex-end;
}

.editor-image-preview {
  min-height: var(--interaction-height);
  text-align: center;
}

.editor-image-preview-image {
  max-height: 10rem;
  max-width: 100%;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-small);
}

.editor-image-note {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

.editor-image-note--error {
  color: var(--color-danger);
}

@media (min-width: 45rem) {
  .interface-shell .project-dossier-layout {
    grid-template-columns: 12rem minmax(0, 1fr);
  }

  .interface-shell .project-dossier-main {
    margin-left: var(--space-s);
  }

  .interface-shell .project-dossier-sidebar {
    max-height: calc(100dvh - var(--app-bar-height) - var(--space-xl));
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .interface-shell .project-index-card--with-cover {
    grid-template-columns: 12rem minmax(0, 1fr);
  }

  .interface-shell .project-index-image img {
    max-height: 15rem;
    min-height: 100%;
  }

  .interface-shell .mgmt-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 62rem) {
  .interface-shell .app-bar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .interface-shell .mgmt-layout {
    grid-template-columns: 13rem minmax(0, 1fr);
  }

  .interface-shell .mgmt-nav {
    top: calc(var(--app-bar-height) + var(--space-s));
    max-height: calc(100dvh - var(--app-bar-height) - var(--space-xl));
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .interface-shell .project-dossier-header--with-cover {
    grid-template-columns: minmax(0, 1fr) 13rem;
  }
}

@media (max-width: 45rem) {
  .interface-shell .project-dossier-header,
  .interface-shell .card-body,
  .interface-shell .mgmt-form-section {
    padding: var(--space-s);
  }

  .interface-shell .mgmt-stat-grid--workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-image-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (pointer: coarse) {
  :root {
    --interaction-height: var(--interaction-height-touch);
  }

  .interface-shell :is(.field-input, .field-select, .field-textarea) {
    font-size: 1rem;
  }

  .interface-shell .field-bool {
    min-height: var(--interaction-height);
  }

  .interface-shell .field-bool label {
    display: inline-flex;
    align-items: center;
    min-height: var(--interaction-height);
  }

  .interface-shell .mgmt-action-link {
    display: inline-flex;
    align-items: center;
    min-height: var(--interaction-height);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition: 0ms;
  }
}
