/* ============================================================================
   v3 · 07 Профиль (Figma 15:2): profile.js (renderContentV3) + profile-enhanced.js
   (активный заказ, «Мои заказы», уведомления, счётчик чата).
   ========================================================================== */

html.dv3{ --v3p-accent:#f5c84b; --v3p-tile:rgba(255,255,255,.08); }

/* Шапку вкладки заменяет блок с аватаром; кнопка темы — в его правом верхнем углу */
html.dv3 [data-view="profile"]:has(.v3p-head) .head{ display:none; }
html.dv3 [data-view="profile"] .js-body{ background:var(--bg); }

html.dv3 .v3p-head{ position:relative; background:var(--head); color:var(--on-head);
  padding:calc(20px + env(safe-area-inset-top)) 16px 20px; }
html.dv3 .v3p-head .v3p-me{ padding-right:48px; }
html.dv3 .v3p-theme{ position:absolute; top:calc(8px + env(safe-area-inset-top)); right:12px; z-index:1;
  display:grid; place-items:center; width:44px !important; height:44px !important; min-width:0; padding:0;
  border:0 !important; border-radius:50% !important; background:var(--on-head-line) !important; color:var(--on-head) !important; }
html.dv3 .v3p-theme svg{ width:18px; height:18px; }
html.dv3 .v3p-theme:focus-visible{ outline:2px solid var(--v3p-accent); outline-offset:2px; }
html.dv3 .v3p-me{ display:flex; align-items:center; gap:14px; width:100%; padding:0; border:0; background:none;
  color:inherit; font:inherit; text-align:left; cursor:pointer; }
html.dv3 .v3p-me:focus-visible{ outline:2px solid var(--v3p-accent); outline-offset:4px; border-radius:12px; }
html.dv3 .v3p-ava{ display:grid; place-items:center; width:56px; height:56px; flex:none; border-radius:50%;
  background:var(--v3p-tile); color:var(--on-head); font-size:24px; font-weight:700; }
html.dv3 .v3p-name{ display:block; font-size:20px; font-weight:700; line-height:1.2;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html.dv3 .v3p-phone{ display:block; margin-top:4px; font-size:13px; color:var(--on-head-2); }

html.dv3 .v3p-tiles{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; margin-top:18px; }
html.dv3 .v3p-tile{ display:flex; flex-direction:column; gap:4px; min-height:60px; padding:10px 12px;
  border-radius:var(--v3-r-ctl); background:var(--v3p-tile); min-width:0; }
html.dv3 .v3p-tt{ font-size:14px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* WebKit: у <button> во flex-колонке дети не сжимаются по ширине — длинный адрес вылезал на плитку СБП */
html.dv3 .v3p-tile > *{ max-width:100%; box-sizing:border-box; }
html.dv3 .v3p-addr{ align-items:stretch; }
html.dv3 .v3p-tt b{ font-size:17px; font-weight:700; color:var(--v3p-accent); }
html.dv3 .v3p-ts{ font-size:11px; line-height:1.3; color:var(--on-head-2); }
html.dv3 .v3p-tact{ position:relative; align-self:flex-start; min-height:44px; margin:-6px 0 -10px; padding:0; border:0; background:none;
  color:var(--v3o-live, #7ddc9c); font-family:inherit; font-weight:600; font-size:12px; cursor:pointer; }
html.dv3 .v3p-tact.is-red{ color:var(--on-head-2); }
html.dv3 .v3p-tact::after{ content:''; position:absolute; inset:0 -12px; }   /* зона нажатия 44 в высоту, шире текста */
/* Плитка адреса (вместо бонусов — бонусной программы нет): кнопка целиком */
html.dv3 .v3p-addr{ border:0; color:inherit; font:inherit; text-align:left; cursor:pointer; -webkit-tap-highlight-color:transparent; }
html.dv3 .v3p-addr:focus-visible{ outline:2px solid var(--v3p-accent); outline-offset:2px; }
html.dv3 .v3p-addr .v3p-tact{ display:flex; align-items:center; }
@media (max-width:359px){ html.dv3 .v3p-tt{ font-size:13px; } html.dv3 .v3p-tt b{ font-size:15px; } }

/* Активный заказ — зелёная строка */
html.dv3 .js-v3-active:empty, html.dv3 .js-v3-orders:empty{ display:none; }
html.dv3 .v3p-live{ display:flex; align-items:center; gap:12px; width:calc(100% - 32px); margin:10px 16px 0;
  padding:14px 16px; border:0; border-radius:var(--v3-r-card); background:var(--green-soft); color:var(--ink);
  font:inherit; text-align:left; cursor:pointer; }
html.dv3 .v3p-live > .v3-i{ width:26px; height:26px; }
html.dv3 .v3p-live > .v3-i:last-child{ width:20px; height:20px; color:var(--green); }
html.dv3 .v3p-live b{ display:block; font-size:15px; font-weight:700; color:var(--green); }
html.dv3 .v3p-live .v3-grow > span{ display:block; margin-top:2px; font-size:13px; }

/* Мои заказы — последние 2 */
html.dv3 .v3p-orders{ margin:10px 16px 0; padding-top:14px; padding-bottom:6px; }
html.dv3 .v3p-oh{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
html.dv3 .v3p-all{ display:inline-flex; align-items:center; min-height:44px; padding:0 0 0 8px; border:0; background:none;
  color:var(--green); font-family:inherit; font-weight:600; font-size:14px; cursor:pointer; }
html.dv3 .v3p-o{ display:flex; align-items:center; gap:12px; min-height:56px; padding:8px 0; cursor:pointer; }
html.dv3 .v3p-o > .v3-grow{ flex:1; min-width:0; }   /* «Повторить» — к правому краю, как кнопки в меню ниже */
html.dv3 .v3p-o .v3-tile-ico{ width:40px; height:40px; border-radius:12px; }
html.dv3 .v3p-rep{ position:relative; flex:none; min-height:36px; padding:0 12px; border:0; border-radius:var(--v3-r-ctl);
  background:var(--green-soft); color:var(--green); font-family:inherit; font-weight:600; font-size:13px; cursor:pointer; }
html.dv3 .v3p-rep:disabled{ opacity:.6; }

/* Меню строками */
html.dv3 .v3p-menu{ margin:10px 16px 0; padding:0 16px; }
html.dv3 .v3p-row{ width:100%; min-height:56px; padding:8px 0; border:0; background:none; color:var(--ink);
  font:inherit; text-align:left; text-decoration:none; cursor:pointer; }
html.dv3 .v3p-row:focus-visible{ outline:2px solid var(--green); outline-offset:-2px; border-radius:8px; }
html.dv3 .v3p-ic{ display:grid; place-items:center; width:24px; flex:none; font-size:20px; color:var(--ink); }
html.dv3 .v3p-rt{ display:block; font-size:15px; font-weight:500; }
html.dv3 .v3p-rs{ display:block; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
html.dv3 .v3p-chev{ display:flex; align-items:center; gap:6px; color:var(--v3-sub); font-size:18px; }
html.dv3 .v3p-act{ position:relative; flex:none; min-height:36px; padding:0 12px; border:0; border-radius:var(--v3-r-ctl);
  background:var(--green-soft); color:var(--green); font-family:inherit; font-weight:600; font-size:13px; cursor:pointer; }
html.dv3 :is(.v3p-act, .v3p-rep)::after{ content:''; position:absolute; inset:-4px -2px; }   /* зона 44 */
html.dv3 .v3p-act.is-red{ background:var(--red-soft); color:var(--red); }
html.dv3 .v3p-out .v3p-rt{ color:var(--red); }
html.dv3 .v3p{ padding-bottom:16px; }

/* Лист «История заказов» */
html.dv3 .v3p-hs{ position:fixed; inset:0; z-index:120; display:flex; align-items:flex-end; justify-content:center; background:rgba(20,18,14,.4); }
html.dv3 .v3p-hs-sheet{ width:100%; max-width:640px; max-height:86vh; overflow:auto; background:var(--bg);
  border-radius:var(--v3-r-card) var(--v3-r-card) 0 0; padding:16px 16px calc(24px + env(safe-area-inset-bottom)); }
html.dv3 .v3p-hs-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
html.dv3 .v3p-hs-x{ display:grid; place-items:center; width:40px; height:40px; border:0; border-radius:50%;
  background:var(--paper); color:var(--ink); font-size:18px; cursor:pointer; }
html.dv3 .v3p-hs-list{ padding:0 16px; }
html.dv3 .v3p-hs-r{ display:flex; flex-direction:column; align-items:flex-end; gap:2px; flex:none; font-size:15px; }
html.dv3 .v3p-hs-r span{ font-size:12px; color:var(--muted); }
html.dv3 .v3p-hs-r span.is-green{ color:var(--green); }

/* ── QA 30.09 ─────────────────────────────────────────────────────────── */
/* Фон под листами не прокручивается (заказы, карточка заказа, чек, чат, история, адрес, подтверждение) */
html.dv3:has(#js-orders-overlay, #js-ordercard-overlay, #js-receipt-overlay, #js-chat-overlay, #js-v3-history, .v3p-edit, .cs-backdrop),
html.dv3:has(#js-orders-overlay, #js-ordercard-overlay, #js-receipt-overlay, #js-chat-overlay, #js-v3-history, .v3p-edit, .cs-backdrop) body{ overflow:hidden; }
html.dv3 :is(.v3p-hs-sheet, .v3p-edit > div, #js-chat-list){ overscroll-behavior:contain; }

/* Строка «Заказ 1498M · 25 сент» рядом с «Повторить» — одной строкой с многоточием */
html.dv3 .v3p-o .v3p-rt{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Гость: вкладка как у вошедшего — тёмная шапка «Профиль», пустое состояние с тёмной кнопкой */
html.dv3 .v3p-head h1{ margin:0; color:var(--on-head); }
html.dv3 .v3p-head .v3p-phone{ margin-top:4px; }
html.dv3 .v3p-guest{ padding:48px 24px 16px; text-align:center; }
html.dv3 .v3p-guest > .v3-i{ width:48px; height:48px; color:var(--muted); stroke-width:1.5; }
html.dv3 .v3p-guest h2{ margin:14px 0 6px; font-size:22px; }
html.dv3 .v3p-guest p{ margin:0 0 20px; font-size:14px; line-height:1.45; color:var(--muted); }
html.dv3 .v3p-guest .v3-btn{ width:100%; max-width:280px; margin:0 auto; font-family:inherit; }
html.dv3:not(.dk) .v3p-guest .v3-btn{ background:linear-gradient(135deg, oklch(.6 .16 150), var(--green)); color:#fff; }

/* Подтверждение (выход, отвязка): главная кнопка тёмная */
html.dv3 .cs-body .btn:not(.soft):not(.ghost){ background:var(--head); color:var(--on-head); }
html.dv3 .cs-body .btn{ border-radius:16px; min-height:50px; font-weight:700; }

/* Лист «Редактировать» (имя + адрес): поля были без рамки и фона — на белом листе их не видно */
html.dv3 .v3p-edit > div{ background:var(--paper) !important; border-radius:var(--v3-r-card) var(--v3-r-card) 0 0 !important;
  padding:20px 16px calc(20px + env(safe-area-inset-bottom)) !important; }
html.dv3 .v3p-edit .auth-input{ min-height:48px; padding:12px 14px; border:1.5px solid transparent; border-radius:var(--v3-r-ctl);
  background:var(--bg); color:var(--ink); font-size:16px; box-sizing:border-box; }
html.dv3 .v3p-edit .auth-input:focus{ outline:0; border-color:var(--green); }
html.dv3 .v3p-edit .js-close{ width:40px !important; height:40px !important; border-radius:50%; background:var(--bg); color:var(--ink); }
html.dv3 .v3p-edit input[type="checkbox"]{ -webkit-appearance:none; appearance:none; width:22px !important; height:22px !important; margin:0;
  border:2px solid var(--line); border-radius:7px; background:var(--paper); display:grid; place-items:center; }
html.dv3 .v3p-edit input[type="checkbox"]:checked{ background:var(--green); border-color:var(--green); }
html.dv3 .v3p-edit input[type="checkbox"]:checked::after{ content:""; width:10px; height:6px; margin-top:-2px;
  border:solid #fff; border-width:0 0 2.5px 2.5px; transform:rotate(-45deg); }
html.dv3 .v3p-edit .js-save{ background:var(--head) !important; color:var(--on-head) !important; border-radius:16px; min-height:50px; font-weight:700; }

/* ── Чат (profile-enhanced.js → openChatOverlay): v2-разметка с белыми литералами ── */
html.dv3 #js-chat-overlay.v3chat #js-chat-sheet{ border-radius:0 !important; background:var(--bg) !important; }
html.dv3 #js-chat-overlay.v3chat #js-chat-close{ display:grid; place-items:center; width:40px; height:40px; padding:0 !important;
  border:0 !important; border-radius:50% !important; background:var(--paper) !important; color:var(--ink) !important; flex:none; }
html.dv3 #js-chat-overlay.v3chat #js-chat-close .v3-i, html.dv3 #js-chat-overlay.v3chat #js-chat-attach .v3-i{ width:20px; height:20px; pointer-events:none; }
html.dv3 #js-chat-overlay.v3chat #js-chat-list > div[style*="align-self"]{ background:var(--paper) !important; border:0 !important; color:var(--ink); }
html.dv3 #js-chat-overlay.v3chat #js-chat-list > div[style*="flex-end"]{ background:var(--green-soft) !important; }
html.dv3 #js-chat-overlay.v3chat #js-chat-faq > button{ background:var(--paper) !important; color:var(--ink) !important; border:1px solid var(--line) !important; min-height:36px; }
html.dv3 #js-chat-overlay.v3chat #js-chat-sheet > div:last-child{ background:var(--paper) !important; border-top:0 !important; box-shadow:var(--v3-shadow-bar); }
html.dv3 #js-chat-overlay.v3chat #js-chat-attach{ display:grid; place-items:center; min-height:44px; background:var(--bg) !important; border:0 !important; color:var(--ink) !important; }
html.dv3 #js-chat-overlay.v3chat #js-chat-input{ background:var(--bg) !important; color:var(--ink) !important; border:1.5px solid transparent !important; min-height:44px; }
html.dv3 #js-chat-overlay.v3chat #js-chat-input:focus{ border-color:var(--green) !important; }
html.dv3 #js-chat-overlay.v3chat #js-chat-send{ background:var(--green) !important; color:#fff !important; min-height:44px; font-weight:700 !important; }

/* ── Вход (auth-flow.js): светлая шапка v3 как у «Оформления», поля и кнопки системы ── */
html.dv3 [data-view="auth"] .js-body > div{ padding-top:8px !important; }
html.dv3 [data-view="auth"] .js-body [style*="font-weight:800"]{ font-weight:700 !important; font-size:24px !important; letter-spacing:-.01em !important; }
html.dv3 [data-view="auth"] .auth-input{ min-height:52px; border:1.5px solid var(--line); border-radius:var(--v3-r-ctl); background:var(--paper); color:var(--ink); }
html.dv3 [data-view="auth"] .auth-input:focus{ outline:0; border-color:var(--green); }
html.dv3 [data-view="auth"] .btn{ border-radius:16px; min-height:50px; font-weight:700; }
html.dv3 [data-view="auth"] .btn:not(.soft):not(.ghost){ background:linear-gradient(135deg, oklch(.6 .16 150), var(--green)) !important; color:#fff !important; }
html.dv3 [data-view="auth"] .btn:disabled{ opacity:.4; }
html.dv3 [data-view="auth"] .btn.ghost{ background:var(--paper); }
html.dv3 [data-view="auth"] .auth-status-bar{ border-radius:var(--v3-r-ctl); }
html.dv3 [data-view="auth"] .v3a-ico{ display:grid; place-items:center; width:64px; height:64px; margin:0 auto 12px; border-radius:50%;
  background:var(--paper); color:var(--muted); }
html.dv3 [data-view="auth"] .v3a-ico .v3-i{ width:28px; height:28px; }
html.dv3 [data-view="auth"] :is(.js-resend, .js-change){ min-height:40px; }

/* Лист «Редактировать»: кнопка «Сохранить» липкая внизу листа — с клавиатурой она уходила за край */
html.dv3 .v3p-edit .js-save{ position:sticky; bottom:0; z-index:1; }
/* Подсказки («Ленина», «12», «45») были цвета текста и читались как уже заполненный адрес */
html.dv3 .v3p-edit .auth-input::placeholder{ color:var(--v3-sub); opacity:.75; }
html.dv3 :is([data-view="checkout"], #js-chat-overlay) :is(input, textarea)::placeholder{ color:var(--v3-sub); opacity:.8; }
