/* Wallam dashboard. Same look as the website: white, airy, pill buttons, soft panels. */
:root {
  --bg: #ffffff; --page: #f6f7fb; --ink: #0f1a2b; --muted: #5d6675; --line: #e8eaf0; --soft: #f5f6fa;
  --accent: #3d5afe; --accent-soft: #eef1ff; --mint: #e6f6ef; --lavender: #efebff;
  --ok: #0f9d6b; --danger: #c8321e; --danger-soft: #fdeceA;
  --font: "Instrument Sans", "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
}
[dir="rtl"] { --font: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Instrument Sans", system-ui, sans-serif; }
:root { --display: "Bricolage Grotesque", "Instrument Sans", "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif; }
[dir="rtl"] { --display: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Bricolage Grotesque", system-ui, sans-serif; }
h1, h2, h3, .big, .plan-price b { font-family: var(--display); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15.5px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
[dir="rtl"] body { line-height: 1.85; }
h1, h2 { margin: 0; line-height: 1.25; letter-spacing: -0.02em; }
[dir="rtl"] h1, [dir="rtl"] h2 { letter-spacing: 0; line-height: 1.5; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.muted, .hint { color: var(--muted); }
.hint { display: block; font-size: .88rem; font-weight: 400; }
.grow { flex: 1; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-name { font: 700 1.4rem/1 "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif; letter-spacing: -0.02em; }
.logo { display: block; height: 30px; width: auto; }

/* ---------- Buttons and fields ---------- */
.btn {
  font: 500 .98rem/1.2 var(--font); border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  padding: 11px 22px; min-height: 44px; transition: background-color .15s, border-color .15s;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #1b2a42; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { padding: 7px 15px; min-height: 36px; font-size: .88rem; }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
label, legend { display: block; font-weight: 600; font-size: .95rem; }
fieldset { border: 0; padding: 0; margin: 0; }
input[type=text], input[type=email], input[type=password], textarea, select {
  display: block; width: 100%; margin-top: 7px; padding: 11px 14px; font: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
textarea { resize: vertical; line-height: 1.7; }
select.inline { width: auto; margin-top: 0; padding: 6px 10px; min-height: 36px; font-size: .88rem; border-radius: 999px; }
.error { color: var(--danger); font-weight: 600; min-height: 1.5em; }
.ok { color: var(--ok); font-weight: 600; }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.form { display: grid; gap: 18px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.checks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.checks label {
  font-weight: 500; display: inline-flex; gap: 10px; align-items: center; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; padding-inline-start: 11px;
  transition: background-color .15s, border-color .15s;
}
.checks label:hover { border-color: #c9cedb; }
.checks label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.checks label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #c3c9d6; background: #fff;
  display: inline-grid; place-content: center; transition: background-color .15s, border-color .15s;
}
input[type=checkbox]::before {
  content: ""; width: 5px; height: 10px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transition: transform .12s;
}
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::before { transform: rotate(45deg) scale(1); }
.checks input[type=checkbox]:focus-visible { outline: none; }
.starters-edit { display: grid; gap: 8px; margin-top: 4px; }
.starters-edit input { margin-top: 0; }

/* ---------- Sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(60% 50% at 20% 0%, rgb(61 90 254 / 0.10), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 410px; display: grid; gap: 16px; padding: 32px; box-shadow: 0 30px 70px rgb(15 26 43 / 0.10); }
.login-card .lang-select { margin-top: 4px; }
.text-link { color: var(--accent); font-weight: 600; font-size: .93rem; text-align: center; text-decoration: none; justify-self: center; padding: 2px 6px; border-radius: 6px; }
.text-link:hover { text-decoration: underline; }
.text-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.login-card .ok:empty, .login-card .error:empty { display: none; }

/* ---------- Shell: side menu and main area ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg); border-inline-end: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding-inline: 10px; }
.tabs { display: grid; gap: 4px; align-content: start; }
.tabs button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; cursor: pointer;
  font: 500 .96rem/1.3 var(--font); color: var(--muted); background: transparent; border: 0; border-radius: 12px; padding: 11px 12px;
}
.tabs button:hover { background: var(--soft); color: var(--ink); }
.tabs button[aria-selected=true] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tabs svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs span { flex: 1; }
.count { font: 700 .75rem/1 "Instrument Sans", sans-serif; font-style: normal; background: var(--danger); color: #fff; border-radius: 999px; padding: 4px 8px; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding-inline: 4px; }
.who { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; text-align: start; }
.lang-select { margin-top: 0; padding: 8px 12px; border-radius: 999px; font-size: .9rem; }

.main { padding: clamp(18px, 3vw, 36px); max-width: 1180px; width: 100%; }
.main > section > .card, .main > section > form.card { max-width: 820px; }
.page-title { margin-bottom: 22px; }
.section-title { margin: 30px 0 14px; }
.banner { margin-bottom: 18px; padding: 14px 18px; background: var(--danger-soft); background: #fdecea; color: var(--danger); border-radius: 14px; font-weight: 600; }
.totals { font-weight: 600; margin-bottom: 16px; }

/* ---------- Home ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stats4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat-credit { background: var(--mint); border-color: transparent; }
.stat-credit.low { background: #fdecea; }
.cost-note { margin-top: 12px; }
.table-card { padding: 6px 0; max-width: none; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 500; font-size: .82rem; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: end; font-variant-numeric: tabular-nums; }
table.data .minus { color: var(--danger); }
table.data .empty-row td { color: var(--muted); text-align: center; padding: 22px; }
.bills { display: grid; gap: 12px; }
.bill { display: grid; grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr) minmax(110px, 1fr) auto; gap: 10px; align-items: end; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.bill .note { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
.bill label { font-size: .8rem; font-weight: 500; color: var(--muted); }
.bill .btn { min-height: 44px; }
.limit-row { display: grid; gap: 8px; }
.real { display: grid; gap: 6px; padding: 16px 18px; border-radius: 16px; background: var(--soft); }
.real b { font: 700 1.6rem/1.2 "Instrument Sans", sans-serif; letter-spacing: -0.02em; }
.real span { color: var(--muted); font-size: .88rem; }
.limit-row .row { justify-content: space-between; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: grid; gap: 8px; align-content: start; justify-items: start; }
.stat-accent { background: var(--lavender); border-color: transparent; }
.stat .label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.big { font: 700 2.1rem/1.15 "Instrument Sans", "IBM Plex Sans Arabic", "Noto Sans Arabic", sans-serif; letter-spacing: -0.03em; }
.stat .btn { margin-top: 6px; }
.stat .extra { font-weight: 600; color: var(--accent); }
.pack-list { display: grid; gap: 10px; margin-bottom: 18px; }
.pack-list .btn { width: 100%; justify-content: center; }
.ask .pack-note { margin: -10px 0 18px; }
.customer .request { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 12px; }
.meter { width: 100%; height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; }
.meter i.high { background: var(--danger); }
.guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.guide-item { text-align: start; cursor: pointer; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 6px; align-content: start; }
.guide-item:hover { border-color: var(--ink); }
.guide-item span { color: var(--muted); font-size: .92rem; }

/* ---------- Conversations: an inbox ---------- */
#tab-chats .main, .main:has(#tab-chats:not([hidden])) { max-width: none; }
.inbox { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr) minmax(240px, 300px); gap: 16px; align-items: start; }
.inbox:not(:has(.profile:not([hidden]))) { grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); }
.inbox-list .page-title { margin-bottom: 14px; }
.search { margin: 0 0 10px; border-radius: 999px; padding-inline-start: 40px !important; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6675' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 18px; }
[dir=rtl] .search { background-position: calc(100% - 14px) center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chips button { font: 500 .84rem/1 var(--font); color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chips button b { font-weight: 600; font-size: .78rem; color: var(--ink); background: var(--soft); border-radius: 999px; padding: 2px 7px; }
.chips button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips button[aria-pressed=true] b { background: rgb(255 255 255 / 0.22); color: #fff; }
.chat-list { display: grid; gap: 2px; max-height: calc(100vh - 250px); overflow-y: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 6px; }
.chat-item { text-align: start; font: inherit; background: transparent; border: 0; border-radius: 13px; padding: 10px; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 11px; color: var(--ink); width: 100%; align-items: center; }
.chat-item:hover { background: var(--soft); }
.chat-item[aria-current=true] { background: var(--accent-soft); }
.chat-item .avatar { grid-row: span 2; }
.chat-item .top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.chat-item .top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .95rem; }
.chat-item .top small { color: var(--muted); font-size: .76rem; flex: none; }
.chat-item .preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .86rem; display: flex; gap: 6px; align-items: center; min-width: 0; }
.chat-item .preview span { overflow: hidden; text-overflow: ellipsis; }
.chat-item .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.chat-item .marks { display: flex; gap: 4px; flex: none; }
.chat-item .marks i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.avatar { flex: none; position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 600 1rem/1 "Instrument Sans", "IBM Plex Sans Arabic", sans-serif; background: var(--accent); }
.avatar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.avatar.big { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar.big svg { width: 28px; height: 28px; }
.avatar .channel { position: absolute; inset-inline-end: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--accent); display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.avatar .channel svg { width: 13px; height: 13px; stroke-width: 2.2; }
.who-line { display: grid; gap: 2px; min-width: 0; }
.who-line b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-line span { color: var(--muted); font-size: .84rem; font-weight: 400; }
.thread-head .tag { white-space: nowrap; }
.thread-head .tag.ai { background: var(--accent-soft); color: var(--accent); }
.reply .suggest { flex: none; }
.profile-toggle { display: none; }
.profile { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 18px; max-height: calc(100vh - 110px); overflow-y: auto; }
.profile-head { display: grid; justify-items: center; gap: 6px; text-align: center; }
.profile-head b { font-size: 1.1rem; overflow-wrap: anywhere; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; padding: 12px 0; border-block: 1px solid var(--line); }
.profile-stats b { display: block; font: 700 1.2rem/1.2 "Instrument Sans", sans-serif; }
.profile-stats span { font-size: .74rem; color: var(--muted); }
.profile-form { display: grid; gap: 12px; }
.profile-form label { font-size: .85rem; }
.profile-form input, .profile-form textarea { margin-top: 5px; }
.label-title { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 7px; }
.label-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.label-chips button { font: 500 .8rem/1 var(--font); border-radius: 999px; padding: 7px 11px; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.label-chips button i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.label-chips button[aria-pressed=true] { color: var(--ink); border-color: currentColor; font-weight: 600; background: var(--soft); }
.profile-history { display: grid; gap: 4px; }
.history-item { text-align: start; font: inherit; border: 0; background: transparent; border-radius: 10px; padding: 8px; cursor: pointer; display: grid; gap: 2px; color: var(--ink); }
.history-item:hover { background: var(--soft); }
.history-item[aria-current=true] { background: var(--accent-soft); }
.history-item small { color: var(--muted); font-size: .76rem; }
.history-item span { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1250px) {
  .inbox, .inbox:not(:has(.profile:not([hidden]))) { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .profile-toggle { display: inline-flex; }
  .profile { grid-column: 2; }
  .profile.folded { display: none; }
}
.tag { font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; line-height: 1.5; }
.tag.need { background: var(--danger); color: #fff; }
.tag.human { background: var(--mint); color: #0b6b49; }
.tag.bad { background: #fdecea; color: var(--danger); }
.tag.phone { background: var(--soft); color: var(--ink); }
.thread { background: var(--bg); border: 1px solid var(--line); border-radius: 20px; min-height: 320px; padding: 18px; }
.empty { color: var(--muted); padding: 40px 12px; text-align: center; }
.thread-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.thread-log { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; max-height: calc(100vh - 330px); min-height: 200px; overflow-y: auto; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.msg small { display: block; font-size: .72rem; opacity: .7; font-weight: 600; }
.msg-photo { display: block; margin: 6px 0; }
.msg-photo img { display: block; max-width: 240px; max-height: 280px; border-radius: 12px; }
.voice { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; padding: 8px 12px 8px 8px; border-radius: 14px; background: rgb(255 255 255 / 0.65); min-width: 230px; direction: ltr; }
.voice-play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; transition: transform .12s; }
.voice-play:hover { transform: scale(1.06); }
.voice-play svg { width: 17px; height: 17px; fill: currentColor; }
.voice-wave { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
.voice-wave i { flex: 1; max-width: 4px; min-width: 2px; border-radius: 2px; background: #b8bfd6; transition: background-color .1s; }
.voice-wave i.on { background: var(--accent); }
.voice-time { flex: none; font: 500 .82rem/1 "Instrument Sans", sans-serif; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 32px; text-align: end; }
.msg.visitor { align-self: flex-start; background: var(--soft); border-end-start-radius: 5px; }
.msg.bot { align-self: flex-end; background: var(--accent-soft); border-end-end-radius: 5px; }
.msg.agent { align-self: flex-end; background: var(--ink); color: #fff; border-end-end-radius: 5px; }
.msg .rated { margin-top: 6px; opacity: .85; }
.msg .teach { display: block; margin-top: 6px; padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.msg .teach:hover { text-decoration: underline; }
.reply { display: flex; gap: 8px; }
.reply input { margin-top: 0; border-radius: 999px; }
.thread .hint { margin-top: 8px; }

/* ---------- Lists inside cards ---------- */
.answer-row, .customer { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.answer-row p { white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.key-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.key-row .muted { flex: 1; font-size: .88rem; min-width: 160px; }
.new-key { background: var(--mint); border-radius: 16px; padding: 16px 18px; display: grid; gap: 10px; }
.card.new-key { border-color: transparent; }
.new-key textarea, #snippet, #app-url, #webhook-secret, #owner-result-text { font-family: Consolas, "Cascadia Mono", monospace; font-size: .86rem; }
.keyline { display: block; padding: 10px 14px; font-size: .9rem; overflow-wrap: anywhere; }
pre { margin: 0; background: var(--ink); color: #dfe6ff; padding: 14px 16px; border-radius: 14px; overflow-x: auto; font: .84rem/1.6 Consolas, "Cascadia Mono", monospace; }
.notes { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; color: var(--muted); }

/* ---------- Small screens: the side menu becomes a top strip ---------- */
@media (max-width: 900px) {
  .bill { grid-template-columns: 1fr 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .tabs { order: 3; width: 100%; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .tabs button { width: auto; white-space: nowrap; padding: 9px 12px; }
  .tabs span { flex: none; }
  .side-foot { margin-top: 0; margin-inline-start: auto; display: flex; align-items: center; }
  .who { display: none; }
  .stats, .guide, .chats, .grid2, .inbox, .inbox:not(:has(.profile:not([hidden]))) { grid-template-columns: 1fr; }
  .profile { grid-column: auto; }
  .chat-list { max-height: 260px; }
  .thread-log { max-height: 50vh; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* ---------- Designed dropdowns (see select.js) ---------- */
.dd { position: relative; margin-top: 7px; font-weight: 400; }
.side-foot .dd, .login-card .dd, .dd-inline { margin-top: 0; }
.dd-button {
  display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; text-align: start;
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; min-height: 46px;
}
.dd-button:hover { border-color: #c9cedb; }
.dd-button[aria-expanded=true] { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.dd-button:disabled { opacity: .55; cursor: default; }
.dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chevron { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.dd-button[aria-expanded=true] .dd-chevron { transform: rotate(180deg); stroke: var(--accent); }
.dd-pill .dd-button { border-radius: 999px; padding: 8px 16px; min-height: 40px; font-size: .92rem; }
.dd-inline { display: inline-block; }
.dd-inline .dd-button { border-radius: 999px; padding: 6px 14px; min-height: 36px; font-size: .88rem; width: auto; min-width: 124px; }

.dd-pop {
  position: absolute; z-index: 40; inset-inline: 0; top: calc(100% + 6px); min-width: 180px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px;
  box-shadow: 0 18px 44px rgb(15 26 43 / 0.16);
}
.dd-up .dd-pop { top: auto; bottom: calc(100% + 6px); }
.dd-list { max-height: 280px; overflow-y: auto; display: grid; gap: 2px; }
.dd-option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: .95rem; line-height: 1.5; }
.dd-option:hover, .dd-option:focus { background: var(--soft); outline: none; }
.dd-option[aria-selected=true] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dd-option[aria-selected=true]::after { content: ""; margin-inline-start: auto; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.dd-search { margin: 0 0 6px !important; border-radius: 10px !important; padding: 9px 12px !important; font-size: .92rem; }
@media (prefers-reduced-motion: reduce) { .dd-chevron { transition: none; } }

/* ---------- Designed question and message boxes ---------- */
dialog.ask { border: 0; border-radius: 22px; padding: 28px; width: min(420px, calc(100vw - 32px)); background: #fff; color: var(--ink); box-shadow: 0 30px 80px rgb(15 26 43 / 0.25); }
dialog.ask::backdrop { background: rgb(15 26 43 / 0.45); }
.ask-text { font-size: 1.05rem; font-weight: 500; margin-bottom: 22px; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .checks label, input[type=checkbox], input[type=checkbox]::before { transition: none; } }

.admin-tag { background: var(--accent-soft); color: var(--accent); margin-inline-start: 2px; }

.customer .dd-inline .dd-button { min-width: 150px; }
/* Small dropdowns in a row: the list is as wide as its longest choice, so no line breaks in two. */
.dd-inline .dd-pop { inset-inline-end: auto; width: max-content; max-width: min(300px, 86vw); }
.dd-inline .dd-option { white-space: nowrap; }
