/* =========================================================
   Магазин у Telegram — кейс на спільній системі cases/_ui/ui.css.
   Своє: пастель, вікно чату й панель власника.
   ========================================================= */

:root {
  --pastel: #cdeacf;
  --pastel-2: #e4f0ac;
}

.hero { display: grid; justify-items: center; }
.hero .duo { margin-top: 20px; }

.run {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 26px 0 0;
  padding: 9px 18px;
  border-radius: var(--pill);
  background: var(--white);
  font-size: 13px;
  color: var(--muted);
}
.run-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fa36a; }

/* --- сцена --- */
.stage { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 1000px) {
  .stage { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
}

.phone-col { display: grid; gap: 12px; justify-items: center; }

.phone {
  width: 100%;
  max-width: 380px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: clamp(500px, 72vh, 620px);
  background: linear-gradient(168deg, #34342f 0%, var(--ink) 55%);
  color: #f0efec;
  border-radius: var(--r);
  overflow: hidden;
}

.phone-bar { display: flex; align-items: center; gap: 11px; padding: 14px 18px; background: #2c2c2a; }
.phone-av {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--f-caps);
  font-weight: 800;
  font-size: 15px;
}
.phone-who { display: grid; line-height: 1.25; }
.phone-who b { font-size: 14px; font-weight: 600; }
.phone-who i { font-style: normal; font-size: 11px; color: #9a9a94; }

.chat {
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}

.msg { max-width: 86%; }

/* бот говорить моноширинним, людина — звичайним */
.msg-bot {
  align-self: flex-start;
  background: #33332f;
  border-radius: 18px 18px 18px 6px;
  padding: 12px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.msg-me {
  align-self: flex-end;
  background: linear-gradient(150deg, var(--lime) 0%, var(--lime-2) 100%);
  color: var(--ink);
  border-radius: 18px 18px 6px 18px;
  padding: 11px 16px;
  font-size: 14px;
}
.msg .dim { color: #a3a39c; }

.keys { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 7px; max-width: 92%; }
.key {
  padding: 10px 16px;
  border: 1px solid #45453f;
  border-radius: var(--pill);
  background: none;
  color: #f0efec;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.key:hover { background: #3a3a35; }
.key-main {
  background: linear-gradient(150deg, var(--lime) 0%, var(--lime-2) 100%);
  border-color: var(--lime-2);
  color: var(--ink);
  font-weight: 500;
}
.key-main:hover { background: #b6e341; border-color: #b6e341; }

.say { display: flex; border-top: 1px solid #33332f; }
.say input {
  flex: 1;
  min-width: 0;
  padding: 15px 18px;
  border: 0;
  background: none;
  color: #f0efec;
  font-family: var(--f-ui);
  font-size: 14px;
}
.say input::placeholder { color: #77776f; }
.say input:disabled { color: #5b5b55; }
.say button { width: 54px; border: 0; background: none; color: var(--lime); font-size: 19px; cursor: pointer; }
.say button:disabled { color: #4b4b45; cursor: default; }

/* --- панель власника --- */
.admin { align-self: stretch; display: grid; grid-template-rows: auto 1fr auto; padding: 0; }
.card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: baseline;
  justify-content: space-between;
  padding: 22px clamp(20px, 3vw, 28px);
  border-bottom: 1px solid var(--rule);
}
.card-head h2 { margin: 0; font-family: var(--f-caps); font-weight: 700; font-size: 18px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }

.admin-body { overflow-y: auto; }
.empty { margin: 0; padding: 40px clamp(20px, 3vw, 28px); color: var(--faint); font-size: 14px; }

.order { padding: 20px clamp(20px, 3vw, 28px); border-bottom: 1px solid var(--rule); }
.order-top { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; justify-content: space-between; }
.order-no { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px; }
.order-when { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--faint); }

.order-who { margin: 9px 0 0; font-size: 14.5px; }
.order-who span { color: var(--muted); }

.order-lines { list-style: none; margin: 14px 0 0; padding: 0; }
.order-lines li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
}
.order-lines .q, .order-lines .s {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.order-lines .q { color: var(--muted); }

.order-total {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-weight: 600;
  font-size: 15px;
}

.badge {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: var(--pill);
  background: linear-gradient(150deg, var(--lime) 0%, var(--lime-2) 100%);
  font-size: 12px;
  font-weight: 500;
}

.tiles { display: flex; flex-wrap: wrap; margin: 0; border-top: 1px solid var(--rule); }
.tiles > div { flex: 1 1 130px; padding: 16px clamp(20px, 3vw, 28px); border-right: 1px solid var(--rule); }
.tiles > div:last-child { border-right: 0; }
.tiles dt { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.tiles dd {
  margin: 6px 0 0;
  font-family: var(--f-caps);
  font-weight: 800;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

/* --- рішення --- */
.acc { margin-top: clamp(24px, 3vw, 36px); }
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86em;
  background: var(--sand-2);
  padding: 2px 7px;
  border-radius: 6px;
}

.spec {
  display: grid;
  gap: 12px;
  margin: clamp(24px, 3vw, 34px) 0 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.spec > div { background: var(--white); border-radius: var(--r-sm); padding: 18px 22px; }
.spec dt { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.spec dd { margin: 6px 0 0; font-size: 15px; }

.cta { display: flex; justify-content: center; margin-top: clamp(28px, 4vw, 44px); }
