:root {
  --paper: #fbf7ef;
  --card: #ffffff;
  --ink: #1f2a44;
  --muted: #5d6473;
  --line: #e8e1d3;
  --accent: #e2553b;
  --green: #2f8f5b;
  --danger: #b3261e;
  color-scheme: light;
  font-family: "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 24px; }
button, a { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.preview-ribbon {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); margin: 0;
  padding: 4px 14px; border-radius: 999px; background: #fff3c4; color: #6b5300; font-size: 13px; font-weight: 600;
}

.page { width: min(100%, 560px); text-align: center; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.page h1 { margin: 10px 0; font-family: Georgia, serif; font-size: clamp(30px, 6vw, 44px); }
.page > p:not(.eyebrow) { color: var(--muted); }

.open-button, .primary-button, .secondary-button, .cancel-button {
  display: grid; place-items: center; min-height: 48px; padding: 0 20px;
  border-radius: 12px; font-weight: 600; text-decoration: none;
}
.open-button { display: inline-grid; margin-top: 20px; border: 0; color: #fff; background: var(--ink); }
.primary-button { border: 0; color: #fff; background: var(--ink); }
.secondary-button { border: 1px solid #cfc7b8; color: var(--ink); background: var(--card); }
.cancel-button { border: 1px solid var(--danger); color: var(--danger); background: var(--card); }
.cancel-button.solid { color: #fff; background: var(--danger); }
:is(button, a):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: progress; }

.subscription-dialog {
  width: min(560px, calc(100% - 32px)); max-height: min(90vh, 860px); padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: 24px; color: inherit; background: var(--card);
  box-shadow: 0 24px 80px rgb(31 42 68 / .22);
}
.subscription-dialog::backdrop { background: rgb(31 42 68 / .4); backdrop-filter: blur(6px); }
.dialog-content { padding: 32px clamp(22px, 6vw, 44px) 28px; }
.close-button {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; color: var(--ink); background: var(--paper); font-size: 26px; line-height: 1;
}
.dialog-content .eyebrow { margin: 0 48px 16px 0; }
.title-row { display: flex; align-items: center; gap: 12px; }
.dialog-content h2 { margin: 0; padding-right: 44px; font-family: Georgia, serif; font-size: clamp(24px, 5vw, 32px); }
.title-row h2 { padding-right: 0; }
.status-icon {
  display: grid; flex: 0 0 28px; height: 28px; place-items: center;
  border-radius: 50%; color: #fff; background: var(--green); font-weight: 700;
}
.description { margin: 14px 0 20px; color: var(--muted); line-height: 1.55; }
.description.small { font-size: 14px; }

.plan-box {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 22px;
  padding: 16px 18px; border-radius: 16px; background: var(--paper);
}
.plan-box dt { color: var(--muted); font-size: 13px; }
.plan-box dd { margin: 2px 0 0; font-weight: 650; }

.support { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.phone-icon { display: grid; width: 40px; place-items: center; color: var(--muted); }
.phone-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.support-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 14px; }
.phone-link { color: var(--ink); font-size: 20px; font-weight: 700; text-decoration: none; }
.phone-link:hover { text-decoration: underline; }
.support-hours { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.support-hours a { color: var(--muted); }

.actions { display: grid; gap: 10px; margin-top: 20px; }
.notice { margin: 14px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.error { padding: 12px; border-radius: 10px; background: #fce8e6; color: var(--danger); }

@media (max-width: 480px) {
  body { padding: 12px; }
  .subscription-dialog { width: calc(100% - 20px); border-radius: 20px; }
  .plan-box { grid-template-columns: 1fr; }
  .close-button { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .subscription-dialog[open] { animation: enter .2s ease-out; }
  @keyframes enter { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
}
