/* v24 «Ранок майстра» — общее: токены, тема, карточки, лист, форма.
   Раскладка телефона — v24-m.css, компьютера — v24-d.css. */

:root {
  --bg: #f6efe4;
  --bg2: #efe4d3;
  --card: #fffaf2;
  --ink: #231c16;
  --muted: #6c5f52;
  --line: #e2d5c2;
  --accent: #d9542f;
  --accent-ink: #fff;
  --sun: #f0a43a;
  --ok: #2f8a5b;
  --bad: #c23b2e;
  --wait: #9a7b2f;
  --site: #3d6fb6;
  --bot: #1f8a8a;
  --direct: #b23a7a;
  --s-new: #f0a43a;
  --s-agreed: #3d6fb6;
  --s-work: #8a5cc4;
  --s-sent: #2f8a5b;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 8px 24px rgba(60, 40, 20, .08);
  --r: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f; --bg2: #201a14; --card: #251f18; --ink: #f3ebdf; --muted: #b3a593; --line: #3a3027;
    --accent: #ff7a50; --accent-ink: #1b120c; --ok: #5cc48d; --bad: #ff7b6b; --wait: #e2c063;
    --site: #7fa8ea; --bot: #5cc8c8; --direct: #ee78b8;
    --s-agreed: #7fa8ea; --s-work: #b796ee; --s-sent: #5cc48d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17130f; --bg2: #201a14; --card: #251f18; --ink: #f3ebdf; --muted: #b3a593; --line: #3a3027;
  --accent: #ff7a50; --accent-ink: #1b120c; --ok: #5cc48d; --bad: #ff7b6b; --wait: #e2c063;
  --site: #7fa8ea; --bot: #5cc8c8; --direct: #ee78b8;
  --s-agreed: #7fa8ea; --s-work: #b796ee; --s-sent: #5cc48d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); overflow-x: hidden; }
main { overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.fatal { padding: 32px 16px; text-align: center; }
[hidden] { display: none !important; }

/* загрузка: скелет до первого рендера */
.boot { max-width: 720px; margin: 80px auto; padding: 0 16px; display: grid; gap: 14px; }
.boot-line { height: 22px; border-radius: 8px; background: linear-gradient(90deg, var(--bg2), var(--line), var(--bg2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.boot-line:nth-child(1) { height: 44px; width: 80%; }
.boot-line:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* шапка */
.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; max-width: 1280px; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; letter-spacing: -.01em; }
.logo-mark { width: 22px; height: 22px; border-radius: 7px; background: conic-gradient(from 200deg, var(--sun), var(--accent), var(--direct), var(--site), var(--sun)); }
.top-gap { flex: 1; }
.top-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 700; font-size: .85rem; cursor: pointer; }
.ico { display: inline-flex; width: 1.1em; height: 1.1em; flex: none; }
.ico svg { width: 100%; height: 100%; }
.pill-demo { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--bg2); border: 1px dashed var(--muted); color: var(--muted);
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; }
.pill-demo.sm { font-size: .64rem; padding: 0 6px; }

/* герой: слова выезжают из масок */
.eyebrow { margin: 0 0 8px; color: var(--accent); font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.h1 { margin: 0; font-weight: 850; letter-spacing: -.035em; line-height: 1.02; }
.h1 .w { display: inline-block; clip-path: inset(-0.3em -0.25em -0.25em -0.12em); vertical-align: bottom; padding-bottom: .06em; }
.h1 .wi { display: inline-block; transform: translateY(150%); animation: rise .8s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(var(--i) * 90ms + 120ms); }
.h1 .brand { background: linear-gradient(100deg, var(--accent), var(--sun) 60%, var(--accent)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rise .8s cubic-bezier(.2, .8, .2, 1) forwards, sweep 4s ease-in-out 1.2s infinite alternate; animation-delay: calc(var(--i) * 90ms + 120ms), 1.4s; padding-right: .04em; }
@keyframes rise { to { transform: none; } }
@keyframes sweep { to { background-position: 100% 0; } }
.lead { color: var(--muted); margin: 14px 0 0; max-width: 40em; }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 20px; border-radius: 14px; border: 0;
  font-weight: 750; text-decoration: none; cursor: pointer; text-align: center; transition: transform .15s ease, box-shadow .15s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.locked, .c-next.locked { opacity: .55; }
.btn.off { opacity: .55; }

/* годинник ранку */
.clock { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.clock-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 0 var(--sun); animation: ping 2s ease-out infinite; flex: none; }
.clock-time { font-weight: 850; font-variant-numeric: tabular-nums; font-size: 1.25rem; letter-spacing: -.02em; }
.clock-counts { color: var(--muted); font-size: .8rem; line-height: 1.3; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sun) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

/* «що від мене зараз» */
.now { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.now-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; }
.now-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ping 1.6s ease-out infinite; flex: none; }
.now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.now-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--bg); border-left: 4px solid var(--s-new); animation: slidein .35s ease-out; }
.now-item.k-offer { border-left-color: var(--bad); }
.now-item.k-down { border-left-color: var(--wait); }
.now-item.k-work { border-left-color: var(--s-agreed); }
.now-item.k-send { border-left-color: var(--s-work); }
.now-text { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; font-size: .88rem; line-height: 1.35; cursor: pointer; }
.now-btn { flex: none; min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 0; background: var(--ink); color: var(--bg); font-weight: 750; font-size: .82rem; cursor: pointer; }
.now-none, .now-more { color: var(--muted); font-size: .88rem; padding: 4px 2px; }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }

/* подсказка «посунь» */
.hint { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; color: var(--muted); font-size: .88rem; transition: opacity .4s, max-height .4s; max-height: 80px; }
.hint.gone { opacity: 0; max-height: 0; margin: 0; overflow: hidden; }
.hint-hand { margin-right: 14px; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 22%, transparent); position: relative; flex: none; animation: nudge 1.6s ease-in-out infinite; }
.hint-hand::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--accent); }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(14px); } }

/* колонки статусов */
.col-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .9rem; }
.col-num { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; color: #fff; background: var(--s-new); flex: none; }
.col-agreed .col-num { background: var(--s-agreed); }
.col-work .col-num { background: var(--s-work); }
.col-sent .col-num { background: var(--s-sent); }
.col-count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-list { display: grid; gap: 10px; }

/* картка заявки */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; border-top: 4px solid var(--s-new); }
.card[data-status="agreed"] { border-top-color: var(--s-agreed); }
.card[data-status="work"] { border-top-color: var(--s-work); }
.card[data-status="sent"] { border-top-color: var(--s-sent); opacity: .86; }
.card.dragging { cursor: grabbing; z-index: 5; box-shadow: 0 18px 40px rgba(0, 0, 0, .22); transition: none; }
.c-top { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.ch { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 99px; font-weight: 750; color: #fff; background: var(--site); line-height: 1.6; }
.ch-bot { background: var(--bot); }
.ch-direct { background: var(--direct); }
:root[data-theme="dark"] .ch { color: #14100c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ch { color: #14100c; } }
.c-time { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; }
.c-body { display: flex; gap: 12px; margin-top: 10px; align-items: flex-start; }
.c-img { width: 72px; height: 72px; flex: none; border-radius: 12px; overflow: hidden; background: #2a231d; }
.c-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.c-img.noimg { background: conic-gradient(from 90deg, var(--bg2), var(--line), var(--bg2)); }
.c-img.noimg img { display: none; }
.c-text { min-width: 0; flex: 1; }
.c-who { margin: 0; font-size: 1rem; line-height: 1.25; }
.c-what { margin: 2px 0 0; font-size: .86rem; line-height: 1.3; }
.c-params { margin: 2px 0 0; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.c-note { margin: 10px 0 0; font-size: .86rem; color: var(--muted); font-style: italic; line-height: 1.35; }
.c-check { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; font-size: .8rem; line-height: 1.35;
  background: color-mix(in srgb, var(--wait) 12%, transparent); }
.c-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wait); flex: none; margin-top: .35em; }
.card[data-state="checking"] .c-check, .card[data-state="busy"] .c-check, .card[data-state="idle"] .c-check {
  background: linear-gradient(90deg, color-mix(in srgb, var(--wait) 10%, transparent), color-mix(in srgb, var(--wait) 24%, transparent), color-mix(in srgb, var(--wait) 10%, transparent));
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.card[data-state="ok"] .c-check { background: color-mix(in srgb, var(--ok) 13%, transparent); }
.card[data-state="ok"] .c-dot { background: var(--ok); }
.card[data-state="bad"] .c-check { background: color-mix(in srgb, var(--bad) 13%, transparent); }
.card[data-state="bad"] .c-dot { background: var(--bad); }
.c-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.track { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex: 1; }
.track li { height: 5px; flex: 1; border-radius: 3px; background: var(--line); transition: background .3s; }
.track li.on[data-s="new"] { background: var(--s-new); }
.track li.on[data-s="agreed"] { background: var(--s-agreed); }
.track li.on[data-s="work"] { background: var(--s-work); }
.track li.on[data-s="sent"] { background: var(--s-sent); }
.c-next { flex: none; min-height: 36px; padding: 4px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; font-size: .78rem; cursor: pointer; }
.c-swipe { position: absolute; top: 50%; left: -2px; transform: translate(-100%, -50%); padding: 6px 10px; border-radius: 10px; background: var(--ok); color: #fff;
  font-weight: 800; font-size: .8rem; opacity: 0; pointer-events: none; white-space: nowrap; transition: opacity .15s; }
.card.will-next .c-swipe { opacity: 1; }
.card.nudge { animation: cardnudge 1.8s ease-in-out .3s infinite; }
@keyframes cardnudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateX(26px) rotate(.8deg); } }

.done { margin-top: 18px; padding: 20px; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--sun) 28%, var(--card)), var(--card)); border: 1px solid var(--line); }
.done .h3 { margin: 0 0 6px; }
.done p { margin: 0; color: var(--muted); }
.done-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* тост */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 10px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: .88rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.in { animation: toastin .3s ease-out; }
.toast-undo { background: none; border: 0; color: var(--sun); font-weight: 800; cursor: pointer; min-height: 32px; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px); } }

/* секции ниже */
.sec { max-width: 1180px; margin: 0 auto; padding: 56px 16px 0; }
.h2 { margin: 0; font-size: clamp(1.6rem, 4.2vw, 2.6rem); line-height: 1.1; letter-spacing: -.025em; font-weight: 850; }
.h3 { font-size: 1.15rem; margin: 0 0 12px; }
.pain-list, .fix-list, .pack-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pain-list li, .fix-list li, .pack-grid li { display: grid; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.pain-list li { border-left: 4px solid var(--bad); }
.fix-list li { border-left: 4px solid var(--ok); }
.pain-list span, .fix-list span, .pack-grid span { color: var(--muted); font-size: .92rem; }
.fix { margin-top: 0; }
.pack-n { font-weight: 850; color: var(--accent) !important; font-size: .9rem !important; }
.price-note { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--bg2); font-size: .92rem; }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.seen { opacity: 1; transform: none; }

/* пилот */
.pilot { padding-bottom: 24px; }
.form { margin-top: 18px; display: grid; gap: 16px; padding: 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.fs { border: 0; margin: 0; padding: 0; }
.fs legend { font-weight: 750; margin-bottom: 8px; padding: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; font-weight: 600; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.btn-send { justify-self: start; }
.form-status { margin: 0; font-size: .9rem; min-height: 1.4em; }
.form-status.warn { color: var(--bad); }

.foot { max-width: 1180px; margin: 40px auto 0; padding: 24px 16px 40px; border-top: 1px solid var(--line); font-size: .88rem; }
.foot p { margin: 0 0 8px; }
.attr { overflow-wrap: anywhere; }

/* лист заказа */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sh-back { position: absolute; inset: 0; background: rgba(15, 10, 6, .45); opacity: 0; transition: opacity .25s; }
.sheet.in .sh-back { opacity: 1; }
.sh-panel { position: absolute; background: var(--card); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sh-x { position: absolute; top: 10px; right: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .45); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.sh-stage { position: relative; flex: none; background: #1c1814; overflow: hidden; }
.sh-stage.on-light { background: radial-gradient(circle at 50% 40%, #fbf6ee, #e6dccd); }
.sh-stage.on-dark { background: radial-gradient(circle at 50% 40%, #3a3129, #16120e); }
.v3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.sh-stage.ready .sh-fallback { opacity: 0; pointer-events: none; }
.sh-fallback { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; transition: opacity .3s, filter .3s; }
.sh-stage.is-bad .sh-fallback { opacity: .45; filter: grayscale(1); }
.sh-stage.is-bad .sh-pill { background: var(--bad); }
.sh-pill { position: absolute; left: 12px; bottom: 12px; z-index: 2; margin: 0; padding: 4px 10px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .76rem; max-width: calc(100% - 24px); }
.sh-body { overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.sh-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .78rem; }
.sh-head .c-time { margin-left: 0; }
.sh-status { margin-left: auto; font-weight: 800; padding: 2px 10px; border-radius: 99px; color: #fff; background: var(--s-new); }
.sh-status.st-agreed { background: var(--s-agreed); }
.sh-status.st-work { background: var(--s-work); }
.sh-status.st-sent { background: var(--s-sent); }
.sh-title { margin: 10px 0 2px; font-size: 1.25rem; line-height: 1.2; }
.sh-h { margin: 18px 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sh-note { margin: 0; font-style: italic; }
.sh-mat { margin: 6px 0 0; font-size: .92rem; }
.kn { display: grid; gap: 4px; margin: 8px 0 12px; }
.kn-row { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.kn-v { font-weight: 800; font-variant-numeric: tabular-nums; }
.kn input { width: 100%; accent-color: var(--accent); min-height: 32px; }
.kn-lim { font-size: .76rem; color: var(--muted); }
.proto { margin: 0; padding: 10px 12px 10px 28px; border-radius: 12px; background: color-mix(in srgb, var(--wait) 10%, transparent); display: grid; gap: 4px; font-size: .88rem; }
.proto.st-ok { background: color-mix(in srgb, var(--ok) 11%, transparent); }
.proto.st-bad { background: color-mix(in srgb, var(--bad) 11%, transparent); }
.sh-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .h1 .wi { transform: none; }
  .reveal { opacity: 1; transform: none; }
}

/* отправленные — компактно */
.card[data-status="sent"] .c-note, .card[data-status="sent"] .c-check { display: none; }
.card[data-status="sent"] .c-img { width: 48px; height: 48px; }
.done { margin: 8px 0 18px; }
