:root {
  --bg: #f5f1e7;
  --bg-alt: #eef4f1;
  --shell: #103744;
  --shell-2: #18505f;
  --shell-3: #2d6a76;
  --gold: #d6b15a;
  --gold-strong: #c59a32;
  --gold-soft: #f3e2ab;
  --gold-deep: #c59a32;
  --gold-text: #76520d;
  --text: #17303e;
  --muted: #526b78;
  --muted-strong: #526b78;
  --line: rgba(20, 52, 63, 0.12);
  --border-soft: rgba(16, 55, 68, 0.10);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-soft: #f3f7f6;
  --surface-tint: rgba(16, 55, 68, 0.05);
  --success: #2f7c61;
  --warn: #765514;
  --danger: #b14848;
  --shadow-sm: 0 12px 24px rgba(15, 43, 54, 0.08);
  --shadow: 0 22px 50px rgba(15, 43, 54, 0.12);
  --shadow-lg: 0 36px 80px rgba(15, 43, 54, 0.16);
  --radius-2xl: 34px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --content-max: 1240px;
  --workspace-max: 1440px;
  --measure: 65ch;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --motion-fast: 140ms;
  --motion-standard: 220ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --focus-ring: #8a5d0a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 177, 90, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(24, 80, 95, 0.12), transparent 32%),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
  color: var(--text);
  line-height: 1.6;
}

h1,
h2,
h3,
.brand-name,
.topbar-title,
.primary-btn,
.secondary-btn,
.ghost-btn,
.nav-item {
  font-family: "Segoe UI Variable Display", "Avenir Next", "Segoe UI", sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background:
    radial-gradient(circle at 10% 15%, rgba(214, 177, 90, 0.08), transparent 24%),
    linear-gradient(180deg, #eff4f3, #f7f3e9 55%, #eef4f1);
}

.app-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(215, 180, 91, 0.18), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(29, 84, 100, 0.2), transparent 30%),
    linear-gradient(140deg, #f9faf8, #eef3f6);
}

.login-screen.is-hidden {
  display: none;
}

.login-card {
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 26px 70px rgba(16, 37, 49, 0.14);
}

.login-logo {
  width: 190px;
  display: block;
  margin-bottom: 22px;
}

.login-card h1 {
  margin: 8px 0 10px;
  font-size: 42px;
}

.login-copy {
  color: var(--muted);
  line-height: 1.55;
}

.login-error {
  margin-top: 14px;
  color: var(--danger);
  font-weight: 700;
}

.login-legal-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.login-legal-note a,
.dialog-legal-note a,
.dialog-legal-links a,
.public-legal-links a {
  color: var(--shell);
  font-weight: 700;
  text-decoration: none;
}

.login-legal-note a:hover,
.login-legal-note a:focus-visible,
.dialog-legal-note a:hover,
.dialog-legal-note a:focus-visible,
.dialog-legal-links a:hover,
.dialog-legal-links a:focus-visible,
.public-legal-links a:hover,
.public-legal-links a:focus-visible {
  color: var(--gold-strong);
}

.login-secondary-actions {
  margin-top: 12px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--shell);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.text-btn:hover,
.text-btn:focus-visible {
  outline: none;
  color: var(--gold-strong);
}

.full-width {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
}

.compact-btn {
  min-height: 40px;
  padding: 0 14px;
}

.pending-assignment-banner {
  margin: 18px 0 4px;
  border: 1px solid rgba(197, 154, 50, 0.28);
  background: rgba(243, 226, 171, 0.28);
  color: var(--shell);
}

.signup-dialog-card {
  max-width: 580px;
}

.signup-step {
  display: grid;
  gap: 14px;
}

.dialog-legal-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(16, 55, 68, 0.1);
  background: rgba(16, 55, 68, 0.04);
  color: var(--text);
  line-height: 1.6;
}

.consent-check input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.consent-check a {
  color: var(--shell);
  font-weight: 700;
  text-decoration: none;
}

.consent-check a:hover,
.consent-check a:focus-visible {
  color: var(--gold-strong);
}

.dialog-legal-links {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(16, 55, 68, 0.08);
  color: var(--muted);
  font-size: 13px;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  min-height: 44px;
  padding: 5px 14px 5px 7px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(16, 55, 68, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.user-menu-trigger:hover,
.user-menu-trigger:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(197, 154, 50, 0.34);
  box-shadow: 0 18px 32px rgba(15, 43, 54, 0.12);
  outline: none;
}

.user-menu.is-open .user-menu-trigger {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(197, 154, 50, 0.34);
}

.user-avatar {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: #17313f;
  font-weight: 800;
  font-size: 13px;
  flex: 0 0 auto;
}

.user-badge {
  color: var(--text);
  display: grid;
  gap: 2px;
  text-align: left;
  min-width: 0;
  max-width: 240px;
}

.user-badge-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-badge strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.15;
}

.user-badge-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-plan-pill {
  margin-top: 0;
  flex: 0 0 auto;
}

.user-menu-caret {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.18s ease;
}

.user-menu.is-open .user-menu-caret {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  padding: 10px;
  display: grid;
  gap: 6px;
  border-radius: 24px;
  border: 1px solid rgba(16, 55, 68, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  z-index: 12;
}

.profile-billing-summary:empty {
  display: none;
}

.profile-billing-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(16, 55, 68, 0.04);
  border: 1px solid rgba(16, 55, 68, 0.08);
  display: grid;
  gap: 12px;
}

.profile-billing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-billing-head strong {
  font-size: 14px;
  color: var(--shell);
}

.profile-billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.profile-billing-grid div {
  display: grid;
  gap: 2px;
}

.profile-billing-grid span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.profile-billing-grid strong {
  color: var(--text);
  font-size: 13px;
}

.profile-billing-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.billing-inline-alert {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.billing-inline-alert strong {
  font-size: 12px;
  color: var(--shell);
}

.billing-inline-alert span {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.billing-inline-alert.neutral {
  background: rgba(16, 55, 68, 0.05);
  border-color: rgba(16, 55, 68, 0.08);
}

.billing-inline-alert.warn {
  background: rgba(179, 127, 33, 0.08);
  border-color: rgba(179, 127, 33, 0.16);
}

.billing-inline-alert.error {
  background: rgba(177, 72, 72, 0.08);
  border-color: rgba(177, 72, 72, 0.16);
}

.user-menu-item {
  min-height: 48px;
  width: 100%;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.user-menu-item:hover,
.user-menu-item:focus-visible,
.user-menu-item.is-active {
  outline: none;
  background: rgba(16, 55, 68, 0.06);
  border-color: rgba(16, 55, 68, 0.08);
}

.user-menu-item.is-active {
  background: rgba(214, 177, 90, 0.16);
  border-color: rgba(197, 154, 50, 0.24);
  color: var(--shell);
}

.user-menu-item-danger {
  color: var(--danger);
}

.user-menu-item-danger:hover,
.user-menu-item-danger:focus-visible {
  background: rgba(177, 72, 72, 0.08);
  border-color: rgba(177, 72, 72, 0.12);
}

.settings-stack {
  display: grid;
  gap: 18px;
}

.settings-card {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.settings-card--single {
  width: 100%;
}

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-section-head h3 {
  margin: 6px 0 0;
}

.settings-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.settings-action-row {
  margin-top: 4px;
}

.settings-action-btn {
  min-width: 180px;
  min-height: 46px;
  justify-content: center;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: var(--text);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.admin-primary-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-tab {
  border: 1px solid rgba(16, 55, 68, 0.12);
  background: #f4f7f8;
  color: var(--shell);
  text-align: center;
  padding: 12px 18px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-tab:hover,
.admin-tab:focus-visible {
  outline: none;
  background: #fff;
  border-color: rgba(16, 55, 68, 0.2);
}

.admin-tab.is-active {
  background: linear-gradient(135deg, rgba(214, 177, 90, 0.28), rgba(214, 177, 90, 0.16));
  border-color: rgba(214, 177, 90, 0.42);
  color: var(--shell);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.admin-toolbar-card,
.admin-panel,
.admin-detail-panel,
.admin-metric-card,
.admin-detail-page {
  border: 1px solid rgba(16, 55, 68, 0.12);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 43, 54, 0.08);
}

.admin-toolbar-card,
.admin-panel,
.admin-detail-panel,
.admin-detail-page {
  padding: 18px 20px;
  min-width: 0;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
}

.admin-filter {
  display: grid;
  gap: 8px;
}

.admin-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-filter input,
.admin-filter select {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(16, 55, 68, 0.14);
  border-radius: 16px;
  background: #f8fafb;
  padding: 12px 14px;
  color: var(--text);
  box-shadow: none;
}

.admin-filter select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--shell) 50%),
    linear-gradient(135deg, var(--shell) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.admin-metric-card {
  padding: 18px 20px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.admin-metric-card:hover,
.admin-metric-card:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(16, 55, 68, 0.22);
  box-shadow: 0 18px 42px rgba(15, 43, 54, 0.12);
}

.admin-metric-card.is-active {
  background: linear-gradient(135deg, rgba(214, 177, 90, 0.18), rgba(214, 177, 90, 0.08));
  border-color: rgba(214, 177, 90, 0.44);
}

.admin-metric-card strong {
  display: block;
  font-size: 36px;
  line-height: 1;
  color: var(--shell);
}

.admin-metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.role-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.role-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 55, 68, 0.025), rgba(255, 255, 255, 0.98));
  cursor: pointer;
}

.role-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.role-option-title {
  color: var(--shell);
  font-weight: 800;
  line-height: 1.25;
}

.role-option-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.role-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  justify-self: end;
}

.role-option:has(input:checked) {
  border-color: rgba(214, 177, 90, 0.44);
  background: linear-gradient(135deg, rgba(214, 177, 90, 0.14), rgba(255, 255, 255, 0.98));
}

.role-option:has(input:disabled) {
  opacity: 0.68;
  cursor: not-allowed;
}

.field-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-checkbox span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.admin-inline-stats {
  margin: 16px 0;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--shell);
  padding: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--gold-deep);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.admin-row {
  cursor: pointer;
  transition: background 0.18s ease;
}

.admin-row:hover {
  background: rgba(16, 55, 68, 0.035);
}

.admin-row.is-selected {
  background: rgba(214, 177, 90, 0.14);
}

.admin-row:focus-within {
  outline: 2px solid rgba(214, 177, 90, 0.28);
  outline-offset: -2px;
}

.admin-panel .empty-state {
  padding: 12px 0 2px;
}

.admin-detail-panel {
  position: sticky;
  top: 22px;
  min-height: 280px;
  max-width: 100%;
  overflow: hidden;
  display: none;
}

.admin-detail-panel.empty-state {
  color: var(--muted);
  display: flex;
  align-items: center;
}

.admin-detail-page {
  display: grid;
  gap: 18px;
}

.admin-detail-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}

.admin-back-btn {
  min-height: 42px;
  padding: 0 16px;
}

.admin-detail-page-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-detail-page-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.admin-detail-page-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.admin-detail-page-intro,
.admin-detail-copy {
  color: var(--muted);
  line-height: 1.7;
}

.admin-detail-page-intro {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(16, 55, 68, 0.04);
}

.admin-detail-page-intro strong {
  color: var(--shell);
  font-size: 14px;
}

.admin-detail-page-intro p,
.admin-detail-copy {
  margin: 0;
}

.admin-detail-page-sections {
  display: grid;
  gap: 18px;
}

.admin-detail-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(16, 55, 68, 0.025), rgba(255, 255, 255, 0.98));
}

.admin-detail-section .admin-section-title {
  margin: 0;
}

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

.admin-detail-header h3 {
  margin: 0;
}

.admin-detail-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.admin-section-title {
  margin: 18px 0 10px;
  color: var(--shell);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-role-grid {
  display: grid;
  gap: 10px;
}

.admin-primary-action {
  min-width: 170px;
}

.admin-danger-btn {
  border-color: rgba(177, 72, 72, 0.16);
  color: var(--danger);
}

.admin-danger-btn:hover,
.admin-danger-btn:focus-visible {
  background: rgba(177, 72, 72, 0.08);
  border-color: rgba(177, 72, 72, 0.22);
}

.admin-ghost-btn {
  background: #f7f9fa;
}

.admin-toolbar .is-hidden {
  display: none;
}

@media (max-width: 1180px) {
  .admin-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .email-theme-preview-grid { grid-template-columns: 1fr; }
  .admin-toolbar {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(214, 177, 90, 0.18), transparent 26%),
    linear-gradient(180deg, #103744, #174d5c 62%, #123f4c 100%);
  color: #fff;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 154px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  filter: drop-shadow(0 10px 18px rgba(7, 22, 29, 0.18));
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: radial-gradient(circle at 35% 35%, #f2d178, var(--gold-deep));
  color: #173f4d;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar-cta {
  background: var(--gold);
  color: #214251;
  border: 0;
  border-radius: 14px;
  min-height: 46px;
  font-weight: 700;
  cursor: pointer;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-item {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.88);
  text-align: left;
  padding: 12px 13px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-item[disabled],
.nav-item.is-disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.nav-item[disabled]:hover,
.nav-item.is-disabled:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(214, 177, 90, 0.22), rgba(255, 255, 255, 0.1));
  color: #fff;
  border-color: rgba(214, 177, 90, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.templates-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin: 22px 0 14px;
}

.template-catalog-summary {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.template-catalog-preview-status {
  min-height: 20px;
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.template-catalog-preview-status.is-visible {
  opacity: 1;
}

.template-catalog-preview-status.is-visible::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 7px;
  border: 2px solid rgba(57, 91, 99, 0.22);
  border-top-color: var(--teal, #395b63);
  border-radius: 50%;
  vertical-align: -1px;
  animation: template-preview-spin 0.8s linear infinite;
}

.templates-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  align-items: start;
  gap: 20px;
}

.template-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 16px;
}

.template-catalog-empty {
  grid-column: 1 / -1;
}

.template-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 34px rgba(16, 55, 68, 0.08);
  display: flex;
  flex-direction: column;
}

.template-card.is-coming-soon {
  background: rgba(247, 249, 250, 0.94);
}

.template-card-preview {
  display: block;
  width: 100%;
  min-height: 218px;
  padding: 0;
  border: 0;
  background: #e9eeee;
  cursor: pointer;
  overflow: hidden;
}

.template-card-preview:focus-visible,
.template-detail-drawer button:focus-visible {
  outline: 3px solid rgba(197, 154, 50, 0.55);
  outline-offset: -3px;
}

.template-preview-image {
  width: 100%;
  height: 100%;
  min-height: 218px;
  display: block;
  object-fit: cover;
  object-position: top;
  transition: transform 0.2s ease;
}

.template-card-preview:hover .template-preview-image {
  transform: scale(1.025);
}

body.template-viewer-page {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #eef4f3 0%, #f8f4eb 100%);
}

.template-viewer-shell {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.template-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.template-viewer-header h1,
.template-viewer-header p {
  margin: 0;
}

.template-viewer-header h1 {
  color: var(--shell);
  font-size: clamp(23px, 3vw, 32px);
  line-height: 1.16;
}

.template-viewer-header .secondary-btn {
  min-width: 150px;
  padding-inline: 18px;
  white-space: nowrap;
  font-size: 13px;
}

.artifact-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.template-viewer-meta {
  margin-top: 8px !important;
  color: var(--muted);
}

.template-viewer-card {
  min-height: 620px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #e7ecec;
  box-shadow: 0 18px 40px rgba(16, 55, 68, 0.12);
}

.template-viewer-loading {
  min-height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.template-viewer-protection-note {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--shell);
  background: rgba(214, 177, 90, 0.16);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.template-viewer-pages {
  display: grid;
  gap: 22px;
  padding: 22px;
  user-select: none;
  -webkit-user-select: none;
}

.template-viewer-page {
  width: min(100%, 760px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(16, 55, 68, 0.13);
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 55, 68, 0.12);
}

.template-viewer-page-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.template-viewer-page figcaption {
  padding: 8px 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

@media print {
  .template-viewer-shell { display: none !important; }
  .template-viewer-page::after { content: none !important; }
}

@media (max-width: 680px) {
  .template-viewer-shell {
    width: min(100% - 24px, 860px);
    padding: 14px 0 20px;
  }

  .template-viewer-header {
    flex-direction: column;
    gap: 10px;
  }

  .template-viewer-header h1 {
    font-size: 24px;
  }

  .template-viewer-header .secondary-btn {
    min-width: 0;
  }

  .artifact-viewer-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .template-viewer-card {
    min-height: 520px;
    border-radius: 16px;
  }

  .template-viewer-loading {
    min-height: 520px;
  }

  .template-viewer-pages {
    gap: 14px;
    padding: 12px;
  }
}

.template-preview-placeholder {
  min-height: 218px;
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 8px;
  text-align: left;
  color: var(--muted);
  background: linear-gradient(145deg, rgba(16, 55, 68, 0.08), rgba(214, 177, 90, 0.12));
}

.template-preview-placeholder span {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.template-preview-placeholder strong {
  color: var(--shell);
  font-size: 18px;
}

.template-card-body {
  padding: 17px;
  display: grid;
  gap: 12px;
  height: 100%;
}

.template-card-body h3,
.template-card-body p,
.template-detail-drawer h2,
.template-detail-drawer h3,
.template-detail-drawer p {
  margin: 0;
}

.template-card-meta,
.template-detail-status {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.template-card-meta span + span::before,
.template-detail-status span + span::before {
  content: "•";
  margin-right: 7px;
  color: var(--gold-deep);
}

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

.template-card-title-row h3 {
  color: var(--shell);
  font-size: 18px;
  line-height: 1.25;
}

.template-card-body > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.template-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.template-tag-list span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #24515f;
  background: rgba(16, 55, 68, 0.07);
  font-size: 11px;
  font-weight: 700;
}

.template-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(16, 55, 68, 0.09);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.template-card-footer .button-row {
  gap: 7px;
}

.template-card-footer .ghost-btn,
.template-card-footer .secondary-btn {
  padding: 8px 10px;
  font-size: 12px;
}

.template-detail-drawer {
  position: sticky;
  top: 102px;
  max-height: calc(100dvh - 122px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.template-detail-drawer.is-hidden {
  display: none;
}

.template-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.template-detail-head h2 {
  color: var(--shell);
  font-size: 22px;
  line-height: 1.2;
}

.template-detail-preview {
  min-height: 320px;
  border-radius: 16px;
  border: 1px solid rgba(16, 55, 68, 0.12);
  object-fit: contain;
  object-position: top;
  background: #eef2f1;
}

.template-detail-drawer section {
  display: grid;
  gap: 8px;
}

.template-detail-drawer section h3 {
  color: var(--shell);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.template-detail-drawer section p,
.template-detail-drawer section li,
.template-detail-actions p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.template-detail-drawer ul {
  margin: 0;
  padding-left: 19px;
  display: grid;
  gap: 6px;
}

.template-detail-integrity {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(16, 55, 68, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.template-detail-integrity strong {
  color: var(--shell);
}

.template-detail-integrity.is-match {
  background: rgba(44, 126, 89, 0.1);
}

.template-detail-integrity.is-mismatch {
  background: rgba(170, 70, 50, 0.1);
}

.template-detail-actions {
  display: grid;
  gap: 9px;
  padding-top: 4px;
}

@media (max-width: 1180px) {
  .templates-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .template-detail-drawer {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .templates-toolbar {
    grid-template-columns: 1fr;
  }

  .template-catalog-grid {
    grid-template-columns: 1fr;
  }

  .template-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Admin workspace — a stable management surface for operational and delivery
   controls. Every tab shares the same spatial rhythm so changing sections
   reads as changing context, not navigating to another product. */
[data-view-panel="admin"] .admin-workspace {
  gap: 20px;
  padding: 20px;
  border: 1px solid rgba(16, 55, 68, 0.11);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(243, 247, 246, 0.86));
  box-shadow: 0 14px 34px rgba(15, 43, 54, 0.045);
}

[data-view-panel="admin"].admin-loading {
  min-height: 720px;
}

[data-view-panel="admin"].admin-loading > :not(.admin-loading-state) {
  display: none !important;
}

.admin-loading-state {
  display: grid;
  gap: 20px;
  min-height: 680px;
  padding: 28px;
  border: 1px solid rgba(16, 55, 68, 0.11);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(243, 247, 246, 0.9));
  box-shadow: 0 14px 34px rgba(15, 43, 54, 0.045);
}

.admin-loading-state[hidden] {
  display: none;
}

.admin-loading-head,
.admin-loading-workspace {
  display: grid;
  gap: 12px;
}

.admin-loading-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.admin-skeleton {
  display: block;
  min-height: 76px;
  border-radius: 12px;
  background: rgba(16, 55, 68, 0.07);
}

.admin-skeleton-kicker { min-height: 10px; width: 100px; border-radius: 999px; }
.admin-skeleton-title { min-height: 36px; width: min(340px, 58%); }
.admin-skeleton-tabs { min-height: 48px; }
.admin-skeleton-toolbar { min-height: 72px; }
.admin-skeleton-content { min-height: 318px; }

.admin-loading-copy {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

[data-view-panel="admin"] .admin-primary-column {
  gap: 18px;
  min-height: 560px;
}

[data-view-panel="admin"] .admin-tabs {
  position: sticky;
  top: 14px;
  z-index: 2;
  flex-wrap: nowrap;
  gap: 3px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid rgba(16, 55, 68, 0.1);
  border-radius: 14px;
  background: rgba(16, 55, 68, 0.055);
  box-shadow: 0 6px 16px rgba(15, 43, 54, 0.035);
  scrollbar-width: thin;
}

[data-view-panel="admin"] .admin-tab {
  position: relative;
  flex: 1 0 0;
  min-width: 132px;
  min-height: 38px;
  padding: 8px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
  box-shadow: none;
}

[data-view-panel="admin"] .admin-tab:hover,
[data-view-panel="admin"] .admin-tab:focus-visible {
  background: rgba(255, 255, 255, 0.76);
  color: var(--shell);
}

[data-view-panel="admin"] .admin-tab.is-active {
  background: var(--shell);
  color: #fff;
  box-shadow: 0 3px 9px rgba(16, 55, 68, 0.18);
}

[data-view-panel="admin"] .admin-toolbar-card {
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: none;
}

[data-view-panel="admin"] .admin-panel {
  min-height: 390px;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(15, 43, 54, 0.055);
  animation: admin-panel-enter 180ms var(--ease-out) both;
}

[data-view-panel="admin"] .admin-panel > .panel-head {
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(16, 55, 68, 0.09);
}

[data-view-panel="admin"] .admin-panel > .panel-head h2 {
  margin: 0;
  color: var(--shell);
  font-size: 22px;
  letter-spacing: -0.02em;
}

[data-view-panel="admin"] .admin-panel .result-header-copy {
  max-width: 62ch;
  margin: 6px 0 0;
}

[data-view-panel="admin"] .admin-panel .admin-table {
  margin-top: 0;
}

[data-view-panel="admin"] .admin-panel .admin-table th {
  padding-top: 0;
}

[data-view-panel="admin"] .admin-panel .admin-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

[data-view-panel="admin"] .admin-panel .button-row {
  margin-top: 0;
}

[data-view-panel="admin"] .email-scenario-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

[data-view-panel="admin"] .email-scenario-card {
  min-height: 148px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(150deg, #fff, rgba(243, 247, 246, 0.92));
}

[data-view-panel="admin"] .email-scenario-card:hover,
[data-view-panel="admin"] .email-scenario-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(16, 55, 68, 0.32);
}

@keyframes admin-panel-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  [data-view-panel="admin"].admin-loading { min-height: 600px; }
  .admin-loading-state { min-height: 560px; padding: 18px 16px; }
  .admin-loading-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-loading-metrics > :last-child { display: none; }
  [data-view-panel="admin"] .admin-workspace { padding: 12px; }
  [data-view-panel="admin"] .admin-primary-column { min-height: 0; }
  [data-view-panel="admin"] .admin-tabs { top: 8px; }
  [data-view-panel="admin"] .admin-panel { min-height: 0; padding: 18px 16px; }
  [data-view-panel="admin"] .admin-panel > .panel-head { align-items: flex-start; flex-direction: column; }
  [data-view-panel="admin"] .admin-panel > .panel-head .primary-btn,
  [data-view-panel="admin"] .admin-panel > .panel-head .secondary-btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  [data-view-panel="admin"] .admin-panel,
  [data-view-panel="admin"] .email-scenario-card,
  .admin-skeleton { animation: none; transition: none; }
}

/* Product-workspace visual refinement.
   Scoped to the existing non-landing, non-case-workspace views so controls,
   event bindings, identifiers, and content semantics remain unchanged. */
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) {
  position: relative;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid rgba(16, 55, 68, 0.11);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 45px rgba(15, 43, 54, 0.06);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: linear-gradient(90deg, var(--shell), var(--shell-3) 72%, var(--gold));
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head {
  align-items: flex-end;
  margin-bottom: clamp(24px, 3vw, 32px);
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(16, 55, 68, 0.12);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head .panel-kicker {
  margin-bottom: 6px;
  color: var(--gold-text);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head h1 {
  max-width: 18ch;
  margin: 0;
  color: var(--shell);
  font-size: clamp(30px, 3vw, 42px);
  letter-spacing: -0.04em;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .summary-card,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .verify-form-card,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-toolbar-card,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-panel,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-detail-panel,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .terminal-card {
  border-color: rgba(16, 55, 68, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 26px rgba(15, 43, 54, 0.055);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .summary-card,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .verify-form-card,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-toolbar-card {
  background: rgba(255, 255, 255, 0.94);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .section-note {
  min-height: 100%;
  padding: 22px;
  background: linear-gradient(135deg, rgba(16, 55, 68, 0.055), rgba(243, 226, 171, 0.2));
  color: var(--shell);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .section-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--shell);
  font-size: 17px;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .field > span,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-filter > span {
  color: var(--shell);
  font-size: 13px;
  font-weight: 750;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) input,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) select,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) textarea {
  border-color: rgba(16, 55, 68, 0.18);
  background: #fff;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) input:focus,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) select:focus,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) textarea:focus {
  border-color: var(--shell-3);
  box-shadow: 0 0 0 3px rgba(45, 106, 118, 0.16);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-tabs {
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(16, 55, 68, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(16, 55, 68, 0.045);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-tab {
  border-radius: 9px;
  color: var(--muted-strong);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-tab.is-active {
  background: var(--shell);
  color: #f7f8f5;
  box-shadow: 0 4px 12px rgba(16, 55, 68, 0.16);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-detail-panel.empty-state,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .summary-card.empty-state {
  display: grid;
  align-content: center;
  min-height: 156px;
  border-style: dashed;
  background: rgba(243, 247, 246, 0.72);
  color: var(--muted-strong);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .admin-metrics {
  margin-bottom: 24px;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .case-toolbar {
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid rgba(16, 55, 68, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(16, 55, 68, 0.04);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .terminal-card {
  overflow: hidden;
  background: var(--shell);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .terminal-head {
  border-bottom-color: rgba(243, 226, 171, 0.22);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .primary-btn,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .secondary-btn,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .ghost-btn {
  min-height: 42px;
  border-radius: 10px;
  white-space: nowrap;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .primary-btn:active,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .secondary-btn:active,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .ghost-btn:active {
  transform: translateY(1px);
}

@media (max-width: 920px) {
  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) {
    padding: 24px;
  }

  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) {
    padding: 20px 16px;
    border-radius: var(--radius-sm);
  }

  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel)::before {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head h1 {
    max-width: none;
    font-size: clamp(29px, 9vw, 38px);
  }

  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .verify-form-card,
  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .summary-card {
    padding: 18px;
  }
}

/* Template library: a visual catalog with grouped, full-width sections. */
.templates-toolbar {
  grid-template-columns: minmax(320px, 2fr) minmax(180px, 1fr) minmax(160px, 1fr);
  max-width: 1080px;
  margin: 26px 0 18px;
}

.templates-layout {
  display: block;
}

.template-catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
}

.template-catalog-group {
  display: grid;
  gap: 14px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(16, 55, 68, 0.12);
}

.template-catalog-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.template-catalog-group h2 {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--shell);
  font-size: 20px;
}

.template-catalog-group-grid {
  display: grid;
  /* Keep empty tracks so a small regional catalog does not stretch its cards. */
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}

.template-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(16, 55, 68, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.template-card:hover {
  transform: translateY(-3px);
  border-color: rgba(197, 154, 50, 0.45);
  box-shadow: 0 18px 34px rgba(16, 55, 68, 0.14);
}

.template-card:focus-visible {
  outline: 3px solid rgba(197, 154, 50, 0.6);
  outline-offset: 3px;
}

.template-card-preview {
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #edf2f1;
  position: relative;
}

.template-card-preview .template-preview-image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  transform: none;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.template-card-preview .template-preview-image.is-ready {
  opacity: 1;
}

.template-preview-skeleton {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(120deg, #e5eceb 25%, #f6f8f7 40%, #e5eceb 55%);
  background-size: 220% 100%;
  animation: template-preview-shimmer 1.35s ease-in-out infinite;
}

.template-card-preview.is-preview-unavailable .template-preview-skeleton {
  animation: none;
  background: linear-gradient(145deg, #e7eeee, #f5f7f6);
}

.template-card-preview.is-preview-unavailable::after {
  content: "Protected preview unavailable";
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 12px;
}

@keyframes template-preview-shimmer {
  to { background-position: -120% 0; }
}

@keyframes template-preview-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .template-preview-skeleton,
  .template-catalog-preview-status.is-visible::before { animation: none; }
}

.template-card:hover .template-preview-image {
  transform: none;
}

.template-card-preview .template-preview-placeholder {
  width: 100%;
  min-height: 0;
  height: 100%;
}

.template-card-name {
  min-height: 58px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--shell);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.32;
}

.template-card-name > span {
  flex: 0 0 auto;
  font-size: 19px;
}

.template-detail-dialog {
  width: min(1120px, calc(100vw - 48px));
  max-width: none;
  max-height: min(850px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 26px;
  background: #fffdfa;
  box-shadow: 0 30px 90px rgba(7, 31, 39, 0.42);
}

.template-detail-dialog::backdrop {
  background: rgba(10, 37, 46, 0.56);
  backdrop-filter: blur(4px);
}

.template-detail-dialog > * {
  box-sizing: border-box;
}

.template-detail-dialog .template-detail-loading {
  padding: 44px;
  color: var(--muted);
}

.template-detail-dialog:not(:empty) {
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(320px, 1.08fr);
  grid-template-areas:
    "head head"
    "preview status"
    "preview overview"
    "preview intended"
    "preview cautions"
    "preview tags"
    "preview integrity"
    "preview actions";
  align-items: start;
  gap: 18px 28px;
}

.template-detail-dialog .template-detail-head { grid-area: head; }
.template-detail-dialog .template-detail-preview { grid-area: preview; }
.template-detail-dialog .template-detail-status { grid-area: status; }
.template-detail-dialog section:nth-of-type(1) { grid-area: overview; }
.template-detail-dialog section:nth-of-type(2) { grid-area: intended; }
.template-detail-dialog section:nth-of-type(3) { grid-area: cautions; }
.template-detail-dialog section:nth-of-type(4) { grid-area: tags; }
.template-detail-dialog .template-detail-integrity { grid-area: integrity; }
.template-detail-dialog .template-detail-actions { grid-area: actions; }

.template-detail-dialog .template-detail-preview {
  width: 100%;
  height: calc(min(850px, 100dvh - 48px) - 140px);
  min-height: 480px;
  margin: 0;
  object-fit: contain;
  object-position: center top;
  background: #eef3f2;
}

@media (max-width: 780px) {
  .templates-toolbar {
    grid-template-columns: 1fr;
  }

  .template-catalog-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .template-detail-dialog {
    width: min(100vw - 20px, 680px);
    max-height: calc(100dvh - 20px);
  }

  .template-detail-dialog:not(:empty) {
    padding: 20px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "preview"
      "status"
      "overview"
      "intended"
      "cautions"
      "tags"
      "integrity"
      "actions";
    gap: 16px;
  }

  .template-detail-dialog .template-detail-preview {
    height: min(65vh, 600px);
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .template-catalog-group-grid {
    grid-template-columns: 1fr;
  }
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-badge {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-meta {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.app-footer {
  padding: 0 24px 24px;
  background: #fbfcfd;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.footer-logo {
  width: 120px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.footer-brand-name {
  color: var(--shell);
  font-weight: 800;
}

.footer-brand-subtitle {
  color: var(--gold-deep);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.footer-legal {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.main-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 251, 244, 0.86);
  backdrop-filter: blur(18px);
  color: var(--text);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(16, 55, 68, 0.08);
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
}

.topbar-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.header-pill,
.status-badge,
.mini-pill,
.service-stage,
.copy-btn,
.ghost-btn {
  border-radius: 999px;
}

.header-pill,
.status-badge,
.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
}

.header-pill.neutral,
.status-badge.neutral,
.mini-pill.neutral {
  background: rgba(16, 55, 68, 0.08);
  color: var(--shell);
}

.status-badge.success,
.mini-pill.success {
  background: rgba(47, 124, 97, 0.12);
  color: var(--success);
}

.mini-pill.starter {
  background: rgba(26, 95, 128, 0.12);
  color: #1a5f80;
}

.mini-pill.pro {
  background: rgba(197, 154, 50, 0.14);
  color: #8f6310;
}

.status-badge.error,
.mini-pill.error {
  background: rgba(177, 72, 72, 0.12);
  color: var(--danger);
}

.status-badge.warn,
.mini-pill.warn {
  background: rgba(179, 127, 33, 0.12);
  color: var(--warn);
}

.workspace {
  padding: 28px;
  overflow: auto;
  background: transparent;
  scroll-padding-top: 120px;
}

.view-panel {
  display: none;
  background: transparent;
}

.view-panel.is-active {
  display: block;
}

.home-view-panel.is-active {
  display: grid;
  gap: 18px;
}

.home-view-panel > * {
  margin: 0;
}

.recent-activity-card {
  margin-top: 0;
}

.recent-activity-head {
  align-items: end;
}

.recent-activity-copy {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.7;
}

.workspace-empty-state {
  display: grid;
  gap: 8px;
  padding: 22px 24px;
}

.workspace-empty-state strong {
  color: var(--shell);
  font-size: 18px;
}

.workspace-empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.workspace-empty-state-inline {
  padding: 4px 0 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-kicker {
  margin: 0 0 6px;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-head h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.button-row,
.sticky-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.case-action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0 14px;
}

.workspace-action-trigger {
  display: inline-flex;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.copy-btn {
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 18px;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  min-height: 46px;
  padding: 0 20px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.primary-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: #17313f;
  box-shadow: 0 14px 30px rgba(197, 154, 50, 0.22);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.84);
  color: var(--shell);
  border-color: rgba(16, 55, 68, 0.14);
  box-shadow: var(--shadow-sm);
}

.ghost-btn {
  background: rgba(16, 55, 68, 0.08);
  color: var(--shell);
  border-color: rgba(16, 55, 68, 0.08);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(15, 43, 54, 0.16);
}

.secondary-btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.stack-lg {
  display: grid;
  gap: 14px;
}

.section-card,
.summary-card,
.terminal-card,
.verify-form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.section-card {
  padding: 18px;
}

.group-card {
  background: linear-gradient(180deg, rgba(16, 55, 68, 0.03), rgba(214, 177, 90, 0.08));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.section-note {
  padding: 16px 18px;
  line-height: 1.6;
}

.group-card h3,
.array-item-title,
.flow-card h3 {
  margin: 0;
}

.group-card h3 {
  margin-bottom: 14px;
  font-size: 20px;
}

.group-note {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

.legal-party-grid .party-field-address1,
.legal-party-grid .party-field-address2 {
  grid-column: 1 / -1;
}

.legal-party-grid .party-layout-spacer {
  min-height: 0;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-size: 13px;
  font-weight: 700;
  color: #24424f;
}

.field-optional {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.checkbox-field {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(16, 55, 68, 0.08);
  border-radius: 18px;
  background: rgba(16, 55, 68, 0.03);
}

.checkbox-field-copy {
  display: grid;
  gap: 4px;
}

.checkbox-field-copy strong {
  color: var(--shell);
  font-size: 16px;
  font-weight: 700;
}

.checkbox-field-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.checkbox-field-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.checkbox-field-control input[type="checkbox"] {
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--gold-strong);
  cursor: pointer;
}

/* Shared action and choice controls.  These deliberately live beside the
   base components so every workspace, dialog, and generated form gets the
   same resilient behaviour instead of carrying local overflow fixes. */
.button-row,
.sticky-actions,
.case-action-bar,
.workspace-actions {
  min-width: 0;
}

.button-row > *,
.sticky-actions > *,
.case-action-bar > *,
.workspace-actions > * {
  min-width: 0;
  max-width: 100%;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.25;
}

.checkbox-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  cursor: pointer;
}

.checkbox-field-input,
.checkbox-field > input[type="checkbox"],
.checkbox-field-control input[type="checkbox"] {
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  margin: 0;
  margin-top: 1px;
  accent-color: var(--gold-strong);
  cursor: pointer;
}

.checkbox-field-copy {
  min-width: 0;
  line-height: 1.45;
}

.checkbox-field-copy > span,
.checkbox-field-copy > small {
  display: block;
}

.checkbox-field:has(input:focus-visible) {
  outline: 3px solid rgba(138, 93, 10, 0.38);
  outline-offset: 2px;
}

.checkbox-field:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (min-width: 641px) {
  .case-workspace-panel .case-action-bar {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  }
}

@media (max-width: 760px) {
  .checkbox-field {
    padding: 16px;
    gap: 12px;
  }
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(16, 55, 68, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  padding: 13px 14px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.file-picker {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(16, 55, 68, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 246, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.file-picker:focus-within {
  outline: none;
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 4px rgba(214, 177, 90, 0.08);
}

.file-picker.has-file {
  border-color: rgba(47, 124, 97, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(238, 244, 241, 0.98));
}

.field .file-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.file-picker-trigger {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  white-space: nowrap;
}

.file-picker-status {
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker.has-file .file-picker-status {
  color: var(--text);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.18s ease, color 0.18s ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  outline: none;
  background: rgba(16, 55, 68, 0.06);
  color: var(--shell);
}

.password-toggle-icon {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

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

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(214, 177, 90, 0.24);
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 4px rgba(214, 177, 90, 0.08);
}

.array-item {
  border: 1px solid rgba(33, 79, 93, 0.1);
  background: #fff;
  border-radius: 16px;
  padding: 14px;
}

.array-item + .array-item {
  margin-top: 12px;
}

.array-item-title {
  color: var(--shell);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.radio-group {
  display: grid;
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(33, 79, 93, 0.12);
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
}

.radio-option input {
  accent-color: var(--shell);
}

.table-group-card {
  overflow: hidden;
}

.dynamic-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid rgba(33, 79, 93, 0.12);
  border-radius: 16px;
  overflow: hidden;
}

.dynamic-table th,
.dynamic-table td {
  border-bottom: 1px solid rgba(33, 79, 93, 0.08);
  border-right: 1px solid rgba(33, 79, 93, 0.08);
  padding: 10px;
  vertical-align: top;
}

.dynamic-table th:last-child,
.dynamic-table td:last-child {
  border-right: 0;
}

.dynamic-table thead th {
  background: rgba(33, 79, 93, 0.08);
  color: var(--shell);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
}

.dynamic-table td input,
.dynamic-table td select {
  width: 100%;
  border: 1px solid #d3dbe2;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
}

.dynamic-table td input:focus,
.dynamic-table td select:focus {
  outline: 2px solid rgba(215, 180, 91, 0.25);
  border-color: var(--gold);
}

.table-readonly {
  background: var(--surface-soft) !important;
  color: var(--muted);
  font-weight: 700;
}

.table-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}

.table-remove-btn {
  border: 0;
  background: rgba(177, 72, 72, 0.12);
  color: var(--danger);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.table-remove-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.summary-card,
.verify-form-card {
  padding: 18px;
}

.verify-intro-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.empty-state {
  color: var(--muted);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.info-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  background: var(--surface);
}

.info-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.info-value {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.value-text {
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.copy-btn {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  background: rgba(16, 55, 68, 0.08);
  color: var(--shell);
  font-size: 12px;
  font-weight: 700;
  border-color: rgba(16, 55, 68, 0.08);
}

.signature-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.provider-progress-flow {
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.flow-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 18px;
  min-height: 100%;
}

.provider-progress-flow .flow-card {
  min-height: 0;
}

.accent-card {
  background: linear-gradient(180deg, rgba(33, 79, 93, 0.96), rgba(33, 79, 93, 0.9));
  color: #fff;
}

.accent-card p,
.accent-card h3 {
  color: #fff;
}

.flow-step {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(215, 180, 91, 0.18);
  color: var(--gold);
  display: grid;
  place-items: center;
  font-weight: 800;
  margin-bottom: 12px;
}

.flow-card h3 {
  font-size: 17px;
  font-weight: 700;
}

.flow-card p {
  color: var(--muted);
  line-height: 1.55;
}

.flow-content {
  margin-top: 14px;
}

.flow-card--signed .flow-content {
  display: grid;
  gap: 18px;
}

.service-stage {
  margin-top: 14px;
  display: inline-flex;
  padding: 8px 12px;
  font-weight: 700;
  border-radius: 999px;
}

.service-stage.pending {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.service-stage.active {
  background: rgba(215, 180, 91, 0.18);
  color: #fff1c8;
}

.service-stage.done {
  background: rgba(47, 124, 97, 0.18);
  color: #d8f3e8;
}

.result-card {
  display: grid;
  gap: 14px;
}

.sealguard-hero {
  display: grid;
  gap: 18px;
  padding: 24px;
  border-radius: 26px;
  border: 1px solid rgba(189, 151, 57, 0.22);
  background:
    radial-gradient(circle at top right, rgba(215, 180, 91, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(29, 84, 100, 0.06), rgba(255, 255, 255, 0.96) 42%);
  box-shadow: 0 22px 40px rgba(16, 37, 49, 0.08);
}

.sealguard-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sealguard-logo {
  width: 112px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.sealguard-brand-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--shell);
}

.sealguard-brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sealguard-body {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.sealguard-badge {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.sealguard-badge-ring {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 35%, #f0d383, var(--gold-deep));
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.54),
    0 18px 30px rgba(189, 151, 57, 0.24);
}

.sealguard-check {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #3b8f70, #2f7c61);
  color: #fff;
  font-size: 40px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(47, 124, 97, 0.28);
}

.sealguard-badge-label {
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sealguard-kicker {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sealguard-copy h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  color: #173f4d;
}

.sealguard-message {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

.sealguard-meta {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sealguard-meta-item {
  border: 1px solid rgba(33, 79, 93, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 14px;
}

.sealguard-meta-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.sealguard-meta-item strong {
  color: var(--text);
  line-height: 1.5;
}

.legal-note {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(33, 79, 93, 0.04);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.result-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.result-header-stack {
  display: grid;
  gap: 4px;
}

.result-header-copy {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.result-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 18px;
  background: rgba(16, 55, 68, 0.08);
  color: var(--shell);
  font-weight: 700;
  border: 1px solid rgba(16, 55, 68, 0.08);
}

.verify-form-card {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.admin-submit-btn {
  width: fit-content;
  min-width: 210px;
  min-height: 42px;
  padding: 0 18px;
  margin-top: 4px;
}

.form-card-head {
  margin-bottom: 4px;
}

.form-card-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.form-card-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.bundle-artifact-card {
  display: grid;
  gap: 16px;
}

.bundle-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(16, 55, 68, 0.03), rgba(214, 177, 90, 0.06));
  padding: 18px;
}

.bundle-panel h4 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}

.bundle-panel-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.bundle-hero-note {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(16, 55, 68, 0.94), rgba(36, 93, 108, 0.92));
  color: #fff;
}

.bundle-hero-note strong {
  font-size: 17px;
  font-weight: 700;
}

.bundle-hero-note span {
  color: rgba(255, 255, 255, 0.8);
}

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

.flow-card--signed .bundle-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bundle-overview-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(16, 55, 68, 0.08);
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bundle-overview-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bundle-overview-item strong {
  color: var(--text);
  font-weight: 600;
  line-height: 1.55;
  word-break: break-word;
}

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

.flow-card--signed .bundle-list {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.signing-telemetry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.signing-telemetry-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.signing-telemetry-item span {
  color: var(--muted);
  font-size: 12px;
}

.signing-telemetry-item strong {
  color: var(--text);
  font-size: 13px;
}

.signing-milestones {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.signing-milestone {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.signing-milestone strong,
.signing-milestone span {
  display: block;
}

.signing-milestone span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.signing-milestone-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.signing-milestone.is-ready .signing-milestone-marker {
  background: rgba(47, 124, 97, 0.14);
  color: var(--success);
}

.signing-milestone.is-pending .signing-milestone-marker {
  background: rgba(179, 127, 33, 0.12);
  color: var(--warn);
}

.bundle-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px 14px;
  flex-wrap: wrap;
}

.bundle-list-item > div:first-child {
  min-width: 0;
  flex: 1;
}

.bundle-list-item strong {
  display: block;
  margin-bottom: 3px;
}

.bundle-list-item span {
  color: var(--muted);
  font-size: 12px;
}

.bundle-link {
  color: var(--shell);
  font-weight: 700;
  text-decoration: none;
  flex: 0 0 auto;
}

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

.flow-card--signed .bundle-guidance-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bundle-guidance-card {
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(16, 55, 68, 0.1);
  box-shadow: var(--shadow-sm);
}

.bundle-guidance-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.bundle-guidance-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

.field-hint {
  margin-left: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.readonly-lite {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
}

.readiness-card {
  display: grid;
  gap: 12px;
}

.readiness-head {
  display: grid;
  gap: 6px;
}

.readiness-head strong {
  color: var(--shell);
}

.readiness-head span {
  color: var(--muted);
  line-height: 1.5;
}

.readiness-list {
  display: grid;
  gap: 8px;
}

.readiness-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.readiness-item strong,
.readiness-item span {
  display: block;
}

.readiness-item span {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.readiness-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.readiness-item.is-ready .readiness-marker {
  background: rgba(47, 124, 97, 0.14);
  color: #2f7c61;
}

.readiness-item.is-blocked .readiness-marker {
  background: rgba(177, 72, 72, 0.12);
  color: var(--danger);
}

.readiness-issues {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(177, 72, 72, 0.18);
  background: rgba(177, 72, 72, 0.05);
}

.readiness-issues strong {
  display: block;
  margin-bottom: 8px;
}

.readiness-issues ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.readiness-issues li + li {
  margin-top: 6px;
}

.readiness-summary-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.readiness-summary-pill,
.readiness-summary-blocker {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.readiness-summary-pill.success {
  background: rgba(47, 124, 97, 0.12);
  color: var(--success);
}

.readiness-summary-pill.warn {
  background: rgba(177, 72, 72, 0.1);
  color: var(--danger);
}

.readiness-summary-blocker {
  background: rgba(16, 55, 68, 0.06);
  color: var(--shell);
}

.readiness-details {
  border-top: 1px solid rgba(16, 55, 68, 0.08);
  padding-top: 10px;
}

.readiness-details summary {
  cursor: pointer;
  color: var(--shell);
  font-weight: 700;
}

.verify-mode-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(179, 127, 33, 0.25);
  background: rgba(215, 180, 91, 0.08);
  color: var(--text);
  line-height: 1.6;
}

.leaf-result-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.leaf-result-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  padding: 14px;
}

.leaf-result-card h4 {
  margin: 0 0 12px;
  font-size: 15px;
}

.leaf-result-card.is-valid {
  border-color: rgba(47, 124, 97, 0.25);
}

.leaf-result-card.is-invalid {
  border-color: rgba(177, 72, 72, 0.25);
}

.inline-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

@media (max-width: 640px) {
  .file-picker {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .file-picker-trigger {
    width: 100%;
    justify-content: center;
  }

  .file-picker-status {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

.terminal-card {
  margin-top: 18px;
  overflow: hidden;
  background: #101c22;
  border-color: #1d3742;
}

.terminal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #1d3742;
  color: #e1e7eb;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terminal-output {
  height: 420px;
  overflow: auto;
  padding: 14px 16px 18px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  color: #d9e4ea;
  white-space: pre-wrap;
}

.terminal-line {
  margin: 0 0 6px;
}

.terminal-line.info {
  color: #d9e4ea;
}

.terminal-line.warn {
  color: #f4d58b;
}

.terminal-line.error {
  color: #f4aaaa;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  min-width: 220px;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #173842;
  color: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: #1c5a47;
}

.toast.error {
  background: #7f3333;
}

.public-home {
  min-height: 100vh;
  padding: 32px 28px 40px;
  background:
    radial-gradient(circle at 12% 10%, rgba(214, 177, 90, 0.24), transparent 22%),
    radial-gradient(circle at 90% 14%, rgba(24, 80, 95, 0.18), transparent 26%),
    linear-gradient(145deg, #f8f1df, #eef5f2 42%, #f7fbfb 100%);
}

.public-home.is-hidden {
  display: none;
}

.public-verify-screen {
  padding-bottom: 56px;
}

.public-nav,
.public-hero,
.product-section,
.trust-strip,
.public-legal-footer {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.public-legal-footer {
  margin-top: 24px;
  padding: 18px 22px;
  border: 1px solid rgba(33, 79, 93, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  flex-wrap: wrap;
}

.public-legal-footer--narrow {
  width: min(1180px, 100%);
}

.public-legal-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.public-legal-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.public-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 52px;
  gap: 18px;
}

.public-nav-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.public-nav-brand img {
  width: 260px;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 22px;
  box-shadow: 0 24px 40px rgba(16, 55, 68, 0.16);
}

.public-nav-brand-copy {
  display: grid;
  gap: 4px;
}

.public-nav-brand-copy span {
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.public-nav-brand-copy strong {
  color: var(--shell);
  font-size: 20px;
  line-height: 1.1;
}

.public-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 430px);
  gap: 28px;
  align-items: stretch;
}

.hero-copy,
.product-login-card,
.feature-card,
.product-section,
.trust-strip,
.product-hero-card,
.overview-card,
.case-card,
.case-header,
.workspace-section,
.case-dialog {
  border: 1px solid rgba(33, 79, 93, 0.12);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.case-dialog.trial-link-dialog {
  width: min(1080px, calc(100vw - 32px));
  max-height: min(92dvh, 980px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.case-dialog.trial-link-result-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.trial-link-dialog .verify-form-card,
.trial-link-result-dialog .verify-form-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-lg);
}

.trial-link-dialog .verify-form-card {
  max-height: min(92dvh, 980px);
  overflow-y: auto;
  padding: 34px 38px 32px;
  display: grid;
  gap: 24px;
}

.trial-link-result-dialog .verify-form-card {
  padding: 34px 38px 32px;
  display: grid;
  gap: 22px;
}

.trial-link-dialog .form-card-head,
.trial-link-result-dialog .form-card-head {
  margin-bottom: 2px;
}

.trial-link-dialog .form-card-head h3,
.trial-link-result-dialog .form-card-head h3 {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.trial-link-basics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.trial-link-section {
  display: grid;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.trial-link-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.trial-link-section-head h4 {
  margin: 0;
  color: var(--shell);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.trial-link-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 56ch;
}

.trial-template-table-wrap {
  overflow: auto;
  max-height: 340px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.trial-template-table {
  min-width: 640px;
  margin: 0;
}

.trial-template-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
}

.trial-template-table th:first-child,
.trial-template-table td:first-child {
  width: 52px;
  text-align: center;
}

.trial-template-table th:not(:first-child),
.trial-template-table td:not(:first-child) {
  padding-left: 14px;
  padding-right: 14px;
}

.trial-template-table tbody tr:last-child td {
  border-bottom: 0;
}

.trial-template-table input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--shell-2);
}

.trial-template-table strong {
  color: var(--shell);
  font-size: 14px;
}

.trial-template-table small {
  color: var(--muted);
}

.trial-link-limits {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.trial-link-limits .field span {
  white-space: nowrap;
}

#trialLinkResultURL {
  min-height: 108px;
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--shell);
  background: var(--surface-soft);
  word-break: break-all;
}

.form-error { min-height: 1.4em; margin: 0; color: var(--danger); font-size: 13px; font-weight: 700; }
.form-validation-summary { margin: 0 0 18px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--danger) 52%, white); border-radius: 12px; background: color-mix(in srgb, var(--danger) 7%, white); color: var(--danger); }
.form-validation-summary strong { display: block; }
.form-validation-summary ul { margin: 8px 0 0; padding-left: 18px; }
.form-validation-summary button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: underline; cursor: pointer; }
.field.has-field-error input, .field.has-field-error select, .field.has-field-error textarea { border-color: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 15%, transparent); }
.field-error { display: block; margin-top: 5px; color: var(--danger); font-weight: 650; }
.dsca-choice-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.dsca-choice-field legend { margin-bottom: 8px; font-weight: 700; }
.dsca-choice-field .radio-option { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.dsca-termination-controls { display: grid; grid-template-columns: minmax(120px, .75fr) minmax(110px, .55fr); gap: 10px; }

@media (max-width: 820px) {
  .trial-link-basics { grid-template-columns: 1fr; }
  .trial-link-dialog .verify-form-card { padding: 28px 24px 26px; }
  .trial-link-limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trial-link-limits .field:first-child { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .trial-link-limits { grid-template-columns: 1fr; }
  .trial-link-limits .field:first-child { grid-column: auto; }
}

.hero-copy {
  border-radius: var(--radius-2xl);
  padding: 52px;
  background:
    radial-gradient(circle at top right, rgba(214, 177, 90, 0.18), transparent 24%),
    linear-gradient(145deg, rgba(16, 55, 68, 0.98), rgba(22, 73, 86, 0.96));
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-copy h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(50px, 7vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.hero-lede {
  max-width: 700px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 19px;
  line-height: 1.8;
}

.hero-footnote {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(29, 66, 80, 0.72);
  font-size: 14px;
  line-height: 1.65;
}

.hero-metrics {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-metrics div {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}

.hero-metrics strong {
  display: block;
  margin-bottom: 6px;
  color: #fff;
  font-size: 15px;
}

.hero-metrics span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.public-verify-layout {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: start;
}

.public-verify-hero,
.public-verify-workbench {
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(33, 79, 93, 0.12);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.public-verify-hero {
  padding: 38px;
}

.public-verify-hero h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.02;
}

.public-verify-workbench {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.public-verify-intro-grid {
  margin-top: 28px;
}

.public-verify-guardrails {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.public-verify-guardrails div {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(16, 55, 68, 0.04);
  padding: 16px 18px;
}

.public-verify-guardrails strong {
  display: block;
  margin-bottom: 4px;
}

.public-verify-guardrails span {
  color: var(--muted);
  font-size: 14px;
}

.public-verify-summary {
  min-height: 220px;
}

.public-verify-result-copy {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.7;
}

.public-verify-result.is-match {
  border-color: rgba(47, 124, 97, 0.22);
}

.public-verify-result.is-mismatch {
  border-color: rgba(177, 72, 72, 0.2);
}

.product-login-card {
  border-radius: var(--radius-2xl);
  padding: 34px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  display: grid;
  align-content: start;
  gap: 10px;
}

.product-login-card .stack-lg {
  gap: 16px;
}

.product-login-card .primary-btn {
  width: 100%;
}

.feature-grid,
.overview-grid,
.case-grid,
.case-prepare-grid {
  display: grid;
  gap: 16px;
}

.feature-grid,
.overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-section {
  margin-top: 28px;
  border-radius: var(--radius-2xl);
  padding: 32px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.feature-card {
  border-radius: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.feature-card span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(214, 177, 90, 0.16);
  color: var(--gold-strong);
  font-weight: 800;
  margin-bottom: 18px;
}

.feature-card h3,
.product-login-card h2 {
  margin-top: 0;
}

.product-login-card h2 {
  margin-bottom: 8px;
  font-size: 40px;
  line-height: 1.05;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.trust-strip {
  margin-top: 28px;
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  background:
    linear-gradient(145deg, rgba(16, 55, 68, 0.96), rgba(24, 80, 95, 0.92));
  color: #fff;
}

.trust-strip div {
  padding: 10px 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.trust-strip div:first-child {
  border-left: 0;
}

.trust-strip strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-soft);
  font-size: 15px;
}

.trust-strip span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.product-hero-card {
  border-radius: var(--radius-2xl);
  padding: 32px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at top right, rgba(214, 177, 90, 0.16), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 244, 0.92));
}

.product-hero-card h1 {
  margin: 6px 0 10px;
  font-size: 40px;
  font-weight: 700;
}

.contact-hero-card,
.introduction-hero-card {
  margin-bottom: 0;
}

.billing-plans-section,
.billing-org-hero,
.billing-overview-card,
.billing-manage-grid,
.billing-faq-card {
  margin-top: 0;
}

.billing-page {
  display: grid;
  gap: 28px;
  padding-bottom: 28px;
}

.billing-page > .billing-status-banner {
  margin: -10px 0 0;
}

.billing-grid,
.billing-proof-grid,
.billing-manage-grid,
.contact-grid {
  display: grid;
  gap: 18px;
}

.billing-section-head,
.billing-overview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.billing-section-head h1,
.billing-overview-head h2 {
  margin: 6px 0 0;
}

.billing-section-copy,
.billing-overview-copy {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.7;
}

.billing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.billing-overview-card {
  padding: 28px 30px;
}

.billing-org-hero,
.billing-admin-note {
  padding: 28px 30px;
}

.billing-status-banner {
  padding: 20px 24px;
  display: grid;
  gap: 8px;
}

.billing-status-banner h2 {
  margin: 6px 0 0;
}

.billing-status-banner p {
  margin: 0;
  line-height: 1.7;
}

.billing-status-banner.neutral {
  background: linear-gradient(145deg, rgba(244, 248, 247, 0.95), rgba(255, 255, 255, 0.98));
}

.billing-status-banner.warn {
  background: linear-gradient(145deg, rgba(250, 244, 231, 0.95), rgba(255, 255, 255, 0.98));
  border-color: rgba(179, 127, 33, 0.16);
}

.billing-status-banner.error {
  background: linear-gradient(145deg, rgba(253, 241, 241, 0.96), rgba(255, 255, 255, 0.98));
  border-color: rgba(177, 72, 72, 0.18);
}

.billing-hero-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.billing-shared-note,
.billing-empty-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.billing-template-usage-list {
  display: grid;
  gap: 10px;
}

.billing-template-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(16, 55, 68, 0.04);
}

.billing-template-usage-row span {
  color: var(--text);
}

.billing-template-usage-row strong {
  color: var(--shell);
}

.billing-usage-highlight {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(16, 55, 68, 0.05), rgba(214, 177, 90, 0.08));
}

.billing-usage-highlight strong {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
  color: var(--shell);
}

.billing-usage-highlight span {
  color: var(--muted);
  font-size: 13px;
}

.billing-usage-meter {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(16, 55, 68, 0.08);
}

.billing-usage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1a5f80, #d6b15a);
}

.billing-overview-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.billing-inline-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(197, 154, 50, 0.12);
  color: var(--shell);
}

.billing-locale-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1.2fr)) repeat(2, minmax(140px, 0.8fr));
  gap: 16px;
}

.billing-locale-field {
  margin: 0;
}

.billing-locale-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(16, 55, 68, 0.04);
}

.billing-locale-card strong {
  color: var(--shell);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.billing-locale-card span {
  color: var(--text);
}

.billing-plans-disclosure {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.billing-plans-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  color: var(--shell);
  font-weight: 700;
}

.billing-plans-disclosure > summary small {
  color: var(--muted);
  font-weight: 500;
}

.billing-plans-disclosure > summary::marker {
  content: "";
}

.billing-plans-disclosure[open] > summary {
  border-bottom: 1px solid var(--line);
}

.billing-plans-disclosure-body {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.billing-invoice-list {
  display: grid;
  gap: 14px;
}

.billing-invoice-row {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(16, 55, 68, 0.04);
}

.billing-invoice-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.billing-invoice-main strong {
  color: var(--shell);
}

.billing-invoice-main span {
  color: var(--muted);
  text-transform: capitalize;
}

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

.billing-invoice-meta div {
  display: grid;
  gap: 4px;
}

.billing-invoice-meta strong {
  color: var(--shell);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.billing-invoice-meta span {
  color: var(--text);
}

.billing-card {
  padding: 28px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100%;
}

.billing-card.is-featured {
  background: linear-gradient(180deg, rgba(255, 250, 239, 0.98), rgba(255, 255, 255, 0.94));
  border-color: rgba(197, 154, 50, 0.28);
  transform: translateY(-6px);
}

.billing-card-starter {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 251, 0.94));
}

.billing-card-pro {
  background: linear-gradient(180deg, rgba(255, 250, 239, 0.98), rgba(255, 255, 255, 0.96));
  border-color: rgba(197, 154, 50, 0.22);
}

.billing-card-enterprise {
  background: linear-gradient(180deg, rgba(245, 248, 250, 0.98), rgba(255, 255, 255, 0.95));
  border-color: rgba(16, 55, 68, 0.14);
}

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

.billing-cta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: auto;
  align-items: stretch;
}

.billing-card-head h3,
.billing-faq-item strong,
.contact-card strong {
  margin: 0;
}

.billing-card-head p,
.billing-faq-item p,
.contact-card p {
  margin: 0;
  color: var(--muted);
}

.billing-price-block strong {
  display: block;
  font-size: 42px;
  line-height: 1;
  color: var(--shell);
}

.billing-price-block {
  padding: 18px;
  border-radius: 22px;
  background: rgba(16, 55, 68, 0.04);
}

.billing-price-block-secondary {
  background: rgba(197, 154, 50, 0.08);
}

.billing-price-block span {
  color: var(--muted);
  font-size: 13px;
}

.billing-plan-meta {
  display: grid;
  gap: 10px;
}

.billing-plan-meta div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.billing-plan-meta strong {
  color: var(--shell);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.billing-plan-meta span {
  color: var(--text);
}

.billing-feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  flex: 1;
}

.billing-feature-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text);
}

.billing-feature-list li::before {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--success);
  font-weight: 800;
}

.billing-cta-btn {
  width: 100%;
  min-width: 0;
  min-height: 64px;
  padding: 12px 18px;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
  justify-content: center;
  overflow-wrap: anywhere;
}

.billing-manage-grid {
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.billing-manage-card {
  padding: 26px;
  display: grid;
  gap: 14px;
}

.billing-manage-card-primary {
  background:
    radial-gradient(circle at top right, rgba(214, 177, 90, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(16, 55, 68, 0.98), rgba(22, 73, 86, 0.96));
  color: #fff;
}

.billing-manage-card-primary .panel-kicker,
.billing-manage-card-primary .billing-ops-head h2,
.billing-manage-card-primary p {
  color: #fff;
}

.billing-manage-card-primary p {
  color: rgba(255, 255, 255, 0.82);
}

.billing-manage-card-primary .mini-pill {
  background: rgba(255, 255, 255, 0.92);
  color: #17313f;
  border: 1px solid rgba(255, 255, 255, 0.46);
}

.billing-manage-card-primary .billing-usage-highlight {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(214, 177, 90, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.billing-manage-card-primary .billing-usage-highlight strong {
  color: #fff;
}

.billing-manage-card-primary .billing-usage-highlight span {
  color: rgba(255, 255, 255, 0.84);
}

.billing-manage-card-primary .billing-usage-meter {
  background: rgba(255, 255, 255, 0.16);
}

.billing-manage-card-primary .billing-plan-meta div {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.billing-manage-card-primary .billing-plan-meta strong {
  color: rgba(255, 255, 255, 0.72);
}

.billing-manage-card-primary .billing-plan-meta span {
  color: #fff;
}

.billing-manage-card-primary .billing-ops-btn.primary-btn {
  background: linear-gradient(135deg, #fff7e8, #f0d28a);
  color: #17313f;
  border-color: rgba(255, 255, 255, 0.24);
}

.billing-manage-card-primary .billing-ops-btn.primary-btn:hover,
.billing-manage-card-primary .billing-ops-btn.primary-btn:focus-visible {
  background: linear-gradient(135deg, #ffffff, #f4d996);
  color: #102d39;
}

.billing-ops-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.billing-ops-head h2 {
  margin: 0;
  font-size: 19px;
}

.billing-manage-card p {
  margin: 0;
  color: var(--muted);
}

.billing-ops-btn {
  width: 100%;
}

.billing-faq-card {
  padding: 30px;
}

.billing-faq-head {
  margin-bottom: 18px;
}

.billing-faq-list {
  display: grid;
  gap: 16px;
}

.billing-faq-item {
  padding: 20px;
  border-radius: 22px;
  background: rgba(16, 55, 68, 0.04);
}

.introduction-trust-strip {
  margin-top: 0;
}

.introduction-overview-strip {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.introduction-overview-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(16, 55, 68, 0.04);
}

.introduction-overview-item strong {
  color: var(--shell);
  font-size: 14px;
}

.introduction-overview-item span,
.introduction-section-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.introduction-note-card,
.introduction-guide-section,
.introduction-step-card {
  padding: 24px;
}

.introduction-note-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--shell);
}

.introduction-note-card p,
.introduction-step-card p,
.introduction-guide-section p,
.introduction-guide-card p {
  margin: 0;
  color: var(--muted);
}

.introduction-quickstart {
  display: grid;
  gap: 18px;
}

.introduction-panel-head {
  margin-bottom: 0;
}

.introduction-step-grid,
.introduction-guide-card-grid {
  display: grid;
  gap: 18px;
}

.introduction-step-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.introduction-step-card {
  display: grid;
  gap: 12px;
}

.introduction-step-card span {
  display: inline-flex;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(214, 177, 90, 0.16);
  color: var(--gold-strong);
  font-weight: 800;
}

.introduction-step-card h3,
.introduction-guide-section h2,
.introduction-guide-card h3 {
  margin: 0;
}

.introduction-guide-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.introduction-guide-nav {
  position: sticky;
  top: 104px;
  padding: 22px;
}

.introduction-guide-nav h3 {
  margin: 0 0 16px;
}

.introduction-guide-nav-list,
.introduction-guide-content {
  display: grid;
  gap: 12px;
}

.introduction-guide-link {
  text-align: left;
  padding: 10px 0;
}

.introduction-guide-content {
  gap: 18px;
}

.introduction-guide-section {
  display: grid;
  gap: 16px;
}

.introduction-guide-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--text);
}

.introduction-guide-list-ordered {
  padding-left: 24px;
}

.introduction-guide-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.introduction-guide-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(16, 55, 68, 0.04);
  border: 1px solid rgba(16, 55, 68, 0.06);
  display: grid;
  gap: 10px;
}

.template-guide-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.template-guide-nav {
  position: sticky;
  top: 104px;
  padding: 22px;
}

.template-guide-nav h3,
.template-guide-section h2,
.template-guide-section h3 {
  margin: 0;
}

.template-guide-nav-list,
.template-guide-content,
.template-guide-category,
.template-guide-facts {
  display: grid;
  gap: 12px;
}

.template-guide-link {
  text-align: left;
  padding: 8px 0;
}

.template-guide-content,
.template-guide-category {
  gap: 18px;
}

.template-guide-section {
  display: grid;
  gap: 18px;
  padding: 24px;
  scroll-margin-top: 104px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.template-guide-section.is-targeted {
  border-color: rgba(214, 177, 90, 0.7);
  box-shadow: 0 0 0 4px rgba(214, 177, 90, 0.16);
}

.template-guide-section:focus-visible {
  outline: none;
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 4px rgba(214, 177, 90, 0.16);
}

.template-guide-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.template-guide-section > p,
.template-guide-section section p,
.template-guide-section footer {
  margin: 0;
  color: var(--muted);
}

.template-guide-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-guide-facts section,
.template-guide-related {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(16, 55, 68, 0.08);
  border-radius: 18px;
  background: rgba(16, 55, 68, 0.035);
}

.template-guide-facts ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 7px;
  color: var(--muted);
}

.template-guide-related .template-tag-list button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.template-guide-index {
  padding: 18px 22px;
}

.template-guide-index summary {
  cursor: pointer;
  color: var(--shell);
  font-weight: 800;
}

.template-guide-index-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 16px;
}

.template-guide-index-list .template-guide-link {
  padding: 4px 0;
}

.template-guide-card-grid {
  display: grid;
  gap: 18px;
}

.template-guide-card {
  padding: 24px;
  scroll-margin-top: 104px;
}

.template-guide-card.is-targeted {
  border-color: rgba(214, 177, 90, 0.7);
  box-shadow: 0 0 0 4px rgba(214, 177, 90, 0.16);
}

.template-guide-card:focus-visible {
  outline: none;
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 4px rgba(214, 177, 90, 0.16);
}

.template-guide-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.template-guide-card-head h2 {
  margin: 0;
}

.template-guide-card-copy {
  display: grid;
  gap: 12px;
}

.template-guide-card-copy p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

.template-guide-card-copy .template-guide-overview {
  padding: 16px 18px;
  border-left: 4px solid var(--gold-strong);
  border-radius: 0 14px 14px 0;
  background: rgba(214, 177, 90, 0.1);
  color: var(--shell);
  font-size: 15px;
}

.template-guide-structured-title {
  margin-top: 6px;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--shell);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.template-guide-field {
  display: grid;
  grid-template-columns: minmax(150px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(16, 55, 68, 0.035);
}

.template-guide-field strong {
  color: var(--shell);
  font-size: 13px;
}

.template-guide-field p {
  color: var(--muted);
}

.template-guide-original-source {
  margin: 0;
  padding: 28px;
  color: var(--text);
  font: 400 14px/1.65 var(--font-body, system-ui, sans-serif);
}

.template-guide-original-source p {
  margin: 0 0 14px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.template-guide-original-source p:empty {
  min-height: 12px;
}

.template-guide-original-source span:focus-visible {
  outline: none;
}

.contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-response-card {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.contact-response-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(16, 55, 68, 0.04);
}

.contact-response-item strong {
  color: var(--shell);
  font-size: 14px;
}

.contact-response-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.contact-card {
  padding: 24px;
  display: grid;
  gap: 10px;
}

.contact-card a,
.contact-card span:not(.panel-kicker) {
  font-size: 20px;
  font-weight: 700;
  color: var(--shell);
  word-break: break-word;
}

.contact-tagline {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.contact-card a:hover {
  color: var(--gold-deep);
}

.overview-card {
  border-radius: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
}

.overview-card span,
.case-meta,
.case-card-head,
.case-header-meta,
.step {
  color: var(--muted);
  font-size: 12px;
}

.overview-card strong {
  display: block;
  margin-top: 10px;
  color: var(--shell);
  font-size: 38px;
}

.summary-card,
.verify-form-card,
.section-note,
.bundle-panel,
.info-item,
.case-card,
.overview-card {
  backdrop-filter: blur(8px);
}

.activity-list,
.case-grid {
  display: grid;
  gap: 12px;
}

.activity-list button,
.case-card {
  text-align: left;
  border-radius: 20px;
}

.activity-list button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.activity-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.activity-list-timestamp {
  font-size: 12px;
}

.case-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.case-toolbar input,
.case-toolbar select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.92);
}

.case-toolbar input {
  flex: 1;
}

.case-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.case-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.96);
}

.case-card h3 {
  margin: 14px 0 8px;
}

.case-card-reference {
  margin: 0;
  color: var(--shell);
  font-size: 14px;
  line-height: 1.5;
}

.case-card-template {
  max-width: 42%;
  text-align: right;
}

.case-card-head,
.case-meta,
.case-header,
.case-header-meta {
  display: flex;
  gap: 10px;
}

.case-card-head,
.case-meta {
  justify-content: space-between;
}

.case-card .primary-btn {
  margin-top: 16px;
}

.case-header {
  justify-content: space-between;
  align-items: flex-start;
  border-radius: var(--radius-2xl);
  padding: 22px 24px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.94);
}

.case-header-main {
  display: grid;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.case-header h1 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 700;
}

.case-header-reference {
  margin: 0;
  color: var(--shell);
  font-size: 15px;
  line-height: 1.6;
}

.case-header-meta {
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.case-header-meta-chip {
  display: grid;
  gap: 4px;
  justify-items: end;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(16, 55, 68, 0.04);
}

.case-review-rejection, .case-review-history {
  margin-top: 14px;
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.case-review-rejection { background: #fff3f1; border: 1px solid #efb6ac; color: #7f251b; }
.case-review-history { background: #f6f8fb; border: 1px solid #d9e0eb; }
.case-review-history-item { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid #e2e7ef; }
.case-review-history-item:first-of-type { border-top: 0; }
.case-review-history-item small { color: #5d6878; }
.case-review-history-item p { margin: 0; }

.case-header-meta-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-header-meta-chip strong {
  color: var(--shell);
  font-size: 14px;
}

.case-header-meta-chip [data-case-letterhead] {
  width: min(236px, 100%);
  min-height: 38px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(16, 55, 68, 0.16);
  border-radius: 12px;
  padding: 8px 38px 8px 12px;
  color: var(--shell);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  background-color: rgba(255, 255, 255, 0.94);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23103744' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 3px 8px rgba(16, 55, 68, 0.05);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.case-header-meta-chip [data-case-letterhead]:hover {
  border-color: rgba(16, 55, 68, 0.3);
  background-color: #fff;
}

.case-header-meta-chip [data-case-letterhead]:focus-visible {
  outline: none;
  border-color: var(--gold-strong);
  box-shadow: 0 0 0 4px rgba(214, 177, 90, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.case-header-meta-chip small {
  max-width: 236px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.case-tx-strip {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px 16px;
  background: linear-gradient(145deg, rgba(16, 55, 68, 0.06), rgba(24, 80, 95, 0.02));
}

.case-tx-strip.is-available {
  border-color: rgba(47, 124, 97, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.case-tx-strip.is-pending {
  border-style: dashed;
}

.case-tx-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.case-tx-value-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.case-tx-value {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: var(--shell);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.case-tx-copy-btn {
  width: auto;
  min-width: 86px;
}

.case-tx-help,
.case-tx-empty {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.workspace-stepper-shell {
  margin: 0 0 14px;
  padding: 8px 0 12px;
  position: relative;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(16, 55, 68, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

.workspace-stepper-shell.is-pinned .stepper {
  position: fixed;
  z-index: 7;
}

.step {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.step span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #edf2f6;
  color: var(--shell);
  flex: 0 0 auto;
}

.step strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.step.is-complete {
  border-color: rgba(47, 124, 97, 0.22);
  background: rgba(47, 124, 97, 0.06);
  color: var(--success);
}

.step.is-current {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(215, 180, 91, 0.16);
}

.step.is-muted {
  opacity: 0.66;
}

.workspace-section {
  border-radius: var(--radius-2xl);
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  scroll-margin-top: 120px;
  position: relative;
}

.workspace-section + .workspace-section {
  margin-top: 14px;
}

.case-prepare-grid {
  grid-template-columns: minmax(250px, 0.82fr) minmax(0, 1.18fr);
  gap: 14px;
  align-items: start;
}

.case-prepare-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-stage-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(16, 55, 68, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
}

.workspace-stage-summary-empty {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
}

.workspace-stage-summary-empty strong {
  color: var(--shell);
  font-size: 16px;
}

.workspace-stage-summary-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.workspace-stage-summary-row {
  display: grid;
  gap: 4px;
}

.workspace-stage-summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.workspace-stage-note {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

#templateDisplayInput[readonly] {
  background: rgba(245, 248, 250, 0.96);
  color: var(--shell);
  font-weight: 600;
}

.workspace-stage-actions {
  gap: 8px;
}

.workspace-action-hint {
  position: absolute;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(179, 127, 33, 0.22);
  background: rgba(215, 180, 91, 0.08);
  max-width: 820px;
  z-index: 8;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

.workspace-action-hint-copy {
  display: grid;
  gap: 4px;
}

.workspace-action-hint-copy span {
  color: var(--shell);
  font-size: 13px;
  line-height: 1.45;
}

.workspace-compact-grid {
  display: grid;
  gap: 12px;
}

.workspace-compact-grid--controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.workspace-mini-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(16, 55, 68, 0.08);
  background: rgba(16, 55, 68, 0.03);
}

.workspace-mini-grid strong {
  font-size: 14px;
}

.workspace-mini-grid span {
  color: var(--muted);
  font-size: 12px;
}

.compact-form-card-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.signer-card {
  display: grid;
  gap: 12px;
}

.signer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.signer-card-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.signer-order-pill {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(215, 180, 91, 0.16);
  color: var(--gold-strong);
  font-weight: 800;
  flex: 0 0 auto;
}

.signer-fields-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.signer-inline-errors {
  display: grid;
  gap: 6px;
}

.signer-inline-error {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(177, 72, 72, 0.07);
  border: 1px solid rgba(177, 72, 72, 0.16);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.signer-card-actions {
  gap: 8px;
}

.dev-tools {
  border: 1px dashed rgba(179, 127, 33, 0.42);
  border-radius: 18px;
  padding: 14px;
  background: rgba(215, 180, 91, 0.06);
}

.dev-tools summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--warn);
}

.case-dialog {
  width: min(620px, calc(100% - 32px));
  border-radius: var(--radius-2xl);
  padding: 30px;
  background: rgba(255, 255, 255, 0.96);
}

.email-preview-dialog {
  width: min(980px, calc(100% - 32px));
}

.email-template-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
  max-height: min(92dvh, 980px);
  padding: 0;
  overflow: hidden;
}

.email-template-workbench {
  max-height: min(92dvh, 980px);
  overflow-y: auto;
  padding: 32px 36px 38px;
  display: grid;
  gap: 26px;
}

.email-template-workbench-head,
.email-template-section-head,
.email-scenario-card-top,
.email-scenario-meta,
.email-log-entry,
.email-log-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.email-template-workbench-head,
.email-template-section-head,
.email-log-entry {
  justify-content: space-between;
}

.email-template-workbench-head > div,
.email-template-section-head > div,
.email-log-entry > div:first-child {
  min-width: 0;
}

.email-template-workbench-head h2,
.email-template-section-head h3 {
  margin: 0;
}

.email-template-workbench-head p,
.email-template-section-head p,
.email-scenario-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.email-template-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--line);
}

.email-template-meta > div {
  display: grid;
  gap: 5px;
  padding: 15px 17px;
  background: rgba(255, 255, 255, 0.94);
}

.email-template-meta span,
.email-template-preview-line span,
.email-log-entry span,
.email-scenario-meta {
  color: var(--muted);
  font-size: 13px;
}

.email-template-content {
  display: grid;
  gap: 16px;
}

.email-template-preview {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.email-template-preview-line {
  display: grid;
  gap: 6px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.email-template-preview-body {
  min-height: 420px;
  max-height: none;
  margin: 0;
  padding: 28px 34px;
  border: 0;
  border-radius: 0;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.8;
}

.email-template-editor {
  display: grid;
  gap: 18px;
}

.email-template-editor textarea {
  min-height: 420px;
  resize: vertical;
}

.email-editor-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  gap: 18px;
  align-items: start;
}

.email-preview-frame {
  display: block;
  width: 100%;
  min-height: 520px;
  border: 0;
  background: #f4f7f6;
}

.email-live-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f4f7f6;
}

.email-theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.email-theme-preview-grid section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.email-theme-preview-grid section > strong {
  display: block;
  padding: 8px 10px;
  font-size: 12px;
}

.email-theme-preview-grid .email-preview-frame {
  min-height: 420px;
}

.email-live-preview-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.email-template-actions .primary-btn,
.email-template-actions .secondary-btn,
.email-log-actions .primary-btn,
.email-log-actions .secondary-btn,
.email-scenario-card .status-badge {
  white-space: nowrap;
}

.email-log-actions .primary-btn,
.email-log-actions .secondary-btn,
.email-scenario-card .primary-btn,
.email-scenario-card .secondary-btn {
  white-space: nowrap;
}

.email-scenario-heading {
  margin-bottom: 14px;
}

.email-scenario-heading h3 {
  margin: 0;
}

.email-scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.email-scenario-card {
  display: grid;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--shell);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.email-scenario-card:hover,
.email-scenario-card:focus-visible {
  border-color: var(--gold-strong);
  box-shadow: 0 10px 24px rgba(16, 55, 68, 0.10);
  outline: none;
}

.email-scenario-card:active { transform: translateY(1px); }

.email-scenario-card-top { justify-content: space-between; }
.email-scenario-card-top strong { font-size: 16px; }
.email-scenario-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.email-scenario-meta { justify-content: space-between; }

.email-log-list { display: grid; gap: 10px; }

.email-log-entry,
.email-log-empty {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.email-log-entry > div:first-child { display: grid; gap: 4px; }
.email-log-actions { flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 720px) {
  .email-template-workbench { padding: 24px 20px 28px; }
  .email-template-workbench-head,
  .email-template-section-head,
  .email-log-entry { align-items: flex-start; flex-direction: column; }
  .email-template-meta { grid-template-columns: 1fr; }
  .email-template-preview-body { min-height: 300px; padding: 20px; }
  .email-editor-preview-grid { grid-template-columns: 1fr; }
  .email-preview-frame { min-height: 360px; }
  .email-scenario-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
}

.branding-preview-dialog {
  width: min(1040px, calc(100% - 32px));
}

.letterhead-confirm-dialog {
  width: min(760px, calc(100vw - 32px));
}

.letterhead-layout-dialog { width: min(940px, calc(100vw - 32px)); }
.letterhead-layout-editor { display: grid; gap: 16px; }
.letterhead-layout-canvas {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 52, 61, .18);
  touch-action: none;
}
.letterhead-layout-safe { position: absolute; border: 1px dashed rgba(18, 109, 138, .6); background: rgba(18, 109, 138, .04); pointer-events: none; }
.letterhead-layout-canvas img { position: absolute; display: block; height: auto; object-fit: contain; object-position: top left; cursor: grab; user-select: none; touch-action: none; }
.letterhead-layout-canvas img:active { cursor: grabbing; }
.letterhead-layout-resize { position: absolute; width: 18px; height: 18px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--accent, #126d8a); transform: translate(-50%, -50%); cursor: nwse-resize; touch-action: none; }
.letterhead-layout-body-line { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(196, 90, 69, .7); color: #9b4a38; font-size: 10px; padding: 3px 6px; pointer-events: none; }

.letterhead-a4-stage {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #eef3f3;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.letterhead-a4-page {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 210 / 297;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 52, 61, .18);
}

.letterhead-a4-page img {
  position: absolute;
  object-fit: contain;
  object-position: top center;
}

.letterhead-crop-line {
  position: absolute;
  left: 0;
  width: 100%;
  border-top: 2px dashed #c45a45;
  pointer-events: none;
}

.letterhead-a4-body {
  position: absolute;
  left: 9%;
  width: 82%;
  display: grid;
  gap: 5px;
  color: #375f69;
  font-size: 9px;
  line-height: 1.25;
}

.letterhead-a4-body strong { font-size: 11px; }
.letterhead-a4-body span { color: #6a7f85; }
.letterhead-a4-body i { display: block; height: 3px; border-radius: 99px; background: #dce5e7; }

.stored-letterhead-a4-stage {
  width: 100%;
}

.stored-letterhead-a4-stage.is-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.stored-letterhead-a4-stage.is-card .letterhead-a4-page {
  width: 100%;
  box-shadow: none;
}

.stored-letterhead-a4-stage.is-card .letterhead-a4-body {
  font-size: 4px;
  gap: 2px;
}

.stored-letterhead-a4-stage.is-card .letterhead-a4-body strong { font-size: 5px; }
.stored-letterhead-a4-stage.is-card .letterhead-a4-body i { height: 1px; }

.stored-letterhead-a4-stage.is-dialog .letterhead-a4-page {
  width: min(100%, 580px);
}

.branding-preview-card {
  display: grid;
  gap: 18px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.branding-asset-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.branding-asset-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.branding-asset-meta-grid {
  margin-top: -2px;
}

.branding-preview-tile {
  display: grid;
  width: 100%;
  min-height: 112px;
  padding: 10px;
  border: 1px solid rgba(16, 55, 68, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 55, 68, 0.02), rgba(214, 177, 90, 0.08));
  cursor: pointer;
  place-items: center;
  overflow: hidden;
}

.branding-preview-tile:hover {
  border-color: rgba(16, 55, 68, 0.18);
  box-shadow: 0 10px 24px rgba(12, 35, 45, 0.08);
}

.branding-preview-tile:focus-visible {
  outline: 3px solid rgba(18, 109, 138, 0.22);
  outline-offset: 3px;
}

.branding-preview-viewport {
  display: grid;
  gap: 12px;
}

.branding-preview-image {
  width: 100%;
  height: 100%;
  max-height: 96px;
  object-fit: contain;
}

.branding-preview-image.is-dialog {
  height: auto;
  max-height: min(72vh, 960px);
  border-radius: 14px;
  border: 1px solid rgba(16, 55, 68, 0.08);
}

.branding-preview-pdf-shell {
  width: 100%;
  min-height: 96px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(16, 55, 68, 0.08);
  background: rgba(245, 248, 250, 0.96);
}

.branding-preview-pdf-shell.is-dialog {
  min-height: min(76vh, 980px);
  border-radius: 14px;
}

.branding-preview-pdf-frame {
  display: block;
  width: 100%;
  height: 96px;
  border: 0;
  background: white;
}

.branding-preview-pdf-frame.is-dialog {
  height: min(76vh, 980px);
}

.branding-preview-fallback {
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: start;
  min-height: 96px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(16, 55, 68, 0.18);
  background: rgba(245, 248, 250, 0.88);
}

.branding-preview-fallback.is-dialog {
  min-height: 320px;
  border-radius: 14px;
}

.branding-preview-fallback strong {
  color: var(--shell);
}

.branding-preview-fallback span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .branding-asset-row {
    grid-template-columns: 1fr;
  }

  .branding-preview-tile {
    max-width: 180px;
  }
}

.case-dialog::backdrop {
  background: rgba(12, 35, 45, 0.48);
}

.registry-table tbody tr {
  cursor: pointer;
}

.registry-table tbody tr:hover {
  background: rgba(33, 79, 93, 0.04);
}

.registry-table code {
  color: var(--shell);
  font-size: 12px;
  font-weight: 700;
}

.workspace-note {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.workspace-note-compact {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
}

#templateCatalogHint,
#newCaseTemplateHint {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 248, 250, 0.92);
  border: 1px solid rgba(27, 44, 58, 0.08);
}

#templateCatalogHint strong,
#newCaseTemplateHint strong {
  color: var(--shell);
  font-size: 13px;
}

#templateCatalogHint span,
#newCaseTemplateHint span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.template-integrity-card {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(16, 55, 68, 0.1);
}

.template-integrity-card.is-match {
  background: linear-gradient(145deg, rgba(240, 248, 244, 0.96), rgba(255, 255, 255, 0.98));
  border-color: rgba(47, 124, 97, 0.16);
}

.template-integrity-card.is-mismatch {
  background: linear-gradient(145deg, rgba(253, 241, 241, 0.96), rgba(255, 255, 255, 0.98));
  border-color: rgba(177, 72, 72, 0.16);
}

.template-integrity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.template-integrity-head strong {
  color: var(--shell);
  font-size: 16px;
}

.template-integrity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.external-link-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.external-link-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px 20px;
  align-items: start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(16, 55, 68, 0.03);
}

.external-link-row strong,
.external-link-row span {
  display: block;
}

.external-link-row span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.external-link-row .bundle-list,
.external-link-row .workspace-note {
  grid-column: 1 / -1;
}

.external-link-row .bundle-list-item {
  background: rgba(255, 255, 255, 0.9);
}

.email-preview-card {
  padding: 18px 20px;
}

.email-preview-header {
  display: grid;
  gap: 4px;
  margin-bottom: 16px;
}

.email-preview-header p {
  margin: 0;
}

.email-preview-body {
  margin: 0;
  min-height: 260px;
  max-height: 52vh;
  overflow: auto;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(33, 79, 93, 0.12);
  background: rgba(245, 248, 250, 0.92);
  color: #183742;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.compact-wrap {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.external-link-url {
  display: block;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(16, 55, 68, 0.04);
  color: var(--shell);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.external-verify-context .info-grid {
  margin-top: 18px;
}

.external-verify-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

@media (max-width: 1200px) {
  .public-hero,
  .public-verify-layout,
  .feature-grid,
  .overview-grid,
  .trust-strip,
  .case-prepare-grid,
  .stepper {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .signature-flow,
  .verify-intro-grid,
  .leaf-result-grid,
  .sealguard-meta,
  .fields-grid {
    grid-template-columns: 1fr;
  }

  .legal-party-grid .party-layout-spacer {
    display: none;
  }

  .legal-party-grid .party-field-name,
  .legal-party-grid .party-field-address1,
  .legal-party-grid .party-field-address2 {
    grid-column: 1 / -1;
  }

  .workspace-stage-summary,
  .workspace-mini-grid,
  .workspace-compact-grid--controls {
    grid-template-columns: 1fr;
  }

  .signing-telemetry {
    grid-template-columns: 1fr;
  }

  .bundle-overview-grid,
  .bundle-guidance-grid {
    grid-template-columns: 1fr;
  }

  .bundle-list {
    grid-template-columns: 1fr;
  }

  .accent-card {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    z-index: 4;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    padding: 16px 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    padding: 18px;
  }

  .public-home {
    padding: 22px 16px 28px;
  }

  .public-nav {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 28px;
  }

  .public-nav-brand {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .public-nav-brand img {
    width: min(280px, 100%);
  }

  .public-nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .public-verify-hero,
  .public-verify-workbench,
  .hero-copy,
  .product-login-card,
  .product-section,
  .workspace-section,
  .case-header,
  .product-hero-card {
    padding: 22px;
  }

  .hero-copy h1,
  .product-login-card h2,
  .product-hero-card h1,
  .panel-head h1,
  .case-header h1 {
    font-size: clamp(30px, 8vw, 48px);
  }

  .sealguard-body {
    grid-template-columns: 1fr;
  }

  .result-header {
    align-items: flex-start;
  }

  .case-header,
  .case-tx-value-row {
    flex-direction: column;
  }

  .case-header-meta {
    align-items: flex-start;
  }

  .compact-form-card-head,
  .signer-card-head {
    flex-direction: column;
  }

  .billing-grid,
  .billing-manage-grid,
  .billing-locale-grid,
  .billing-invoice-meta,
  .contact-response-card,
  .contact-grid,
  .introduction-overview-strip,
  .introduction-step-grid,
  .introduction-guide-card-grid,
  .introduction-guide-shell,
  .template-guide-shell,
  .template-guide-facts {
    grid-template-columns: 1fr;
  }

  .template-guide-field {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .billing-card.is-featured {
    transform: none;
  }

  .billing-price-grid {
    grid-template-columns: 1fr;
  }

  .billing-cta-grid {
    grid-template-columns: 1fr;
  }

  .billing-section-head,
  .billing-overview-head,
  .billing-ops-head,
  .recent-activity-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .introduction-guide-nav,
  .template-guide-nav {
    position: static;
  }
}

@media (max-width: 640px) {
  .button-row,
  .sticky-actions,
  .hero-actions,
  .public-nav-actions,
  .topbar-right,
  .case-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .result-link,
  .copy-btn {
    width: 100%;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .user-menu,
  .user-menu-trigger,
  .user-menu-dropdown {
    width: 100%;
  }

  .user-menu-dropdown {
    right: auto;
    left: 0;
  }

  .profile-billing-grid {
    grid-template-columns: 1fr;
  }

  .billing-inline-note {
    width: 100%;
    border-radius: 18px;
    justify-content: space-between;
  }

  .settings-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-action-btn {
    width: 100%;
  }

  .case-card-template {
    max-width: none;
    text-align: left;
  }
}

/* Targeted evolution: shared rhythm, interaction states, and responsive shell. */
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.app-shell,
.login-screen,
.public-home {
  min-height: 100vh;
  min-height: 100dvh;
}

:where(h1, h2, h3) {
  line-height: 1.15;
  text-wrap: balance;
}

:where(p, li) {
  text-wrap: pretty;
}

.login-copy,
.hero-lede,
.hero-footnote,
.result-header-copy,
.form-card-head p,
.group-note,
.recent-activity-copy,
.workspace-empty-state p {
  max-width: var(--measure);
}

.field-help,
.group-note,
.form-card-head p,
.result-header-copy,
.workspace-empty-state p {
  line-height: 1.65;
}

.panel-head {
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.panel-kicker {
  margin-bottom: var(--space-2);
  color: var(--gold-text);
  line-height: 1.4;
}

.hero-copy .panel-kicker,
.trust-strip .panel-kicker {
  color: var(--gold-soft);
}

.panel-head h1 {
  font-size: clamp(28px, 2.4vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.topbar-subtitle,
.public-legal-copy,
.field-help,
.group-note,
.form-card-head p,
.result-header-copy,
.workspace-empty-state p,
.feature-card p,
.public-verify-guardrails span {
  color: var(--muted-strong);
}

.public-nav-brand-copy span,
.feature-card > span {
  color: var(--gold-text);
}

.public-verify-hero .hero-lede {
  color: var(--muted-strong);
}

.public-nav,
.public-hero,
.product-section,
.trust-strip,
.public-legal-footer,
.public-verify-layout {
  width: min(var(--content-max), 100%);
}

.public-hero {
  align-items: start;
}

.workspace {
  padding: var(--space-6);
  scrollbar-gutter: stable;
}

.workspace > .view-panel {
  width: min(100%, var(--workspace-max));
  margin-inline: auto;
}

.home-view-panel.is-active {
  gap: var(--space-5);
}

.view-panel.is-active {
  animation: view-panel-enter var(--motion-standard) var(--ease-out) both;
}

@keyframes view-panel-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.copy-btn,
.nav-item,
.user-menu-item,
.text-btn,
.result-link {
  transition-duration: var(--motion-fast);
  transition-timing-function: var(--ease-out);
}

.primary-btn:active:not(:disabled),
.secondary-btn:active:not(:disabled),
.ghost-btn:active:not(:disabled),
.copy-btn:active:not(:disabled),
.nav-item:active:not(:disabled),
.user-menu-item:active,
.text-btn:active,
.result-link:active {
  transform: translateY(1px) scale(0.99);
}

button.is-loading {
  cursor: wait;
  opacity: 0.78;
}

.text-btn {
  min-height: 44px;
}

.password-toggle {
  width: 44px;
  height: 44px;
}

.file-picker-trigger {
  min-height: 44px;
}

:where(a[href], button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring) !important;
  outline-offset: 3px !important;
}

.sidebar :where(a[href], button):focus-visible,
.hero-copy :where(a[href], button):focus-visible,
.trust-strip :where(a[href], button):focus-visible {
  outline-color: var(--gold-soft) !important;
}

.public-legal-links a,
.login-legal-note a,
.dialog-legal-links a,
.consent-check a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.public-legal-links a:hover,
.public-legal-links a:focus-visible,
.login-legal-note a:hover,
.login-legal-note a:focus-visible,
.dialog-legal-links a:hover,
.dialog-legal-links a:focus-visible,
.consent-check a:hover,
.consent-check a:focus-visible {
  text-decoration-line: underline;
}

.mobile-nav-toggle {
  display: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.toast {
  z-index: 100;
  line-height: 1.5;
}

@media (min-width: 761px) and (max-width: 1200px) {
  .feature-grid,
  .overview-grid,
  .trust-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trust-strip div:nth-child(odd) {
    border-left: 0;
  }
}

@media (max-width: 920px) {
  .main-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    padding: var(--space-3) var(--space-4);
    gap: 0;
  }

  .brand-block {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0;
    border-bottom: 0;
  }

  .brand-logo {
    width: 88px;
  }

  .brand-name {
    font-size: 20px;
    line-height: 1.1;
  }

  .brand-subtitle {
    margin-top: 2px;
    font-size: 11px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-list {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar.is-mobile-open .nav-list {
    display: grid;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    min-height: 0;
    padding: var(--space-3) var(--space-4);
    align-items: center;
    flex-direction: row;
  }

  .topbar-subtitle {
    max-width: 60ch;
    line-height: 1.45;
  }

  .workspace {
    padding: var(--space-5) 18px var(--space-6);
  }

  .panel-head {
    margin-bottom: var(--space-4);
  }

  .public-nav {
    margin-bottom: var(--space-6);
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: var(--space-3);
  }

  .topbar-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-2);
  }

  .user-menu,
  .user-menu-trigger {
    min-width: 0;
  }

  .header-pill {
    padding: 7px 9px;
    font-size: 11px;
    white-space: nowrap;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .panel-head {
    gap: var(--space-3);
  }

  .public-home {
    padding-inline: var(--space-4);
  }

  .hero-copy,
  .product-login-card,
  .product-section,
  .workspace-section,
  .case-header,
  .product-hero-card,
  .public-verify-hero,
  .public-verify-workbench {
    padding: var(--space-5);
  }

  .public-verify-hero h1 {
    font-size: clamp(34px, 11vw, 46px);
  }

  .toast {
    right: var(--space-4);
    bottom: var(--space-4);
    left: var(--space-4);
    min-width: 0;
    max-width: none;
  }
}

@media (hover: none), (pointer: coarse) {
  .primary-btn:hover,
  .secondary-btn:hover,
  .ghost-btn:hover,
  .copy-btn:hover,
  .nav-item:hover,
  .feature-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  :where(a[href], button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid Highlight !important;
  }
}

/* Case management redesign: scan-first list and single-stage workspace. */
.cases-panel,
.case-workspace-panel,
.case-card,
.case-card > *,
.case-header,
.case-header-main,
.case-header-main > *,
.case-header-meta,
.case-header-meta-chip,
.workspace-command-panel,
.workspace-stage-summary,
.workspace-section,
.workspace-section > *,
.group-card,
.fields-grid > * {
  min-width: 0;
}

.cases-panel {
  max-width: 1240px;
}

.cases-panel .panel-head {
  align-items: flex-end;
}

.cases-panel .case-toolbar {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.cases-panel .case-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
}

.cases-panel .case-card {
  display: grid;
  grid-template-columns: minmax(108px, auto) minmax(240px, 1.6fr) minmax(170px, 0.9fr) minmax(180px, 0.8fr) auto;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) 18px;
  border-radius: var(--radius-md);
  box-shadow: none;
  backdrop-filter: none;
  transition: border-color var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
}

.cases-panel .case-card:hover {
  border-color: rgba(16, 55, 68, 0.24);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 43, 54, 0.07);
}

.case-card-status {
  align-self: start;
}

.cases-panel .case-card-main {
  display: grid;
  gap: var(--space-1);
}

.cases-panel .case-card h3 {
  margin: 0;
  color: var(--shell);
  font-size: 18px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cases-panel .case-card-reference,
.cases-panel .case-card-template,
.cases-panel .case-meta span {
  overflow-wrap: anywhere;
}

.cases-panel .case-card-reference {
  font-size: 13px;
}

.cases-panel .case-card-template {
  max-width: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.cases-panel .case-meta {
  display: grid;
  justify-content: initial;
  gap: var(--space-1);
  line-height: 1.45;
}

.cases-panel .case-card .case-card-action {
  min-width: 116px;
  margin-top: 0;
  white-space: nowrap;
}

.workspace-case-overview {
  display: grid;
  gap: var(--space-3);
}

.case-workspace-panel .case-header {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 34px rgba(15, 43, 54, 0.08);
}

.case-workspace-panel .case-header-main {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  align-items: start;
  gap: var(--space-6);
}

.case-workspace-panel .case-header h1 {
  max-width: 22ch;
  margin-bottom: var(--space-2);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.case-workspace-panel .case-header-reference {
  overflow-wrap: anywhere;
}

.case-workspace-panel .case-tx-strip {
  align-self: stretch;
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.case-workspace-panel .case-header-meta {
  display: grid;
  grid-template-columns: minmax(120px, 0.5fr) minmax(180px, 0.7fr) minmax(260px, 1.4fr);
  align-items: stretch;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.case-workspace-panel .case-header-meta-chip {
  align-content: start;
  justify-items: start;
  padding: 0;
  background: transparent;
}

.case-workspace-panel .case-header-meta-chip strong,
.case-workspace-panel .case-header-meta-chip small {
  max-width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
}

.case-workspace-panel .case-header-meta-chip [data-case-letterhead] {
  width: 100%;
  min-height: 44px;
}

.workspace-command-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
}

.case-workspace-panel .workspace-stage-summary {
  grid-template-columns: minmax(140px, 0.55fr) minmax(260px, 1.35fr) minmax(240px, 1fr);
  gap: var(--space-5);
  margin: 0;
  padding: 18px var(--space-5);
  border: 0;
  border-radius: 0;
  background: transparent;
}

.case-workspace-panel .workspace-stage-summary-row {
  align-content: start;
  gap: var(--space-2);
}

.case-workspace-panel .workspace-stage-summary-row strong,
.case-workspace-panel .workspace-stage-summary-row > span:last-child {
  color: var(--shell);
  font-size: 15px;
  line-height: 1.5;
}

.case-workspace-panel .case-action-bar {
  justify-content: flex-end;
  margin: 0;
  padding: 0 var(--space-5) 18px;
}

.case-workspace-panel .case-action-bar:not(:empty) {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.case-workspace-panel .workspace-stepper-shell {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: var(--space-3) 0 var(--space-4);
  padding: var(--space-2) 0;
  background: linear-gradient(180deg, rgba(239, 244, 243, 0.98), rgba(247, 243, 233, 0.94));
}

.case-workspace-panel .stepper {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgba(15, 43, 54, 0.07);
}

.case-workspace-panel .step {
  min-height: 48px;
  padding: 10px var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: color var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
}

.case-workspace-panel .step:hover:not([aria-disabled="true"]) {
  background: rgba(16, 55, 68, 0.06);
}

.case-workspace-panel .step.is-complete {
  border: 0;
  background: transparent;
  color: var(--success);
}

.case-workspace-panel .step.is-workflow-current {
  color: var(--shell);
  box-shadow: inset 0 -2px 0 rgba(47, 124, 97, 0.5);
}

.case-workspace-panel .step.is-current {
  background: rgba(214, 177, 90, 0.16);
  color: var(--shell);
  box-shadow: inset 0 0 0 1px rgba(197, 154, 50, 0.56);
}

.case-workspace-panel .step.is-muted {
  opacity: 0.42;
  cursor: not-allowed;
}

.case-workspace-panel .workspace-stage-section[hidden] {
  display: none !important;
}

.case-workspace-panel .workspace-stage-section {
  margin-top: 0;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(15, 43, 54, 0.07);
  backdrop-filter: none;
}

.case-workspace-panel .workspace-stage-section.is-stage-active {
  animation: workspace-stage-enter var(--motion-standard) var(--ease-out) both;
}

@keyframes workspace-stage-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.case-workspace-panel .workspace-stage-section > .panel-head {
  align-items: center;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.case-workspace-panel .workspace-stage-section > .panel-head h1 {
  font-size: clamp(26px, 2.4vw, 34px);
}

.case-workspace-panel .workspace-stage-note {
  max-width: 72ch;
  margin: 0 0 var(--space-5);
  padding-left: var(--space-4);
  border-left: 3px solid var(--gold);
  line-height: 1.65;
}

.case-workspace-panel .verify-form-card,
.case-workspace-panel .summary-card,
.case-workspace-panel .section-note,
.case-workspace-panel .readiness-card {
  border-radius: var(--radius-md);
  box-shadow: none;
  backdrop-filter: none;
}

.case-workspace-panel .verify-form-card {
  padding: var(--space-5);
  background: rgba(243, 247, 246, 0.7);
}

.case-workspace-panel #formSections {
  gap: 0;
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.case-workspace-panel #formSections .group-card {
  padding: var(--space-5) 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.case-workspace-panel #formSections .group-card > h3 {
  margin-bottom: var(--space-4);
  color: var(--shell);
  font-size: 18px;
}

.case-workspace-panel #formSections .workspace-form-group {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1.66fr);
  align-items: start;
  gap: var(--space-6);
}

.case-workspace-panel #formSections .workspace-form-group > h3 {
  position: sticky;
  top: 88px;
  margin: 2px 0 0;
  line-height: 1.45;
}

.dsca-attachment-panel {
  display: grid;
  gap: var(--space-5);
}

.case-workspace-panel #formSections .dsca-attachment-panel > h3 {
  margin: 0;
}

.dsca-attachment-heading,
.dsca-attachment-section-head,
.dsca-revision-row-head,
.attachment-row,
.attachment-row-actions,
.dsca-attachment-actions {
  display: flex;
  align-items: center;
}

.dsca-attachment-heading,
.dsca-attachment-section-head,
.dsca-revision-row-head,
.attachment-row {
  justify-content: space-between;
}

.dsca-attachment-heading {
  align-items: flex-start;
  gap: var(--space-5);
}

.dsca-attachment-heading h3,
.dsca-attachment-section-head h4 {
  margin: 0;
  color: var(--shell);
}

.dsca-attachment-heading .field-help {
  max-width: 72ch;
  margin: var(--space-2) 0 0;
}

.dsca-revision-badge {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(16, 55, 68, 0.12);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--shell);
  font-size: 12px;
  font-weight: 800;
}

.dsca-attachment-policy {
  margin: calc(var(--space-3) * -1) 0 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--gold);
  background: rgba(214, 177, 90, 0.08);
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
}

.dsca-attachment-section {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(243, 247, 246, 0.72);
}

.dsca-attachment-section-head {
  gap: var(--space-4);
}

.dsca-attachment-section-head h4 {
  font-size: 16px;
}

.dsca-attachment-section-head > span,
.dsca-revision-row-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attachment-list,
.dsca-revision-list {
  display: grid;
  gap: var(--space-2);
}

.attachment-row {
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid rgba(16, 55, 68, 0.09);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.attachment-row-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attachment-row-copy strong,
.attachment-row-copy span,
.attachment-row-copy code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-row-copy strong {
  color: var(--shell);
  font-size: 14px;
}

.attachment-row-copy span,
.attachment-row-copy code {
  color: var(--muted);
  font-size: 12px;
}

.attachment-row-actions,
.dsca-attachment-actions {
  flex: 0 0 auto;
  gap: var(--space-2);
}

.dsca-attachment-empty {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5);
  border: 1px dashed rgba(16, 55, 68, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
}

.dsca-attachment-empty strong {
  color: var(--shell);
}

.dsca-attachment-empty span {
  color: var(--muted);
  font-size: 13px;
}

.dsca-upload-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dsca-file-field {
  grid-column: 1 / -1;
}

.dsca-file-field > .field-help {
  margin: -2px 0 0;
  font-size: 12px;
}

.dsca-attachment-actions {
  justify-content: flex-end;
}

.dsca-revision-history {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
}

.dsca-revision-history summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  color: var(--shell);
  font-weight: 800;
  cursor: pointer;
}

.dsca-revision-history summary > span {
  color: var(--muted);
  font-size: 12px;
}

.dsca-revision-list {
  padding: 0 var(--space-5) var(--space-5);
}

.dsca-revision-row {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid var(--line);
}

.dsca-revision-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
}

.dsca-revision-row dl > div {
  display: grid;
  gap: 2px;
}

.dsca-revision-row dl > div:nth-child(n + 4) {
  grid-column: 1 / -1;
}

.dsca-revision-row dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dsca-revision-row dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.dsca-revision-row .text-btn {
  justify-self: start;
}

.case-workspace-panel .sticky-actions {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.case-workspace-panel .case-tx-value,
.case-workspace-panel .info-item code,
.case-workspace-panel .result-value,
.case-workspace-panel .artifact-value {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1280px) {
  .cases-panel .case-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-3) var(--space-4);
  }

  .cases-panel .case-card-status {
    grid-row: 1 / span 2;
  }

  .cases-panel .case-card-template,
  .cases-panel .case-meta {
    grid-column: 2;
  }

  .cases-panel .case-card .case-card-action {
    grid-column: 3;
    grid-row: 1 / span 3;
  }

  .case-workspace-panel .case-header-main {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 1181px) {
  .workspace-case-overview {
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
    align-items: stretch;
    gap: var(--space-4);
  }

  .case-workspace-panel .case-header,
  .case-workspace-panel .workspace-command-panel {
    height: 100%;
  }

  .case-workspace-panel .case-header-main {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .case-workspace-panel .case-header-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-workspace-panel .case-header-meta-chip:last-child {
    grid-column: 1 / -1;
  }

  .case-workspace-panel .workspace-stage-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-5);
  }

  .case-workspace-panel .workspace-stage-summary-row + .workspace-stage-summary-row {
    padding-top: var(--space-4);
    border-top: 1px solid var(--line);
  }

  .case-workspace-panel .case-action-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    align-items: stretch;
  }
}

@media (min-width: 921px) and (max-width: 1180px) {
  .topbar {
    padding: var(--space-3) 18px;
  }

  .topbar-subtitle {
    display: none;
  }

  .topbar-right {
    gap: var(--space-2);
  }

  .header-pill {
    padding: 7px 9px;
    font-size: 11px;
  }

  .case-workspace-panel .stepper {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 0.72fr);
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }

  .case-workspace-panel .step {
    scroll-snap-align: start;
  }
}

@media (max-width: 920px) {
  .case-workspace-panel .case-header-meta,
  .case-workspace-panel .workspace-stage-summary {
    grid-template-columns: 1fr;
  }

  .case-workspace-panel .case-header-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-workspace-panel .case-header-meta-chip:last-child {
    grid-column: 1 / -1;
  }

  .case-workspace-panel .workspace-stepper-shell {
    margin-inline: -18px;
    padding-inline: 18px;
  }

  .case-workspace-panel .stepper {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 0.72fr);
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }

  .case-workspace-panel .step {
    scroll-snap-align: start;
  }

  .case-workspace-panel .workspace-stage-section {
    padding: var(--space-5);
  }

  .case-workspace-panel #formSections .workspace-form-group {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .case-workspace-panel #formSections .workspace-form-group > h3 {
    position: static;
  }
}

@media (max-width: 700px) {
  .cases-panel .case-card {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .cases-panel .case-card-status,
  .cases-panel .case-card-main,
  .cases-panel .case-card-template,
  .cases-panel .case-meta,
  .cases-panel .case-card .case-card-action {
    grid-column: 1;
    grid-row: auto;
  }

  .cases-panel .case-card .case-card-action {
    width: 100%;
  }

  .case-workspace-panel .case-header,
  .case-workspace-panel .workspace-stage-section {
    padding: 18px;
  }

  .case-workspace-panel .case-header-meta {
    grid-template-columns: 1fr;
  }

  .case-workspace-panel .case-header-meta-chip:last-child {
    grid-column: auto;
  }

  .case-workspace-panel .case-tx-value-row {
    align-items: stretch;
  }

  .case-workspace-panel .workspace-stage-summary {
    gap: var(--space-4);
    padding: var(--space-4);
  }

  .case-workspace-panel .case-action-bar {
    justify-content: stretch;
    padding: 0 var(--space-4) var(--space-4);
  }

  .case-workspace-panel .case-action-bar > * {
    width: 100%;
  }

  .case-workspace-panel .workspace-stage-section > .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .case-workspace-panel .verify-form-card {
    padding: var(--space-4);
  }

  .dsca-attachment-heading,
  .dsca-attachment-section-head,
  .dsca-revision-row-head,
  .attachment-row {
    align-items: stretch;
    flex-direction: column;
  }

  .dsca-revision-badge {
    align-self: flex-start;
  }

  .dsca-upload-fields,
  .dsca-revision-row dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .dsca-file-field,
  .dsca-revision-row dl > div:nth-child(n + 4) {
    grid-column: auto;
  }

  .attachment-row-actions,
  .dsca-attachment-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    width: 100%;
  }

  .attachment-row-actions > *,
  .dsca-attachment-actions > * {
    width: 100%;
  }
}

/* Public entry: modern, trust-first brand landing page. */
.entry-page {
  min-height: 100dvh;
  padding: 22px 28px 36px;
  background: #f3f5f1;
}

.entry-nav,
.entry-hero,
.entry-workflow,
.entry-proof,
.entry-footer {
  width: min(var(--content-max), 100%);
  margin-inline: auto;
}

.entry-nav {
  min-height: 68px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.entry-brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.entry-brand img {
  width: 152px;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.entry-brand strong {
  color: var(--shell);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.entry-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 400px);
  gap: var(--space-5);
  align-items: stretch;
}

.entry-story {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  display: grid;
  align-items: center;
  border-radius: var(--radius-md);
  background: var(--shell);
  isolation: isolate;
}

.entry-story::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(10, 42, 52, 0.98) 0%, rgba(10, 42, 52, 0.84) 46%, rgba(10, 42, 52, 0.18) 100%);
}

.entry-story-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
}

.entry-story-copy {
  display: grid;
  justify-items: start;
  gap: 0;
  width: min(620px, 78%);
  padding: 48px;
  color: #f7f8f5;
}

.entry-eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.entry-product-name {
  margin: 0;
  color: #f7f8f5;
  font-size: clamp(58px, 7vw, 88px);
  font-weight: 750;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.entry-story h1 {
  max-width: 22ch;
  margin: var(--space-5) 0 0;
  color: rgba(247, 248, 245, 0.94);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.entry-story-copy > .entry-summary {
  max-width: 440px;
  margin: var(--space-4) 0 0;
  color: rgba(247, 248, 245, 0.76);
  font-size: 15px;
  line-height: 1.55;
}

.entry-verify-btn {
  width: auto;
  min-width: 154px;
  margin-top: var(--space-6);
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-sm);
  background: rgba(248, 249, 246, 0.96);
  color: var(--shell);
  white-space: nowrap;
}

.entry-verify-btn:hover,
.entry-verify-btn:focus-visible {
  border-color: var(--gold-soft);
  background: #fff;
  color: var(--shell);
}

.entry-login-card {
  min-height: 590px;
  align-content: center;
  gap: var(--space-3);
  padding: 38px;
  border: 1px solid rgba(20, 52, 63, 0.13);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 50px rgba(15, 43, 54, 0.1);
  backdrop-filter: none;
}

.entry-login-card h2 {
  margin: 0;
  color: var(--shell);
  font-size: clamp(32px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.entry-login-card .login-copy {
  max-width: 34ch;
  margin: 0 0 var(--space-3);
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.6;
}

.entry-login-card .field input {
  min-height: 50px;
  border-radius: var(--radius-sm);
}

.entry-login-card .primary-btn {
  min-height: 48px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.entry-login-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-top: var(--space-2);
  color: var(--muted-strong);
  font-size: 14px;
}

.entry-login-links .text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
}

.entry-login-links span .text-btn {
  margin-left: 4px;
}

.entry-login-card .login-error:empty {
  display: none;
}

.entry-login-card .login-legal-note {
  margin-top: var(--space-2);
  font-size: 12px;
  line-height: 1.55;
}

.entry-workflow {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.5fr);
  gap: var(--space-7);
  align-items: end;
  margin-top: var(--space-6);
  padding: var(--space-7) 0;
  border-top: 1px solid rgba(20, 52, 63, 0.16);
  border-bottom: 1px solid rgba(20, 52, 63, 0.16);
}

.entry-section-heading h2,
.entry-proof-copy h2 {
  margin: 0;
  color: var(--shell);
  font-size: clamp(30px, 3.3vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.entry-section-heading p,
.entry-proof-copy > p {
  max-width: 48ch;
  margin: var(--space-4) 0 0;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.65;
}

.entry-workflow-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.entry-workflow-list div {
  min-width: 0;
  padding: var(--space-2) var(--space-4);
  border-left: 1px solid rgba(20, 52, 63, 0.16);
}

.entry-workflow-list strong,
.entry-workflow-list span {
  display: block;
}

.entry-workflow-list strong {
  margin-bottom: var(--space-2);
  color: var(--shell);
  font-size: 16px;
}

.entry-workflow-list span {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
}

.entry-proof {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: var(--space-8);
  align-items: center;
  margin-top: var(--space-8);
}

.entry-proof-visual {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(20, 52, 63, 0.14);
  border-radius: var(--radius-md);
  background: #f4f2e9;
  box-shadow: 0 16px 36px rgba(15, 43, 54, 0.08);
}

.entry-proof-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.entry-proof-points {
  display: grid;
  margin-top: var(--space-6);
  border-top: 1px solid rgba(20, 52, 63, 0.18);
}

.entry-proof-points span {
  padding: 14px 0;
  border-bottom: 1px solid rgba(20, 52, 63, 0.13);
  color: var(--shell);
  font-size: 14px;
  font-weight: 700;
}

.entry-footer {
  margin-top: var(--space-8);
  padding: var(--space-5) 0 0;
  border: 0;
  border-top: 1px solid rgba(20, 52, 63, 0.16);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.entry-footer .public-legal-copy strong {
  color: var(--shell);
  font-size: 14px;
}

.entry-reveal-ready [data-entry-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out);
}

.entry-reveal-ready [data-entry-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
  .entry-story {
    animation: entry-panel-arrive 620ms var(--ease-out) both;
  }

  .entry-story-art {
    animation: entry-art-arrive 760ms var(--ease-out) both;
  }

  .entry-story-copy {
    animation: entry-copy-arrive 560ms 80ms var(--ease-out) both;
  }

  .entry-login-card {
    animation: entry-login-arrive 580ms 120ms var(--ease-out) both;
  }
}

@keyframes entry-panel-arrive {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes entry-art-arrive {
  from { opacity: 0.72; transform: scale(1.025); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes entry-copy-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes entry-login-arrive {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .entry-hero {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 370px);
  }

  .entry-story,
  .entry-login-card {
    min-height: 540px;
  }

  .entry-story-copy {
    width: min(560px, 84%);
    padding: var(--space-6);
  }

  .entry-workflow {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

@media (max-width: 820px) {
  .entry-page {
    padding: 18px;
  }

  .entry-nav {
    min-height: 60px;
    margin-bottom: 18px;
    align-items: center;
    flex-direction: row;
  }

  .entry-brand {
    width: auto;
    flex-direction: row;
    align-items: center;
  }

  .entry-brand img {
    width: 132px;
  }

  .entry-hero,
  .entry-proof {
    grid-template-columns: 1fr;
  }

  .entry-story {
    min-height: 430px;
  }

  .entry-login-card {
    min-height: 0;
  }

  .entry-workflow-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5) 0;
  }

  .entry-workflow-list div:nth-child(odd) {
    border-left: 0;
  }

  .entry-proof {
    gap: var(--space-6);
    margin-top: var(--space-7);
  }
}

@media (max-width: 640px) {
  .entry-page {
    padding: 14px 14px var(--space-5);
  }

  .entry-nav {
    min-height: 54px;
    margin-bottom: 14px;
  }

  .entry-brand {
    gap: var(--space-3);
  }

  .entry-brand img {
    width: 112px;
    border-radius: 10px;
  }

  .entry-brand strong {
    font-size: 15px;
  }

  .entry-hero {
    gap: var(--space-4);
  }

  .entry-story {
    min-height: 350px;
  }

  .entry-story::after {
    background: linear-gradient(90deg, rgba(10, 42, 52, 0.98) 0%, rgba(10, 42, 52, 0.84) 62%, rgba(10, 42, 52, 0.34) 100%);
  }

  .entry-story-art {
    object-position: 64% center;
  }

  .entry-story-copy {
    width: 92%;
    padding: var(--space-5);
  }

  .entry-eyebrow {
    margin-bottom: var(--space-3);
    font-size: 10px;
  }

  .entry-story h1 {
    max-width: 20ch;
    margin-top: var(--space-4);
    font-size: clamp(26px, 7vw, 32px);
  }

  .entry-product-name {
    font-size: clamp(48px, 15vw, 64px);
  }

  .entry-story-copy > .entry-summary {
    margin-top: var(--space-3);
    font-size: 14px;
  }

  .entry-verify-btn {
    width: auto;
    margin-top: var(--space-5);
  }

  .entry-login-card {
    padding: var(--space-5);
  }

  .entry-login-card h2 {
    font-size: 30px;
  }

  .entry-login-card .stack-lg {
    gap: 14px;
  }

  .entry-workflow {
    margin-top: var(--space-5);
    padding: var(--space-6) 0;
  }

  .entry-workflow-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .entry-workflow-list div,
  .entry-workflow-list div:nth-child(odd) {
    padding: var(--space-4) 0;
    border-left: 0;
    border-top: 1px solid rgba(20, 52, 63, 0.14);
  }

  .entry-section-heading h2,
  .entry-proof-copy h2 {
    font-size: 30px;
  }

  .entry-footer {
    align-items: flex-start;
    flex-direction: column;
    margin-top: var(--space-7);
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-reveal-ready [data-entry-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* Layout pass: preserve the current product IA while making the work surface
   denser, easier to scan, and more deliberate across common viewport widths. */
@media (min-width: 921px) {
  .app-shell {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 18px 14px;
    gap: 16px;
  }

  .brand-block {
    gap: 10px;
    padding: 4px 6px 16px;
  }

  .nav-list {
    gap: 5px;
  }

  .nav-item {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .main-shell {
    grid-template-rows: 72px minmax(0, 1fr);
  }

  .topbar {
    min-height: 72px;
    padding: 12px clamp(24px, 3vw, 40px);
  }

  .workspace {
    padding: clamp(24px, 3vw, 40px);
  }
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) {
  max-width: 1360px;
  padding: clamp(28px, 3vw, 44px);
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head {
  align-items: center;
  gap: 20px;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head > .button-row {
  margin-left: auto;
  justify-content: flex-end;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head h1 {
  max-width: 24ch;
  font-size: clamp(30px, 2.8vw, 40px);
}

.templates-toolbar {
  max-width: none;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid rgba(16, 55, 68, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(16, 55, 68, 0.035);
}

.template-catalog-grid {
  gap: 28px;
}

.template-catalog-group {
  gap: 16px;
  padding-bottom: 28px;
}

.template-catalog-group-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.template-card-name {
  min-height: 64px;
  padding: 16px;
}

/* The verification forms represent two comparable routes, so show them side by
   side when space allows and keep their result area separate and legible. */
[data-view-panel="verify"].is-active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

[data-view-panel="verify"] > .panel-head,
[data-view-panel="verify"] > .verify-intro-grid,
[data-view-panel="verify"] > #verifySummary {
  grid-column: 1 / -1;
}

[data-view-panel="verify"] > .verify-intro-grid {
  margin: -4px 0 4px;
}

[data-view-panel="verify"] > .verify-form-card {
  min-width: 0;
  margin: 0;
  padding: 24px;
}

[data-view-panel="verify"] > #verifySummary {
  min-height: 132px;
}

/* Settings is a personal workspace, not a long serial form. Keep profile as the
   primary block, then place preferences and security in a balanced second row. */
#settingsView .settings-stack {
  max-width: 1120px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
}

#settingsView .settings-stack > :first-child {
  grid-column: 1 / -1;
}

#settingsProfileForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}

#settingsProfileForm .settings-section-head,
#settingsProfileForm .settings-action-row {
  grid-column: 1 / -1;
}

#settingsProfileForm .settings-action-row {
  display: flex;
  justify-content: flex-end;
}

#settingsView .settings-card {
  max-width: none;
  min-height: 100%;
}

.contact-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  align-items: stretch;
}

.contact-grid .contact-card:first-child {
  grid-row: span 2;
}

.contact-grid .contact-card {
  min-height: 0;
}

.contact-card:first-child {
  justify-content: center;
  padding: clamp(24px, 3vw, 36px);
}

.contact-response-card {
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr));
}

.introduction-overview-strip,
.trust-strip.introduction-trust-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.introduction-step-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (max-width: 920px) {
  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) {
    padding: 24px;
  }

  [data-view-panel="verify"].is-active {
    grid-template-columns: 1fr;
  }

  [data-view-panel="verify"] > .panel-head,
  [data-view-panel="verify"] > .verify-intro-grid,
  [data-view-panel="verify"] > #verifySummary {
    grid-column: auto;
  }

  #settingsView .settings-stack {
    grid-template-columns: 1fr;
  }

  #settingsView .settings-stack > :first-child {
    grid-column: auto;
  }

  .contact-grid,
  .contact-response-card {
    grid-template-columns: 1fr;
  }

  .contact-grid .contact-card:first-child {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) {
    padding: 20px 16px;
  }

  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head {
    align-items: flex-start;
  }

  .workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) > .panel-head > .button-row,
  #settingsProfileForm .settings-action-row {
    width: 100%;
    justify-content: stretch;
  }

  #settingsProfileForm {
    grid-template-columns: 1fr;
  }

  #settingsProfileForm .settings-section-head,
  #settingsProfileForm .settings-action-row {
    grid-column: auto;
  }

  [data-view-panel="verify"] > .verify-form-card {
    padding: 20px;
  }

  .templates-toolbar {
    padding: 14px;
  }

  .template-catalog-group-grid,
  .introduction-overview-strip,
  .trust-strip.introduction-trust-strip {
    grid-template-columns: 1fr;
  }
}

/* Account-menu refinement: a deliberate hierarchy for profile, guidance,
   subscription, and support surfaces without changing their existing actions. */
.billing-page,
.introduction-page,
.contact-page {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
  max-width: 1200px;
}

#settingsView .settings-page-layout {
  grid-template-columns: minmax(0, 1.22fr) minmax(300px, 0.78fr);
  grid-template-areas:
    "profile preferences"
    "profile security";
  gap: 20px;
  max-width: 1180px;
}

#settingsView .settings-profile-card { grid-area: profile; }
#settingsView .settings-preferences-card { grid-area: preferences; }
#settingsView .settings-security-card { grid-area: security; }

#settingsView .settings-card {
  padding: clamp(24px, 2.6vw, 32px);
  border-radius: var(--radius-md);
  box-shadow: none;
}

#settingsView .settings-profile-card {
  border-color: rgba(16, 55, 68, 0.18);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 246, 0.86));
}

#settingsView .settings-section-head {
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(16, 55, 68, 0.1);
}

#settingsView .settings-section-head h3 {
  color: var(--shell);
  font-size: 20px;
  letter-spacing: -0.02em;
}

#settingsView .settings-profile-card .field:nth-of-type(1) {
  grid-column: 1 / -1;
}

#settingsView .settings-profile-card .field input[readonly] {
  color: var(--muted-strong);
  background: rgba(16, 55, 68, 0.035);
}

#settingsView .settings-preferences-card,
#settingsView .settings-security-card {
  align-content: start;
}

#settingsView .settings-preferences-card .checkbox-row {
  min-height: 48px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(16, 55, 68, 0.08);
}

#settingsView .settings-preferences-card .checkbox-row:last-of-type {
  border-bottom: 0;
}

#settingsView .settings-security-card {
  background: rgba(16, 55, 68, 0.045);
}

.billing-page {
  gap: 32px;
}

.billing-org-hero {
  padding: clamp(28px, 3vw, 40px);
  border-color: rgba(16, 55, 68, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 245, 243, 0.92));
  box-shadow: none;
}

.billing-org-hero .billing-overview-head {
  align-items: start;
}

.billing-org-hero .billing-overview-head h1 {
  max-width: 22ch;
  color: var(--shell);
  font-size: clamp(30px, 3.2vw, 44px);
  letter-spacing: -0.04em;
}

.billing-overview-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(16, 55, 68, 0.12);
}

.billing-inline-note {
  min-height: 72px;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid rgba(16, 55, 68, 0.12);
  border-radius: 0;
  background: transparent;
}

.billing-inline-note:first-child {
  padding-left: 0;
  border-left: 0;
}

.billing-inline-note strong {
  color: var(--muted-strong);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.billing-inline-note span {
  color: var(--shell);
  font-size: 14px;
  font-weight: 750;
}

.billing-page > .billing-overview-card,
.billing-page > .billing-faq-card {
  padding: 32px 0 0;
  border: 0;
  border-top: 1px solid rgba(16, 55, 68, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.billing-page > .billing-overview-card .billing-overview-head,
.billing-page > .billing-faq-card .billing-faq-head {
  margin-bottom: 16px;
}

.billing-usage-grid {
  grid-template-columns: minmax(0, 1.25fr) repeat(2, minmax(220px, 0.75fr));
  gap: 16px;
}

.billing-usage-grid .billing-manage-card,
.billing-manage-grid:not(.billing-usage-grid) .billing-manage-card {
  border-radius: var(--radius-md);
  box-shadow: none;
}

.billing-manage-grid:not(.billing-usage-grid) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.billing-manage-grid:not(.billing-usage-grid) .billing-manage-card-primary {
  grid-column: 1 / -1;
}

.billing-plans-disclosure {
  border-color: rgba(16, 55, 68, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.billing-plans-disclosure > summary {
  padding: 20px 24px;
}

.billing-plans-disclosure-body {
  padding: 0 24px 24px;
}

.billing-invoice-row {
  grid-template-columns: minmax(160px, 0.8fr) minmax(0, 1.2fr) auto;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(16, 55, 68, 0.1);
  border-radius: 0;
  background: transparent;
}

.billing-invoice-row:last-child {
  border-bottom: 0;
}

.introduction-page {
  gap: 32px;
}

.introduction-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 20px;
  align-items: stretch;
}

.introduction-masthead .introduction-hero-card {
  min-height: 0;
  padding: clamp(28px, 3vw, 42px);
  box-shadow: none;
}

.introduction-masthead .introduction-hero-card h1 {
  max-width: 15ch;
  margin-bottom: 16px;
  font-size: clamp(32px, 3.6vw, 48px);
  letter-spacing: -0.045em;
}

.introduction-masthead .introduction-overview-strip {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.introduction-masthead .introduction-overview-item {
  align-content: center;
  min-height: 0;
  padding: 18px 0;
  border-left: 0;
  border-bottom: 1px solid rgba(16, 55, 68, 0.1);
}

.introduction-masthead .introduction-overview-item:last-child {
  border-bottom: 0;
}

.introduction-note-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.32fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  padding: 18px 0;
  border: 0;
  border-top: 1px solid rgba(16, 55, 68, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.introduction-note-card p {
  margin: 0;
  max-width: 72ch;
}

.introduction-quickstart {
  padding-top: 8px;
}

.introduction-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.6fr);
  align-items: end;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(16, 55, 68, 0.12);
}

.introduction-panel-head .introduction-section-copy {
  margin: 0;
}

.introduction-step-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.introduction-step-card {
  min-height: 188px;
  padding: 22px;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.introduction-step-card:nth-child(-n + 3) { grid-column: span 2; }
.introduction-step-card:nth-child(n + 4) { grid-column: span 3; }

.introduction-step-card > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: rgba(16, 55, 68, 0.08);
  color: var(--shell);
  font-size: 12px;
}

.introduction-operating-model {
  padding: 0;
}

.introduction-operating-model .introduction-trust-strip {
  margin: 0;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.introduction-guide-shell {
  grid-template-columns: minmax(220px, 0.3fr) minmax(0, 0.9fr);
  gap: 48px;
  align-items: start;
  padding-top: 8px;
}

.introduction-guide-nav {
  padding: 20px;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.introduction-guide-link {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.introduction-guide-content {
  gap: 0;
}

.introduction-guide-section {
  padding: 30px 0;
  border: 0;
  border-top: 1px solid rgba(16, 55, 68, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.introduction-guide-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.introduction-guide-section h2 {
  max-width: 24ch;
  color: var(--shell);
  font-size: clamp(24px, 2.2vw, 32px);
  letter-spacing: -0.03em;
}

.introduction-guide-section p,
.introduction-guide-list {
  max-width: 68ch;
}

.introduction-guide-card {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: rgba(16, 55, 68, 0.045);
}

.contact-page {
  gap: 28px;
}

.contact-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 20px;
}

.contact-masthead .contact-hero-card {
  min-height: 0;
  padding: clamp(28px, 3vw, 42px);
  box-shadow: none;
}

.contact-masthead .contact-hero-card h1 {
  max-width: 16ch;
  font-size: clamp(32px, 3.5vw, 46px);
  letter-spacing: -0.04em;
}

.contact-masthead .contact-response-card {
  grid-template-columns: 1fr;
  margin: 0;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.contact-masthead .contact-response-item {
  padding: 18px 0;
  border-left: 0;
  border-bottom: 1px solid rgba(16, 55, 68, 0.1);
}

.contact-masthead .contact-response-item:last-child {
  border-bottom: 0;
}

.contact-page .contact-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 16px;
}

.contact-page .contact-card {
  padding: 26px;
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.contact-page .contact-card:first-child {
  background: var(--shell);
  border-color: var(--shell);
}

.contact-page .contact-card:first-child .panel-kicker,
.contact-page .contact-card:first-child strong,
.contact-page .contact-card:first-child p {
  color: rgba(247, 248, 245, 0.82);
}

.contact-page .contact-card:first-child a {
  color: var(--gold-soft);
  font-size: clamp(18px, 2vw, 24px);
}

@media (max-width: 1080px) {
  .billing-overview-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 0;
  }

  .billing-inline-note:nth-child(4) {
    padding-left: 0;
    border-left: 0;
  }

  .billing-usage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-usage-grid .billing-manage-card-primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  #settingsView .settings-page-layout,
  .introduction-masthead,
  .contact-masthead,
  .introduction-panel-head {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  #settingsView .settings-profile-card,
  #settingsView .settings-preferences-card,
  #settingsView .settings-security-card {
    grid-area: auto;
  }

  .introduction-step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .introduction-step-card:nth-child(n) {
    grid-column: auto;
  }

  .introduction-guide-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .introduction-guide-nav {
    position: static;
  }

  .billing-invoice-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #settingsView .settings-card,
  .billing-org-hero,
  .introduction-masthead .introduction-hero-card,
  .contact-masthead .contact-hero-card {
    padding: 22px;
  }

  .billing-overview-strip,
  .billing-usage-grid,
  .billing-manage-grid:not(.billing-usage-grid),
  .introduction-step-grid {
    grid-template-columns: 1fr;
  }

  .billing-inline-note,
  .billing-inline-note:nth-child(4) {
    min-height: 0;
    padding: 14px 0;
    border-top: 1px solid rgba(16, 55, 68, 0.1);
    border-left: 0;
  }

  .billing-inline-note:first-child {
    padding-top: 0;
    border-top: 0;
  }

  .billing-manage-grid:not(.billing-usage-grid) .billing-manage-card-primary {
    grid-column: auto;
  }

  .introduction-note-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .introduction-masthead .introduction-overview-strip,
  .contact-masthead .contact-response-card {
    padding-inline: 20px;
  }

  .billing-plans-disclosure > summary,
  .billing-plans-disclosure-body {
    padding-inline: 18px;
  }
}

/* Dense account-workspace pass: one coherent, calm product surface instead of
   a collection of oversized cards. These rules intentionally supersede the
   earlier account-menu experiment. */
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) {
  --account-accent: #1a5b54;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) :is(input, select, textarea, button) {
  max-width: 100%;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .field input,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .field select {
  min-height: 40px;
  padding: 8px 11px;
  border-radius: 10px;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .field textarea {
  min-height: 88px;
  padding: 10px 11px;
  border-radius: 10px;
}

.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .primary-btn,
.workspace > .view-panel:not(.home-view-panel):not(.case-workspace-panel) .secondary-btn {
  min-height: 40px;
  padding-inline: 14px;
  border-radius: 10px;
  white-space: nowrap;
}

/* Settings: a stable two-column worksheet. No item spans behind or below
   another card, and the profile form stays readable at a practical measure. */
#settingsView .settings-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, 0.92fr);
  gap: 16px;
  max-width: 1050px;
  align-items: start;
}

#settingsView .settings-profile-card {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
}

#settingsView .settings-preferences-card {
  grid-column: 2 !important;
  grid-row: 1 / span 2 !important;
}

#settingsView .settings-security-card {
  grid-column: 1 !important;
  grid-row: 3 !important;
}

#settingsView .settings-card {
  min-height: 0;
  padding: 22px;
  border-radius: 14px;
  border-color: rgba(26, 91, 84, 0.16);
  background: rgba(255, 255, 255, 0.84);
}

#settingsView .settings-profile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
}

#settingsView .settings-profile-card .field {
  min-width: 0;
}

#settingsView .settings-section-head {
  padding-bottom: 12px;
}

#settingsView .settings-section-head h3 {
  font-size: 18px;
}

#settingsView .settings-preferences-card,
#settingsView .settings-security-card {
  gap: 14px;
}

#settingsView .settings-preferences-card .checkbox-row {
  min-height: 0;
  padding: 10px 0;
}

#settingsView .settings-security-card {
  background: rgba(229, 240, 236, 0.62);
}

#settingsView .settings-action-row {
  margin-top: 2px;
}

/* Introduction: readable editorial rhythm, a short orientation area, then a
   constrained manual with a practical local index. */
.introduction-page {
  max-width: 1080px;
  gap: 24px;
}

.introduction-masthead {
  grid-template-columns: minmax(0, 1.32fr) minmax(260px, 0.68fr);
  gap: 16px;
}

.introduction-masthead .introduction-hero-card,
.contact-masthead .contact-hero-card {
  padding: 28px 30px;
  border-radius: 16px;
}

.introduction-masthead .introduction-hero-card h1 {
  max-width: 17ch;
  font-size: clamp(30px, 3vw, 40px);
}

.introduction-masthead .introduction-hero-card > p:not(.panel-kicker) {
  max-width: 66ch;
}

.introduction-masthead .introduction-overview-strip {
  padding: 8px 18px;
  background: rgba(229, 240, 236, 0.58);
}

.introduction-masthead .introduction-overview-item {
  padding: 13px 0;
  background: transparent;
}

.introduction-note-card {
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
}

.introduction-note-card strong {
  margin: 0;
}

.introduction-panel-head {
  display: block;
  padding: 0 0 14px;
}

.introduction-panel-head h1 {
  font-size: clamp(24px, 2.4vw, 31px);
}

.introduction-panel-head .introduction-section-copy {
  max-width: 68ch;
  margin-top: 8px;
}

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

.introduction-step-card {
  min-height: 0;
  padding: 18px;
}

.introduction-step-card:nth-child(-n + 3) { grid-column: span 4; }
.introduction-step-card:nth-child(n + 4) { grid-column: span 6; }

.introduction-step-card > span {
  width: 26px;
  height: 26px;
  margin-bottom: 8px;
}

.introduction-operating-model .introduction-trust-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(26, 91, 84, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.introduction-operating-model .introduction-trust-strip > div {
  padding: 14px 16px;
  border-left: 1px solid rgba(26, 91, 84, 0.12);
}

.introduction-operating-model .introduction-trust-strip > div:first-child {
  border-left: 0;
}

.introduction-guide-shell {
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
}

.introduction-guide-nav {
  max-height: calc(100dvh - 116px);
  padding: 16px;
  overflow: auto;
  border-radius: 12px;
}

.introduction-guide-nav h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.introduction-guide-link {
  min-height: 0;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.35;
}

.introduction-guide-section {
  gap: 14px;
  padding: 24px 0;
}

.introduction-guide-section p,
.introduction-guide-list {
  max-width: 64ch;
  overflow-wrap: anywhere;
}

.introduction-guide-card-grid {
  gap: 10px;
}

.introduction-guide-card {
  padding: 14px;
  border-radius: 10px;
}

/* Template Guide: jurisdictions form the navigation hierarchy, so the index
   remains compact even when the controlled library grows. */
.template-guide-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.28fr) minmax(0, 0.72fr);
  gap: 24px;
  align-items: start;
}

.template-guide-index {
  position: sticky;
  top: 92px;
  max-height: calc(100dvh - 116px);
  padding: 16px;
  overflow: auto;
  border-radius: 12px;
}

.template-guide-index-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(26, 91, 84, 0.12);
}

.template-guide-index-head h2 {
  margin: 0;
  font-size: 17px;
}

.template-guide-index-head > span,
.template-guide-index-group summary span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.template-guide-index-groups {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.template-guide-index-group {
  border-bottom: 1px solid rgba(26, 91, 84, 0.08);
}

.template-guide-index-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 2px;
  cursor: pointer;
  color: var(--shell);
  font-size: 12px;
  font-weight: 750;
}

.template-guide-index-list {
  display: grid;
  gap: 2px;
  margin: 0 0 8px;
}

.template-guide-index-list .template-guide-link {
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.template-guide-index-list .template-guide-link:hover,
.template-guide-index-list .template-guide-link:focus-visible {
  background: rgba(26, 91, 84, 0.08);
  color: var(--shell);
}

.template-guide-card-grid {
  gap: 14px;
}

.template-guide-card {
  padding: 22px;
  border-radius: 14px;
}

.template-guide-card-copy {
  gap: 10px;
}

.template-guide-card-copy p,
.template-guide-field p {
  overflow-wrap: anywhere;
}

/* Billing: concentrate attention on status, usage, and next action. */
.billing-page {
  max-width: 1120px;
  gap: 22px;
}

.billing-org-hero {
  padding: 26px 28px;
  border-radius: 16px;
}

.billing-overview-strip {
  margin-top: 18px;
  padding-top: 14px;
}

.billing-inline-note {
  min-height: 54px;
  padding: 0 12px;
}

.billing-plans-section {
  display: grid;
  gap: 14px;
}

.billing-section-head {
  gap: 8px;
}

.billing-section-head h1 {
  font-size: clamp(24px, 2.4vw, 31px);
}

.billing-usage-grid,
.billing-manage-grid:not(.billing-usage-grid) {
  gap: 12px;
}

.billing-manage-card {
  padding: 20px;
  gap: 12px;
}

.billing-manage-card-primary {
  background: linear-gradient(135deg, #2a766d, #1e625a);
}

.billing-manage-card-primary .billing-plan-meta div {
  padding: 7px 9px;
  border-radius: 8px;
}

.billing-page > .billing-overview-card,
.billing-page > .billing-faq-card {
  padding-top: 22px;
}

.billing-overview-copy,
.billing-empty-note,
.billing-faq-item p {
  max-width: 70ch;
}

.billing-locale-grid {
  gap: 12px;
}

.billing-invoice-row {
  gap: 12px;
  padding: 14px 0;
}

.billing-faq-list {
  gap: 8px;
}

.billing-faq-item {
  padding: 14px 0;
  border-radius: 0;
  background: transparent;
  border-top: 1px solid rgba(26, 91, 84, 0.1);
}

/* Contact: make the support channel the clear first action, but keep every
   commercial detail visible without the previous heavy dark block. */
.contact-page {
  max-width: 1020px;
  gap: 20px;
}

.contact-masthead {
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.8fr);
  gap: 16px;
}

.contact-masthead .contact-hero-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(226, 240, 235, 0.9));
}

.contact-masthead .contact-hero-card h1 {
  max-width: 18ch;
  font-size: clamp(30px, 3vw, 40px);
}

.contact-masthead .contact-response-card {
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.7);
}

.contact-masthead .contact-response-item {
  padding: 13px 0;
}

.contact-page .contact-grid {
  grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 0.85fr));
  gap: 12px;
}

.contact-page .contact-card,
.contact-page .contact-card:first-child {
  min-height: 0;
  padding: 20px;
  border-radius: 12px;
  border-color: rgba(26, 91, 84, 0.14);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}

.contact-page .contact-card:first-child {
  background: #e4f0ec;
}

.contact-page .contact-card:first-child .panel-kicker,
.contact-page .contact-card:first-child strong,
.contact-page .contact-card:first-child p {
  color: inherit;
}

.contact-page .contact-card a,
.contact-page .contact-card:first-child a {
  color: var(--shell);
  font-size: clamp(16px, 1.8vw, 20px);
}

@media (max-width: 920px) {
  #settingsView .settings-page-layout,
  .introduction-masthead,
  .contact-masthead {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  #settingsView .settings-profile-card,
  #settingsView .settings-preferences-card,
  #settingsView .settings-security-card {
    grid-area: auto;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .introduction-operating-model .introduction-trust-strip,
  .contact-page .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-page .contact-card:first-child {
    grid-column: 1 / -1;
  }

  .template-guide-layout,
  .introduction-guide-shell {
    grid-template-columns: 1fr;
  }

  .template-guide-index,
  .introduction-guide-nav {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  #settingsView .settings-page-layout,
  #settingsView .settings-profile-card,
  .introduction-step-grid,
  .introduction-operating-model .introduction-trust-strip,
  .contact-page .contact-grid {
    grid-template-columns: 1fr;
  }

  .introduction-step-card:nth-child(n) {
    grid-column: auto;
  }

  .introduction-note-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .introduction-masthead .introduction-hero-card,
  .contact-masthead .contact-hero-card,
  .billing-org-hero,
  #settingsView .settings-card,
  .template-guide-card {
    padding: 18px;
  }

  .contact-page .contact-card:first-child {
    grid-column: auto;
  }
}

/* Editorial refinement: use the same deep teal as the navigation for all
   reading surfaces, with a deliberate text measure rather than full-width
   copy. */
.introduction-page {
  max-width: 1040px;
}

.introduction-masthead .introduction-hero-card > p:not(.panel-kicker) {
  max-width: 60ch;
  color: var(--text);
}

.introduction-note-card {
  max-width: 820px;
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.56);
}

.introduction-guide-shell {
  grid-template-columns: 190px minmax(0, 760px);
  justify-content: start;
  gap: 32px;
}

.introduction-guide-content {
  width: min(100%, 760px);
}

.introduction-guide-section,
.introduction-guide-section:first-child {
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
}

.introduction-guide-section + .introduction-guide-section {
  margin-top: 12px;
}

.introduction-guide-section h2 {
  max-width: 20ch;
  color: var(--shell);
  font-size: clamp(23px, 2.1vw, 29px);
  line-height: 1.18;
}

.introduction-guide-section p,
.introduction-guide-list {
  max-width: 58ch;
  color: var(--text);
  line-height: 1.72;
}

.introduction-guide-list {
  padding-left: 19px;
}

.introduction-guide-card-grid {
  gap: 12px;
}

.introduction-guide-card {
  padding: 16px;
  background: rgba(16, 55, 68, 0.04);
}

/* Billing is an operational brief: headline and context stay together, the
   quota is the focal point, and supporting facts sit beside it rather than
   competing with three equal cards. */
.billing-page {
  max-width: 1060px;
  gap: 26px;
}

.billing-plans-section {
  gap: 16px;
}

.billing-section-head {
  display: block;
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.billing-section-head h1 {
  margin-top: 4px;
  color: var(--shell);
  font-size: clamp(25px, 2.5vw, 33px);
  line-height: 1.15;
}

.billing-section-copy {
  max-width: 64ch;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.billing-usage-grid .billing-manage-card-primary {
  grid-column: span 8;
  grid-row: span 2;
}

.billing-usage-grid .billing-manage-card:not(.billing-manage-card-primary) {
  grid-column: span 4;
}

.billing-manage-card {
  padding: 20px;
  border-radius: 12px;
}

.billing-usage-grid .billing-manage-card.billing-manage-card-primary {
  background: linear-gradient(145deg, #103744, #18505f) !important;
}

.billing-manage-card-primary .billing-ops-head {
  align-items: center;
}

.billing-manage-card-primary .billing-usage-highlight {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 18px 0 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: transparent;
}

.billing-manage-card-primary .billing-usage-highlight strong {
  font-size: clamp(42px, 5vw, 58px);
  letter-spacing: -0.05em;
}

.billing-manage-card-primary .billing-usage-meter {
  height: 7px;
  margin: 16px 0;
}

.billing-manage-card-primary .billing-plan-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.billing-manage-card-primary .billing-plan-meta div {
  display: grid;
  gap: 3px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: transparent;
}

.billing-manage-card-primary .billing-plan-meta div:first-child {
  padding-left: 0;
  border-left: 0;
}

.billing-manage-card-primary .billing-plan-meta strong {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.billing-usage-grid .billing-manage-card:not(.billing-manage-card-primary) {
  gap: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.billing-usage-grid .billing-manage-card:not(.billing-manage-card-primary) .billing-ops-head h2 {
  font-size: 16px;
  line-height: 1.25;
}

.billing-usage-grid .billing-plan-meta {
  gap: 7px;
}

.billing-usage-grid .billing-plan-meta div {
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.billing-usage-grid .billing-plan-meta div:first-child {
  border-top: 0;
}

.billing-template-usage-list {
  gap: 4px;
}

.billing-template-usage-row {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}

.billing-page > .billing-overview-card,
.billing-page > .billing-faq-card {
  padding-top: 24px;
}

.billing-overview-head,
.billing-faq-head {
  align-items: flex-start;
}

@media (max-width: 920px) {
  .introduction-guide-shell {
    grid-template-columns: 1fr;
  }

  .introduction-guide-content {
    width: 100%;
  }

  .billing-usage-grid .billing-manage-card-primary,
  .billing-usage-grid .billing-manage-card:not(.billing-manage-card-primary) {
    grid-column: span 6;
    grid-row: auto;
  }

  .billing-usage-grid .billing-manage-card-primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .introduction-note-card,
  .introduction-guide-section,
  .introduction-guide-section:first-child {
    padding: 20px;
  }

  .billing-usage-grid {
    grid-template-columns: 1fr;
  }

  .billing-usage-grid .billing-manage-card-primary,
  .billing-usage-grid .billing-manage-card:not(.billing-manage-card-primary) {
    grid-column: auto;
  }

  .billing-manage-card-primary .billing-plan-meta {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .billing-manage-card-primary .billing-plan-meta div,
  .billing-manage-card-primary .billing-plan-meta div:first-child {
    padding: 0;
    border-left: 0;
  }
}

/* Final contact and invoice-settings pass: long real-world contact data must
   wrap safely, while billing controls get their own deliberate action row. */
.contact-page,
.contact-masthead > *,
.contact-response-item,
.contact-page .contact-card {
  min-width: 0;
}

.contact-page :is(p, span, strong, a) {
  overflow-wrap: anywhere;
}

.contact-page .contact-card a,
.contact-page .contact-card:first-child a {
  display: inline-block;
  max-width: 100%;
  font-size: clamp(15px, 1.35vw, 18px);
  line-height: 1.35;
  word-break: break-word;
}

.contact-page .contact-card span:not(.panel-kicker) {
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.35;
}

.contact-masthead .contact-response-item span,
.contact-page .contact-card p {
  line-height: 1.6;
}

.billing-page > .billing-overview-card:has(.billing-locale-grid) {
  max-width: 960px;
}

.billing-locale-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 820px;
  margin-top: 18px;
}

.billing-locale-field,
.billing-locale-card {
  min-width: 0;
}

.billing-locale-card {
  min-height: 0;
  padding: 13px 14px;
  border-radius: 10px;
}

.billing-locale-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 820px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.billing-locale-buttons {
  flex: 0 0 auto;
  gap: 10px;
}

.billing-locale-actions .billing-empty-note {
  max-width: 42ch;
  margin: 0;
  text-align: right;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .billing-locale-grid {
    grid-template-columns: 1fr;
  }

  .billing-locale-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .billing-locale-buttons {
    width: 100%;
  }

  .billing-locale-buttons .primary-btn,
  .billing-locale-buttons .secondary-btn {
    width: 100%;
  }

  .billing-locale-actions .billing-empty-note {
    max-width: none;
    text-align: left;
  }
}

/* Keep this last: workspace refinements above intentionally specialize the
   layout, while these constraints remain non-negotiable at every viewport. */
.case-workspace-panel .case-action-bar {
  min-width: 0;
}

@media (min-width: 641px) {
  .case-workspace-panel .case-action-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    align-items: stretch;
  }
}

.case-workspace-panel .case-action-bar > *,
.button-row > *,
.sticky-actions > *,
.workspace-actions > * {
  min-width: 0;
  max-width: 100%;
}
