/* Tokens shared with demo.automatehq.eu */
:root {
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --subtle: #f9fafb;
  --hover: #f2f4f7;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --ink: #14161b;
  --ink-hover: #2c3038;
  --ink-2: #475467;
  --ink-3: #667085;
  --new: #2e5bff;
  --repeat: #0e9f6e;
  --repeat-text: #077a53;
  --repeat-soft: #ecfdf3;
  --repeat-line: #abefc6;
  --danger: #c4320a;
  --danger-soft: #fef3f2;
  --danger-line: #fecdca;
  --focus-ring: 0 0 0 4px rgba(46, 91, 255, 0.18);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 8px;
  --gutter: 32px;
  --topbar-height: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--new); outline-offset: 2px; }

/* Top bar */
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(12px);
}
.topbar__inner {
  display: flex;
  align-items: center;
  width: min(100%, 720px);
  min-height: var(--topbar-height);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; border-radius: var(--radius-sm); }
.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #fff;
  background: var(--ink);
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.brand-mark circle { fill: currentColor; stroke: none; }
.brand-copy { display: grid; line-height: 1.2; }
.brand-copy strong { font-size: 14px; font-weight: 600; }
.brand-copy small { color: var(--ink-3); font-size: 12px; }

/* Page */
main {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 40px var(--gutter) 64px;
}
.page-head h1 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; }
.page-head p { max-width: 52ch; margin: 0; color: var(--ink-2); font-size: 15px; }

.panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 22, 27, 0.04);
}

/* Robert picker */
.picker { min-width: 0; margin: 0; padding: 20px 24px 24px; border: 0; }
/* float keeps the legend inside the fieldset box instead of on its border */
.picker__legend {
  float: left;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 0;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
}
.picker__selected { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.picker__selected.is-set { color: var(--ink); font-weight: 500; }
.picker__grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 6px;
}
.robert { position: relative; }
.robert input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.robert span {
  display: grid;
  place-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
  pointer-events: none;
}
.robert input:hover + span { border-color: var(--line-strong); background: var(--hover); color: var(--ink); }
.robert input:focus-visible + span { border-color: var(--new); box-shadow: var(--focus-ring); }
.robert input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.robert input:disabled { cursor: wait; }
/* Reported during this visit: green outline so nobody sends it twice by accident */
.robert.is-reported span { border-color: var(--repeat-line); background: var(--repeat-soft); color: var(--repeat-text); }
.robert.is-reported input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Action area */
.action-bar {
  display: grid;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--subtle);
}
.submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background 150ms ease;
}
.account-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.account-details__label { color: var(--ink-3); font-size: 12px; }
.account-details__email { min-width: 0; color: var(--ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; user-select: text; }
.submit:hover:not(:disabled) { background: var(--ink-hover); }
.submit:disabled { cursor: not-allowed; color: var(--ink-3); background: var(--hover); box-shadow: inset 0 0 0 1px var(--line); }
.submit.is-sending { cursor: wait; color: #fff; background: var(--ink-hover); box-shadow: none; }
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
.submit.is-sending .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.feedback {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.feedback strong { font-weight: 600; }
.feedback span { font-variant-numeric: tabular-nums; }
.feedback[data-kind="success"] { border-color: var(--repeat-line); background: var(--repeat-soft); color: var(--repeat-text); }
.feedback[data-kind="error"] { border-color: var(--danger-line); background: var(--danger-soft); color: var(--danger); }
.feedback[data-kind="error"] span { color: var(--ink-2); }

.noscript { margin-top: 16px; color: var(--danger); }

@media (max-width: 680px) {
  .picker__grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  :root { --gutter: 16px; }
  main { padding-top: 28px; padding-bottom: 0; }
  .page-head h1 { font-size: 22px; }
  .panel { margin-top: 20px; }
  .picker { padding: 16px; }
  .picker__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  /* Keep the send button in reach while scrolling through 88 numbers */
  .action-bar {
    position: sticky;
    bottom: 0;
    margin: 0 calc(var(--gutter) * -1);
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    border-radius: 0;
    background: rgba(249, 250, 251, 0.94);
    backdrop-filter: saturate(1.4) blur(12px);
  }
  .panel { border-bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .spinner { animation-duration: 1.6s; }
}
