

html.sup-lock, html.sup-lock body { overflow: hidden; }

.sup {
  position: fixed; left: 0; right: 0; top: var(--sup-vt, 0px); height: var(--sup-vh, 100dvh);
  z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  font-family: var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  color: var(--cream, #f5f6f8);
  background: rgba(5, 5, 8, .68);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 200ms ease;
}
.sup[hidden] { display: none; }
.sup.on { opacity: 1; }

.sup-card {
  position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0;
  background: var(--deep, #0b0b0f);
  transform: translateY(28px); transition: transform 300ms var(--ease-drawer, cubic-bezier(.32, .72, 0, 1));
}
.sup.on .sup-card { transform: none; }

@media (min-width: 720px) {
  .sup { align-items: center; }
  .sup-card {
    width: min(480px, calc(100% - 48px)); height: min(720px, calc(100% - 64px));
    border-radius: var(--r-xl, 16px); overflow: hidden;
    border: 1px solid var(--nw-нить-ярко, color-mix(in oklab, var(--cream, #f5f6f8) 16%, transparent));
    box-shadow: 0 40px 90px -30px #000, 0 0 0 1px rgba(0, 0, 0, .5);
  }
}


.sup-head {
  position: relative; display: flex; align-items: center; gap: 12px; flex: none;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 13px max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, var(--stone-2, #18181f) 0%, var(--stone, #141419) 100%);
  border-bottom: 1px solid var(--nw-нить, color-mix(in oklab, var(--cream, #f5f6f8) 9%, transparent));
}
.sup-head::after {
  content: ""; position: absolute; top: 0; right: 0; width: 58px; height: 20px; pointer-events: none;
  background: var(--nw-штрихи, none) 100% 0 / 58px 20px no-repeat; opacity: .9;
}
.sup-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sup-title { font-weight: 800; font-size: 17px; line-height: 1.2; letter-spacing: .01em; }
.sup-sub { font-size: 12.5px; line-height: 1.3; color: var(--sand-dim, #9aa1ad); }
.sup-x {
  position: relative; z-index: 1; flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--nw-нить, rgba(255, 255, 255, .09)); background: transparent;
  color: var(--cream, #f5f6f8); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, transform 130ms ease;
}
.sup-x svg { width: 20px; height: 20px; }
.sup-x:hover { background: var(--nw-блик, rgba(255, 255, 255, .06)); }
.sup-x:active { transform: scale(.94); }


.sup-av {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  background: var(--deep, #0b0b0f); color: var(--cream, #f5f6f8);
  border: 1px solid var(--nw-нить-ярко, rgba(255, 255, 255, .16));
}
.sup-av svg { width: 22px; height: 22px; }
.sup-av.big { width: 64px; height: 64px; border-color: var(--nw-свет-тихо, rgba(255, 30, 61, .26)); }
.sup-av.big svg { width: 38px; height: 38px; }


.sup-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 6px; outline: 0;
  padding: 16px max(14px, env(safe-area-inset-right, 0px)) 14px max(14px, env(safe-area-inset-left, 0px));
}
.sup-day {
  align-self: center; margin: 10px 0 6px; padding: 3px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--sand-dim, #9aa1ad);
  background: var(--nw-блик, rgba(255, 255, 255, .05));
}
.sup-day:first-child { margin-top: 0; }

.sup-row-m { display: flex; align-items: flex-end; gap: 8px; margin-top: 4px; animation: sup-in 220ms var(--ease-out, cubic-bezier(.23, 1, .32, 1)) both; }
.sup-row-m.me { justify-content: flex-end; }
.sup-row-m .sup-av { width: 30px; height: 30px; margin-bottom: 18px; }
.sup-row-m .sup-av svg { width: 18px; height: 18px; }
.sup-col { display: flex; flex-direction: column; gap: 3px; max-width: min(82%, 380px); min-width: 0; }
.sup-row-m.me .sup-col { align-items: flex-end; }
.sup-who { font-size: 11.5px; font-weight: 700; color: var(--sand, #babfc9); padding-left: 4px; }

.sup-m {
  padding: 9px 13px 10px; border-radius: 16px; font-size: 15px; line-height: 1.42;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
}
.sup-m.me {
  border-bottom-right-radius: 5px; color: #fff;
  background: linear-gradient(160deg, var(--lamp-lo, #b8162c) 0%, color-mix(in oklab, var(--lamp-lo, #b8162c) 72%, var(--lamp, #ff1e3d)) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}
.sup-m.st {
  border-bottom-left-radius: 5px; color: var(--cream, #f5f6f8);
  background: linear-gradient(180deg, var(--stone-2, #18181f) 0%, var(--stone, #141419) 100%);
  border: 1px solid var(--nw-нить-ярко, rgba(255, 255, 255, .16));
}
.sup-m a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--lamp, #ff1e3d); }
.sup-ord {
  display: inline-block; margin: 0 0 5px; padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, .28); color: inherit;
}
.sup-ord + .sup-t::before { content: "\A"; white-space: pre; }
.sup-meta {
  display: flex; align-items: center; gap: 5px; padding: 0 4px; font-size: 11.5px; line-height: 1.2;
  color: var(--sand-dim, #9aa1ad); font-variant-numeric: tabular-nums;
}
.sup-ok { width: 13px; height: 13px; color: var(--ore, #34d399); stroke-width: 2.6; }


.sup-empty {
  margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px;
  max-width: 330px; padding: 12px 6px; text-align: center;
}
.sup-empty b { font-size: 18px; font-weight: 800; margin-top: 6px; }
.sup-empty p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sand, #babfc9); }
.sup-guest { font-size: 12.5px; line-height: 1.45; color: var(--sand-dim, #9aa1ad); }
.sup-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.sup-chip {
  padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; line-height: 1.2; font-family: inherit; cursor: pointer;
  color: var(--cream, #f5f6f8); background: transparent; -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--nw-нить-ярко, rgba(255, 255, 255, .16));
  transition: border-color 160ms ease, background 160ms ease, transform 130ms ease;
}
.sup-chip:hover { border-color: var(--nw-свет-нить, var(--lamp, #ff1e3d)); background: var(--nw-блик, rgba(255, 255, 255, .05)); }
.sup-chip:active { transform: scale(.96); }


.sup-form {
  flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, var(--stone, #141419) 0%, var(--rock, #0f0f14) 100%);
  border-top: 1px solid var(--nw-нить, rgba(255, 255, 255, .09));
}
.sup-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sup-opts:empty { display: none; }
.sup-pick {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%;
  padding: 0 12px; height: 34px; border-radius: 999px; cursor: pointer;
  background: var(--stone-2, #18181f); border: 1px solid var(--nw-нить-ярко, rgba(255, 255, 255, .16));
}
.sup-pick[hidden], .sup-cbtn[hidden], .sup-contact[hidden] { display: none; }
.sup-pick-l { font-size: 12px; font-weight: 700; color: var(--sand-dim, #9aa1ad); }
.sup-sel {
  appearance: none; -webkit-appearance: none; min-width: 0; max-width: 100%; height: 100%; padding: 0 22px 0 0;
  border: 0; outline: 0; background: transparent; color: var(--cream, #f5f6f8); cursor: pointer;
  font-weight: 600; font-size: 13px; line-height: 1; font-family: inherit; text-overflow: ellipsis;
}
.sup-sel option { color: #111; }
.sup-pick-c { position: absolute; right: 10px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; pointer-events: none; color: var(--sand-dim, #9aa1ad); }
.sup-pick:focus-within { border-color: var(--nw-свет-нить, var(--lamp, #ff1e3d)); }
.sup-cbtn {
  height: 34px; padding: 0 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-radius: 999px; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
  font-weight: 600; font-size: 13px; line-height: 1; font-family: inherit; color: var(--sand, #babfc9);
  border: 1px dashed var(--nw-нить-ярко, rgba(255, 255, 255, .22));
}
.sup-cbtn:hover { color: var(--cream, #f5f6f8); border-color: var(--nw-свет-нить, var(--lamp, #ff1e3d)); }
.sup-contact { display: flex; flex-direction: column; gap: 5px; }
.sup-hint { font-size: 12px; line-height: 1.4; color: var(--sand-dim, #9aa1ad); }
.sup-in, .sup-ta {
  width: 100%; box-sizing: border-box; color: var(--cream, #f5f6f8); font-family: inherit;
  background: var(--deep, #0b0b0f); border: 1px solid var(--seam-2, #32323c); border-radius: 14px; outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.sup-in { height: 42px; padding: 0 14px; font-size: 16px; }
.sup-in::placeholder, .sup-ta::placeholder { color: var(--sand-dim, #9aa1ad); opacity: 1; }
.sup-in:focus, .sup-ta:focus {
  border-color: var(--nw-свет-нить, var(--lamp, #ff1e3d));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--lamp, #ff1e3d) 16%, transparent);
}
.sup-row { display: flex; align-items: flex-end; gap: 8px; }
.sup-ta {
  flex: 1; min-width: 0; min-height: 46px; max-height: 132px; padding: 12px 14px; resize: none;
  font-size: 16px; line-height: 1.38; overflow-y: auto;
}
@media (hover: hover) and (pointer: fine) { .sup-ta, .sup-in { font-size: 15px; } }
.sup-send {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer; color: #fff;
  font-weight: 800; font-size: 13px; line-height: 1; font-family: inherit; letter-spacing: .05em; text-transform: uppercase;
  background: var(--metal, var(--lamp, #ff1e3d)); -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 24px -12px var(--lamp, #ff1e3d), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform 130ms ease, opacity 160ms ease, filter 160ms ease;
}
.sup-send svg { width: 17px; height: 17px; stroke-width: 2.6; }
.sup-send:hover:not(:disabled) { filter: brightness(1.08); }
.sup-send:active:not(:disabled) { transform: scale(.96); }
.sup-send:disabled { opacity: .42; cursor: default; box-shadow: none; }
.sup-note { min-height: 0; font-size: 12px; line-height: 1.4; color: var(--sand-dim, #9aa1ad); }
.sup-note:empty { display: none; }
.sup-note.warn, .sup-note.bad { color: var(--rust, #ff8a3d); }

.sup :focus-visible { outline: 2px solid var(--lamp, #ff1e3d); outline-offset: 2px; }
.sup-in:focus-visible, .sup-ta:focus-visible, .sup-log:focus-visible { outline: 0; }

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

@media (prefers-reduced-motion: reduce) {
  .sup, .sup-card { transition: none; }
  .sup-row-m { animation: none; }
}


:where(.sup-anchor) { position: relative; }
.sup-dot {
  display: block; width: 9px; height: 9px; border-radius: 50%; pointer-events: none;
  background: var(--lamp, #ff1e3d);
  box-shadow: 0 0 0 2px var(--deep, #0b0b0f), 0 0 10px color-mix(in oklab, var(--lamp, #ff1e3d) 70%, transparent);
  animation: sup-pulse 2.4s ease-in-out infinite;
}
.sup-dot.abs { position: absolute; top: 6px; right: 6px; }
.sup-dot.in { display: inline-block; margin-left: 8px; vertical-align: 2px; }
@keyframes sup-pulse { 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .sup-dot { animation: none; } }
