/**
 * Calm Canvas layout + components for the static UI prototype.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: 450;
  letter-spacing: -0.006em;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--canvas);
  font-feature-settings: "cv11", "ss01", "calt";
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--foreground);
}

h1 {
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.022em;
}

h2 {
  font-size: 15px;
  line-height: 22px;
}

.mono,
.record-code,
kbd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* —— Prototype banner —— */
.proto-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 6px 16px;
  background: var(--ink);
  color: var(--ink-foreground);
  font-size: 12px;
  line-height: 1.4;
}
.proto-banner a {
  color: #c8c8f4;
}
.proto-banner .proto-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 500;
}
.proto-banner .spacer {
  flex: 1;
}

/* —— Wordmark —— */
.wordmark {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--foreground);
  text-decoration: none;
  white-space:nowrap;
}
.wordmark:hover {
  text-decoration: none;
}
.wordmark .natives {
  color: var(--primary);
}
.wordmark.inverse {
  color: #fff;
}
.wordmark.inverse .natives {
  color: #c8c8f4;
}
.surface-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 500;
}

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-height);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 100ms, border-color 100ms, color 100ms, box-shadow 100ms;
}
.btn:hover {
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(23, 23, 58, 0.12);
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--foreground);
  box-shadow: var(--elevation-sm);
}
.btn-secondary:hover {
  background: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}
.btn-ghost:hover {
  background: var(--accent);
  color: var(--foreground);
}
.btn-destructive {
  background: var(--destructive);
  color: #fff;
}
.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.btn-block {
  width: 100%;
}

/* —— Status / pills / chips —— */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.pill.success {
  background: var(--success-bg);
  color: var(--success-text);
}
.pill.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.pill.danger {
  background: var(--destructive-bg);
  color: var(--destructive-text);
}
.pill.info {
  background: var(--info-bg);
  color: var(--info-text);
}
.pill.neutral {
  background: var(--neutral-bg);
  color: var(--neutral-text);
}
.record-code {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 500;
}
.count-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 500;
}
.kbd {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 500;
}

/* —— Forms —— */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--foreground);
}
.field .hint,
.field .error {
  font-size: 12px;
  color: var(--muted-foreground);
}
.field .error {
  color: var(--destructive-text);
}
.input,
.select,
.textarea {
  height: var(--control-height);
  padding: 0 10px;
  border: 1px solid var(--input);
  border-radius: 7px;
  background: var(--surface);
  color: var(--foreground);
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 10px;
  resize: vertical;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: var(--shadow-focus);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--muted-foreground);
}

/* —— App shell (CRM / expert) —— */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 32px);
  gap: 0;
  padding: 8px 8px 8px 0;
}
.app-shell.collapsed {
  grid-template-columns: 56px 1fr;
}
.app-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 10px;
  min-height: calc(100vh - 48px);
  position: sticky;
  top: 40px;
  align-self: start;
}
.app-nav .nav-brand {
  display: flex;
  align-items: center;
  padding: 4px 8px 12px;
}
.app-nav .cmd-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  margin: 0 4px 12px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted-foreground);
  font-size: 12.5px;
  box-shadow: var(--elevation-sm);
  cursor: pointer;
}
.app-nav .cmd-field .spacer {
  flex: 1;
}
.nav-group {
  margin-top: 10px;
  padding: 0 10px 4px;
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 10px;
  margin: 1px 4px;
  border-radius: var(--radius-md);
  color: var(--secondary-foreground);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
}
.nav-item:hover {
  background: var(--accent);
  text-decoration: none;
}
.nav-item.active {
  background: var(--sidebar-accent);
  font-weight: 550;
  color: var(--foreground);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: var(--primary);
}
.nav-item .icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
  flex-shrink: 0;
}
.nav-item.active .icon {
  color: var(--primary-text);
}

html[data-density="comfortable"] .nav-item {
  height: 44px;
  margin: 2px 4px;
}
html[data-density="comfortable"] .nav-item.active {
  background: var(--primary-subtle);
  color: var(--primary-text);
}
html[data-density="comfortable"] .nav-item.active::before {
  display: none;
}

.app-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: calc(100vh - 48px);
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--elevation-sm);
  overflow: hidden;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar .crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 13px;
}
.topbar .crumbs .current {
  color: var(--foreground);
  font-weight: 550;
}
.topbar .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pane-body {
  flex: 1;
  overflow: auto;
  padding: var(--pane-gutter);
}

/* —— Public chrome —— */
.public-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.public-header nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.public-header nav a {
  color: var(--secondary-foreground);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.public-header nav a:hover {
  color: var(--primary-text);
}
.public-footer {
  padding: 32px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
}
/* —— Auth split —— */
.auth-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: calc(100vh - 32px);
}
.auth-hero {
  background: var(--brand-gradient);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}
.auth-hero h1 {
  color: #fff;
  font-size: 28px;
  line-height: 1.25;
  max-width: 16ch;
}
.auth-hero p,
.auth-hero li {
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
}
.auth-hero ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}
.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--canvas);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--elevation-md);
}
.auth-card h1 {
  margin-bottom: 6px;
}
.auth-card .sub {
  color: var(--muted-foreground);
  margin-bottom: 24px;
  font-size: 14px;
}
.auth-card .stack {
  display: grid;
  gap: 14px;
}

/* —— Page chrome —— */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
  margin-bottom: 20px;
}
.page-header .title-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.entity-tile {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: var(--primary-subtle);
  color: var(--primary-text);
  flex-shrink: 0;
}
.entity-tile .icon {
  width: 16px;
  height: 16px;
}
.entity-tile.lg {
  width: 40px;
  height: 40px;
}
.entity-tile.lg .icon {
  width: 20px;
  height: 20px;
}
.page-header .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.page-header .desc {
  width: 100%;
  color: var(--muted-foreground);
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab {
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover {
  color: var(--foreground);
}
.tab.active {
  color: var(--foreground);
  border-bottom-color: var(--foreground);
}
html[data-density="comfortable"] .tab.active {
  color: var(--primary-text);
  border-bottom-color: var(--primary);
}

/* —— Stats / sections / tables —— */
.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
}
.stat-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
}
.stat-cell:last-child {
  border-right: 0;
}
.stat-cell .label {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
}
.stat-cell .value {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-cell .delta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--success-text);
}

.section-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--elevation-xs, var(--elevation-sm));
  margin-bottom: 16px;
  overflow: hidden;
}
.section-card .section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.section-card .section-head h2 {
  flex: 1;
}
.section-card .section-body {
  padding: 12px 16px;
}
.section-card.flush .section-body {
  padding: 0;
}
.section-card.flush .list-row {
  padding-left: 16px;
  padding-right: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.table-wrap {
  overflow-x: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  height: 32px;
  padding: 0 12px;
  text-align: left;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
  position: sticky;
  top: 0;
}
table.data td {
  height: var(--row-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}
table.data tr:hover td {
  background: var(--row-hover);
}
table.data td.right,
table.data th.right {
  text-align: right;
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary-text);
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar.lg {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.identity .meta {
  color: var(--muted-foreground);
  font-size: 12px;
}

/* —— Lists / cards / kanban —— */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--row-height);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row .grow {
  flex: 1;
  min-width: 0;
}
.list-row .title {
  font-weight: 550;
}
.list-row .meta {
  color: var(--muted-foreground);
  font-size: 12px;
}

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 272px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--canvas);
  border-radius: 10px;
  padding: 10px;
  min-height: 320px;
}
.kanban-col .col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 550;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--elevation-sm);
  padding: 10px;
  margin-bottom: 8px;
}
.kanban-card .name {
  font-weight: 550;
}
.kanban-card .role {
  color: var(--muted-foreground);
  font-size: 12px;
  margin: 2px 0 8px;
}
.kanban-card .foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 12px;
}

.key-facts {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.key-facts .fact {
  padding: 12px 14px;
  border-right: 1px solid var(--border);
}
.key-facts .fact:last-child {
  border-right: 0;
}
.key-facts .label {
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 500;
}
.key-facts .value {
  margin-top: 4px;
  font-weight: 550;
  font-size: 13.5px;
}
.meter {
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--muted);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.welcome-banner {
  background: var(--brand-gradient);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 20px;
}
.welcome-banner h1 {
  color: #fff;
}
.welcome-banner p {
  color: rgba(255, 255, 255, 0.82);
  margin: 8px 0 0;
}

.blinded-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--elevation-sm);
}
.blinded-card h3 {
  font-size: 15px;
  margin-bottom: 4px;
}
.blinded-card .blurb {
  color: var(--muted-foreground);
  font-size: 13px;
  margin: 10px 0 14px;
}
.blinded-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  max-width: 360px;
  margin: 0 auto;
}
.empty .tile {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: var(--radius);
  background: var(--brand-gradient);
  display: grid;
  place-items: center;
  color: #fff;
}
.empty p {
  color: var(--muted-foreground);
  font-size: 13px;
  margin: 8px 0 16px;
}

.hub {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
.hub-hero {
  margin-bottom: 28px;
}
.hub-hero p {
  color: var(--muted-foreground);
  max-width: 60ch;
  margin-top: 8px;
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.hub-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--elevation-sm);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.hub-card:hover {
  border-color: var(--row-selected-border);
  box-shadow: var(--elevation-md);
  text-decoration: none;
}
.hub-card h3 {
  font-size: 14px;
  margin-bottom: 4px;
}
.hub-card p {
  color: var(--muted-foreground);
  font-size: 12.5px;
  margin: 0;
}
.hub-card .route {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary-text);
}

.mobile-nav-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  padding: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  z-index: 200;
}
.modal-backdrop.open {
  display: flex;
}
.modal {
  width: min(640px, calc(100vw - 24px));
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--elevation-xl);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-body {
  padding: 16px;
  max-height: 50vh;
  overflow: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.cmd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  color: var(--foreground);
  text-decoration: none;
}
.cmd-row .icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
  flex-shrink: 0;
}
.cmd-row .entity-tile .icon {
  width: 14px;
  height: 14px;
  color: var(--primary-text);
}
.cmd-row:hover,
.cmd-row:focus {
  background: var(--row-selected);
  outline: none;
  text-decoration: none;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted-foreground);
  cursor: pointer;
}
.theme-switch:hover {
  background: var(--row-hover);
  color: var(--foreground);
}
.theme-switch-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
}
.theme-switch-icon .icon {
  width: 14px;
  height: 14px;
}
.theme-switch-track {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: var(--secondary);
  border: 1px solid var(--border-strong, var(--border));
  flex-shrink: 0;
}
.theme-switch-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--elevation-sm);
  transition: transform 0.15s ease;
}
html.dark .theme-switch {
  color: var(--foreground);
}
html.dark .theme-switch-track {
  background: var(--primary-subtle);
  border-color: var(--primary);
}
html.dark .theme-switch-thumb {
  transform: translateX(12px);
  background: var(--primary);
}
.theme-switch-sun {
  color: var(--foreground);
}
.theme-switch-moon {
  opacity: 0.45;
}
html.dark .theme-switch-sun {
  opacity: 0.45;
}
html.dark .theme-switch-moon {
  opacity: 1;
  color: var(--foreground);
}

.tier-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--secondary);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.tier-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 8px;
}
.tier-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 12px 14px;
}
.tier-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
}
.tier-desc {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.45;
}

.share-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.share-step {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted-foreground);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.share-step.done {
  color: var(--foreground);
}
.share-step.active {
  color: var(--primary-text);
  background: var(--primary-subtle);
  border-color: var(--primary);
}

.email-frame {
  display: block;
  width: 100%;
  min-height: 560px;
  border: 0;
  background: var(--canvas);
}

.email-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}
.email-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
}
.email-meta .label {
  display: inline-block;
  min-width: 72px;
  color: var(--muted-foreground);
  font-weight: 500;
}
.email-meta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.email-card {
  border: 1px solid #e7e5e4;
  border-radius: 10px;
  background: #fff;
  color: #1c1917;
  box-shadow: var(--elevation-sm);
  overflow: hidden;
}
.email-card-head {
  padding: 20px 24px 12px;
  border-bottom: 1px solid #e7e5e4;
}
.email-card-head .wordmark {
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.email-card-head .natives {
  color: #3d3cd6;
}
.email-card-head h1 {
  font-size: 18px;
  line-height: 1.35;
  color: #1c1917;
}
.email-card-body {
  padding: 20px 24px 28px;
  font-size: 14px;
  line-height: 1.55;
}
.email-card-body p {
  margin: 0 0 12px;
}
.email-profile {
  border: 1px solid #e7e5e4;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0;
}
.email-profile-label {
  font-weight: 600;
  margin-bottom: 6px;
}
.email-facts {
  width: 100%;
  font-size: 14px;
  margin-bottom: 8px;
  border-collapse: collapse;
}
.email-facts td {
  padding: 2px 0;
  vertical-align: top;
}
.email-facts td:first-child {
  padding-right: 12px;
  color: #57534e;
  white-space: nowrap;
  width: 1%;
}
.email-screening {
  border-top: 1px solid #e7e5e4;
  margin-top: 8px;
  padding-top: 8px;
}
.email-screening .q {
  color: #57534e;
  margin-bottom: 4px;
}
.email-cta-wrap {
  margin: 20px 0 8px;
}
.email-muted {
  color: #666;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .tier-strip {
    grid-template-columns: 1fr 1fr;
  }
  .stat-band {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-cell:nth-child(2) {
    border-right: 0;
  }
  .key-facts {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-hero {
    padding: 28px 24px;
    min-height: auto;
  }
  .auth-hero h1 {
    font-size: 22px;
  }
  .auth-hero ul {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .app-nav {
    display: none;
    position: fixed;
    inset: 40px 0 auto 0;
    z-index: 90;
    background: var(--canvas);
    border-bottom: 1px solid var(--border);
    max-height: calc(100vh - 40px);
    overflow: auto;
    box-shadow: var(--elevation-lg);
  }
  .app-nav.open {
    display: flex;
  }
  .app-pane {
    border-radius: 0;
    border: 0;
    min-height: calc(100vh - 40px);
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .public-header {
    padding: 12px 16px;
    flex-wrap: wrap;
  }
  .public-header nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
  }
  .public-header nav.open {
    display: flex;
  }
  .stat-band,
  .key-facts {
    grid-template-columns: 1fr 1fr;
  }
  .pane-body {
    padding: 16px;
  }
}

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