/* Tokens follow apple.com (mobile, ≤734px) and iOS system colors. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --page: #f5f5f7;
  --card: #fff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --divider: rgba(0, 0, 0, .12);

  --blue: #0071e3;
  --link: #0066cc;
  --quiet: #e8e8ed;
  --green: #34c759;
  --green-text: #248a3d;

  --note-fg: #b64400;
  --note-bg: rgba(245, 99, 0, .1);

  --hairline: rgba(0, 0, 0, .08);

  /* Liquid glass — the .lens.samGlass recipe from Aceton Business */
  --glass-fill: rgba(120, 120, 128, .12);
  --glass-blur: blur(18px) saturate(1.28) brightness(1.04);
  --glass-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .05), inset 0 0 0 1px rgba(255, 255, 255, .07);
  --glass-sheen: rgba(255, 255, 255, .62);
  --thumb: #fff;
  --thumb-shadow: 0 3px 10px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .9);

  /* Floating help dock — geometry from Aceton Business */
  --ui-inset: clamp(16px, 5.35vw, 21px);
  --ui-gap: clamp(7px, 2.05vw, 8px);
  /* Large closed help button; the opened field still uses --compact-h. */
  --dock-h: clamp(84px, 22.5vw, 92px);
  --compact-h: clamp(50px, 13.75vw, 54px);
  --morph: cubic-bezier(.22, .78, .22, 1);
  --lens-bg: rgba(246, 246, 249, .38);
  --lens-shadow: 0 10px 26px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(0, 0, 0, .05), inset 0 0 0 1px rgba(255, 255, 255, .07);
  --kb: 0px;

  --ease: cubic-bezier(.4, 0, .6, 1);
  --ease-out: cubic-bezier(0, 0, .5, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #000;
    --card: #1d1d1f;
    --text: #f5f5f7;
    --text-2: #86868b;
    --divider: rgba(255, 255, 255, .16);

    --link: #2997ff;
    --quiet: #333336;
    --green: #30d158;
    --green-text: #30d158;

    --note-fg: #ff9f4d;
    --note-bg: rgba(255, 146, 48, .14);

    --hairline: rgba(255, 255, 255, .12);

    --glass-fill: rgba(255, 255, 255, .09);
    --glass-shadow: 0 6px 18px rgba(0, 0, 0, .45);
    --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255, 255, 255, .05);
    --glass-sheen: rgba(255, 255, 255, .4);
    --thumb: rgba(255, 255, 255, .2);
    --thumb-shadow: 0 3px 10px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .22);

    --lens-bg: rgba(44, 44, 46, .5);
    --lens-shadow: 0 10px 26px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 255, 255, .06);
  }
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 17px/1.47 var(--font);
  letter-spacing: -.022em;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Keep vertical scrolling, but do not draw a scrollbar beside the mobile UI. */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

button { font: inherit; letter-spacing: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Page ---------- */

.page {
  width: min(100% - 32px, 440px);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 0 calc(env(safe-area-inset-bottom) + var(--ui-inset) + var(--dock-h) + 24px);
}

/* ---------- Hero ---------- */

/* App Store product-header pattern: icon on the left, name and subtitle on the right */
.hero-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-icon {
  flex: none;
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 22.5%;
  background: #b3161b; /* painting's red while the image loads */
  box-shadow: 0 0 0 .5px var(--hairline);
}

.hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1429;
  font-weight: 600;
  letter-spacing: .007em;
  text-wrap: balance;
}

.hero-sub {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.33;
  letter-spacing: -.01em;
  color: var(--text-2);
  text-wrap: pretty;
}

/* Segmented control — a glass track with a lifted thumb */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 48px;
  margin-top: 20px;
  padding: 4px;
  border-radius: 999px;
  background: var(--glass-fill);
  box-shadow: var(--glass-shadow), var(--glass-edge);
}

.seg-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: 40px;
  border-radius: 999px;
  background: var(--thumb);
  box-shadow: var(--thumb-shadow);
  transition: transform .4s cubic-bezier(.22, .78, .22, 1);
}

.seg[data-value="android"] .seg-thumb { transform: translateX(100%); }

.seg button {
  position: relative;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text-2);
  cursor: pointer;
  transition: color .16s ease-in .1s;
}

.seg button[aria-checked="true"] { color: var(--text); }

/* ---------- Steps ---------- */

.steps {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 20px 20px;
  border-radius: 28px;
  background: var(--card);
  scroll-margin-top: 16px;
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.19;
  font-weight: 600;
  letter-spacing: .011em;
}

.step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: -2.5px; /* centre on the first line of a wrapping title */
  border-radius: 50%;
  background: var(--quiet);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

/* App row in step 1 */
.app {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 23%;
  box-shadow: 0 0 0 .5px var(--hairline);
}

.app strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
}

.app span {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-2);
}

/* ---------- Buttons: liquid glass ---------- */

.btn,
.chip,
.seg,
.chat-send {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* Sheen: rests as a soft highlight at the top edge, follows the finger on press. */
.btn::after,
.chip::after,
.seg::after,
.chat-send::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(130px 95px at var(--gx, 50%) var(--gy, 16%),
    var(--glass-sheen), rgba(255, 255, 255, .15) 46%, rgba(255, 255, 255, 0) 72%);
  mix-blend-mode: overlay;
  opacity: .32;
  transition: opacity .2s ease;
}

.btn.pressed::after,
.chip.pressed::after,
.seg.pressed::after,
.chat-send.pressed::after { opacity: .94; }

/* One hierarchy everywhere — colour follows the button's role, never the step state:
   .btn  — the step's main action: tinted blue glass
   .chip — a secondary action: clear glass
   .link — a tertiary action: plain text */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 62%), var(--blue);
  box-shadow:
    0 8px 22px rgba(0, 113, 227, .28),
    inset 0 1px 0 rgba(255, 255, 255, .42),
    inset 0 -1px 0 rgba(0, 0, 0, .12),
    inset 0 0 0 1px rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.btn svg,
.chip svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn svg { width: 22px; height: 22px; }

.chip {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin-top: -2px;
  padding: 0 18px 0 15px;
  border: 0;
  border-radius: 999px;
  background: var(--glass-fill);
  box-shadow: var(--glass-shadow), var(--glass-edge);
  color: var(--link);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.chip svg { width: 20px; height: 20px; }

.chip .i-done { display: none; }
.chip.is-done { color: var(--green-text); }
.chip.is-done .i-copy { display: none; }
.chip.is-done .i-done { display: block; }

.chip--left {
  align-self: flex-start;
  margin-top: 12px;
}

.link {
  margin: -12px 0;
  padding: 12px 2px;
  border: 0;
  background: none;
  color: var(--link);
  cursor: pointer;
}

/* ---------- Text ---------- */

.aside {
  margin: -4px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -.016em;
  color: var(--text-2);
}

.hint {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--text-2);
}

.hint-2 {
  display: block;
  margin-top: 8px;
}

.note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--note-bg);
  color: var(--note-fg);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.note svg {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.manual label {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-2);
}

.manual input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--page);
  color: var(--text);
  font: 15px/1.3 var(--font);
}

/* ---------- Troubleshooting ---------- */

.help {
  margin-top: 12px;
  border-radius: 28px;
  background: var(--card);
}

.help summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 20px;
  border-radius: 28px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.help summary::-webkit-details-marker { display: none; }
.help summary:focus-visible { outline-offset: -4px; }

.help summary svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s var(--ease);
}

.help[open] summary svg { transform: rotate(180deg); }

.help-body { padding: 0 20px 8px; }

.qa {
  padding: 16px 0;
  border-top: 1px solid var(--divider);
}

.qa h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.qa p {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--text-2);
}

.qa .manual { margin-top: 8px; }

/* ---------- Help chat ----------
   The support glass circle stretches into a message field — the Search control
   from Aceton Business — while the page behind it switches to the chat. */

.qa { scroll-margin-top: 16px; }

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom);
  z-index: 20;
  max-width: 480px;
  height: 0;
  margin: 0 auto;
  transition: bottom .3s var(--morph);
}

.keyboard-open .dock {
  bottom: calc(env(safe-area-inset-bottom) + var(--kb));
}

.lens {
  position: absolute;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--lens-bg);
  box-shadow: var(--lens-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  transform: translateZ(0);
  transform-origin: 50% 50%;
}

.lens::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(130px 95px at var(--gx, 50%) var(--gy, 16%),
    var(--glass-sheen), rgba(255, 255, 255, .15) 46%, rgba(255, 255, 255, 0) 72%);
  mix-blend-mode: overlay;
  opacity: .32;
  transition: opacity .2s ease;
}

.lens.pressed::after { opacity: .94; }

.ask {
  right: var(--ui-inset);
  bottom: var(--ui-inset);
  display: flex;
  align-items: center;
  width: var(--dock-h);
  height: var(--dock-h);
  margin: 0;
  border: 2px solid var(--blue);
  transition:
    width .40s var(--morph),
    height .40s var(--morph),
    transform .24s var(--morph);
}

.ask.pressed { transform: scale(.986); }

.ask-icon {
  position: relative;
  z-index: 6;
  flex: 0 0 var(--dock-h);
  display: grid;
  place-items: center;
  width: var(--dock-h);
  height: var(--dock-h);
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  cursor: pointer;
  transition:
    width .40s var(--morph),
    height .40s var(--morph),
    flex-basis .40s var(--morph);
}

.ask-icon svg {
  width: clamp(40px, 10.5vw, 44px);
  height: clamp(40px, 10.5vw, 44px);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: width .40s var(--morph), height .40s var(--morph);
}

.chat-input {
  position: relative;
  z-index: 6;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 52px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 17px/1.2 var(--font); /* 16px+ keeps iOS from zooming in on focus */
  letter-spacing: -.022em;
  opacity: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  transition: opacity .20s ease .08s;
}

.chat-input::placeholder { color: var(--text-2); }

/* Send is the field's primary action — the same tinted glass as .btn */
.chat-send {
  position: absolute;
  z-index: 6;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 62%), var(--blue);
  box-shadow: 0 4px 12px rgba(0, 113, 227, .28), inset 0 1px 0 rgba(255, 255, 255, .42), inset 0 -1px 0 rgba(0, 0, 0, .12);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: scale(.72);
  pointer-events: none;
  transition: opacity .12s ease, transform .28s cubic-bezier(.2, .9, .25, 1);
}

.chat-send svg {
  position: relative;
  z-index: 3;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-close,
.keyboard-hide {
  left: var(--ui-inset);
  bottom: var(--ui-inset);
  display: grid;
  place-items: center;
  width: var(--compact-h);
  height: var(--compact-h);
  padding: 0;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: scale(.72);
  pointer-events: none;
  transition: opacity .2s, transform .28s cubic-bezier(.2, .9, .25, 1);
}

.chat-close svg,
.keyboard-hide svg {
  position: relative;
  z-index: 6;
  width: clamp(24px, 6.7vw, 27px);
  height: clamp(24px, 6.7vw, 27px);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Chatting: the circle stretches into the field, Close takes the left slot. */
.is-chat .ask {
  width: calc(100% - (var(--ui-inset) * 2) - var(--compact-h) - var(--ui-gap));
  height: var(--compact-h);
}

.is-chat .ask-icon {
  flex-basis: clamp(40px, 10vw, 44px);
  width: clamp(40px, 10vw, 44px);
  height: var(--compact-h);
}

.is-chat .ask-icon svg {
  width: clamp(26px, 7.2vw, 29px);
  height: clamp(26px, 7.2vw, 29px);
}

.is-chat .chat-input {
  opacity: 1;
  pointer-events: auto;
}

.is-chat .chat-send {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  transition-delay: .22s;
}

.is-chat .chat-send:disabled {
  opacity: .4;
  pointer-events: none;
}

.is-chat .chat-close {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.is-chat.keyboard-open .chat-close {
  opacity: 0;
  transform: scale(.72);
  pointer-events: none;
}

.is-chat.keyboard-open .keyboard-hide {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* The page behind switches between the guide and the chat. */
.page-in { animation: page-in .32s var(--morph) both; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* No header: the conversation sits on the message field, as in a messenger. */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--ui-inset) + var(--compact-h) + 16px);
}

.keyboard-open .chat-page {
  height: calc(var(--vvh, 100dvh) + var(--kb));
  padding-bottom: calc(env(safe-area-inset-bottom) + var(--ui-inset) + var(--compact-h) + 16px + var(--kb));
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.msg {
  max-width: 86%;
  margin: 0;
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -.012em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg--bot {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: var(--card);
  color: var(--text);
}

.msg--me {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: var(--blue);
  color: #fff;
}

.msg--error {
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  background: var(--note-bg);
  color: var(--note-fg);
}

/* Typing indicator */
.msg--typing {
  display: flex;
  gap: 5px;
  padding: 15px 16px;
}

.msg--typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-2);
  animation: typing 1.2s ease-in-out infinite;
}

.msg--typing i:nth-child(2) { animation-delay: .15s; }
.msg--typing i:nth-child(3) { animation-delay: .3s; }

@keyframes typing {
  0%, 60%, 100% { opacity: .3; transform: none; }
  30% { opacity: 1; transform: translateY(-2px); }
}

.chat-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chat-suggest .chip {
  align-self: auto;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  font-size: 15px;
  text-align: left;
}

/* ---------- Larger screens ---------- */

@media (min-width: 735px) {
  .page { padding-top: 64px; }
}

@media (hover: hover) {
  .btn:hover::after,
  .chip:hover::after { opacity: .6; }
  .link:hover { text-decoration: underline; }
  .seg button:not([aria-checked="true"]):hover { color: var(--text); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
