/* SMS Gateway — visual language follows the "Valence" reference app:
   slate light theme / neutral-gray dark theme, system-ui at 85%, 0.375rem radius,
   57px headers, 59px footers, flat left-aligned message blocks. Self-contained (no Pico). */

:root, [data-theme="light"] {
  --bg: #f1f5f9; --c-bg: #ffffff; --fg: #0f172a; --muted: #64748b;
  --g-bd: #cbd5e1; --g-bg: #f8fafc; --t-fg: #1e293b; --hover: #f1f5f9; --hover-strong: #e2e8f0;
  --contrast: #0f172a; --p-bg: #0f172a; --p-fg: #ffffff; --p-hover: #334155;
  --s-bg: #e2e8f0; --s-fg: #0f172a; --s-hover: #cbd5e1;
  --ok: #10b981; --err: #ef4444; --warn: #f59e0b;
  --overlay: rgba(15, 23, 42, .5); --shadow: 0 10px 30px rgba(15, 23, 42, .12);
  --radius: 0.375rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a0a0a; --c-bg: #171717; --fg: #fafafa; --muted: #a3a3a3;
  --g-bd: #404040; --g-bg: #171717; --t-fg: #d4d4d4; --hover: #1f1f1f; --hover-strong: #262626;
  --contrast: #fafafa; --p-bg: #fafafa; --p-fg: #0a0a0a; --p-hover: #d4d4d4;
  --s-bg: #262626; --s-fg: #fafafa; --s-hover: #404040;
  --overlay: rgba(0, 0, 0, .6); --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 85%; height: 100%; }
body { margin: 0; height: 100%; font-family: var(--font); font-size: 1rem; line-height: 1.5;
  background: var(--bg); color: var(--fg); -webkit-font-smoothing: antialiased; overflow: hidden; }
/* thin right-edge marker, as in the reference shell */
body::after { content: ""; position: fixed; top: 0; right: 0; width: 3px; height: 100%; background: var(--hover-strong); pointer-events: none; }
code, kbd, .mono { font-family: var(--mono); }
.hidden { display: none !important; }
.sprite { display: none; }
.muted { color: var(--muted); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 14px; height: 14px; }

/* ---------- form controls ---------- */
input, textarea, select {
  font: inherit; font-size: 0.85rem; color: var(--fg); background: var(--c-bg);
  border: 1px solid var(--g-bd); border-radius: var(--radius); padding: 0.5rem 0.65rem; width: 100%;
  outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--contrast); box-shadow: none; }
input[type=checkbox] { width: auto; accent-color: var(--contrast); margin: 0 0.4rem 0 0; vertical-align: -2px; }
label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0.9rem 0 0.3rem; }
label.inline { display: inline-flex; align-items: center; text-transform: none; font-weight: 500; font-size: 0.85rem; color: var(--fg); letter-spacing: 0; }

button { font: inherit; cursor: pointer; color: inherit; }
.btn-modern { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 600; padding: 0.5rem 0.9rem; border-radius: var(--radius);
  border: 1px solid transparent; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn-primary { background: var(--p-bg); color: var(--p-fg); }
.btn-primary:hover { background: var(--p-hover); }
.btn-secondary { background: var(--s-bg); color: var(--s-fg); }
.btn-secondary:hover { background: var(--s-hover); }
.btn-danger { background: transparent; color: var(--err); border-color: var(--g-bd); }
.btn-danger:hover { background: var(--hover-strong); }
.btn-sm { padding: 0.25rem 0.55rem; font-size: 0.75rem; }
.btn-icon-only { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); }
.btn-icon-only:hover { background: var(--hover-strong); color: var(--fg); }
button:disabled { opacity: .5; cursor: default; }

.badge { display: inline-block; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--hover-strong); color: var(--muted); vertical-align: 1px; }
.badge.ok { color: var(--ok); } .badge.err { color: var(--err); } .badge.warn { color: var(--warn); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.dot.off { background: var(--err); }

/* ---------- login ---------- */
#login-view { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); }
#network-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-card { position: relative; z-index: 1; width: 350px; max-width: calc(100vw - 2rem); background: var(--c-bg);
  border: 1px solid var(--g-bd); border-radius: var(--radius); padding: 1.75rem 1.5rem 1.5rem; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; }
.login-sub { margin: 0.25rem 0 0.5rem; font-size: 0.85rem; }
#login-error { color: var(--err); font-size: 0.8rem; min-height: 1.2rem; margin: 0.6rem 0; }

/* ---------- shell ---------- */
#app-view { display: flex; height: 100vh; height: 100dvh; }
#sidebar { width: 240px; flex: none; display: flex; flex-direction: column; background: var(--c-bg); border-right: 1px solid var(--g-bd); }
#sidebar-header { height: 57px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 0.6rem 0 1rem; border-bottom: 1px solid var(--g-bd); }
.brand { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 0.95rem; }
#sidebar-search { position: relative; display: flex; align-items: center; margin: 0.65rem 0.75rem 0.25rem; color: var(--muted); }
#sidebar-search .icon { position: absolute; left: 0.55rem; }
#sidebar-search input { padding: 0.35rem 1.8rem 0.35rem 1.9rem; font-size: 0.8rem; background: var(--bg); }
#sidebar-search kbd { position: absolute; right: 0.45rem; font-size: 0.65rem; border: 1px solid var(--g-bd); border-radius: 4px; padding: 0 0.3rem; color: var(--muted); }
#conv-list { flex: 1; overflow-y: auto; padding: 0.25rem 0 1rem; }
.section-header { display: flex; align-items: center; gap: 0.25rem; width: 100%; border: 0; background: none;
  padding: 0.85rem 1rem 0.3rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); text-align: left; }
.section-header .icon { width: 12px; height: 12px; transition: transform .15s; }
.section-header.collapsed .icon { transform: rotate(-90deg); }
.section-header .count { margin-left: auto; font-weight: 500; }
.conv-item { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid transparent; background: none;
  padding: 0.35rem 0.9rem 0.35rem calc(1rem - 3px); color: var(--t-fg); }
.conv-item:hover { background: var(--hover); }
.conv-item.active { border-left-color: var(--contrast); background: var(--hover-strong); color: var(--fg); }
.conv-item.active .conv-name { font-weight: 700; }
.conv-row { display: flex; align-items: baseline; gap: 0.4rem; }
.conv-name { font-size: 0.85rem; font-weight: 500; flex: 1; min-width: 0; }
.conv-time { font-size: 0.7rem; color: var(--muted); flex: none; }
.conv-preview { font-size: 0.75rem; color: var(--muted); }
.conv-item.unread .conv-name { font-weight: 700; color: var(--fg); }
.conv-item.unread .conv-time::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--contrast); margin-right: 0.3rem; vertical-align: 1px; }
.empty-note { padding: 0.75rem 1rem; font-size: 0.8rem; color: var(--muted); }
#sidebar-footer { height: 59px; flex: none; display: flex; align-items: center; gap: 0.55rem; padding: 0 0.6rem 0 1rem; border-top: 1px solid var(--g-bd); }
.avatar { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--p-bg); color: var(--p-fg); font-size: 0.75rem; font-weight: 700; }
.me-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
#me-name { font-size: 0.85rem; font-weight: 600; }
#me-role { font-size: 0.7rem; }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
#info-header { height: 57px; flex: none; display: flex; align-items: center; gap: 0.5rem; padding: 0 0.75rem 0 1.25rem;
  background: var(--c-bg); border-bottom: 1px solid var(--g-bd); }
.info-text { flex: 1; min-width: 0; }
#info-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#info-topic { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-actions { display: flex; gap: 0.15rem; }
.mobile-only { display: none; }

#chat-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#new-to-row { flex: none; display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 1.25rem;
  background: var(--c-bg); border-bottom: 1px solid var(--g-bd); }
#new-to-row .to-label { margin: 0; flex: none; }
#new-to-row select { width: auto; max-width: 14rem; flex: none; background: var(--bg); }
#new-to-row input { flex: 1; min-width: 0; background: var(--bg); }
#new-to-row.one-from select, #new-to-row.one-from #new-from-label { display: none; }
#chat-pane { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.day-sep { align-self: center; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0.5rem 0; }
.msg { max-width: 46rem; background: var(--g-bg); border: 1px solid var(--g-bd); border-radius: var(--radius);
  padding: 0.5rem 0.75rem; font-size: 0.85rem; line-height: 1.5; }
[data-theme="light"] .msg { border-color: transparent; background: var(--c-bg); }
.msg.out { border-left: 3px solid var(--contrast); }
.msg-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.1rem; }
.msg-author { font-weight: 700; font-size: 0.85rem; }
.msg-time { font-size: 0.7rem; color: var(--muted); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--t-fg); }
.msg-error { font-size: 0.75rem; color: var(--err); margin-top: 0.2rem; }
.empty-state { margin: auto; text-align: center; color: var(--muted); font-size: 0.85rem; }
.empty-state .icon { width: 32px; height: 32px; margin-bottom: 0.5rem; }

#composer { min-height: 59px; flex: none; display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.6rem 0.75rem 0.6rem 1.25rem;
  background: var(--c-bg); border-top: 1px solid var(--g-bd); }
#composer-input { resize: none; height: 40px; max-height: 160px; line-height: 1.4; padding: 0.55rem 0.7rem; background: var(--bg); }
#char-count { font-size: 0.7rem; align-self: center; min-width: 3.5rem; text-align: right; }
#composer .send { width: 40px; height: 40px; color: var(--fg); }

/* ---------- admin ---------- */
#admin-view { flex: 1; overflow-y: auto; padding: 1.25rem; }
.admin-inner { max-width: 640px; margin: 0 auto; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--g-bd); margin-bottom: 1rem; }
.tab { border: 0; background: none; padding: 0.5rem 0.75rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--fg); border-bottom-color: var(--contrast); }
.panel { background: var(--c-bg); border: 1px solid var(--g-bd); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.panel h3 { margin: 0 0 0.6rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 8rem; }
.row > .btn-modern { flex: none; min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
th { text-align: left; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--g-bd); }
td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--g-bd); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.chip { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.72rem; background: var(--hover-strong); border-radius: 999px; padding: 0.05rem 0.2rem 0.05rem 0.55rem; }
.chip button { border: 0; background: none; padding: 0 0.15rem; color: var(--muted); line-height: 1; }
.chip button:hover { color: var(--err); }

/* ---------- modal & toasts ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-card { width: 420px; max-width: 100%; background: var(--c-bg); border: 1px solid var(--g-bd); border-radius: var(--radius); padding: 1.25rem 1.25rem 1rem; box-shadow: var(--shadow); }
.modal-card h2 { margin: 0; font-size: 0.95rem; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { background: var(--p-bg); color: var(--p-fg); font-size: 0.8rem; font-weight: 500; padding: 0.55rem 0.85rem; border-radius: var(--radius);
  box-shadow: var(--shadow); max-width: 320px; animation: toast-in .18s ease-out; }
.toast.err { background: var(--err); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- small screens: one pane at a time ---------- */
@media (max-width: 720px) {
  #sidebar { width: 100%; }
  #app-view.in-conv #sidebar { display: none; }
  #app-view:not(.in-conv) #main { display: none; }
  .mobile-only { display: inline-flex; }
  #info-header { padding-left: 0.5rem; }
}
@media (prefers-reduced-motion: reduce) { #network-bg { display: none; } }

.btn-sm { height: 1.75rem; padding: 0 0.65rem; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.msg-media { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.msg-media a { display: block; max-width: 12rem; }
.msg-media img { display: block; max-width: 12rem; max-height: 10rem; border-radius: var(--radius); border: 1px solid var(--g-bd); object-fit: cover; }
.msg-media video { display: block; max-width: 16rem; max-height: 12rem; border-radius: var(--radius); border: 1px solid var(--g-bd); background: #000; }
.msg-media .file-link { font-size: 0.8rem; word-break: break-all; }
.claim-badge { color: var(--ok); }

/* Connection status */
.header-right { display: flex; align-items: center; gap: 0.35rem; }
.conn-pill {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.15rem 0.45rem; border-radius: 999px; border: 1px solid var(--g-bd);
  color: var(--muted); background: var(--g-bg); line-height: 1.2; user-select: none;
  transition: color .12s, background .12s, border-color .12s;
}
.conn-pill.live { color: #166534; border-color: #86efac; background: #dcfce7; }
html[data-theme="dark"] .conn-pill.live { color: #bbf7d0; border-color: #166534; background: #052e16; }
.conn-pill.reconnect { color: #92400e; border-color: #fcd34d; background: #fef3c7; }
html[data-theme="dark"] .conn-pill.reconnect { color: #fde68a; border-color: #92400e; background: #451a03; }
.conn-pill.offline { color: var(--muted); }

/* ---------- v3: handoff note, opt-out, attachments, canned ---------- */
#info-note { font-size: 0.75rem; color: var(--t-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40rem; }
#info-note::before { content: "Note · "; font-weight: 700; color: var(--muted); }
#optout-bar { flex: none; display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1.25rem; font-size: 0.8rem;
  color: var(--err); background: var(--c-bg); border-top: 1px solid var(--g-bd); }
#attach-row { flex: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 1.25rem 0; background: var(--c-bg); border-top: 1px solid var(--g-bd); }
#attach-row + #composer { border-top: 0; }
#composer .btn-icon-only { width: 36px; height: 40px; flex: none; }
#composer.blocked textarea, #composer.blocked button { opacity: 0.5; pointer-events: none; }
.chip.media { max-width: 22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canned-list { display: flex; flex-direction: column; gap: 0.35rem; max-height: 50vh; overflow: auto; margin-top: 0.75rem; }
.canned-item { text-align: left; border: 1px solid var(--g-bd); background: var(--bg); border-radius: var(--radius); padding: 0.5rem 0.65rem; color: var(--fg); font: inherit; cursor: pointer; }
.canned-item:hover { background: var(--hover-strong); }
.canned-item b { display: block; font-size: 0.8rem; }
.canned-item span { display: block; font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-body { max-width: 28rem; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.8rem; color: var(--t-fg); }

/* ---------- phone polish ---------- */
.more-menu { display: contents; }
.msg-media a, .msg-media img { max-width: min(12rem, 100%); }
.msg-media video { max-width: min(16rem, 100%); }
.msg { max-width: min(46rem, 100%); }
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
  #main, #sidebar { min-width: 0; max-width: 100vw; }
  kbd { display: none; }
  #info-header { gap: 0.25rem; padding-right: 0.4rem; position: relative; }
  .info-actions { align-items: center; flex: none; gap: 0.25rem; }
  .info-actions .btn-icon-only { width: 40px; height: 40px; }
  #more-btn { font-size: 1.3rem; line-height: 1; justify-content: center; align-items: center; }
  .more-menu { display: none; position: absolute; top: calc(100% - 4px); right: 0.4rem; z-index: 40; flex-direction: column; gap: 0.1rem;
    background: var(--c-bg); border: 1px solid var(--g-bd); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0.3rem; }
  .more-menu.open { display: flex; }
  .more-menu .btn-icon-only { width: auto; min-width: 11rem; justify-content: flex-start; gap: 0.6rem; padding: 0 0.7rem; }
  .more-menu .btn-icon-only::after { content: attr(title); font-size: 0.85rem; color: var(--fg); }
  .more-menu .hidden { display: none !important; }
  #info-note { max-width: 100%; }
  #chat-pane { padding: 0.75rem; }
  #new-to-row { padding: 0.45rem 0.75rem; flex-wrap: wrap; }
  #new-to-row select { max-width: 100%; }
  #composer { gap: 0.25rem; padding: 0.5rem calc(0.5rem + env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) calc(0.4rem + env(safe-area-inset-left)); align-items: flex-end; }
  #composer-input { flex: 1; min-width: 0; width: auto; font-size: 16px; }
  #char-count { min-width: 0; }
  #char-count:empty { display: none; }
  #attach-row, #optout-bar { padding-left: 0.75rem; padding-right: 0.75rem; }
  .chip.media { max-width: 100%; }
  #sidebar-footer { padding-bottom: env(safe-area-inset-bottom); height: auto; min-height: 59px; }
  /* admin */
  #admin-view { padding: 0.75rem 0.75rem calc(0.75rem + env(safe-area-inset-bottom)); overflow-x: hidden; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tab { flex: none; padding: 0.6rem 0.75rem; }
  .panel { padding: 0.85rem; }
  .row { flex-direction: column; align-items: stretch; }
  .row > * { min-width: 0; width: 100%; }
  .row > .btn-modern { align-self: flex-start; min-height: 40px; }
  #admin-view table, #admin-view tbody, #admin-view tr, #admin-view td { display: block; width: 100%; }
  #admin-view thead { display: none; }
  #admin-view tr { border: 1px solid var(--g-bd); border-radius: var(--radius); padding: 0.4rem 0.6rem; margin-bottom: 0.6rem; background: var(--bg); }
  #admin-view td { border: 0; padding: 0.25rem 0; overflow-wrap: anywhere; }
  #admin-view td.actions { text-align: left; white-space: normal; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding-top: 0.5rem; border-top: 1px solid var(--g-bd); margin-top: 0.3rem; }
  #admin-view td.actions > * { min-height: 36px; }
  #admin-view td select { max-width: 100%; }
  .cell-body { max-width: 100%; }
  .chip { max-width: 100%; white-space: normal; }
  .chip button { min-width: 28px; min-height: 28px; }
  /* modals */
  .modal-overlay { padding: 0.5rem; align-items: flex-end; padding-bottom: calc(0.5rem + env(safe-area-inset-bottom)); }
  .modal-card { width: 100%; padding: 1rem; max-height: 90vh; overflow-y: auto; }
  .modal-card input, .modal-card select, .modal-card textarea { font-size: 16px; min-height: 44px; }
  .modal-actions .btn-modern { min-height: 44px; flex: 1; }
  #toasts { left: 0.75rem; right: 0.75rem; bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}
@media (max-width: 720px) and (pointer: coarse) { .modal-card textarea { resize: none; } }

/* ---------- admin providers ---------- */
.provider-card .provider-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; }
.provider-card .provider-head h3 { margin: 0; }
.provider-webhooks { margin: 0.75rem 0; }
.provider-webhooks .webhook-url { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.35rem; }
.provider-webhooks code { font-size: 0.75rem; word-break: break-all; background: var(--g-bg, transparent); padding: 0.2rem 0.4rem; border-radius: 4px; }
.row.tight { display: flex; gap: 0.5rem; align-items: center; }
.row.tight input { flex: 1; min-width: 0; }
@media (max-width: 720px) {
  .provider-webhooks .webhook-url { flex-direction: column; align-items: stretch; }
  .provider-webhooks .webhook-url .btn-modern { width: 100%; }
}
