/* Every .space tool (Rick, 2026-11-25): one screen. Its name, one line, the thing itself, and a way
   to back space. First principles, less is more, cool is exciting, beautiful is mathematical. */
html, body { height: 100%; overflow: hidden; }
.tool { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding: max(18px, env(safe-area-inset-top)) 18px max(12px, env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.tool-head { text-align: center; }
.tool-name { margin: 6px 0 2px; font-size: 30px; font-weight: 500; letter-spacing: 0.06em; }
.tool-line { margin: 0; color: var(--dim); font-size: 15px; letter-spacing: 0.02em; }
.tool-how { margin: 6px 0 0; color: var(--dim); font-size: 12.5px; letter-spacing: 0.03em; opacity: 0.8; }
.demo { position: relative; min-height: 0; display: grid; border: 1px solid var(--line); border-radius: 3px; background: rgba(0, 0, 0, 0.55); overflow: hidden; }
.tool-foot { display: grid; gap: 8px; }
.back { min-height: 48px; color: #000; font: inherit; font-size: 15px; font-weight: 500; letter-spacing: 0.06em; background: #fff; border: 0; border-radius: 3px; cursor: pointer; transition: transform 0.15s ease; }
.back:active { transform: scale(0.98); }
.tool-links { margin: 0; text-align: center; font-size: 12px; color: var(--dim); }
.tool-links a { display: inline-block; min-width: 44px; padding: 6px 8px; line-height: 16px; color: inherit; }

/* Inside a demo: quiet controls in the same voice. */
.demo button.pick, .demo .chip { min-height: 40px; padding: 0 14px; color: var(--ink); font: inherit; font-size: 14px; background: none; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.demo button.pick[aria-pressed="true"], .demo .chip[aria-pressed="true"] { color: #000; background: #fff; }
[hidden] { display: none !important; }
.demo textarea { min-height: 96px; }
.demo input[type="range"] { height: 28px; margin: 0; }
.demo textarea, .demo input[type="text"] { width: 100%; padding: 12px; color: var(--ink); font: inherit; font-size: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 3px; outline: 0; resize: none; }
.demo canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.pad { padding: 14px; display: grid; gap: 10px; align-content: start; overflow: auto; }
.row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.big { font-size: 44px; font-weight: 500; letter-spacing: 0.02em; text-align: center; margin: 0; }
.dim { color: var(--dim); }
.fade-in { animation: fade 0.5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* Backing space: the terms come first, then checkout. */
.pay { width: min(calc(100vw - 32px), 420px); padding: 22px; color: var(--ink); background: #000; border: 1px solid var(--line); border-radius: 3px; }
.pay::backdrop { background: rgba(0, 0, 0, 0.6); }
.pay h2 { margin: 0 0 8px; font-size: 20px; font-weight: 500; }
.pay p { margin: 0 0 12px; color: var(--dim); font-size: 14px; line-height: 1.5; }
.pay label { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.pay input[type="checkbox"] { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: #fff; }
.pay a { color: var(--ink); }
.pay .back { width: 100%; }
.pay .back:disabled { opacity: 0.35; cursor: not-allowed; }
.pay .close { display: block; width: 100%; margin-top: 8px; min-height: 44px; color: var(--dim); font: inherit; background: none; border: 0; cursor: pointer; }
.pay .soon { margin: 10px 0 0; color: var(--ink); text-align: center; }
