:root {
  --bg: #0d0e12;
  --panel: #f4f4f6;
  --ink: #1b1c22;
  --muted: #6b6d78;
  --amber: #f5a623;
  --amber-dark: #c97a12;
  --red: #d64545;
  --border: #dcdce2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  display: flex;
  justify-content: center;
  padding: 32px 16px 64px;
}

.demo-wrap {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.demo-note {
  margin: 0;
  color: #b9bac2;
  font-size: 13px;
  text-align: center;
}

.browser {
  background: #fff;
  border-radius: 14px;
  overflow: visible;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid #22232b;
}

.browser-titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #22232b;
  border-radius: 14px 14px 0 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.browser-title {
  margin-left: 10px;
  color: #9497a3;
  font-size: 12px;
}

.browser-urlbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f0f0f3;
  border-bottom: 1px solid var(--border);
}

.lock {
  font-size: 12px;
}

.url {
  flex: 1;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #43454f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.toolbar {
  position: relative;
}

.toolbar-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn[aria-expanded="true"] {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.25);
}

.toolbar-mark {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  position: relative;
  display: block;
}

.toolbar-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 2px;
  height: 8px;
  top: 4px;
  background: #22232b;
  border-radius: 2px;
}

.popup-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a2e38;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  z-index: 50;
}

.popup-panel.hidden {
  display: none;
}

.mock-page {
  padding: 22px;
  background: var(--panel);
  border-radius: 0 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.assistant-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff7ea;
  border: 1px solid #f1d8a6;
  border-radius: 10px;
  padding: 12px 14px;
}

.assistant-icon {
  font-size: 22px;
}

.assistant-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.assistant-body {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 14px;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.checkout-form input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
}

.checkout-form input.agent-fill {
  border-color: var(--amber);
  background: #fff8ec;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--amber);
  color: #23262f;
  align-self: flex-start;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #e0c07d;
  color: #8a6110;
  flex: 0 0 auto;
}

.btn-danger {
  background: #fdeceb;
  color: var(--red);
  border: 1px solid #f2c2be;
}

.action-status {
  margin: 4px 0 0;
  font-size: 12px;
  min-height: 16px;
}

.action-status.ok { color: #1a8a4a; }
.action-status.no { color: var(--red); }

.account-card .account-copy {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.mock-overlay-scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 999;
}

.mock-overlay-card {
  margin-top: 120px;
  width: 340px;
  background: #1c1f27;
  color: #e9e9ee;
  border: 1px solid #2a2e38;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.mock-overlay-card h2 {
  margin: 0 0 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mock-overlay-card p {
  margin: 0 0 12px;
  font-size: 12px;
  color: #9497a3;
  line-height: 1.4;
}

.mock-overlay-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  display: inline-block;
}

.mock-overlay-actions {
  display: flex;
  gap: 8px;
}

.mock-overlay-actions button {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 9px 0;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.mock-overlay-allow {
  background: var(--amber);
  color: #15171d;
}

.mock-overlay-block {
  background: #2a2e38;
  color: #e9e9ee;
}

@media (max-width: 520px) {
  .mock-overlay-card,
  .popup-panel .tw-popup {
    width: min(340px, 90vw);
  }
}
