:root {
  --control-height: 48px;
  --surface: #fff;
  --surface-muted: #f8fafc;
  --border: #e1e7f0;
  --border-strong: #cfd7e5;
  --text: #172033;
  --muted: #69758a;
  --primary: #3157d5;
  --primary-hover: #2749bc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #f6f8fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; background: #f6f8fb; }
a { color: #3157d5; text-decoration: none; }

.brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand img { display: block; width: clamp(124px, 12vw, 148px); height: auto; }

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  min-height: 76px;
  padding: 0 24px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid #e5e9f2;
  backdrop-filter: blur(16px);
}

.app-header-inner {
  width: min(1072px, 100%);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

.app-site-navigation { display: flex; align-items: center; gap: 24px; margin-left: auto; font-size: .9rem; }
.app-site-navigation a { color: #5b6679; }
.app-site-navigation a:hover { color: #172033; }
.header-brand { display: flex; align-items: center; flex: 0 0 auto; }
.account { display: flex; align-items: center; justify-content: flex-end; flex: 1 1 auto; min-width: 0; gap: 10px; margin-left: 8px; }
.account > span { display: inline-flex; min-height: 36px; max-width: 260px; min-width: 0; align-items: center; gap: 8px; padding: 0 12px; border-radius: 999px; color: #435067; background: #f1f4f8; font-size: .78rem; font-weight: 700; }
.account-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account > span::before { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #27ae60; box-shadow: 0 0 0 4px rgba(39,174,96,.08); content: ""; }
.account form { display: block; flex: 0 0 auto; margin: 0; }
.link-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.link-button .icon-logout { display: none; width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.auth { flex: 1; display: grid; place-content: center; gap: 24px; padding: 32px; }

.card { width: min(440px, calc(100vw - 40px)); padding: 34px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 50px rgba(26,39,73,.08); }
.card.wide { width: min(680px, calc(100vw - 40px)); }
.registration-card { width: min(560px, calc(100vw - 40px)); }
h1 { font-size: clamp(1.75rem, 3vw, 2.15rem); line-height: 1.1; margin: 7px 0 12px; letter-spacing: -.04em; color: #111a2d; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .7rem; color: #4263ce; }
.muted, small { color: var(--muted); }
.muted { line-height: 1.55; }

form { display: grid; gap: 16px; margin-top: 24px; min-width: 0; }
label { display: grid; min-width: 0; gap: 7px; color: #4f5b70; font-size: .82rem; font-weight: 700; }
input, select, textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 11px; color: var(--text); font: inherit; font-size: .92rem; background: var(--surface-muted); transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
input, select { height: var(--control-height); }
textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: #b9c4d5; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #5274dd; background: #fff; box-shadow: 0 0 0 3px rgba(82,116,221,.15); }
button, .button { display: inline-grid; min-height: var(--control-height); place-items: center; border: 1px solid transparent; border-radius: 11px; padding: 0 17px; color: #fff; background: var(--primary); box-shadow: 0 4px 12px rgba(49,87,213,.14); cursor: pointer; font: inherit; font-size: .9rem; font-weight: 750; text-align: center; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
button:hover, .button:hover { background: var(--primary-hover); box-shadow: 0 6px 18px rgba(49,87,213,.2); }
button:active, .button:active { transform: translateY(1px); }
.button.secondary { border-color: #d5def4; color: var(--primary); background: #eef3ff; box-shadow: none; }
.button.secondary:hover { border-color: #c4d0ef; background: #e3ebff; }
.foot { text-align: center; margin: 22px 0 0; font-size: .9rem; }
.form-between { display: flex; justify-content: flex-end; margin-top: -7px; font-size: .88rem; }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; inset: 4px 4px 4px auto; width: 40px; min-height: 0; padding: 0; color: #667085; background: transparent; box-shadow: none; font-size: 1rem; }
.password-toggle:hover { color: #3157d5; background: #eef4ff; box-shadow: none; }
.password-toggle:active { transform: none; }
.password-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; padding: 13px 15px; border-radius: 10px; background: #f8f9fc; border: 1px solid #e2e7f0; font-size: .82rem; color: #667085; }
.password-rules span::before { content: "○"; display: inline-block; width: 20px; }
.password-rules span.valid { color: #14753b; }
.password-rules span.valid::before { content: "✓"; }
.password-rules small { grid-column: 1 / -1; margin-top: 2px; }
.confirmation-field.match input { border-color: #35a463; background: #f5fff8; }
.confirmation-field.mismatch input { border-color: #d64b59; background: #fff8f8; }
.password-match { min-height: 18px; }
.password-match.match { color: #14753b; }
.password-match.mismatch { color: #b42332; }
.reset-code-input { text-align: center; letter-spacing: .12em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.auto-submit-status { min-height: 20px; margin: -5px 0 0; text-align: center; color: #667085; font-size: .82rem; }
.centered-card { text-align: center; }
.success-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 20px; border-radius: 50%; color: #fff; background: #20a05a; font-size: 1.8rem; font-weight: 800; }
.full-button { display: block; width: 100%; margin-top: 24px; }

.error, .success, .notice, .warning { padding: 13px 15px; border-radius: 10px; margin: 18px 0; }
.error { background: #fff0f1; color: #a3212e; border: 1px solid #facbd0; }
.success { background: #e9f8ef; color: #126c38; border: 1px solid #bfe6ce; }
.notice { background: #eef4ff; border: 1px solid #cedcff; }
.warning { background: #fff8e8; color: #764d00; border: 1px solid #f2daa2; }
.error p, .notice p, .warning p { margin: 7px 0 0; line-height: 1.5; }
.workspace-error-card { max-width: 720px; padding: 28px; border: 1px solid #f0c2c7; border-radius: 16px; background: #fff; box-shadow: 0 16px 42px rgba(81,26,34,.08); }
.workspace-error-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.workspace-error-mark { display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; color: #fff; background: #b42332; font-size: 1.7rem; font-weight: 850; box-shadow: 0 9px 22px rgba(180,35,50,.24); }
.workspace-error-heading h1 { margin: 0; }
.workspace-operation-error { border-left: 5px solid #b42332; }
.workspace-error-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.workspace-error-actions .button { display: inline-grid; place-items: center; min-height: 46px; }

.layout { flex: 1; width: 100%; display: grid; grid-template-columns: 224px minmax(0,1fr); gap: 40px; max-width: 1120px; margin: 40px auto 54px; padding: 0 24px; }
.layout .app-navigation { display: flex; flex-direction: column; gap: 5px; align-self: start; }
.app-navigation a { display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 10px 13px; border-radius: 11px; color: #5d687b; font-size: .88rem; font-weight: 620; transition: color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.app-navigation a:hover { color: #1d2a40; background: rgba(255,255,255,.78); }
.app-navigation a.active { color: #2e54c7; background: #eaf0ff; box-shadow: inset 0 0 0 1px rgba(74,105,207,.08); font-weight: 750; }
.app-navigation svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: #8a96aa; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .16s ease; }
.app-navigation a:hover svg { stroke: #52627b; }
.app-navigation a.active svg { stroke: #3157d5; }
.disabled { color: #98a2b3; }

.app-tabbar { display: none; }
.app-tabbar .tab, .tabbar-sheet a { display: flex; align-items: center; gap: 12px; color: #5d687b; font-size: .88rem; font-weight: 620; }
.app-tabbar svg, .tabbar-sheet svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: #8a96aa; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-tabbar svg.icon-dots { fill: #8a96aa; stroke: none; }
.app-tabbar .tab.active svg.icon-dots { fill: #3157d5; }
.app-tabbar .tab.active, .tabbar-sheet a.active { color: #2e54c7; font-weight: 750; }
.app-tabbar .tab.active svg, .tabbar-sheet a.active svg { stroke: #3157d5; }
.tabbar-sheet-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15,20,35,.32); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.tabbar-sheet-overlay.open { opacity: 1; pointer-events: auto; }
.tabbar-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; display: flex; flex-direction: column; gap: 3px; padding: 10px 10px calc(14px + env(safe-area-inset-bottom)); background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 30px rgba(20,25,45,.14); transform: translateY(100%); transition: transform .26s cubic-bezier(.32,.72,0,1); }
.tabbar-sheet.open { transform: translateY(0); }
.tabbar-sheet-grab { width: 34px; height: 4px; margin: 2px auto 10px; border-radius: 3px; background: #dde3ee; }
.tabbar-sheet a { min-height: 46px; padding: 0 11px; border-radius: 11px; }
.tabbar-sheet a:hover { background: #f6f8fc; }
.layout section { min-width: 0; }
.layout > section > .muted { max-width: 820px; margin: 0 0 28px; font-size: .92rem; }
.layout > section > h1 + .muted { margin-top: 0; }
.inline { display: grid; grid-template-columns: 1fr auto; align-items: end; max-width: 680px; }
.device-form { display: grid; grid-template-columns: minmax(170px,.7fr) minmax(240px,1fr) auto; align-items: end; max-width: 820px; }
.device-form > label { grid-template-rows: 22px auto; align-self: end; }
.device-form > label input, .device-form > label select { height: 48px; }
.device-form > button { min-height: 48px; }
.sms-compose-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
.sms-compose-form .sms-compose-message, .sms-compose-form > button { grid-column: 1 / -1; }
.sms-compose-form > button { width: 100%; }
.pairing-code { text-align: center; letter-spacing: .12em; font-size: 1.5rem; word-break: normal; }
.publication-form { display: grid; grid-template-columns: minmax(200px,1.35fr) minmax(155px,1fr) minmax(155px,1fr) 105px auto; align-items: end; }
.publication-form.automatic-name { grid-template-columns: minmax(180px,1fr) minmax(180px,1.2fr) 105px auto; }
.profile-form { max-width: 560px; }
.developer-card { width: 100%; max-width: none; margin-top: 28px; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.scope-fieldset { display: grid; gap: 10px; margin: 0; padding: 15px; border: 1px solid var(--border); border-radius: 12px; }
.scope-fieldset legend { padding: 0 6px; color: #4f5b70; font-size: .82rem; font-weight: 750; }
.secret-once code { display: block; margin-top: 12px; padding: 12px; overflow-wrap: anywhere; border-radius: 8px; color: #172033; background: #fff; }
.integration-app-list .button { margin-top: 12px; }
.integration-section { margin-top: 30px; }
.integration-section > h2 { margin-bottom: 6px; }
.integration-gateway { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--muted); }
.integration-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.integration-actions form { margin: 0; }
.integration-actions .button { min-height: 40px; margin: 0; }
.publication-form > label { grid-template-rows: 22px 48px; align-self: end; }
.publication-form > label input, .publication-form > label select, .publication-form .domain-input { height: 48px; }
.publication-form > button { min-height: 48px; align-self: end; }
.publication-form-access { grid-template-columns: minmax(220px,1.3fr) minmax(180px,1fr) minmax(180px,1fr) 105px; }
.publication-form-access.automatic-name { grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) 105px; }
.publication-form-access .access-mode-picker { grid-column: 1 / -1; }
.publication-form-access > button { grid-column: 1 / -1; justify-self: start; min-width: 220px; }
.access-mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 2px 0 0; padding: 0; border: 0; }
.access-mode-picker legend { margin-bottom: 9px; font-size: .9rem; font-weight: 650; }
.access-mode-option { display: block; cursor: pointer; }
.access-mode-option input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
.access-mode-option span { display: grid; gap: 7px; height: 100%; padding: 16px 18px; border: 1px solid #d8deea; border-radius: 13px; background: var(--surface-muted); transition: border-color .15s, box-shadow .15s, background .15s; }
.access-mode-option strong { display: flex; align-items: center; gap: 9px; }
.access-mode-option em { padding: 3px 7px; border-radius: 999px; color: #216e42; background: #ddf7e8; font-size: .68rem; font-style: normal; text-transform: uppercase; letter-spacing: .04em; }
.access-mode-option input:checked + span { border-color: #3157d5; box-shadow: 0 0 0 2px #3157d533; background: #f5f7ff; }
.access-mode-option input:focus-visible + span { outline: 3px solid #9db4ff; outline-offset: 2px; }
.access-mode-option small { line-height: 1.4; }
.form-hint { margin: 10px 0 0; color: #667085; font-size: .86rem; line-height: 1.5; }
.device-form,
.publication-form,
.workspace-create-form,
.search-form,
.sms-history-filters,
.profile-form,
.quota-form,
.location-frequency-form,
.member-form,
.workspace-member-form {
  max-width: none;
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(28,45,78,.055);
}
.profile-form { max-width: 600px; }
.form-hint { max-width: 820px; margin: 11px 2px 0; color: #748096; font-size: .8rem; }
.domain-input { display: flex; height: var(--control-height); align-items: center; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface-muted); overflow: hidden; transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease; }
.domain-input:focus-within { border-color: #5274dd; background: #fff; box-shadow: 0 0 0 3px rgba(82,116,221,.15); }
.domain-input input { min-width: 0; flex: 1 1 auto; border: 0; border-radius: 0; }
.domain-input span { flex: 0 0 auto; padding-right: 12px; color: #667085; white-space: nowrap; }

.list { display: grid; gap: 12px; margin-top: 28px; }
.list article { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 19px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 5px 18px rgba(28,45,78,.035); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.list article:hover { border-color: #ccd5e2; box-shadow: 0 9px 24px rgba(28,45,78,.065); transform: translateY(-1px); }
.list article > div:first-child { display: grid; gap: 6px; }
.list article form { margin: 0; }
.row-actions { display: flex; align-items: center; gap: 10px; }
.row-actions form { display: block; }
.row-actions button, .row-actions .button { min-height: 38px; padding: 0 12px; border-radius: 9px; box-shadow: none; font-size: .78rem; }
.resource-summary { display: flex !important; min-width: 0; align-items: flex-start; gap: 13px !important; }
.resource-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #5e6d83; background: #f0f3f8; }
.resource-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.resource-icon.publication { color: #3157d5; background: #edf2ff; }
.resource-icon.sms { color: #7456cb; background: #f2efff; }
.resource-icon.workspace { color: #9a6500; background: #fff6df; }
.resource-icon.macos { color: #5262aa; background: linear-gradient(145deg, #f0f3ff, #e6eafa); box-shadow: inset 0 0 0 1px #dce2f3; }
.resource-copy { display: grid; min-width: 0; gap: 6px; }
.resource-copy > strong, .publication-title strong { color: #172033; font-size: .97rem; }
.status { display: inline-flex; width: max-content; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid transparent; border-radius: 999px; background: #f1f3f6; color: #596274; font-size: .7rem; font-weight: 700; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; content: ""; }
.status.online { background: #e5f8ed; color: #14753b; }
.status.offline { background: #fff0f1; color: #a3212e; }
.status.revoked { background: #fff0f1; color: #a3212e; }
.status.sent, .status.delivered { background: #e5f8ed; color: #14753b; }
.status.received { background: #e8f4ff; color: #1769a8; }
.status.failed { background: #fff0f1; color: #a3212e; }
.status.queued, .status.claimed, .status.unknown, .status.canceled { background: #f1f3f6; color: #596274; }
.sms-gateway-number { display: block; width: max-content; color: #172033; font-size: 1.08rem; letter-spacing: .025em; }
.sms-message-list article { align-items: center; }
.sms-message-list article > div { flex: 1; min-width: 0; }
.sms-body { width: min(720px,100%); margin-top: 10px; }
.sms-body summary { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; overflow: hidden; border: 1px solid #e2e7f0; border-radius: 9px; color: #1b2538; background: #f8f9fc; cursor: pointer; list-style: none; }
.sms-body summary::-webkit-details-marker { display: none; }
.sms-body summary::after { content: ""; position: absolute; right: 84px; top: 0; bottom: 0; width: 54px; pointer-events: none; background: linear-gradient(90deg,transparent,#f8f9fc 80%); }
.sms-body-preview { min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.sms-body-action { position: relative; z-index: 1; color: #3157d5; font-size: .78rem; font-weight: 750; }
.sms-body-action::after { content: " ▾"; }
.sms-body[open] .sms-body-action { font-size: 0; }
.sms-body[open] .sms-body-action::before { content: "Скрыть"; font-size: .78rem; }
.sms-body[open] .sms-body-action::after { content: " ▴"; font-size: .78rem; }
.sms-body[open] summary::after { display: none; }
.sms-body-full { margin: 0; padding: 12px 13px 4px; white-space: pre-wrap; overflow-wrap: anywhere; animation: sms-body-reveal .18s ease-out; }
@keyframes sms-body-reveal { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .sms-body-full { animation: none; } }
.sms-history-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 26px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 28px rgba(28,45,78,.055); }
.sms-history-filters label { min-width: 0; }
.sms-history-filter-actions { display: flex; align-items: end; gap: 10px; }
.sms-history-filter-actions button, .sms-history-filter-actions .button { display: inline-grid; place-items: center; min-height: 48px; }
.gateway-detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.gateway-detail-heading h1 { margin-bottom: 8px; }
.gateway-detail { margin-top: 24px; }
.gateway-detail article { padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 28px rgba(28,45,78,.055); }
.gateway-phone-banner { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 8px; padding: 16px; border-radius: 12px; color: #2143ae; background: #eef3ff; }
.gateway-phone-banner span { font-weight: 700; }
.gateway-phone-banner strong { font-size: 1.45rem; letter-spacing: .035em; }
.gateway-properties { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; margin: 0; }
.gateway-properties > div { min-width: 0; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.gateway-properties dt { margin-bottom: 5px; color: #748096; font-size: .74rem; font-weight: 750; text-transform: uppercase; letter-spacing: .045em; }
.gateway-properties dd { margin: 0; color: #172033; overflow-wrap: anywhere; }
.gateway-properties .gateway-key { grid-column: 1 / -1; border-top: 1px solid var(--border); border-bottom: 0; }
.gateway-properties .gateway-sim-list { grid-column: 1 / -1; }
.gateway-sim-list dd { display: flex; flex-wrap: wrap; gap: 8px; }
.sim-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 10px; border: 1px solid #cfdbf6; border-radius: 999px; background: #f3f6ff; color: #2d56c8; font-size: .86rem; font-weight: 650; }
.gateway-connection-summary { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0; }
.gateway-connection-summary span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; background: #f2f4f8; color: #69768d; font-size: .78rem; font-weight: 700; }
.gateway-connection-summary i, .connection-state i { width: 7px; height: 7px; border-radius: 50%; background: #9aa4b5; box-shadow: 0 0 0 3px rgba(154,164,181,.13); }
.gateway-connection-summary .active { color: #177340; background: #e6f7ed; }
.gateway-connection-summary .active i { background: #43aa6f; box-shadow: 0 0 0 3px rgba(67,170,111,.14); }
.gateway-connections { margin: 26px 0; padding: 22px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(145deg,#fff 0%,#f8faff 100%); box-shadow: 0 10px 32px rgba(28,45,78,.06); }
.gateway-connections-heading, .api-connections-title, .api-client-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.gateway-connections-heading h2 { margin: 0; }
.gateway-connections-heading small, .api-client-heading small { color: #748096; }
.connection-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.connection-card { display: flex; align-items: flex-start; gap: 14px; padding: 17px; border: 1px solid #dce4f3; border-radius: 15px; background: #fff; }
.connection-card p, .api-connections-title p { margin: 4px 0 10px; color: #69768d; font-size: .9rem; }
.connection-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #315bd4; background: #edf2ff; font-size: .78rem; font-weight: 850; }
.connection-icon.wifi { color: #146b8a; background: #e8f7fb; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: #69768d; font-size: .85rem; font-weight: 750; }
.connection-state.online { color: #177340; }
.connection-state.online i { background: #43aa6f; box-shadow: 0 0 0 3px rgba(67,170,111,.14); }
.connection-state.pending { color: #946200; }
.connection-state.pending i { background: #e5a72a; box-shadow: 0 0 0 3px rgba(229,167,42,.14); }
.connection-state.offline, .connection-state.revoked { color: #a52830; }
.connection-state.offline i, .connection-state.revoked i { background: #d84b55; box-shadow: 0 0 0 3px rgba(216,75,85,.14); }
.api-connections { margin-top: 14px; padding: 18px; border: 1px solid #dce4f3; border-radius: 15px; background: #fff; }
.api-connections-title p { margin-bottom: 0; }
.connection-count { display: inline-grid; min-width: 34px; height: 34px; padding: 0 9px; place-items: center; border-radius: 999px; color: #315bd4; background: #edf2ff; font-weight: 800; }
.api-client-list { display: grid; gap: 10px; margin-top: 15px; }
.api-client-list article { padding: 14px; border: 1px solid #e3e9f4; border-radius: 12px; background: #fbfcff; }
.connection-properties { display: inline-flex; margin-top: 12px; }
.connection-secret-card { margin-top: 20px; }
.masked-secret, .api-secret-value code { display: block; overflow-wrap: anywhere; padding: 14px; border: 1px solid #dce4f3; border-radius: 12px; background: #f6f8fc; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.api-secret-value { display: grid; gap: 10px; }
.scope-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.scope-list span { padding: 4px 9px; border-radius: 999px; color: #315bd4; background: #edf2ff; font-size: .78rem; font-weight: 700; }
.empty.compact { margin-top: 14px; padding: 14px; }
@media (max-width: 720px) { .connection-grid { grid-template-columns: 1fr; } .gateway-connections-heading, .api-client-heading { flex-direction: column; gap: 5px; } }
.gateway-privacy-note { margin: 14px 16px 0; }
.gateway-key dd { font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: .78rem; }
.gateway-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.gateway-stats article { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.gateway-stats strong { color: #3157d5; font-size: 1.55rem; }
.gateway-stats span { color: #172033; font-weight: 750; }
.gateway-stats small { color: #748096; }
.publication-main { display: grid; gap: 7px; min-width: 0; }
.publication-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.publication-title strong { overflow-wrap: anywhere; }
.access-badge { display: inline-flex; width: max-content; padding: 4px 8px; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.access-badge.protected { color: #17623a; background: #e0f5e8; }
.access-badge.public { color: #855d08; background: #fff1cd; }
.compact-button { min-height: 38px; padding: 0 12px; border-radius: 9px; box-shadow: none; font-size: .78rem; }
.access-card { text-align: center; }
.access-shield { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 18px; color: #fff; background: linear-gradient(145deg,#3157d5,#2143ae); box-shadow: 0 12px 28px #3157d540; font-size: 1.8rem; font-weight: 850; }
.access-service { display: grid; gap: 5px; margin: 22px 0; padding: 18px; border: 1px solid #d8deea; border-radius: 12px; background: #f8faff; }
.access-service span { color: #667085; overflow-wrap: anywhere; }
.access-card .notice { text-align: left; }
.danger, .link-button { min-height: 38px; padding: 0 12px; border-radius: 9px; color: #a3212e; background: transparent; box-shadow: none; font-size: .78rem; }
.button.danger { border-color: #facbd0; color: #a3212e; background: #fff0f1; }
.danger:hover { color: #8e1c28; background: #fff0f1; box-shadow: none; }
.button.danger:hover { border-color: #efb6bd; background: #ffe7e9; }
.link-button { min-height: 36px; border: 1px solid #e2aeb4; background: #fff7f8; white-space: nowrap; }
.link-button:hover { color: #8e1c28; background: #ffedef; border-color: #cf7781; box-shadow: none; }
.danger:active, .link-button:active { transform: none; }
.danger-solid { border-color: #b42332; background: #b42332; }
.danger-solid:hover { border-color: #981e2a; background: #981e2a; }
.empty { padding: 30px; text-align: center; color: #667085; background: #fff; border: 1px dashed #cfd6e4; border-radius: 14px; }
pre { padding: 16px; overflow: auto; border-radius: 12px; background: #172033; color: #fff; font-size: .9rem; white-space: pre-wrap; word-break: break-all; }

.confirm-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.confirm-actions form { display: block; margin: 0; }
.confirm-actions button, .confirm-actions .button { min-width: 190px; }

.search-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; align-items: end; max-width: 780px; }
.admin-user-form { width: 100%; max-width: none; }
.search-form .button { min-height: 48px; display: inline-grid; place-items: center; }
.table-wrap { margin-top: 28px; overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(28,45,78,.035); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #e8ecf3; white-space: nowrap; }
th { color: #667085; background: #f8f9fc; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: 0; }
.table-empty { padding: 32px; color: #667085; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; color: #667085; font-size: .9rem; }
.pagination > div { display: flex; gap: 8px; }
.pagination .button { min-height: 40px; padding: 0 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 26px 0 36px; }
.stat-grid.access-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.stat-grid > div { display: grid; gap: 5px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 5px 18px rgba(28,45,78,.035); }
.stat-grid strong { font-size: 1.45rem; overflow-wrap: anywhere; }
.stat-grid span { color: #667085; font-size: .82rem; }
.inline-action { display: block; margin: 0 0 30px; }
.member-form { margin-bottom: 26px; }
h2 { margin: 40px 0 0; color: #1c2639; font-size: 1.2rem; letter-spacing: -.02em; }
.location-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 24px 0 18px; }
.location-grid > div { display: grid; gap: 7px; padding: 18px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 5px 18px rgba(28,45,78,.035); }
.location-grid span { color: #667085; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.location-grid strong { font-size: 1.12rem; overflow-wrap: anywhere; }
.location-grid small { color: #667085; }
.phone-map { margin: 0 0 18px; overflow: hidden; border: 1px solid #d8deea; border-radius: 12px; background: #eef1f6; }
.phone-map iframe { display: block; width: 100%; height: 420px; border: 0; }
.location-frequency-form { margin-top: 18px; }
.phone-back-link { margin-top: 24px; }
.frequency-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.frequency-options label { display: block; cursor: pointer; }
.frequency-options input { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
.frequency-options span { display: grid; gap: 5px; height: 100%; padding: 14px; border: 1px solid #d8deea; border-radius: 13px; background: var(--surface-muted); transition: border-color .15s, box-shadow .15s, background .15s; }
.frequency-options small { color: #667085; line-height: 1.35; }
.frequency-options input:checked + span { border-color: #3157d5; box-shadow: 0 0 0 2px #3157d533; background: #f5f7ff; }
.frequency-options input:focus-visible + span { outline: 3px solid #9db4ff; outline-offset: 2px; }
.frequency-options .battery-hot-1 span { border-color: #e8adb2; background: #fff7f7; }
.frequency-options .battery-hot-2 span { border-color: #df7f88; background: #fff0f1; }
.frequency-options .battery-hot-3 span { border-color: #c94350; background: #ffe5e8; color: #8f1824; }
.frequency-options .battery-hot input:checked + span { border-color: #b42332; box-shadow: 0 0 0 2px #b4233238; }
.battery-warning { border-color: #e9a5ac; background: #fff0f1; color: #8f1824; }
.compact-list { margin-top: 14px; }
.recorder-panel { margin-top: 18px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 5px 18px rgba(28,45,78,.035); }
.recorder-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.status.recording { background: #fff0f1; color: #a3212e; }
.recorder-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.recorder-actions form { display: block; margin: 0; }
.command-wait { display: flex; align-items: center; gap: 9px; margin: 14px 0 0; color: #3157d5; font-weight: 700; }
.command-wait-dot { width: 10px; height: 10px; border-radius: 50%; background: #3157d5; box-shadow: 0 0 0 5px #3157d522; animation: command-pulse 1.2s ease-in-out infinite; }
@keyframes command-pulse { 50% { opacity: .35; transform: scale(.8); } }
.secondary-action { color: #3157d5; background: #e9efff; }
button:disabled { cursor: not-allowed; opacity: .45; }
.legal-acceptances { display: grid; gap: 13px; margin: 2px 0 0; padding: 16px; border: 1px solid #d8deea; border-radius: 12px; background: #f8faff; }
.legal-acceptances legend { padding: 0 6px; font-size: .82rem; font-weight: 750; color: #667085; }
.checkbox-field, .legal-checkbox { display: grid; grid-template-columns: 21px minmax(0, 1fr); gap: 10px; align-items: start; font-weight: 500; line-height: 1.45; cursor: pointer; }
/* Native checkboxes must not inherit text-field padding and full-width sizing. */
.checkbox-field input[type="checkbox"], .legal-checkbox input { width: 19px; height: 19px; min-width: 0; min-height: 0; padding: 0; margin: 2px 0 0; accent-color: #3157d5; }
.legal-checkbox a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.legal-acceptance-list { display: grid; gap: 10px; margin-top: 18px; }
.legal-acceptance-list article { padding: 16px 18px; border: 1px solid #d8deea; border-radius: 12px; background: #fff; }
.legal-acceptance-list article > div { display: grid; gap: 6px; }
.legal-acceptance-list span, .legal-acceptance-list small { color: #667085; line-height: 1.45; }
.legal-acceptance-list code { overflow-wrap: anywhere; font-size: .78rem; color: #3d4a61; }
.registration-progress { min-height: 390px; align-content: center; text-align: center; }
.registration-spinner { width: 64px; height: 64px; margin: 0 auto 26px; border: 6px solid #dce5ff; border-top-color: #3157d5; border-radius: 50%; animation: registration-spin .8s linear infinite; }
.registration-progress-note { margin: 20px 0 0; color: #667085; font-size: .86rem; }
@keyframes registration-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .registration-spinner { animation-duration: 1.8s; } }
.upload-setting { grid-template-columns: 1fr auto; align-items: end; padding: 18px 20px; border: 1px solid #d8deea; border-radius: 12px; background: #fff; }
.upload-setting label { display: grid; grid-template-columns: 22px 1fr; align-items: start; }
.storage-options { display: grid; gap: 16px; }
.upload-setting input { width: 20px; height: 20px; margin: 2px 0 0; }
.upload-setting span { display: grid; gap: 4px; }
.recordings-list { display: grid; gap: 10px; margin-top: 18px; }
.recordings-list article { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border: 1px solid #e2e7f0; border-radius: 12px; background: #fff; }
.recordings-list article > div:first-child { display: grid; gap: 5px; min-width: 0; }
.recordings-list strong { overflow-wrap: anywhere; }
.recordings-list audio { width: min(520px, 100%); margin-top: 6px; }
.workspace-create-form { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; align-items: end; }
.workspace-create-form > label { grid-template-rows: 22px 48px; align-self: end; }
.workspace-create-form > label input, .workspace-create-form > label select { height: 48px; }
.workspace-create-form > button { min-height: 48px; }
.workspace-meta, .workspace-file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 22px; color: #667085; font-size: .85rem; }
.workspace-search { display: grid; grid-template-columns: minmax(220px,1fr) auto; align-items: end; max-width: 680px; }
.workspace-search > button { min-height: 48px; }
.workspace-breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; margin: 24px 0 10px; color: #667085; }
.workspace-file { min-height: 280px; max-height: 70vh; white-space: pre-wrap; word-break: normal; }
.workspace-preview-image { display: block; max-width: 100%; max-height: 75vh; object-fit: contain; margin: 20px auto; }
.workspace-preview-pdf { width: 100%; height: 75vh; min-height: 400px; border: 1px solid #d8e0ef; border-radius: 12px; background: white; }
.workspace-write-panel { margin-top: 22px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.workspace-write-panel summary { cursor: pointer; font-weight: 750; }
.workspace-member-form { display: grid; grid-template-columns: 1fr 220px auto; align-items: end; max-width: 820px; }
.workspace-member-form > label { grid-template-rows: 22px 48px; align-self: end; }
.workspace-member-form > label input, .workspace-member-form > label select { height: 48px; }
.workspace-member-form > button { min-height: 48px; align-self: end; }
.workspace-access-form { display: block; margin: 0; }
.quota-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.quota-form fieldset { display: grid; grid-template-columns: minmax(180px,1fr) 110px; gap: 10px; margin: 0; padding: 16px; border: 1px solid #d8deea; border-radius: 12px; background: #fff; }
.quota-form legend { padding: 0 5px; font-size: .9rem; font-weight: 700; }
.quota-form select, .quota-form input { height: 48px; }
.quota-form > button { grid-column: 1 / -1; justify-self: start; min-height: 48px; }

.app-footer { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 34px; border-top: 1px solid #e2e7f0; color: #667085; font-size: .82rem; }
.app-footer-grid { display: grid; grid-template-columns: minmax(220px, 1.35fr) repeat(2, minmax(180px, 1fr)); align-items: start; gap: 46px; }
.app-footer-brand img { display: block; width: 112px; height: auto; }
.app-footer-brand p { max-width: 260px; margin: 14px 0 0; color: #7b8496; line-height: 1.55; }
.app-footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.app-footer-links a { color: #526079; line-height: 1.4; transition: color .16s ease, transform .16s ease; }
.app-footer-links a:hover { color: #3157d5; transform: translateX(2px); }
.app-footer-heading { margin-bottom: 4px; color: #8993a7; font-size: .7rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.app-footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 30px; padding-top: 22px; border-top: 1px solid #e9edf4; color: #8993a7; font-size: .75rem; }

@media (prefers-reduced-motion: reduce) {
  button, .button, input, select, textarea, .app-navigation a, .app-navigation svg, .list article, .app-footer-links a { transition: none; }
  button:active, .button:active, .list article:hover, .app-footer-links a:hover { transform: none; }
  .tabbar-sheet, .tabbar-sheet-overlay { transition: none; }
}

@media (max-width: 1180px) {
  .publication-form, .publication-form.automatic-name { grid-template-columns: 1fr 1fr; }
  .publication-form button { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .app-header { padding: 0 16px; }
  .app-header-inner { min-height: 70px; gap: 12px; }
  .header-brand { margin-left: 8px; }
  .brand img { width: 96px; }
  .app-site-navigation { display: none; }
  .account { gap: 7px; }
  .account > span { max-width: none; min-height: 34px; padding: 0 9px; font-size: .73rem; }
  .link-button { min-height: 34px; width: 34px; padding: 0; border-radius: 50%; }
  .link-button span { display: none; }
  .link-button .icon-logout { display: block; }
  .layout { grid-template-columns: 1fr; margin-top: 24px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .layout .app-navigation { display: none; }
  .app-tabbar { display: flex; align-items: stretch; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(16px); border-top: 1px solid #e5e9f2; }
  .app-tabbar .tab { flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; min-height: 0; padding: 6px 2px; border: none; background: none; font-size: .64rem; cursor: pointer; }
  .app-tabbar .tab span { font-size: .64rem; }
  .inline, .device-form, .publication-form { grid-template-columns: 1fr; }
	.workspace-create-form, .workspace-search, .workspace-member-form { grid-template-columns: 1fr; }
	.quota-form { grid-template-columns: 1fr; }
	.quota-form fieldset { grid-template-columns: 1fr; }
  .publication-form.automatic-name, .search-form { grid-template-columns: 1fr; }
	.publication-form-access, .publication-form-access.automatic-name, .access-mode-picker { grid-template-columns: 1fr; }
  .publication-form button { grid-column: auto; }
  .list article { flex-direction: column; align-items: stretch; gap: 14px; }
  .row-actions { flex-wrap: wrap; align-items: stretch; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
  .row-actions > a, .row-actions > form { flex: 1 1 130px; }
  .row-actions button, .row-actions .button { width: 100%; min-height: 42px; font-size: .82rem; }
  .card { padding: 25px; }
  .confirm-actions { align-items: stretch; flex-direction: column; }
  .confirm-actions button, .confirm-actions .button { width: 100%; }
  .app-footer { width: calc(100% - 32px); }
  .app-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .app-footer-bottom { align-items: flex-start; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
	.stat-grid.access-stats { grid-template-columns: 1fr; }
  .location-grid { grid-template-columns: 1fr 1fr; }
  .upload-setting { grid-template-columns: 1fr; }
  .recorder-heading, .recordings-list article { align-items: flex-start; flex-direction: column; }
  .phone-map iframe { height: 330px; }
  .frequency-options { grid-template-columns: 1fr 1fr; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .sms-history-filters { grid-template-columns: 1fr; }
  .gateway-detail-heading { align-items: flex-start; flex-direction: column; }
  .gateway-properties, .gateway-stats { grid-template-columns: 1fr; }
  .gateway-properties .gateway-key, .gateway-properties .gateway-sim-list { grid-column: auto; }
  .gateway-properties > div { border-bottom: 1px solid var(--border); }
  .gateway-properties > div:last-child { border-bottom: 0; }
  .password-rules { grid-template-columns: 1fr; }
  .password-rules small { grid-column: auto; }
}
