:root {
  color-scheme: dark;
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 6% 6.5%;
  --card-foreground: 0 0% 98%;
  --popover: 240 6% 8%;
  --popover-foreground: 0 0% 98%;
  --primary: 158 64% 52%;
  --primary-foreground: 164 86% 8%;
  --secondary: 240 4% 14%;
  --secondary-foreground: 0 0% 96%;
  --muted: 240 4% 13%;
  --muted-foreground: 240 5% 65%;
  --accent: 240 4% 17%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 98%;
  --warning: 32 94% 56%;
  --border: 240 4% 17%;
  --input: 240 4% 19%;
  --ring: 158 64% 52%;
  --radius: 0.5rem;
  --topbar-height: 4rem;
  --sidebar-width: 18rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

body {
  min-width: 20rem;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

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

[hidden] {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsla(var(--background) / 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: 0.7rem;
  place-items: center;
  border: 1px solid hsl(158 55% 32%);
  border-radius: 0.45rem;
  background: hsl(158 45% 12%);
  color: hsl(var(--primary));
}

.brand-mark .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.15rem;
  text-overflow: ellipsis;
}

.brand-copy span {
  color: hsl(var(--muted-foreground));
  font-size: 0.7rem;
  line-height: 0.95rem;
}

.topbar-actions,
.header-actions,
.status-line,
.address-row,
.code-value-row,
.code-meta,
.dialog-footer {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 0.6rem;
}

.health-badge,
.badge,
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 560;
  line-height: 1;
}

.health-badge {
  height: 1.8rem;
  gap: 0.45rem;
  padding: 0 0.65rem;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.status-dot,
.live-dot {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: hsl(var(--muted-foreground));
}

.health-badge[data-status="ok"] {
  border-color: hsl(158 45% 24%);
  background: hsl(158 42% 10%);
  color: hsl(158 60% 72%);
}

.health-badge[data-status="ok"] .status-dot,
.badge.success .live-dot {
  background: hsl(var(--primary));
  box-shadow: 0 0 0 0.18rem hsl(158 64% 52% / 0.12);
}

.health-badge[data-status="error"] {
  border-color: hsl(0 44% 28%);
  background: hsl(0 42% 11%);
  color: hsl(0 78% 72%);
}

.health-badge[data-status="error"] .status-dot {
  background: hsl(0 72% 56%);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 570;
  line-height: 1;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.button.primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.button.primary:hover:not(:disabled) {
  background: hsl(158 68% 46%);
}

.button.secondary {
  border-color: hsl(var(--border));
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.button.secondary:hover:not(:disabled),
.button.ghost:hover:not(:disabled) {
  background: hsl(var(--accent));
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.button.destructive,
.button.destructive-ghost:hover:not(:disabled) {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.button.destructive-ghost {
  border-color: transparent;
  background: transparent;
  color: hsl(0 70% 67%);
}

.button.icon-button {
  width: 2.25rem;
  height: 2.25rem;
  min-height: 2.25rem;
  flex: 0 0 auto;
  padding: 0;
}

.spinning {
  animation: spin 0.8s linear infinite;
}

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

.button.full-width {
  width: 100%;
}

.app-main {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
  min-width: 0;
  border-right: 1px solid hsl(var(--border));
  background: hsl(240 7% 5%);
}

.create-section,
.recent-section {
  padding: 1.25rem;
}

.section-heading,
.panel-heading,
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}

.section-heading {
  margin-bottom: 1.15rem;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-heading h1,
.section-heading h2,
.panel-heading h2,
.dialog-header h2,
.workspace-empty h2 {
  margin: 0;
  color: hsl(var(--foreground));
  font-weight: 650;
  letter-spacing: 0;
}

.section-heading h1 {
  margin-top: 0.2rem;
  font-size: 1rem;
  line-height: 1.4rem;
}

.section-heading h2 {
  font-size: 0.8rem;
  line-height: 1.2rem;
}

.eyebrow {
  display: block;
  color: hsl(var(--muted-foreground));
  font-size: 0.67rem;
  font-weight: 580;
  line-height: 1rem;
  text-transform: uppercase;
}

.field-group {
  margin-bottom: 1rem;
  padding: 0;
  border: 0;
}

.field-group label,
.field-group legend {
  display: block;
  margin-bottom: 0.45rem;
  padding: 0;
  color: hsl(var(--foreground));
  font-size: 0.76rem;
  font-weight: 560;
  line-height: 1.1rem;
}

.input {
  width: 100%;
  height: 2.35rem;
  padding: 0 0.7rem;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  outline: none;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.82rem;
  line-height: 1;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

.toggle-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.toggle-group button {
  min-width: 0;
  height: 2.1rem;
  padding: 0 0.45rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 540;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-group button:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.toggle-group button[aria-pressed="true"] {
  border-color: hsl(158 45% 30%);
  background: hsl(158 42% 12%);
  color: hsl(158 62% 72%);
}

.separator {
  height: 1px;
  margin: 0 1.25rem;
  background: hsl(var(--border));
}

.count-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.recent-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.9rem;
  align-items: center;
  min-height: 3.3rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--muted-foreground));
}

.recent-item:hover {
  background: hsl(var(--muted));
}

.recent-item[data-active="true"] {
  border-color: hsl(var(--border));
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.recent-select {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: 0.45rem 0.2rem 0.45rem 0.65rem;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.recent-address,
.recent-expiry {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-address {
  margin-bottom: 0.2rem;
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1rem;
}

.recent-expiry {
  color: hsl(var(--muted-foreground));
  font-size: 0.66rem;
  line-height: 0.9rem;
}

.recent-remove {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}

.recent-remove:hover {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.recent-remove .icon {
  width: 0.85rem;
  height: 0.85rem;
}

.small-empty,
.message-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
}

.small-empty {
  min-height: 7rem;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.74rem;
}

.small-empty .icon {
  width: 1.2rem;
  height: 1.2rem;
}

.workspace {
  min-width: 0;
  padding: 1.25rem;
}

.workspace-empty {
  display: flex;
  min-height: calc(100vh - var(--topbar-height) - 2.5rem);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(240 5% 5%);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: 1rem;
  place-items: center;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.empty-icon .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.workspace-empty h2 {
  font-size: 0.95rem;
  line-height: 1.4rem;
}

.workspace-empty p {
  margin: 0.4rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.78rem;
}

.inbox-workspace {
  min-height: calc(100vh - var(--topbar-height) - 2.5rem);
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
}

.inbox-header {
  display: flex;
  min-height: 6.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
}

.address-block {
  min-width: 0;
}

.status-line {
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.badge {
  min-height: 1.45rem;
  gap: 0.4rem;
  padding: 0 0.5rem;
}

.badge.success {
  border-color: hsl(158 45% 25%);
  background: hsl(158 42% 10%);
  color: hsl(158 62% 72%);
}

.badge.outline {
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.badge.warning {
  border-color: hsl(32 48% 28%);
  background: hsl(32 44% 11%);
  color: hsl(32 82% 70%);
}

.badge.error {
  border-color: hsl(0 46% 29%);
  background: hsl(0 42% 11%);
  color: hsl(0 78% 72%);
}

.expiry {
  display: inline-flex;
  align-items: center;
  min-width: 8.8rem;
  gap: 0.35rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1rem;
}

.expiry .icon {
  width: 0.82rem;
  height: 0.82rem;
}

.address-row {
  min-width: 0;
  gap: 0.55rem;
}

.inbox-address {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: hsl(var(--foreground));
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 560;
  line-height: 1.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  flex: 0 0 auto;
  gap: 0.35rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(24rem, 1fr) minmax(20rem, 23rem);
  min-height: calc(100vh - var(--topbar-height) - 8.8rem);
}

.code-panel,
.message-panel {
  min-width: 0;
  padding: 1.25rem;
}

.message-panel {
  border-left: 1px solid hsl(var(--border));
  background: hsl(240 6% 5.5%);
}

.panel-heading {
  align-items: center;
  min-height: 2.5rem;
}

.panel-heading h2 {
  margin-top: 0.1rem;
  font-size: 0.95rem;
  line-height: 1.4rem;
}

.code-state,
.code-result {
  display: flex;
  min-height: 24rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.code-state {
  position: relative;
  overflow: hidden;
}

.code-placeholder {
  color: hsl(var(--muted-foreground) / 0.35);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 2.65rem;
  font-weight: 680;
  line-height: 3rem;
  font-variant-numeric: tabular-nums;
}

.code-state p {
  margin: 0.8rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.78rem;
}

.scan-line {
  position: absolute;
  top: 28%;
  width: 10rem;
  height: 1px;
  background: hsl(var(--primary) / 0.55);
  box-shadow: 0 0 1rem hsl(var(--primary) / 0.28);
  animation: scan 2.4s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { transform: translateY(0); opacity: 0; }
  15%, 85% { opacity: 1; }
  50% { transform: translateY(7.2rem); }
}

.code-value-row {
  max-width: 100%;
  justify-content: center;
  gap: 0.8rem;
}

.code-value {
  max-width: min(100%, 32rem);
  overflow: hidden;
  color: hsl(var(--primary));
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 3.1rem;
  font-weight: 720;
  line-height: 3.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.code-meta {
  max-width: 100%;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.72rem;
}

.code-meta span:not(.meta-dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-dot {
  width: 0.18rem;
  height: 0.18rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: hsl(var(--muted-foreground));
}

.candidate-row {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.candidate-button {
  min-height: 1.8rem;
  padding: 0 0.55rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
}

.candidate-button:hover {
  border-color: hsl(158 40% 32%);
  color: hsl(var(--primary));
}

.verification-link {
  margin-top: 1rem;
}

.message-heading {
  margin-bottom: 0.8rem;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: calc(100vh - 13rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: hsl(var(--border)) transparent;
}

.message-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1rem;
  min-height: 4.7rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  text-align: left;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.message-item:hover {
  border-color: hsl(240 4% 28%);
  background: hsl(var(--accent));
}

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

.message-subject,
.message-from,
.message-time {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-subject {
  margin-bottom: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.05rem;
}

.message-from {
  color: hsl(var(--muted-foreground));
  font-size: 0.68rem;
  line-height: 0.95rem;
}

.message-time {
  margin-top: 0.15rem;
  color: hsl(var(--muted-foreground) / 0.75);
  font-size: 0.64rem;
  line-height: 0.9rem;
}

.message-item > .icon {
  color: hsl(var(--muted-foreground));
}

.message-empty {
  min-height: 16rem;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.75rem;
}

.message-empty .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.dialog {
  width: min(92vw, 28rem);
  max-height: min(90vh, 44rem);
  padding: 0;
  overflow: visible;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: 0 1.5rem 4rem hsl(0 0% 0% / 0.55);
}

.dialog::backdrop {
  background: hsl(240 10% 2% / 0.78);
  backdrop-filter: blur(3px);
}

.dialog-content {
  margin: 0;
  padding: 1.25rem;
}

.dialog-header {
  gap: 0.8rem;
  margin-bottom: 1.25rem;
}

.dialog-icon {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid hsl(158 45% 28%);
  border-radius: calc(var(--radius) - 2px);
  background: hsl(158 42% 11%);
  color: hsl(var(--primary));
}

.dialog-icon.danger {
  border-color: hsl(0 46% 29%);
  background: hsl(0 42% 11%);
  color: hsl(0 72% 67%);
}

.dialog-header > div:not(.dialog-icon) {
  min-width: 0;
  flex: 1;
}

.dialog-header h2 {
  font-size: 0.95rem;
  line-height: 1.35rem;
}

.dialog-header p {
  margin: 0.25rem 0 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.72rem;
  line-height: 1rem;
}

.dialog-close {
  margin: -0.35rem -0.35rem 0 0;
}

.input-with-action {
  position: relative;
}

.input-with-action .input {
  padding-right: 2.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.input-action {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: calc(var(--radius) - 3px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}

.input-action:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

.input-action .hide-icon,
.input-action[data-visible="true"] .show-icon {
  display: none;
}

.input-action[data-visible="true"] .hide-icon {
  display: block;
}

.field-error {
  min-height: 1rem;
  margin: 0.4rem 0 0;
  color: hsl(0 76% 69%);
  font-size: 0.7rem;
  line-height: 1rem;
}

.dialog-footer {
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.footer-spacer {
  flex: 1;
}

.message-dialog {
  width: min(92vw, 46rem);
  overflow: hidden;
}

.message-dialog-content {
  display: flex;
  max-height: min(86vh, 46rem);
  flex-direction: column;
}

.message-dialog-header {
  flex: 0 0 auto;
  padding-bottom: 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.message-dialog-title {
  min-width: 0;
}

.message-dialog-title h2,
.message-dialog-title p {
  overflow-wrap: anywhere;
}

.message-dialog-title h2 {
  margin-top: 0.7rem;
  font-size: 1rem;
}

.message-body {
  min-height: 12rem;
  padding: 0.25rem 0;
  overflow: auto;
  color: hsl(0 0% 90%);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.35rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  scrollbar-color: hsl(var(--border)) transparent;
}

.confirm-content {
  width: 100%;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  width: min(22rem, calc(100vw - 2rem));
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 3.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--popover));
  color: hsl(var(--foreground));
  box-shadow: 0 0.8rem 2rem hsl(0 0% 0% / 0.45);
  font-size: 0.76rem;
  line-height: 1.1rem;
  animation: toast-in 160ms ease-out;
}

.toast.success .icon {
  color: hsl(var(--primary));
}

.toast.error .icon {
  color: hsl(0 72% 67%);
}

@keyframes toast-in {
  from { transform: translateY(0.5rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 68rem) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .message-panel {
    border-top: 1px solid hsl(var(--border));
    border-left: 0;
  }

  .message-list {
    max-height: 24rem;
  }
}

@media (max-width: 48rem) {
  :root {
    --topbar-height: 3.75rem;
  }

  .topbar {
    padding: 0 0.85rem;
  }

  .health-badge {
    width: 1.8rem;
    padding: 0;
  }

  .health-badge span:last-child {
    display: none;
  }

  .app-main {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid hsl(var(--border));
  }

  .create-section,
  .recent-section,
  .code-panel,
  .message-panel {
    padding: 1rem;
  }

  .recent-section {
    padding-top: 0.85rem;
  }

  .recent-list {
    display: grid;
    grid-auto-columns: minmax(13rem, 76vw);
    grid-auto-flow: column;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: thin;
  }

  .recent-item {
    scroll-snap-align: start;
  }

  .small-empty {
    min-height: 4.2rem;
    flex-direction: row;
  }

  .workspace {
    padding: 0.75rem;
  }

  .workspace-empty,
  .inbox-workspace {
    min-height: 30rem;
  }

  .inbox-header {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem;
  }

  .inbox-address {
    font-size: 0.86rem;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .workspace-grid {
    min-height: 0;
  }

  .code-state,
  .code-result {
    min-height: 18rem;
  }

  .code-value {
    font-size: 2.2rem;
    line-height: 2.8rem;
  }

  .code-placeholder {
    font-size: 2rem;
  }

  .message-list {
    max-height: none;
  }

  .dialog-footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 24rem) {
  .brand-copy span {
    display: none;
  }

  .toggle-group {
    grid-template-columns: 1fr;
  }

  .expiry {
    min-width: 0;
  }

  .code-value-row {
    width: 100%;
  }

  .code-value {
    min-width: 0;
    font-size: 1.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
