/* TUNOO - calm dark store UI. Uniform boxes, voice bar and a small assistant orb. */
:root {
  --bar: 84px;
  --top: 64px;
  --S: min(86vw, clamp(150px, 27vh, 230px));
  --bg: #08090b;
  --panel: rgba(26, 29, 34, .96);
  --card: #1a1d22;
  --card2: #20242a;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .18);
  --cy: #3f8cff;
  --mg: #2f6eea;
  --pu: #1150cf;
  --text: #f2f4f7;
  --dim: #9aa1ac;
  --ok: #3ddc84;
  --warn: #ffb53d;
  --bad: #ff5470;
  --eye: #dfe6ef;
  --mono: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --cut: none;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none
}

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(700px 420px at 50% -10%, rgba(25, 82, 190, .20), transparent 68%), linear-gradient(180deg, #08090b, #0b0e12)
}

body::after {
  display: none
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit
}

button {
  cursor: pointer
}

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

/* ---------- header ---------- */
.top {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(8, 9, 11, .98), rgba(8, 9, 11, .86) 72%, rgba(8, 9, 11, 0));
  transition: opacity .6s
}

body[data-mode="face"] .top {
  opacity: .25
}

.deptbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(300px, 62vw);
  padding: 7px 12px 7px 10px;
  background: transparent;
  border: 0;
  transition: background .2s
}

.deptbtn:hover,
.deptbtn[aria-expanded="true"] {
  background: rgba(255, 255, 255, .06);
  border-radius: 10px
}

.deptbtn svg {
  flex: none;
  width: 22px;
  height: 22px;
  stroke: var(--dim)
}

.deptbtn .lbl {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
  line-height: 1.15
}

.deptbtn small {
  font: 500 9px var(--mono);
  letter-spacing: .08em;
  color: var(--dim)
}

.deptbtn b {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.deptbtn .chev {
  width: 14px;
  height: 14px;
  transition: transform .25s
}

.deptbtn[aria-expanded="true"] .chev {
  transform: rotate(180deg)
}

.brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  line-height: 1.1;
  pointer-events: none
}

.brand b {
  display: block;
  font: 700 17px var(--mono);
  letter-spacing: .28em;
  padding-left: .28em
}

.brand span {
  font: 500 9.5px var(--mono);
  letter-spacing: .18em;
  color: var(--dim);
  text-transform: uppercase
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px
}

.qbtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  font: 600 19px var(--mono);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all .2s
}

.qbtn svg {
  width: 18px;
  height: 18px;
  display: block
}

.qbtn:hover,
.qbtn[aria-expanded="true"] {
  background: var(--card2);
  border-color: var(--line2)
}

/* ---------- department menu ---------- */
.menu {
  position: fixed;
  z-index: 40;
  top: calc(var(--top) + 4px);
  left: 16px;
  width: min(460px, calc(100vw - 32px));
  max-height: min(72dvh, 560px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 14px;
  opacity: 0;
  transform: translateY(-10px) scale(.98);
  pointer-events: none;
  transition: opacity .25s, transform .25s
}

.menu.open {
  opacity: 1;
  transform: none;
  pointer-events: auto
}

.uniform-search {
  position: fixed;
  z-index: 40;
  top: calc(var(--top) + 8px);
  right: 62px;
  width: min(310px, calc(100vw - 78px));
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity .2s, transform .2s
}

.uniform-search.open {
  opacity: 1;
  transform: none;
  pointer-events: auto
}

.uniform-search input {
  width: 100%;
  padding: 11px 14px;
  background: var(--card2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  outline: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28)
}

.uniform-search input:focus {
  border-color: var(--cy)
}

.menu input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none
}

.menu input:focus {
  border-color: var(--cy)
}

.dlist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  overflow-y: auto;
  padding: 2px
}

.ditem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  text-align: left;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  transition: all .15s
}

.ditem:hover {
  border-color: var(--line2);
  background: rgba(255, 255, 255, .06)
}

.ditem[aria-selected="true"] {
  border-color: var(--cy);
  background: rgba(63, 140, 255, .14);
  box-shadow: inset 0 0 14px rgba(63, 140, 255, .12)
}

.ditem .bd {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font: 700 11px var(--mono);
  color: #031018;
  background: linear-gradient(135deg, var(--cy), var(--pu))
}

.ditem span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2
}

.ditem b {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.ditem i {
  font: normal 10.5px var(--mono);
  color: var(--dim)
}

.dempty {
  grid-column: 1/-1;
  color: var(--dim);
  font-size: 13px;
  padding: 12px;
  text-align: center
}

/* ---------- uniform boxes ---------- */
.browse {
  position: fixed;
  z-index: 5;
  top: var(--top);
  bottom: var(--bar);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 16px 0;
  transition: opacity .7s ease, transform .8s cubic-bezier(.22, .8, .2, 1), filter .7s ease
}

body[data-mode="chat"] .browse {
  opacity: 0;
  transform: scale(.965);
  filter: blur(10px);
  pointer-events: none
}

.stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 4px 2px 10px;
  font: 500 11px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim)
}

.stats b {
  color: var(--cy);
  font-weight: 700
}

.grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
  align-content: start;
  padding: 2px 2px calc(var(--S) * .2);
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 140, 255, .4) transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 70px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 70px), transparent)
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 14px;
  transition: border-color .2s, transform .2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12)
}

.card:hover {
  border-color: var(--line2);
  transform: translateY(-2px)
}

.card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px
}

.code {
  font: 600 10px var(--mono);
  color: var(--dim);
  letter-spacing: .04em
}

.cat {
  font: 500 9.5px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-right: 12px
}

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

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px
}

.sz {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  font: 500 11px var(--mono);
  background: var(--card2);
  color: var(--dim)
}

.sz b {
  color: var(--text);
  font-weight: 700;
  letter-spacing: .04em
}

.sz em {
  font-style: normal;
  color: var(--dim)
}

.sz.low {
  border-color: rgba(255, 181, 61, .55);
  color: var(--warn)
}

.sz.low b {
  color: var(--warn)
}

.sz.out {
  border-color: rgba(255, 84, 112, .5);
  color: var(--bad);
  background: rgba(255, 84, 112, .07)
}

.sz.out b {
  color: var(--bad)
}

.card footer {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, .1);
  font: 500 10.5px var(--mono);
  letter-spacing: .08em;
  color: var(--dim);
  text-transform: uppercase
}

.card footer strong {
  color: var(--ok);
  font-weight: 700
}

.empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--dim);
  padding: 40px 0
}

/* ---------- orb / idle face stage ---------- */
.stage {
  --lvl: 0;
  --tx: 0px;
  --ty: 0px;
  --sc: 1;
  position: fixed;
  z-index: 26;
  left: 50%;
  top: 46%;
  width: var(--S);
  height: var(--S);
  margin: calc(var(--S) / -2) 0 0 calc(var(--S) / -2);
  transform: translate(var(--tx), var(--ty)) scale(var(--sc));
  transition: transform 1s cubic-bezier(.22, .8, .2, 1);
  will-change: transform;
  outline-offset: -6px;
  border-radius: 50%
}

.stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 62%;
  width: 90%;
  height: 48%;
  transform: translate(-50%, -50%) scale(calc(1 + var(--lvl) * .45));
  opacity: calc(.55 + var(--lvl) * .9);
  background: radial-gradient(closest-side, rgba(63, 140, 255, .35), rgba(17, 80, 207, .16) 60%, transparent 74%);
  filter: blur(20px);
  z-index: 0;
  pointer-events: none;
  transition: opacity .08s linear
}

/* In chat, the canvas is the single orb surface; don't add a second blue disc behind it. */
body[data-mode="chat"] .stage::after {
  display: none
}

body[data-mode="browse"] .stage {
  --tx: 0px;
  --ty: calc(50vh - var(--bar) + 14px - var(--S) * .155);
  --sc: .31;
  cursor: pointer
}

body[data-mode="browse"] .stage:hover {
  filter: drop-shadow(0 0 16px rgba(63, 140, 255, .55))
}

body[data-mode="chat"] .stage {
  --ty: calc(var(--bar) / -2 - 6px);
  --sc: 1
}

body[data-mode="face"] .stage {
  --tx: 0px;
  --ty: calc(50vh - var(--bar) + 14px - var(--S) * .155);
  --sc: .31
}

/* Full-width dock wash. It is deliberately independent from the transformed orb
   stage so the fade stays pinned to the viewport while the orb changes size. */
#dockBackdrop {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30vh;
  min-height: 190px;
  pointer-events: none;
  opacity: .96;
  background: linear-gradient(180deg, rgba(30, 31, 43, 0) 0%, rgba(30, 31, 43, .64) 16%, rgba(12, 13, 20, .94) 45%, #08090b 78%);
  transition: height 1s cubic-bezier(.22, .8, .2, 1), opacity 1s cubic-bezier(.22, .8, .2, 1)
}

body[data-mode="chat"] #dockBackdrop {
  height: 92dvh;
  min-height: 0;
  opacity: 1
}

.layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1), filter .8s ease
}

#orbLayer canvas {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, .35)) drop-shadow(0 0 22px rgba(255, 120, 80, .35)) drop-shadow(0 0 42px rgba(150, 80, 255, .35)) drop-shadow(0 0 64px rgba(70, 110, 255, .30))
}

#faceLayer {
  padding: 3%;
  opacity: 0;
  transform: scale(.84);
  pointer-events: none
}

#faceHost {
  width: 100%;
  height: 100%;
  animation: float 5s ease-in-out infinite
}

#faceHost svg {
  width: 100%;
  height: 100%;
  overflow: visible
}

body[data-mode="face"] #faceLayer,
body[data-flash="1"] #faceLayer {
  opacity: 1;
  transform: none
}

body[data-mode="face"] #orbLayer,
body[data-flash="1"] #orbLayer {
  opacity: 0;
  transform: scale(.8);
  filter: blur(8px)
}

.hint {
  position: fixed;
  z-index: 27;
  bottom: calc(var(--bar) + 40px);
  left: calc(50% + var(--S) * .155 + 16px);
  font: 500 10.5px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cy);
  opacity: .75;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .5s
}

body:not([data-mode="browse"]) .hint {
  opacity: 0
}

.hi {
  display: none;
  position: fixed;
  z-index: 28;
  left: 50%;
  bottom: calc(var(--bar) + var(--S) * .31 + 6px);
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-weight: 600;
  background: var(--card2);
  border: 1px solid var(--line2);
  border-radius: 18px 18px 18px 4px;
  opacity: 0;
  transform: translate(-50%, 10px) scale(.8);
  transition: opacity .4s, transform .4s cubic-bezier(.2, 1.4, .4, 1);
  pointer-events: none
}

.hi span {
  display: inline-block;
  font-size: 22px;
  transform-origin: 70% 80%
}

.hi.on {
  opacity: 1;
  transform: translate(-50%, 0) scale(1)
}

.hi.on span {
  animation: wave .9s ease-in-out .3s 3
}

@keyframes wave {

  0%,
  100% {
    rotate: 0deg
  }

  25% {
    rotate: 24deg
  }

  50% {
    rotate: -12deg
  }

  75% {
    rotate: 20deg
  }
}

/* ---------- voice bar (fixed, full width) ---------- */
.bar {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bar);
  background: linear-gradient(180deg, rgba(8, 9, 11, 0), #08090b);
  border: 0;
  pointer-events: none
}

.bar::before {
  display: none
}

#voiceWave {
  position: absolute;
  left: 0;
  top: 4px;
  width: 100%;
  height: 26px;
  display: block
}

.status {
  position: absolute;
  left: 14px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(50% - var(--S) * .16 - 24px);
  font: 500 10.5px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim)
}

.status .dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #46546b
}

.status.live {
  color: var(--text)
}

.status.live .dot {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok)
}

.status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

/* ---------- chat panel (right side, shown in chat mode) ---------- */
.chat {
  position: fixed;
  z-index: 24;
  right: 16px;
  top: calc(var(--top) + 12px);
  bottom: calc(var(--bar) + 14px);
  width: min(440px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(29, 33, 40, .985), rgba(18, 21, 27, .985));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .42);
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
  transition: transform .9s cubic-bezier(.22, .8, .2, 1), opacity .6s
}

body[data-mode="chat"] .chat {
  transform: none;
  opacity: 1;
  pointer-events: auto
}

.chat-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font: 700 12px var(--mono);
  letter-spacing: .08em;
  color: var(--text)
}

.chat-h i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 8px;
  box-shadow: 0 0 8px var(--ok);
  animation: pulse 1.6s infinite
}

.chat-h button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: var(--dim);
  font-size: 16px;
  line-height: 1;
  padding-bottom: 4px;
}

.chat-h button:hover {
  color: #fff;
  border-color: var(--line2)
}

.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 140, 255, .35) transparent
}

.msg {
  max-width: 88%;
  padding: 10px 13px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere
}

.msg.bot {
  align-self: flex-start;
  background: linear-gradient(145deg, rgba(47, 53, 63, .9), rgba(29, 33, 40, .96));
  border: 1px solid rgba(255, 255, 255, .1);
  border-left: 3px solid var(--cy);
  border-radius: 5px 14px 14px 14px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .16)
}

.msg.you {
  align-self: flex-end;
  background: linear-gradient(145deg, rgba(38, 82, 159, .72), rgba(24, 52, 104, .72));
  border: 1px solid rgba(113, 169, 255, .38);
  border-radius: 14px 5px 14px 14px;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .16)
}

.msg.typing {
  display: flex;
  gap: 5px;
  padding: 12px 14px
}

.msg.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cy);
  animation: dot 1.2s infinite
}

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

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

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  background: rgba(8, 9, 11, .24)
}

.chips:empty {
  display: none
}

.chip {
  padding: 8px 12px;
  font-size: 12px;
  color: #e9f1ff;
  background: rgba(40, 52, 72, .8);
  border: 1px solid rgba(116, 157, 220, .3);
  border-radius: 999px;
  text-align: left;
  transition: all .15s
}

.chip:hover {
  background: rgba(63, 140, 255, .2);
  border-color: var(--cy)
}

.ask {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  background: rgba(8, 9, 11, .16)
}

.ask input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  outline: none
}

.ask input:focus {
  border-color: var(--cy)
}

.btn {
  padding: 0 18px;
  min-height: 40px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  color: #02131a;
  background: linear-gradient(90deg, var(--cy), #6aa8ff);
  border: 0;
  border-radius: 999px
}

.send-btn {
  flex: none;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 12px
}

.send-btn svg {
  width: 19px;
  height: 19px;
  display: block
}

.btn.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line)
}

.btn:disabled {
  opacity: .5;
  cursor: default
}

/* ---------- popups ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(2, 4, 10, .72);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s
}

.modal.open {
  opacity: 1;
  pointer-events: auto
}

.sheet {
  width: min(580px, 100%);
  max-height: 84dvh;
  display: flex;
  flex-direction: column;
  background: rgba(6, 11, 22, .97);
  border: 1px solid var(--line2);
  clip-path: var(--cut);
  transform: translateY(14px) scale(.97);
  transition: transform .35s cubic-bezier(.2, 1.2, .4, 1)
}

.modal.open .sheet {
  transform: none
}

.sheet-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 0
}

.tabs {
  display: flex;
  gap: 4px
}

.tab {
  padding: 9px 16px;
  font: 700 11.5px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim)
}

.tab[aria-selected="true"] {
  color: var(--cy);
  border-bottom-color: var(--cy)
}

.x {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  color: var(--dim);
  font-size: 18px;
  line-height: 1
}

.x:hover {
  color: #fff;
  border-color: var(--line2)
}

.sheet-b {
  overflow-y: auto;
  padding: 16px 18px 20px;
  border-top: 1px solid var(--line);
  margin-top: -1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(63, 140, 255, .35) transparent
}

.sheet-b h4 {
  margin: 0 0 6px;
  font: 700 11px var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cy)
}

.sheet-b p,
.sheet-b li {
  font-size: 14px;
  line-height: 1.65;
  color: #b8c8e0
}

.sheet-b ul {
  margin: 0 0 16px;
  padding-left: 18px
}

details {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, .025)
}

summary {
  cursor: pointer;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 10px
}

summary::-webkit-details-marker {
  display: none
}

summary::after {
  content: "+";
  color: var(--cy);
  font: 700 16px var(--mono)
}

details[open] summary::after {
  content: "\2212"
}

details[open] {
  border-color: var(--line2)
}

details p {
  margin: 0;
  padding: 0 14px 12px
}

details .askbtn {
  margin: 0 14px 12px;
  padding: 5px 12px;
  font-size: 11.5px;
  background: rgba(63, 140, 255, .08);
  border: 1px solid var(--line);
  border-radius: 999px
}

details .askbtn:hover {
  border-color: var(--cy)
}

.seg {
  display: flex;
  gap: 8px;
  margin-bottom: 12px
}

.seg button {
  flex: 1;
  padding: 9px;
  font-weight: 600;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 10px
}

.seg button[aria-pressed="true"] {
  border-color: var(--cy);
  background: rgba(63, 140, 255, .15);
  color: #fff
}

.seg button[data-t="complaint"][aria-pressed="true"] {
  border-color: var(--bad);
  background: rgba(255, 84, 112, .14)
}

.field {
  display: block;
  margin-bottom: 12px;
  font: 600 10.5px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim)
}

.field textarea,
.field input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font: 400 14px/1.5 -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  resize: vertical
}

.field textarea {
  min-height: 110px
}

.field textarea:focus,
.field input:focus {
  border-color: var(--cy)
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px
}

.fmsg {
  min-height: 20px;
  font-size: 13px;
  color: var(--bad);
  margin-bottom: 6px
}

.fok {
  text-align: center;
  padding: 26px 6px
}

.fok b {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
  color: var(--ok)
}

.fok span {
  font: 500 12px var(--mono);
  color: var(--dim);
  letter-spacing: .1em
}

/* camera runs hidden in the background (no preview) */
.ghost {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 2px;
  opacity: .01;
  pointer-events: none
}

.note {
  position: fixed;
  z-index: 35;
  left: 50%;
  top: calc(var(--top) + 6px);
  transform: translateX(-50%);
  max-width: min(520px, 90vw);
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  color: var(--warn);
  background: rgba(8, 14, 28, .94);
  border: 1px solid rgba(255, 181, 61, .4);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s
}

.note.on {
  opacity: 1
}

/* ---------- start screen (only when the browser still needs the first permission) ---------- */
.start {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 24px;
  background: rgba(3, 5, 12, .96);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s
}

.start.show {
  opacity: 1;
  pointer-events: auto
}

.start h2 {
  margin: 0;
  font: 700 22px var(--mono);
  letter-spacing: .2em
}

.start p {
  margin: 0;
  max-width: 400px;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.6
}

.start .btn {
  padding: 14px 34px;
  font-size: 15px
}

/* ---------- eye faces ---------- */
.faces {
  filter: drop-shadow(0 0 7px rgba(61, 108, 245, .6))
}

.face {
  opacity: 0;
  transform: scale(.92);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .4s ease, transform .4s ease;
  pointer-events: none
}

.face.on {
  opacity: 1;
  transform: none
}

.face .eye {
  fill: var(--eye)
}

.face .ln {
  fill: none;
  stroke: var(--eye);
  stroke-width: 15;
  stroke-linecap: round;
  stroke-linejoin: round
}

.face .ln.m {
  stroke-width: 10
}

.face .ln.thin2 {
  stroke-width: 6
}

.face .ring {
  fill: none;
  stroke: var(--eye);
  stroke-width: 8
}

.face .red .eye {
  fill: #ff4d5e
}

.face .red .ln {
  stroke: #ff4d5e
}

.face .green .ln {
  stroke: #7cff9b
}

.face .tn {
  fill: #ff6b9a
}

.face .blush {
  fill: #ff7aa8;
  opacity: .6;
  animation: blush 1.6s ease-in-out infinite
}

.face .glass {
  fill: #05060b;
  stroke: var(--eye);
  stroke-width: 6
}

.face .glint {
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  opacity: .65
}

.face .shades {
  animation: drop .7s cubic-bezier(.2, 1.4, .4, 1) both
}

.face .yawnm {
  fill: #05060b;
  stroke: var(--eye);
  stroke-width: 9;
  transform-box: fill-box;
  transform-origin: center;
  animation: yawn 2.6s ease-in-out infinite
}

.blinker .eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4.8s infinite
}

.face .beat {
  transform-box: fill-box;
  transform-origin: center;
  animation: beat 1s ease-in-out infinite
}

.face .pop {
  transform-box: fill-box;
  transform-origin: center;
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both
}

.face .twinkle {
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 1.4s ease-in-out infinite
}

.face .shake {
  animation: shake .12s linear infinite
}

.face .roll {
  animation: roll 1.5s ease-in-out infinite
}

.face .wag {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: wag .5s ease-in-out infinite alternate
}

.face .tear {
  animation: tear 2.2s ease-in infinite
}

.face .tear.t2 {
  animation-delay: 1s
}

.face .sweat {
  animation: tear 1.8s ease-in infinite
}

.face .puff {
  opacity: 0;
  animation: puff 2.4s ease-out infinite
}

.face .p2 {
  animation-delay: .25s
}

.face .p3 {
  animation-delay: .5s
}

.face .zz {
  fill: var(--eye);
  font: 700 26px system-ui, sans-serif;
  animation: zz 3s ease-in-out infinite
}

.face .z2 {
  animation-delay: 1.2s
}

.face .qm {
  fill: var(--eye);
  font: 800 74px system-ui, sans-serif;
  animation: bob 1.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center
}

.face .d1,
.face .d2,
.face .d3 {
  transform-box: fill-box;
  transform-origin: center;
  animation: dot 1.3s infinite
}

.face .d2 {
  animation-delay: .18s
}

.face .d3 {
  animation-delay: .36s
}

@keyframes blink {

  0%,
  93%,
  100% {
    transform: scaleY(1)
  }

  96.5% {
    transform: scaleY(.1)
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-6px)
  }
}

@keyframes beat {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.15)
  }
}

@keyframes pop {
  from {
    transform: scale(.7)
  }

  to {
    transform: scale(1)
  }
}

@keyframes twinkle {

  0%,
  100% {
    transform: scale(1) rotate(0)
  }

  50% {
    transform: scale(1.14) rotate(8deg)
  }
}

@keyframes shake {
  0% {
    transform: translateX(-2px)
  }

  50% {
    transform: translateX(2px)
  }

  100% {
    transform: translateX(-2px)
  }
}

@keyframes roll {
  0% {
    transform: translate(0, -14px)
  }

  25% {
    transform: translate(14px, 0)
  }

  50% {
    transform: translate(0, 14px)
  }

  75% {
    transform: translate(-14px, 0)
  }

  100% {
    transform: translate(0, -14px)
  }
}

@keyframes wag {
  from {
    transform: rotate(-6deg)
  }

  to {
    transform: rotate(6deg)
  }
}

@keyframes tear {
  0% {
    transform: translateY(0);
    opacity: 0
  }

  15% {
    opacity: 1
  }

  100% {
    transform: translateY(30px);
    opacity: 0
  }
}

@keyframes puff {
  0% {
    opacity: 0;
    transform: translate(-10px, 6px) scale(.6)
  }

  30% {
    opacity: .85
  }

  100% {
    opacity: 0;
    transform: translate(10px, -8px) scale(1.15)
  }
}

@keyframes zz {
  0% {
    opacity: 0;
    transform: translate(0, 8px)
  }

  40% {
    opacity: 1
  }

  100% {
    opacity: 0;
    transform: translate(8px, -14px)
  }
}

@keyframes bob {

  0%,
  100% {
    transform: translateY(0) rotate(-6deg)
  }

  50% {
    transform: translateY(-6px) rotate(6deg)
  }
}

@keyframes dot {

  0%,
  60%,
  100% {
    transform: scale(.6);
    opacity: .45
  }

  30% {
    transform: scale(1.2);
    opacity: 1
  }
}

@keyframes blush {

  0%,
  100% {
    opacity: .4
  }

  50% {
    opacity: .8
  }
}

@keyframes drop {
  from {
    transform: translateY(-46px);
    opacity: 0
  }

  to {
    transform: none;
    opacity: 1
  }
}

@keyframes yawn {

  0%,
  100% {
    transform: scale(.55, .35)
  }

  45%,
  60% {
    transform: scale(1, 1)
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .35
  }
}

/* ---------- small screens ---------- */
@media (max-width:760px) {
  :root {
    --bar: 72px;
    --top: 58px
  }

  .brand {
    display: none
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 9px
  }

  .card {
    padding: 10px 11px
  }

  .sz {
    font-size: 10.5px;
    padding: 3px 6px
  }

  .stats {
    gap: 10px;
    font-size: 10px
  }

  .hint {
    display: none
  }

  .chat {
    left: 12px;
    right: 12px;
    width: auto;
    top: auto;
    height: 46dvh;
    bottom: calc(var(--bar) + 10px)
  }

  body[data-mode="chat"] .stage {
    --ty: calc(-30dvh);
    --sc: .66
  }

  body[data-mode="chat"] #dockBackdrop {
    height: 94dvh
  }

  body[data-mode="face"] .stage {
    --tx: 0px;
    --ty: calc(50vh - var(--bar) + 14px - var(--S) * .155);
    --sc: .31
  }

  .uniform-search {
    right: 62px;
    width: calc(100vw - 78px)
  }

  .dlist {
    grid-template-columns: 1fr
  }

  .status {
    max-width: 44%
  }
}

@media (min-width:761px) and (max-width:1250px) {
  body[data-mode="chat"] .stage {
    --tx: -203px
  }
}

@media (max-height:560px) {
  :root {
    --S: min(86vw, 200px)
  }
}

@media (prefers-reduced-motion:reduce) {

  #faceHost,
  .face *,
  .hi.on span,
  .chat-h i {
    animation: none !important
  }

  .stage,
  #dockBackdrop,
  .layer,
  .browse,
  .chat,
  .face {
    transition-duration: .2s
  }
}