/* /whatsapp-bot/ only. Loaded after site.css.
   Idea: one night in the business. The blush accent of the site is the dawn.
   The phone uses WhatsApp's dark palette because it is a picture of WhatsApp,
   not a second brand colour. Radius rule: phone 46/38, bubbles 10, slip 3, board 24. */

:root {
  --wa-bg: #0b141a;
  --wa-bar: #1f2c34;
  --wa-in: #202c33;
  --wa-out: #005c4b;
  --wa-text: #e9edef;
  --wa-meta: #9fb0ba;
  --wa-link: #53bdeb;
  --paper: #f4f1ec;
  --ink: #181413;
  --ink-soft: #6a5f5a;
}

html { scroll-padding-top: 88px; }

/* ---------- hero ---------- */
.bh { position: relative; isolation: isolate; overflow: clip; padding-block: 24px 56px; }
.bh::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset-block-start: 8%; inset-inline-end: 6%; width: 760px; height: 620px; max-width: 100%;
  background: radial-gradient(closest-side, rgb(77 141 255 / 0.11), transparent);
}
.bh-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
.bh-title { font-size: clamp(2rem, 1.6vw + 1.35rem, 2.75rem); line-height: 1.14; letter-spacing: -0.02em; font-weight: 700; }
.bh-title span { display: block; }
.bh-title span + span { color: var(--accent); }
.bh-lead { margin-top: 20px; max-width: 46ch; font-size: 1.16rem; line-height: 1.6; color: var(--muted); }
.bh .cta-row { margin-top: 28px; }

.sim { min-width: 0; }
.sim-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 14px; }
.sim-label { font-weight: 600; font-size: 1.02rem; }
.sim-tabs { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.sim-tabs::-webkit-scrollbar { display: none; }
.sim-tab {
  flex: none; padding: 6px 0; background: none; border: 0; cursor: pointer; font: inherit; font-size: 0.95rem;
  color: var(--faint); border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.sim-tab:hover { color: var(--text); }
.sim-tab[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); }

.sim-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.sim-note { margin-top: 14px; font-size: 0.84rem; line-height: 1.5; color: var(--faint); }
.sim-replay { background: none; border: 0; padding: 0; margin-inline-start: 6px; cursor: pointer; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* phone */
.phone {
  --ph-h: 500px;
  width: 100%; max-width: 340px; margin-inline: auto; padding: 8px; border-radius: 46px;
  background: linear-gradient(150deg, #4c4543, #1b1b1e 38%, #26262b 70%, #575050);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.6), 0 40px 70px -30px rgb(0 0 0 / 0.95), 0 8px 24px -12px rgb(77 141 255 / 0.14);
}
.phone-screen { position: relative; display: flex; flex-direction: column; height: var(--ph-h); border-radius: 38px; overflow: hidden; background: var(--wa-bg); color: var(--wa-text); }
.ph-status { position: relative; display: flex; align-items: center; justify-content: space-between; height: 34px; padding-inline: 26px; background: var(--wa-bar); font-size: 0.8rem; font-weight: 600; flex: none; direction: ltr; }
.ph-island { position: absolute; inset-inline-start: 50%; translate: -50% 0; top: 8px; width: 84px; height: 22px; border-radius: 12px; background: #000; }
.ph-sig { width: 22px; height: 10px; border-radius: 3px; border: 1px solid var(--wa-meta); box-shadow: inset 12px 0 0 var(--wa-meta); }
.ph-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px 10px; background: var(--wa-bar); flex: none; }
.ph-bar p { display: grid; line-height: 1.25; min-width: 0; }
.ph-bar b { font-weight: 600; font-size: 0.96rem; }
.ph-bar span:not(.ph-avatar) { font-size: 0.76rem; color: var(--wa-meta); }
.ph-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: #2a3942; color: #c9d4da; }
.ph-avatar .i { width: 20px; height: 20px; }

.ph-chat { flex: 1; min-height: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; overflow-y: auto; scrollbar-width: none; }
.ph-chat::-webkit-scrollbar { display: none; }
.ph-chat:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.msg { max-width: 86%; padding: 6px 9px 5px; border-radius: 10px; font-size: 0.9rem; line-height: 1.42; overflow-wrap: anywhere; color: var(--wa-text); }
.msg small { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 1px; font-size: 0.66rem; color: var(--wa-meta); }
.msg small .i, .msg small svg { width: 15px; height: 15px; color: var(--wa-link); }
.msg-out small { color: #c4d0d7; }
.msg-in { align-self: flex-start; background: var(--wa-in); border-start-start-radius: 2px; }
.msg-out { align-self: flex-end; background: var(--wa-out); border-start-end-radius: 2px; }
.msg-typing { display: flex; gap: 4px; padding: 11px 12px; }
.msg-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--wa-meta); }
.msg-opts { align-self: stretch; display: grid; gap: 4px; padding-block: 2px; list-style: none; }
.msg-opts button {
  padding: 9px 10px; border: 0; border-radius: 10px; cursor: pointer; font: inherit; font-size: 0.9rem; font-weight: 500;
  background: var(--wa-in); color: var(--wa-link); transition: background 0.15s, scale 0.1s;
}
.msg-opts button:hover { background: #2a3942; }
.msg-opts button:active { scale: 0.98; }

.ph-compose { display: flex; align-items: center; gap: 6px; padding: 7px 8px 12px; flex: none; }
.ph-compose input {
  flex: 1; min-width: 0; height: 40px; padding-inline: 14px; border: 1px solid transparent; border-radius: 20px;
  background: var(--wa-bar); color: var(--wa-text); font: inherit; font-size: 16px;
}
.ph-compose input::placeholder { color: var(--wa-meta); opacity: 1; }
.ph-compose.is-open input { border-color: var(--accent); }
.ph-compose button { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; cursor: pointer; background: #00a884; color: #06211b; }
.ph-compose button:disabled { background: var(--wa-bar); color: var(--wa-meta); cursor: default; }
.ph-compose button .i { width: 18px; height: 18px; }
[dir="rtl"] .ph-compose button .i { scale: -1 1; }

/* the slip: a printed work ticket, the one light object on the page */
.slip-col { display: grid; gap: 12px; min-width: 0; align-content: start; }
.slip {
  position: relative; padding: 16px 18px 26px; border-radius: 3px 3px 0 0; background: var(--paper); color: var(--ink);
  -webkit-mask: radial-gradient(7px at 50% 100%, transparent 96%, #000) 0 0 / 18px 100% repeat-x;
  mask: radial-gradient(7px at 50% 100%, transparent 96%, #000) 0 0 / 18px 100% repeat-x;
}
.slip-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 9px; border-bottom: 2px solid var(--ink); }
.slip-top b { font-weight: 700; font-size: 1.04rem; }
.slip-top span { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-soft); }
.slip-rows { display: grid; }
.slip-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding-block: 7px; border-bottom: 1px dashed #c9c0b8; font-size: 0.9rem; line-height: 1.35; min-height: 34px; }
.slip-row dt { color: var(--ink-soft); }
.slip-row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.slip-empty { margin-top: 10px; font-size: 0.8rem; color: var(--ink-soft); }
.slip-stamp {
  display: inline-block; margin-top: 12px; padding: 5px 12px; border: 2px solid #a8392a; border-radius: 3px; rotate: -3deg;
  color: #a8392a; font-weight: 700; font-size: 0.94rem; letter-spacing: 0.01em;
}
.slip-stamp[hidden], .slip-empty[hidden] { display: none; }
.slip-human, .slip-out { border-color: var(--ink); color: var(--ink); }
.slip-ready { border-color: #0b6b58; color: #0b6b58; }
.does { padding-inline: 2px; }
.does-t { font-size: 0.8rem; color: var(--faint); }
.does-d { margin-top: 2px; font-size: 0.95rem; line-height: 1.45; color: var(--text); }

@media (prefers-reduced-motion: no-preference) {
  .msg { animation: bubble 0.28s var(--ease) both; }
  .msg-opts { animation: bubble 0.32s var(--ease) both; }
  .msg-typing i { animation: dot 1s infinite ease-in-out; }
  .msg-typing i:nth-child(2) { animation-delay: 0.14s; }
  .msg-typing i:nth-child(3) { animation-delay: 0.28s; }
  .slip-row.is-set dd { animation: ink 0.4s var(--ease) both; }
  .slip-stamp:not([hidden]) { animation: stamp 0.34s var(--ease) both; }
  .does-d { transition: color 0.2s; }
}
@keyframes bubble { from { opacity: 0; translate: 0 8px; } }
@keyframes dot { 0%, 60%, 100% { opacity: 0.35; translate: 0 0; } 30% { opacity: 1; translate: 0 -3px; } }
@keyframes ink { from { opacity: 0; translate: 6px 0; } }
@keyframes stamp { from { opacity: 0; scale: 1.5; } }

@media (min-width: 640px) {
  .sim-stage { grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 22px; align-items: center; }
  .phone { --ph-h: 560px; margin-inline: 0; }
  .slip { rotate: 1deg; }
}
@media (min-width: 1040px) {
  .bh { padding-block: 20px 72px; }
  .bh-grid { grid-template-columns: minmax(0, 0.86fr) minmax(0, 1fr); align-items: center; gap: 44px; }
  .phone { --ph-h: clamp(520px, calc(100dvh - 236px), 620px); }
}

/* ---------- the night ---------- */
.night { --dawn: 0; position: relative; isolation: isolate; padding-block: 72px 56px; background: #080809; border-block: 1px solid var(--line); }
.night-sky {
  position: absolute; inset-inline: 0; inset-block-end: 0; height: 150vh; z-index: -1; pointer-events: none;
  opacity: var(--dawn); transition: opacity 1.2s ease;
  background:
    radial-gradient(62% 15% at 50% 87%, rgb(250 190 160 / 0.72), transparent 76%),
    radial-gradient(120% 30% at 50% 88%, rgb(190 98 80 / 0.55), transparent 78%);
}
@media (max-width: 959px) {
  .night-sky {
    height: 110svh;
    background:
      radial-gradient(150% 12% at 50% 90%, rgb(250 190 160 / 0.6), transparent 78%),
      radial-gradient(190% 26% at 50% 90%, rgb(190 98 80 / 0.5), transparent 78%);
  }
}
.night-head { max-width: 40rem; }
.night-head h2 { font-size: clamp(1.6rem, 0.9vw + 1.2rem, 2.1rem); line-height: 1.16; letter-spacing: -0.02em; }
.night-head p { margin-top: 14px; font-size: 1.14rem; line-height: 1.55; color: var(--muted); }
.night-grid { display: grid; gap: 0; margin-top: 28px; }

.night-stage { position: sticky; top: 72px; z-index: 2; height: 300px; padding-block: 8px; background: #080809; }
.lock {
  position: relative; height: 100%; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  padding: 14px 12px; border-radius: 24px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #17161c, #0e0d10);
}
.lock::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 1.1s ease;
  background: linear-gradient(180deg, #2d2228, #6d463f 62%, #d08f80);
}
.lock.is-morning::after { opacity: 1; }
.lock > * { position: relative; z-index: 1; }
.lock-name { font-size: 0.78rem; color: var(--muted); }
.lock-time { font-size: 3rem; line-height: 1.05; font-weight: 200; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lock-list { list-style: none; display: grid; width: 100%; margin-top: 8px; }

.note { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 0.5s var(--ease), opacity 0.4s; }
.note > * { overflow: hidden; }
.note.is-on { grid-template-rows: 1fr; opacity: 1; }
.note { grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; }
.note-ic { display: grid; place-items: center; width: 30px; height: 30px; margin-block-start: 9px; border-radius: 8px; background: #25d366; }
.note-ic .i { width: 19px; height: 19px; color: #fff; }
.note p { display: grid; padding-block: 8px; line-height: 1.3; min-height: 0; border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.note b { font-weight: 600; font-size: 0.9rem; }
.note span { font-size: 0.86rem; color: var(--muted); }
.note em { font-style: normal; font-size: 0.78rem; color: var(--accent); }
.lock.is-morning .lock-list { opacity: 0; transition: opacity 0.3s; }

.morning {
  position: absolute !important; inset-inline: 12px; inset-block-end: 12px; padding: 13px 15px; border-radius: 16px; background: rgb(13 13 15 / 0.82);
  opacity: 0; translate: 0 18px; transition: opacity 0.5s ease 0.15s, translate 0.7s var(--ease) 0.15s;
}
.lock.is-morning .morning { opacity: 1; translate: 0 0; }
.morning b { font-size: 1rem; font-weight: 600; }
.morning dl { display: grid; gap: 5px; margin-top: 7px; font-size: 0.9rem; }
.morning dl div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; }
.morning dt { color: var(--accent); }
.morning dd { margin: 0; }

.night-scenes { list-style: none; }
.scene { display: flex; flex-direction: column; justify-content: center; min-height: 62svh; padding-block: 24px; opacity: 0.8; transition: opacity 0.45s ease; }
.scene.is-on { opacity: 1; }
.scene-time { font-size: 1.9rem; font-weight: 200; letter-spacing: -0.01em; color: var(--accent); font-variant-numeric: tabular-nums; text-align: start; }
[dir="rtl"] .scene-time { text-align: end; }
.scene h3 { margin-top: 6px; font-size: clamp(1.25rem, 0.6vw + 1rem, 1.55rem); line-height: 1.2; }
.scene p:last-child { margin-top: 10px; max-width: 34rem; font-size: 1.1rem; line-height: 1.6; color: var(--muted); }
.night-cap { margin-top: 12px; font-size: 0.84rem; color: var(--muted); }
.night.is-dawn .night-cap { color: var(--text); }

html:not(.bot-js) .scene { opacity: 1; }
html:not(.bot-js) .note { grid-template-rows: 1fr; opacity: 1; }
html:not(.bot-js) .night-stage { position: static; height: 340px; }

@media (min-width: 960px) {
  .night { padding-block: 112px 72px; }
  .night-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 80px; align-items: start; margin-top: 12px; }
  .night-stage { order: 2; top: calc(50dvh - 330px); height: 660px; padding: 8px; border-radius: 46px; background: linear-gradient(150deg, #4c4543, #1b1b1e 38%, #26262b 70%, #575050) !important; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.6), 0 40px 70px -30px #000; }
  .lock { padding: 46px 16px 16px; border: 0; border-radius: 38px; }
  .lock-name { font-size: 0.9rem; }
  .lock-time { font-size: 3.8rem; }
  .lock-list { margin-top: 20px; }
  .note { padding-inline: 2px; }
  .morning { inset-inline: 14px; inset-block-end: 16px; padding: 16px 18px; }
  .scene { min-height: 82vh; padding-block: 0; }
  .scene-time { font-size: clamp(2.2rem, 2.6vw, 2.8rem); line-height: 1; }
}

/* ---------- settings board ---------- */
.ctl-head h2, .me-copy h2 { font-size: clamp(1.6rem, 0.9vw + 1.2rem, 2.1rem); line-height: 1.18; letter-spacing: -0.015em; }
.ctl-head p { margin-top: 12px; font-size: 1.1rem; color: var(--muted); }
.ctl-board { display: grid; margin-top: 30px; border: 1px solid var(--line-2); border-radius: var(--r-card); overflow: hidden; background: var(--card); }
.ctl-set { padding: 20px; display: grid; gap: 4px; align-content: start; }
.ctl-label { font-size: 0.86rem; color: var(--faint); margin-bottom: 6px; }
.tg {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 56px; padding: 10px 0;
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 1.04rem; color: var(--text); text-align: start;
}
.tg i { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line-2); transition: background 0.2s; }
.tg i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: inset-inline-start 0.22s var(--ease); }
.tg[aria-checked="true"] i { background: var(--accent); }
.tg[aria-checked="true"] i::after { inset-inline-start: 21px; background: var(--on-accent); }
.ctl-view { display: flex; flex-direction: column; gap: 8px; min-height: 280px; padding: 20px; background: var(--wa-bg); }
.ctl-view .ctl-label { color: var(--wa-meta); }
.msg-in-c { align-self: flex-start; background: var(--wa-in); }
.ctl-view .msg { font-size: 1rem; max-width: 92%; }
.msg-reply { align-self: flex-end; background: var(--wa-out); transition: background 0.2s; }
.msg-reply[hidden] { display: none; }
.msg-reply.is-draft { background: transparent; outline: 1.5px dashed var(--wa-meta); outline-offset: -1.5px; }
.ctl-state { align-self: flex-end; min-height: 1.5em; font-size: 0.92rem; color: var(--accent-2); }
.ctl-approve { align-self: flex-end; }
.ctl-approve[hidden] { display: none; }
.ctl-note { margin-top: 14px; max-width: 70ch; font-size: 0.88rem; line-height: 1.55; color: var(--faint); }
@media (min-width: 860px) {
  .ctl-board { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  .ctl-set { padding: 30px 34px; }
  .ctl-view { padding: 30px; }
}

/* ---------- the person ---------- */
.me { padding-top: 0; }
.me-grid { display: grid; gap: 24px; }
.me-photo { width: 140px; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-frame); }
.me-body { margin-top: 14px; max-width: 58ch; font-size: 1.16rem; line-height: 1.65; color: var(--muted); }
.me-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; }
.me-links a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.me-quote { margin: 30px 0 0; padding-top: 22px; border-top: 1px solid var(--line); max-width: 60ch; }
.me-note { font-size: 0.86rem; color: var(--faint); }
.me-quote blockquote { margin: 8px 0 0; font-size: 1.12rem; line-height: 1.6; }
.me-by { margin-top: 8px; font-size: 0.92rem; color: var(--muted); }
.me-by b { font-weight: 600; color: var(--text); }
@media (min-width: 860px) {
  .me-grid { grid-template-columns: 260px minmax(0, 1fr); gap: 56px; align-items: start; }
  .me-photo { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .night-sky, .lock::after, .note, .morning, .scene, .tg i, .tg i::after, .sim-tab { transition: none; }
}

/* ---------- after a chat ends ---------- */
.sim-after { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.sim-after-t { font-weight: 600; font-size: 1.05rem; }
.sim-after-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 12px; }
.sim-after-form { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 0.95rem; }
.sim-after-form:hover { color: var(--text); }
.sim-after:not([hidden]) { animation: after-in 0.4s ease-out both; }
@keyframes after-in { from { opacity: 0; translate: 0 6px; } }

/* ---------- trade links ---------- */
.trade-strip { border-block: 1px solid var(--line); }
.trade-strip-in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; padding-block: 16px; }
.trade-strip-k { color: var(--faint); font-size: 0.92rem; }
.trade-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.trade-links a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 5px; }
.trade-links a:hover { text-decoration-color: var(--accent); }
.trade-links a[aria-current="page"] { color: var(--accent); text-decoration: none; }
.trade-links .trade-all { color: var(--muted); }

/* ---------- trade pages: today vs with the bot ---------- */
.tp-list { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line); }
.tp-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.tp-row p { line-height: 1.6; }
.tp-k { display: block; margin-bottom: 4px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em; color: var(--faint); }
.tp-now { color: var(--muted); }
.tp-bot { color: var(--text); padding-inline-start: 14px; border-inline-start: 2px solid var(--accent); }
.tp-bot .tp-k { color: var(--accent); }

.tp-rules-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.tp-rules-grid header p { margin-top: 10px; color: var(--muted); }
.tp-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tp-rules li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.55; }
.tp-rules .i { flex: none; width: 20px; height: 20px; margin-top: 3px; color: var(--accent); }

@media (min-width: 900px) {
  .tp-row { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
  .tp-rules-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .sim-after:not([hidden]) { animation: none; }
}

/* ===== 11-26 mobile pass ===== */
@media (max-width: 959px) {
  .sim-tab { padding-block: 11px; min-width: 44px; }
  .trade-links .trade-all { display: inline-flex; align-items: center; min-height: 44px; }
  .msg small { font-size: 0.72rem; }
}
