:root {
  color-scheme: light;
  --bg: #f1f5f9;
  --bg-blur-strong: rgba(241, 245, 249, 0.92);
  --bg-blur-soft: rgba(241, 245, 249, 0.75);
  --sticky-top-offset: 104px;
  --sidebar-width: clamp(280px, 22vw, 320px);
  --sidebar-pad-inline: 22px;
  --page-pad: 32px;

  --motion-fast: 140ms;
  --motion-base: 200ms;

  --panel: #ffffff;
  --panel-blur: rgba(255, 255, 255, 0.78);
  --panel-strong: #ffffff;
  --panel-alt: #f8fafc;

  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --text: #0f172a;
  --muted: #475569;

  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --accent-soft: #e0f2fe;

  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-bg: #fee2e2;

  --warn: #d97706;
  --warn-soft: #fef3c7;
  --warn-bg: #fde68a;

  --success: #047857;
  --success-soft: #ecfdf5;
  --success-bg: #d1fae5;

  --info: #1d4ed8;
  --info-soft: #eff6ff;
  --info-bg: #dbeafe;

  --overlay: rgba(15, 23, 42, 0.4);

  --radius-xl: 18px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 10px 18px -10px rgb(15 23 42 / 0.18), 0 4px 10px -8px rgb(15 23 42 / 0.12);
  --shadow-lg: 0 30px 70px -24px rgb(15 23 42 / 0.35);
  --shadow: var(--shadow-md);
  --shadow-soft: var(--shadow-sm);
}

#legacyCompat {
  display: none !important;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-blur-strong: rgba(15, 23, 42, 0.92);
  --bg-blur-soft: rgba(15, 23, 42, 0.75);

  --panel: #1e293b;
  --panel-blur: rgba(30, 41, 59, 0.72);
  --panel-strong: #1e293b;
  --panel-alt: #0f172a;

  --line: #334155;
  --line-strong: #475569;

  --text: #f8fafc;
  --muted: #94a3b8;

  --accent: #0ea5e9;
  --accent-strong: #38bdf8;
  --accent-soft: rgba(14, 165, 233, 0.15);

  --danger: #fca5a5;
  --danger-soft: rgba(185, 28, 28, 0.15);
  --danger-bg: rgba(185, 28, 28, 0.3);

  --warn: #fcd34d;
  --warn-soft: rgba(217, 119, 6, 0.15);
  --warn-bg: rgba(217, 119, 6, 0.3);

  --success: #6ee7b7;
  --success-soft: rgba(4, 120, 87, 0.15);
  --success-bg: rgba(4, 120, 87, 0.3);

  --info: #93c5fd;
  --info-soft: rgba(29, 78, 216, 0.18);
  --info-bg: rgba(29, 78, 216, 0.3);

  --overlay: rgba(0, 0, 0, 0.8);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.65);
  --shadow: var(--shadow-md);
  --shadow-soft: var(--shadow-sm);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  font-family: 'Inter', 'Avenir Next', 'IBM Plex Sans', 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}



button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

a {
  color: inherit;
}

:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

body.sidebar-collapsed {
  --sidebar-width: clamp(72px, 6vw, 88px);
  --sidebar-pad-inline: 12px;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  transition: grid-template-columns var(--motion-base) ease;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px var(--sidebar-pad-inline);
  border-right: 1px solid var(--line);
  background: var(--panel-blur);
  backdrop-filter: blur(18px);
  z-index: 3;
  transition: padding var(--motion-base) ease, transform 180ms ease;
}

.brand-toggle {
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  text-align: left;
  transition: padding var(--motion-base) ease, background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
  white-space: nowrap;
}



.brand-copy h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.brand-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease,
    border-color var(--motion-fast) ease, transform var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
  white-space: nowrap;
}

.nav button:hover,
.nav button.active {
  color: var(--text);
  border-color: var(--accent-strong);
  background: var(--panel-alt);
  transform: translateX(4px);
}

.nav button.active {
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

.sidebar-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.content-shell {
  position: relative;
  min-width: 0;
}

#workspaceMain {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

#workspaceMain[inert] {
  pointer-events: none;
  user-select: none;
}

.sidebar-backdrop {
  display: none;
}

.mobile-topbar {
  display: none;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 18px var(--page-pad) 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

.page-header-main {
  flex: 1 1 420px;
  min-width: 0;
}

.page-header-copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.page-header-menu {
  display: none;
  margin-top: 2px;
  box-shadow: none;
}

.page-header-tools {
  flex: 1 1 440px;
  display: grid;
  gap: 12px;
  justify-items: end;
  min-width: 0;
}

.page-search-slot {
  width: min(100%, 460px);
}

.page-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.page-search:focus-within {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.page-search-icon,
.page-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: 0 0 auto;
}

.page-search-input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.page-search-input::-webkit-search-cancel-button {
  display: none;
}

.page-search-clear {
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
}

.page-search-clear:hover {
  color: var(--text);
}

.page-search-clear[hidden] {
  display: none;
}

.page-search-clear svg {
  width: 18px;
  height: 18px;
}

.page-kicker {
  color: var(--accent-strong);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.page-header h2 {
  margin: 8px 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.page-subtitle {
  margin-top: 10px;
  color: var(--muted);
  max-width: 760px;
}

.topbar-actions {
  width: 100%;
}

.header-action-groups {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.header-primary-actions,
.header-utility-actions {
  justify-content: flex-end;
}

.header-utility-actions {
  row-gap: 8px;
}

.header-primary-actions:empty,
.header-utility-actions:empty,
.topbar-actions:empty {
  display: none;
}

.content {
  padding: 0 var(--page-pad) 34px;
  min-width: 0;
  overflow-x: clip;
}

#viewRoot {
  min-width: 0;
}

.message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.message-text {
  min-width: 0;
}

.message-dismiss {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-weight: 700;
}

.message[data-variant="error"] {
  color: var(--danger);
  border-color: var(--danger-soft);
  background: var(--danger-bg);
}

.message[data-variant="success"] {
  color: var(--success);
  border-color: var(--success-soft);
  background: var(--success-bg);
}

.message[data-variant="info"] {
  color: var(--accent-strong);
  border-color: var(--info-soft);
  background: var(--info-bg);
}

.view-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: start;
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 20px 0;
}

.card-header h3 {
  margin: 0;
  font-size: 1.04rem;
}

.card-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-body {
  padding: 18px 20px 20px;
}

.stack {
  display: grid;
  gap: 12px;
}

.list-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease,
    transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.list-item:hover,
.list-item.active {
  border-color: var(--accent-soft);
  background: var(--panel-strong);
  transform: translateY(-1px);
}

.list-item button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: block;
  width: 100%;
  text-align: inherit;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.item-title {
  font-weight: 700;
}

.item-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.summary-bar {
  position: static;
  display: grid;
  gap: 12px;
  padding: 16px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--accent-soft), var(--panel), var(--panel));
  border: 1px solid var(--accent-soft);
  box-shadow: var(--shadow-soft);
}

.detail-header {
  position: static;
  display: grid;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, var(--accent-soft), var(--panel), var(--panel));
  border: 1px solid var(--accent-soft);
  box-shadow: var(--shadow-soft);
}

.detail-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.detail-header-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.detail-header-copy .page-subtitle {
  max-width: none;
}

.detail-header-title {
  margin: 6px 0 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.detail-header-side {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex: 0 0 auto;
  max-width: 100%;
}

.detail-header-badges,
.detail-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-cell {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-alt);
}

.summary-label {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-value {
  margin-top: 5px;
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.chip.success {
  color: var(--success);
  background: var(--success-soft);
}

.chip.warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.chip.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.chip.neutral {
  color: var(--muted);
  background: var(--line);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font: inherit;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease,
    border-color var(--motion-fast) ease, transform var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

.btn:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--panel-strong);
  color: var(--text);
  border-color: var(--line);
}

.btn.secondary:hover {
  background: var(--panel);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.btn.ghost:hover {
  color: var(--text);
  background: var(--panel-alt);
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  background: var(--danger);
}

.btn.small {
  padding: 8px 11px;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-with-icon {
  white-space: nowrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-label {
  min-width: 0;
}

.utility-button {
  min-height: 46px;
}

.theme-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow-soft);
}

.theme-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease,
    border-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.theme-option:hover {
  color: var(--text);
  background: var(--panel);
  transform: translateY(-1px);
}

.theme-option.active {
  color: var(--text);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}

.theme-option:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  aspect-ratio: 1;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.toolbar-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.panel-grid {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.section-block {
  padding: 16px;
  border-radius: 16px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.section-block h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.mini-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.passport-metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.passport-brief {
  margin-bottom: 18px;
  background: linear-gradient(160deg, var(--panel), var(--panel-alt), var(--accent-soft));
}

.metric {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-alt);
}

.passport-metric {
  border: 1px solid var(--line);
  background: var(--panel);
}

.metric strong {
  display: block;
  font-size: 1.1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.label {
  color: var(--muted);
  font-size: 0.86rem;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.toggle input {
  margin: 0;
}

.empty-state {
  padding: 28px 22px;
  border-radius: 22px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: var(--panel-alt);
  text-align: center;
}

.empty-state-title {
  color: var(--text);
  font-weight: 700;
}

.search-empty-state {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.search-empty-actions {
  justify-content: center;
}

.dialog {
  width: min(840px, calc(100vw - 24px));
  max-height: calc(100vh - 36px);
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  padding: 0;
  background: var(--panel-strong);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(3px);
}

.dialog-header,
.dialog-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.dialog-body {
  padding: 20px;
  overflow: auto;
  max-height: calc(100vh - 210px);
}

.dialog-title {
  margin: 0;
  font-size: 1.1rem;
}

.dialog-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(7px);
  z-index: 10;
}

.auth-card {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 28px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-lg);
}

.auth-card h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.8rem;
}

.auth-card p {
  color: var(--muted);
}

.auth-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-status[data-variant="error"] {
  color: var(--danger);
}

.detail-columns {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.requirement-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-blur);
}

.stack.compact {
  gap: 8px;
}

.item-meta.tight {
  margin-top: 4px;
}

.inbox-layout {
  display: grid;
  gap: 18px;
  align-items: start;
  min-width: 0;
  grid-template-columns: minmax(320px, 1.2fr) minmax(0, 1.8fr);
}

.inbox-layout>* {
  min-width: 0;
}

.inbox-list .card-header {
  flex-direction: column;
  align-items: flex-start;
}

.inbox-list {
  min-width: 300px;
}

.inbox-summary-bar {
  gap: 14px;
  position: static;
  top: auto;
}

.summary-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.summary-head> :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.summary-title {
  margin: 6px 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.summary-head-meta {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex: 0 0 auto;
  max-width: 100%;
}

.summary-head-meta .toolbar-line {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 8px;
}

.request-headline-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.segmented-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 650;
  line-height: 1.2;
  transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease,
    border-color var(--motion-fast) ease, transform var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
  white-space: nowrap;
}

.segmented-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.segmented-btn.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgb(2 132 199 / 0.16);
}

.queue-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.queue-item-main {
  min-width: 0;
  flex: 1 1 auto;
}

.queue-item-status {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.inbox-list .item-row {
  align-items: flex-start;
}

.inbox-list .item-title {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.inbox-list .item-meta {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.percent-pill {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
}

.attention-banner {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
}

.attention-banner.success {
  border-color: var(--success-soft);
  background: var(--success-soft);
}

.attention-banner.warn {
  border-color: var(--warn-soft);
  background: var(--warn-soft);
}

.attention-banner.danger {
  border-color: var(--danger-soft);
  background: var(--danger-soft);
}

.attention-banner.info {
  border-color: var(--info-soft);
  background: var(--info-soft);
}

.coverage-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.coverage-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.coverage-value {
  margin-top: 8px;
  font-size: 1.18rem;
  font-weight: 700;
}

.inbox-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.inbox-detail-content {
  display: grid;
  gap: 18px;
  min-width: 0;
  width: 100%;
}

.inbox-detail-main {
  display: grid;
  gap: 18px;
}

.inbox-detail-main>* {
  min-width: 0;
}

.inbox-detail-main .requirements-table {
  max-width: 100%;
  overflow-x: auto;
}

.inbox-detail-followup {
  min-width: 0;
  width: 100%;
}

.inbox-detail .package-summary-block,
.inbox-detail-followup .package-summary-block {
  position: static;
  top: auto;
  width: 100%;
  max-width: 100%;
  z-index: auto;
}

@media (max-width: 1279px) {
  .inbox-layout {
    grid-template-columns: minmax(280px, 1.2fr) minmax(0, 1.8fr);
  }
}

.compact-block {
  padding: 14px;
}

.section-header-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.section-label {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.requirements-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  background: var(--panel);
}

.requirements-table-head,
.requirements-table-row {
  display: grid;
  grid-template-columns: minmax(112px, 132px) 1fr minmax(110px, 128px) minmax(190px, 1fr) minmax(170px, 0.92fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  width: max-content;
  min-width: 100%;
}

.panel-grid>*,
.detail-columns>*,
.mini-grid>*,
.summary-grid>*,
.coverage-grid>*,
.requirements-table-head>*,
.requirements-table-row>*,
.section-block>* {
  min-width: 0;
  max-width: 100%;
}

.requirements-table-head {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
  background: var(--panel-alt);
}

.requirements-table-row+.requirements-table-row {
  border-top: 1px solid var(--line);
}

.table-cell-strong {
  font-weight: 700;
}

.package-summary-block {
  position: sticky;
  top: var(--sticky-top-offset);
}

@media (min-width: 768px) {
  body.sidebar-collapsed .sidebar {
    overflow-x: hidden;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .sidebar-footer,
  body.sidebar-collapsed .nav-label {
    display: none;
  }

  body.sidebar-collapsed .nav button,
  body.sidebar-collapsed .brand-toggle {
    padding: 14px;
  }

  body.sidebar-collapsed .nav button {
    justify-content: center;
  }
}

.package-section+.package-section {
  margin-top: 16px;
}

.package-line {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.empty-inline {
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: var(--panel);
}

.mono {
  font-family: "IBM Plex Mono", "Cascadia Code", monospace;
  font-size: 0.88rem;
  word-wrap: break-word;
  word-break: break-all;
  white-space: pre-wrap;
}

@media (max-width: 1120px) {

  .view-grid,
  .detail-columns,
  .inbox-detail-content,
  .summary-grid,
  .coverage-grid,
  .mini-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .summary-bar {
    position: static;
  }

  .detail-header {
    position: static;
  }

  .package-summary-block {
    position: static;
  }

  .summary-head {
    align-items: stretch;
  }

  .summary-head-meta {
    justify-items: stretch;
  }

  .summary-head,
  .section-header-line {
    flex-direction: column;
  }

  .detail-header-top {
    flex-direction: column;
  }

  .detail-header-side {
    justify-items: stretch;
  }

  .detail-header-badges,
  .detail-header-actions {
    justify-content: flex-start;
  }

  .requirements-table-head {
    display: none;
  }

  .requirements-table-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  :root {
    --page-pad: 24px;
  }

  body.sidebar-expanded {
    --sidebar-width: clamp(228px, 24vw, 272px);
  }

  .page-header-tools {
    flex-basis: 100%;
    justify-items: stretch;
  }

  .page-search-slot {
    width: 100%;
  }

  .header-action-groups {
    justify-content: flex-start;
  }
}

@media (max-width: 1023px) {
  :root {
    --page-pad: 20px;
  }

  body.sidebar-expanded {
    --sidebar-width: clamp(208px, 24vw, 244px);
  }

  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .inbox-list {
    min-width: 0;
  }
}

@media (max-width: 940px) {
  .utility-button,
  .theme-option {
    min-width: 46px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .utility-button .btn-label,
  .theme-option .btn-label {
    display: none;
  }
}

@media (min-width: 1024px) and (max-width: 1120px) {
  .inbox-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  :root {
    --page-pad: 18px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 320px);
    max-width: 320px;
    min-height: 100dvh;
    border-right: 1px solid var(--line);
    box-shadow: 0 18px 48px rgb(15 23 42 / 0.2);
    transform: translateX(-104%);
    z-index: 30;
  }

  body.sidebar-mobile-open .sidebar {
    transform: translateX(0);
  }

  .content-shell {
    min-height: 100dvh;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgb(15 23 42 / 0.35);
    z-index: 25;
  }

  body.sidebar-mobile-open .sidebar-backdrop {
    display: block;
  }

  body.sidebar-mobile-open {
    overflow: hidden;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .mobile-topbar-title {
    min-width: 0;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-header {
    position: static;
    border-bottom: 0;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .page-header-menu {
    display: inline-flex;
  }

  .page-header-main,
  .page-header-tools {
    flex: 1 1 100%;
  }

  .page-header-tools {
    justify-items: stretch;
  }

  .page-search-slot {
    width: 100%;
  }

  .header-action-groups,
  .header-primary-actions,
  .header-utility-actions {
    justify-content: flex-start;
  }

  .header-primary-actions,
  .header-utility-actions {
    width: 100%;
  }

  .theme-control {
    width: 100%;
    justify-content: flex-start;
  }

  .card-header,
  .card-body,
  .dialog-header,
  .dialog-body,
  .dialog-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
