/* ==========================================================================
   Tier curtain CSS v2.0 -- Morphy Pitchdeck four-tier substrate
   Builds on hori-modernist.css v2.0 (glass, shadows, Instrument Serif)
   Each tier has a distinct visual atmosphere, not just a colored accent.
   ========================================================================== */

/* ==========================================================================
   DM page tier-aware layout
   ========================================================================== */

.dm-page {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  position: relative;
}

.dm-page[data-tier="T0"] .dm-tier-panels { display: none; }
.dm-page[data-tier="T1"] { grid-template-columns: 1fr 380px; }
.dm-page[data-tier="T2"] { grid-template-columns: 1fr 400px; }
.dm-page[data-tier="T3"] { grid-template-columns: 1fr 440px; }

.dm-tier-indicator {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
}

.dm-tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-sm);
}

/* T0: dark ink, grounded */
.dm-page[data-tier="T0"] .dm-tier-badge {
  background: var(--ngahere);
  color: var(--cream);
}

/* T1: pounamu glow, first reveal */
.dm-page[data-tier="T1"] .dm-tier-badge {
  background: linear-gradient(135deg, var(--pounamu), var(--pounamu-deep));
  color: var(--cream);
  box-shadow:
    var(--shadow-sm),
    0 0 12px rgba(31, 138, 58, 0.15);
}

/* T2: kowhai warmth, deeper trust */
.dm-page[data-tier="T2"] .dm-tier-badge {
  background: var(--kowhai);
  color: var(--ngahere);
  box-shadow:
    var(--shadow-sm),
    0 0 12px rgba(196, 136, 31, 0.15);
}

/* T3: full gradient, inner sanctum */
.dm-page[data-tier="T3"] .dm-tier-badge {
  background: linear-gradient(135deg, var(--pounamu), var(--kowhai) 60%, var(--ngahere));
  color: var(--cream);
  box-shadow:
    var(--shadow-md),
    0 0 20px rgba(31, 138, 58, 0.12),
    0 0 20px rgba(196, 136, 31, 0.08);
}

.dm-back-to-deck {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ng40);
  border: 1px solid var(--rule);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: var(--cream-warm);
  box-shadow: var(--shadow-sm);
  transition:
    color 0.2s var(--ease-in-out),
    border-color 0.2s var(--ease-in-out),
    box-shadow 0.2s var(--ease-in-out);
}

.dm-back-to-deck:hover {
  color: var(--pounamu);
  border-color: rgba(31, 138, 58, 0.2);
  box-shadow: var(--shadow-md);
}

.dm-main-canvas {
  padding: 28px;
  overflow-y: auto;
}

.dm-seed-banner {
  background: var(--cream-deep);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--ng20);
  border: 1px solid var(--rule);
  line-height: 1.6;
}

.dm-seed-banner em {
  font-family: var(--font-display);
  color: var(--pounamu);
}

.dm-tier-panels {
  border-left: 1px solid var(--rule);
  background: var(--cream-deep);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================================================
   T0 Panel -- base conversation
   ========================================================================== */

.t0-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 16px;
}

.t0-panel-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 4px;
}

.t0-panel-tagline {
  color: var(--ng40);
  font-size: 14px;
  line-height: 1.6;
}

.t0-conversation-canvas {
  flex: 1;
  min-height: 300px;
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 18px;
  overflow-y: auto;
  box-shadow: inset 0 1px 3px rgba(14, 14, 14, 0.03);
}

.t0-empty-state {
  color: var(--ng60);
  font-style: italic;
  font-size: 14px;
}

.t0-turn {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.7;
}

.t0-turn.role-user strong { color: var(--pounamu); }
.t0-turn.role-morphy strong { color: var(--kowhai); }
.t0-turn.role-system {
  color: var(--ng40);
  font-style: italic;
  font-size: 13px;
}

.t0-input-form {
  display: flex;
  gap: 8px;
}

.t0-input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--cream-warm);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.2s var(--ease-in-out), box-shadow 0.2s var(--ease-in-out);
}

.t0-input:focus {
  outline: none;
  border-color: rgba(31, 138, 58, 0.3);
  box-shadow: 0 0 0 3px var(--pounamu-glow);
}

.t0-submit {
  padding: 11px 20px;
  background: linear-gradient(135deg, var(--pounamu), var(--pounamu-deep));
  color: var(--cream);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(31, 138, 58, 0.2);
  transition:
    box-shadow 0.2s var(--ease-in-out),
    transform 0.15s var(--ease-out);
}

.t0-submit:hover {
  box-shadow: 0 4px 16px rgba(31, 138, 58, 0.3);
  transform: translateY(-1px);
}

.t0-rewards {
  background: var(--cream-deep);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule);
}

.t0-rewards h3 {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: var(--ng40);
}

.t0-rewards ul { list-style: none; padding: 0; font-size: 13px; }

.t0-rewards li {
  padding: 3px 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.t0-rewards-pending {
  color: var(--ng40);
  font-style: italic;
  font-size: 13px;
}

.t0-panel-footer { padding-top: 12px; border-top: 1px solid var(--rule); }

.t0-end-session {
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.2s var(--ease-in-out),
    box-shadow 0.2s var(--ease-in-out);
}

.t0-end-session:hover {
  background: var(--cream-deep);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   T1 Panel -- first curtain pulled (pounamu atmosphere)
   ========================================================================== */

.t1-panel {
  background: var(--cream-warm);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s var(--ease-out) both;
}

/* Subtle left-edge accent */
.t1-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--pounamu), rgba(31, 138, 58, 0.3));
  border-radius: 0 2px 2px 0;
}

.t1-panel-header h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--pounamu);
  margin-bottom: 2px;
}

.t1-panel-subtitle {
  font-size: 12px;
  color: var(--ng40);
  margin-bottom: 16px;
}

.t1-section { margin-bottom: 20px; }

.t1-section h4 {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ng60);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.t1-section-note {
  font-size: 11px;
  color: var(--ng40);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* R1-R7 live bars */
.t1-rewards-live { display: flex; flex-direction: column; gap: 6px; }

.t1-reward-bar {
  display: grid;
  grid-template-columns: 28px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
}

.t1-reward-label { color: var(--ng20); font-weight: 600; }

.t1-reward-track {
  height: 5px;
  background: var(--cream-deep);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.t1-reward-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pounamu), var(--pounamu-deep));
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}

.t1-reward-value {
  text-align: right;
  color: var(--ng40);
  font-variant-numeric: tabular-nums;
}

/* Receipt list */
.t1-receipt-list {
  list-style: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
}

.t1-receipt {
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  cursor: pointer;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--cream-warm);
  transition:
    border-color 0.2s var(--ease-in-out),
    box-shadow 0.2s var(--ease-in-out);
}

.t1-receipt:hover {
  border-color: rgba(31, 138, 58, 0.25);
  box-shadow: var(--shadow-sm);
}

.t1-receipt.expanded {
  display: block;
  background: var(--cream-deep);
  border-color: rgba(31, 138, 58, 0.2);
}

.t1-receipt-type {
  background: var(--pounamu);
  color: var(--cream);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.t1-receipt-hash { flex: 1; color: var(--ng20); }
.t1-receipt-time { color: var(--ng60); }

.t1-receipt-payload {
  margin-top: 8px;
  padding: 10px;
  background: var(--cream-warm);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 10px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--rule);
}

.t1-empty {
  color: var(--ng40);
  font-style: italic;
  padding: 8px;
  font-size: 12px;
}

/* SCAR list */
.t1-scar-list { list-style: none; padding: 0; }

.t1-scar {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}

.t1-scar-id {
  font-family: var(--font-mono);
  color: var(--pounamu);
  font-weight: 600;
}

.t1-scar-status {
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active {
  background: var(--pounamu);
  color: var(--cream);
}

.status-approved-in-principle {
  background: var(--kowhai);
  color: var(--ngahere);
}

.status-pending {
  background: var(--ng80);
  color: var(--cream);
}

/* ==========================================================================
   T2 Panel -- second curtain (kowhai warmth atmosphere)
   ========================================================================== */

.t2-panel {
  background: var(--cream-warm);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s var(--ease-out) 0.1s both;
}

.t2-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--kowhai), rgba(196, 136, 31, 0.3));
  border-radius: 0 2px 2px 0;
}

.t2-panel-header h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--kowhai);
  margin-bottom: 2px;
}

.t2-panel-subtitle {
  font-size: 12px;
  color: var(--ng40);
  margin-bottom: 16px;
}

.t2-section { margin-bottom: 20px; }

.t2-section h4 {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ng60);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.t2-section-note {
  font-size: 11px;
  color: var(--ng40);
  font-style: italic;
  line-height: 1.5;
}

/* Colony agent grid */
.t2-agent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.t2-agent {
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--cream-warm);
  font-family: var(--font-mono);
  transition: border-color 0.2s var(--ease-in-out);
}

.t2-agent:hover {
  border-color: rgba(196, 136, 31, 0.25);
}

.t2-agent-name { color: var(--ng20); font-weight: 600; }

.t2-agent-status {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.t2-agent-idle .t2-agent-status {
  background: var(--cream-deep);
  color: var(--ng40);
  border: 1px solid var(--rule);
}

.t2-agent-running .t2-agent-status {
  background: var(--pounamu);
  color: var(--cream);
}

.t2-agent-auditing .t2-agent-status {
  background: var(--kowhai);
  color: var(--ngahere);
}

.t2-agent-error .t2-agent-status {
  background: #c53030;
  color: var(--cream);
}

/* Pataka query */
.t2-pataka-form {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.t2-pataka-form input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-body);
  background: var(--cream-warm);
  transition: border-color 0.2s var(--ease-in-out), box-shadow 0.2s var(--ease-in-out);
}

.t2-pataka-form input:focus {
  outline: none;
  border-color: rgba(196, 136, 31, 0.3);
  box-shadow: 0 0 0 3px var(--kowhai-glow);
}

.t2-pataka-form button {
  padding: 7px 14px;
  background: var(--kowhai);
  color: var(--ngahere);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.2s var(--ease-in-out),
    box-shadow 0.2s var(--ease-in-out);
}

.t2-pataka-form button:hover {
  background: var(--kowhai-warm);
  box-shadow: var(--shadow-md);
}

.t2-pataka-results { list-style: none; padding: 0; }

.t2-pataka-result {
  padding: 10px;
  background: var(--cream-deep);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 11px;
  border: 1px solid var(--rule);
}

.t2-pataka-domain {
  background: var(--pounamu);
  color: var(--cream);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 600;
  margin-right: 6px;
}

.t2-pataka-path {
  font-family: var(--font-mono);
  color: var(--ng40);
  font-size: 10px;
}

.t2-pataka-snippet {
  margin-top: 4px;
  color: var(--ng20);
  line-height: 1.5;
}

/* Sublation ticker */
.t2-sublation-ticker {
  list-style: none;
  padding: 0;
  max-height: 150px;
  overflow-y: auto;
}

.t2-sublation-ticker li {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--rule);
}

.t2-sublation-time {
  color: var(--ng60);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.t2-sublation-content { color: var(--ng20); }
.t2-empty { color: var(--ng40); font-style: italic; font-size: 11px; }

/* Embodiment library */
.t2-embodiment-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.t2-embodiment {
  padding: 5px 12px;
  background: var(--cream-deep);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition:
    border-color 0.2s var(--ease-in-out),
    background 0.2s var(--ease-in-out),
    box-shadow 0.2s var(--ease-in-out);
}

.t2-embodiment:hover {
  border-color: rgba(196, 136, 31, 0.3);
  background: var(--kowhai-glow);
}

.t2-embodiment.selected {
  background: var(--kowhai);
  color: var(--ngahere);
  border-color: var(--kowhai);
  box-shadow: var(--shadow-sm);
}

.t2-embodiment-detail {
  margin-top: 8px;
  padding: 10px;
  background: var(--cream-deep);
  border-radius: var(--radius-sm);
  font-size: 11px;
  border: 1px solid var(--rule);
}

/* ==========================================================================
   T3 Panel -- inner sanctum (full spectrum atmosphere)
   ========================================================================== */

.t3-panel {
  background: var(--cream-warm);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.4s var(--ease-out) 0.2s both;
}

/* Gradient left accent: the full pounamu-kowhai-ngahere spectrum */
.t3-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--pounamu), var(--kowhai) 50%, var(--ngahere));
  border-radius: 0 2px 2px 0;
}

/* Subtle ambient glow at top */
.t3-panel::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 3px;
  right: 0;
  height: 80px;
  background: linear-gradient(
    180deg,
    rgba(31, 138, 58, 0.04),
    rgba(196, 136, 31, 0.02) 50%,
    transparent
  );
  pointer-events: none;
}

.t3-panel-header h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--ngahere);
  margin-bottom: 2px;
}

.t3-panel-subtitle {
  font-size: 12px;
  color: var(--ng40);
  margin-bottom: 16px;
  font-style: italic;
}

.t3-section { margin-bottom: 20px; }

.t3-section h4 {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ng60);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.t3-section-note {
  font-size: 11px;
  color: var(--ng40);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.5;
}

.t3-placeholder-note {
  font-size: 11px;
  color: var(--kowhai);
  background: var(--kowhai-glow);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid rgba(196, 136, 31, 0.12);
  line-height: 1.5;
}

.t3-empty {
  color: var(--ng40);
  font-style: italic;
  font-size: 11px;
}

/* Cerebras thinking trace */
.t3-thinking-stack { display: flex; flex-direction: column; gap: 6px; }

.t3-thinking-trace {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: var(--cream-deep);
  transition: border-color 0.2s var(--ease-in-out);
}

.t3-thinking-trace:hover {
  border-color: rgba(31, 138, 58, 0.15);
}

.t3-thinking-trace summary {
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--ng20);
  font-weight: 600;
}

.t3-thinking-payload {
  margin-top: 8px;
  padding: 10px;
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 10px;
  max-height: 250px;
  overflow-y: auto;
  color: var(--ng10);
}

/* Sovereign override diagram */
.t3-override-toggle {
  background: var(--cream-warm);
  border: 1px solid var(--rule);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.2s var(--ease-in-out),
    box-shadow 0.2s var(--ease-in-out);
}

.t3-override-toggle:hover {
  background: var(--cream-deep);
  box-shadow: var(--shadow-md);
}

.t3-override-diagram {
  margin-top: 10px;
  padding: 14px;
  background: var(--cream-deep);
  border-radius: var(--radius-sm);
  font-size: 12px;
  border: 1px solid var(--rule);
}

.t3-keystroke-glyph {
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.t3-keystroke-glyph kbd {
  background: var(--ngahere);
  color: var(--cream);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  margin: 0 2px;
  box-shadow:
    0 1px 0 rgba(14, 14, 14, 0.2),
    inset 0 -1px 0 rgba(14, 14, 14, 0.3);
}

.t3-override-architecture {
  margin-top: 10px;
  font-size: 11px;
  font-style: italic;
  color: var(--ng40);
  line-height: 1.5;
}

/* IP / roadmap stubs */
.t3-ip-stub, .t3-roadmap-stub {
  list-style: none;
  padding: 0;
  font-size: 12px;
}

.t3-ip-stub li, .t3-roadmap-stub li {
  padding: 5px 0;
  border-bottom: 1px solid var(--rule);
}

.t3-financial-stub {
  font-size: 12px;
  color: var(--ng20);
  line-height: 1.6;
}

/* Inner sanctum disclosure */
.t3-inner-sanctum-disclosure {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(
    135deg,
    var(--cream-warm),
    var(--cream-deep) 50%,
    rgba(31, 138, 58, 0.03)
  );
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ng20);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.t3-inner-sanctum-disclosure strong {
  color: var(--ngahere);
  font-weight: 700;
}

/* ==========================================================================
   Curtain overlays
   ========================================================================== */

.curtain-reveal-overlay,
.curtain-unravel-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  transition: opacity 600ms var(--ease-out);
}

.curtain-reveal-overlay canvas,
.curtain-unravel-overlay canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   Sovereign modal
   ========================================================================== */

.sovereign-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(14, 14, 14, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sovereign-modal {
  background: var(--cream-warm);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 480px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.35s var(--ease-out) both;
}

.sovereign-modal h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--ngahere);
}

.sovereign-modal p {
  font-size: 14px;
  color: var(--ng20);
  margin-bottom: 24px;
  line-height: 1.7;
}

.sovereign-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.sovereign-modal-buttons button {
  padding: 13px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--cream-warm);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition:
    background 0.2s var(--ease-in-out),
    border-color 0.2s var(--ease-in-out),
    box-shadow 0.2s var(--ease-in-out),
    transform 0.15s var(--ease-out);
}

.sovereign-modal-buttons button:hover {
  background: var(--pounamu-glow);
  border-color: rgba(31, 138, 58, 0.2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sovereign-modal-t3 {
  background: linear-gradient(135deg, var(--pounamu), var(--kowhai) 60%, var(--ngahere)) !important;
  color: var(--cream) !important;
  border: none !important;
  box-shadow: var(--shadow-md), 0 0 20px rgba(31, 138, 58, 0.1) !important;
}

.sovereign-modal-cancel {
  background: transparent;
  border: none;
  color: var(--ng60);
  cursor: pointer;
  font-size: 13px;
  width: 100%;
  padding: 8px;
  box-shadow: none;
  transition: color 0.2s var(--ease-in-out);
}

.sovereign-modal-cancel:hover {
  color: var(--ng20);
  box-shadow: none;
  background: transparent;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .dm-page[data-tier="T1"],
  .dm-page[data-tier="T2"],
  .dm-page[data-tier="T3"] {
    grid-template-columns: 1fr;
  }
  .dm-tier-panels {
    border-left: none;
    border-top: 1px solid var(--rule);
    max-height: 60vh;
  }
}
