:root {
  --navy: #071d3a;
  --navy-2: #0b2f58;
  --sky: #4bb7e8;
  --sky-soft: #dff5ff;
  --gold: #c99a2e;
  --gold-soft: #fff3ce;
  --ivory: #fffaf0;
  --ink: #102033;
  --muted: #687789;
  --line: rgba(7, 29, 58, .13);
  --panel: rgba(255, 250, 240, .93);
  --danger: #c03546;
  --ok: #0f8f70;
  --warn: #a86506;
  --shadow: 0 18px 45px rgba(7, 29, 58, .14);
  --tier-accent: var(--sky);
  --tier-soft: var(--sky-soft);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  background:
    linear-gradient(120deg, rgba(7, 29, 58, .96), rgba(11, 47, 88, .88) 44%, rgba(75, 183, 232, .64)),
    linear-gradient(180deg, #fffaf0, #dff5ff);
}

.tier-none {
  --tier-accent: var(--sky);
  --tier-soft: var(--sky-soft);
}

.tier-trial {
  --tier-accent: #c99a2e;
  --tier-soft: #fff3ce;
}

.tier-civil {
  --tier-accent: #2f9fd3;
  --tier-soft: #dff5ff;
}

.tier-commercial {
  --tier-accent: #0f8f70;
  --tier-soft: #dff8ef;
}

.tier-military {
  --tier-accent: #5d6780;
  --tier-soft: #eef1f5;
}

.tier-government {
  --tier-accent: #7c5a12;
  --tier-soft: #fff0c7;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px 1fr;
}

.sidebar {
  color: white;
  padding: 22px 18px;
  border-right: 1px solid rgba(255, 255, 255, .16);
  background: rgba(7, 29, 58, .72);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  color: var(--navy);
  font-weight: 900;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), var(--ivory) 58%, var(--tier-accent));
  box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.brand p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, .68);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav button {
  width: 100%;
  height: 43px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: rgba(255, 255, 255, .78);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  color: white;
  border-color: rgba(255, 255, 255, .2);
  background: color-mix(in srgb, var(--tier-accent) 34%, transparent);
}

.side-card {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
}

.side-card strong {
  display: block;
  margin-bottom: 8px;
}

.side-card p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  line-height: 1.45;
}

.main {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h2 {
  margin: 0;
  color: white;
  font-size: clamp(24px, 4vw, 40px);
  line-height: 1.05;
}

.topbar p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .78);
  max-width: 720px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--navy);
  background: var(--ivory);
  box-shadow: 0 8px 18px rgba(7, 29, 58, .12);
  text-decoration: none;
}

.btn.primary {
  color: white;
  border-color: rgba(255, 255, 255, .22);
  background: linear-gradient(135deg, var(--navy), var(--tier-accent));
}

.btn.gold {
  color: var(--navy);
  border-color: rgba(201, 154, 46, .45);
  background: linear-gradient(135deg, #f8d982, var(--gold));
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
}

.panel,
.stat,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.stat {
  padding: 16px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 9px;
  color: var(--tier-accent);
  font-size: 27px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 520px;
  overflow: hidden;
  padding: 0;
}

.chat-layout.in-call {
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.app-shell:has(.chat-layout.in-call) {
  grid-template-columns: 1fr;
}

.app-shell:has(.chat-layout.in-call) .sidebar,
.main:has(.chat-layout.in-call) .topbar {
  display: none;
}

.main:has(.chat-layout.in-call) {
  padding: 0;
}

.chat-layout.in-call .channel-list,
.chat-layout.in-call .notification-strip,
.chat-layout.in-call .typing-strip,
.chat-layout.in-call .messages,
.chat-layout.in-call .composer,
.chat-layout.in-call .sync-panel {
  display: none;
}

.chat-layout.in-call .chat-pane {
  min-height: 100vh;
  grid-template-rows: 1fr;
}

.chat-layout.in-call .chat-head {
  display: none;
}

.chat-layout.in-call .chat-head strong,
.chat-layout.in-call .profile-line {
  color: white;
}

.channel-list {
  padding: 12px;
  border-right: 1px solid var(--line);
  background: rgba(223, 245, 255, .65);
}

.search-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.field.compact {
  min-height: 38px;
  padding: 8px 10px;
}

.mini-title {
  margin: 12px 2px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.recent-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.recent-contact {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--navy);
  background: rgba(255, 255, 255, .55);
  text-align: left;
}

.recent-contact:hover {
  border-color: rgba(75, 183, 232, .45);
  background: white;
}

.recent-contact.selected {
  border-color: var(--sky);
  background: white;
  box-shadow: inset 3px 0 0 var(--sky);
}

.recent-contact strong,
.recent-contact small {
  display: block;
}

.recent-contact small {
  max-width: 130px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-contact b {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--danger);
  font-size: 12px;
}

.avatar {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--tier-accent));
  font-size: 12px;
  font-weight: 900;
}

.avatar.online::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid white;
  border-radius: 999px;
  background: #19b857;
}

.channel {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  margin-bottom: 7px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--navy);
  background: transparent;
  text-align: left;
}

.channel.active,
.channel:hover {
  border-color: rgba(75, 183, 232, .55);
  background: white;
}

.badge {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--sky);
  font-size: 12px;
  font-weight: 700;
}

.chat-pane {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.chat-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-head strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
}

.messages {
  min-height: 320px;
  max-height: 520px;
  overflow: auto;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .42);
}

.notification-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 243, 206, .55);
}

.notification-strip span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(201, 154, 46, .24);
  border-radius: 999px;
  color: var(--navy);
  background: white;
  font-size: 12px;
}

.message {
  max-width: 78%;
  margin-bottom: 12px;
  padding: 11px 13px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}

.message.me {
  margin-left: auto;
  color: white;
  background: linear-gradient(135deg, var(--navy-2), var(--tier-accent));
}

.message small {
  display: block;
  margin-bottom: 5px;
  opacity: .72;
}

.message-text {
  overflow-wrap: anywhere;
}

.attachment-chip,
.seen-status {
  margin-top: 8px;
  font-size: 12px;
}

.attachment-chip {
  padding: 7px 9px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
}

.attachment-chip span,
.seen-status {
  opacity: .78;
}

.seen-icon {
  min-width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.message-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.message-tools a,
.message-tools .link-btn {
  color: inherit;
  text-decoration: underline;
  opacity: .9;
}

.profile-line {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.typing-strip {
  display: none;
  padding: 8px 18px;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 243, 206, .72);
  font-size: 13px;
  font-weight: 700;
}

.typing-strip.show {
  display: block;
}

.danger-btn {
  color: white;
  border-color: rgba(192, 53, 70, .35);
  background: var(--danger);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.composer-toolbar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.composer-toolbar .btn {
  padding: 8px 10px;
}

.composer-toolbar span,
.composer-hint {
  color: var(--muted);
  font-size: 12px;
}

.composer-hint {
  grid-column: 1 / -1;
  margin: -2px 0 0;
}

.sync-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(223, 245, 255, .52);
}

.sync-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sync-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.conversation-output-toggle,
.assistant-output-panel {
  margin-top: 16px;
}

.hidden-during-call {
  display: none;
}

.output-toggle-button {
  width: 100%;
  min-height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-color: rgba(201, 154, 46, .38);
  color: var(--navy);
  background: linear-gradient(135deg, #fffaf0, var(--gold-soft));
  font-size: 16px;
  font-weight: 900;
}

.output-toggle-button span {
  color: var(--muted);
  font-size: 13px;
}

.output-drawer {
  margin-top: 10px;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.field,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: white;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.full {
  grid-column: 1 / -1;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.item strong {
  color: var(--navy);
}

.item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--tier-soft);
  font-size: 12px;
  font-weight: 700;
}

.pill.gold {
  background: var(--gold-soft);
}

.pill.danger {
  color: white;
  background: var(--danger);
}

.pill.ok {
  color: white;
  background: var(--ok);
}

.map {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(7, 29, 58, .16);
  background:
    linear-gradient(rgba(7, 29, 58, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 29, 58, .08) 1px, transparent 1px),
    radial-gradient(circle at 28% 40%, rgba(75, 183, 232, .75), transparent 16%),
    radial-gradient(circle at 72% 62%, rgba(201, 154, 46, .58), transparent 18%),
    linear-gradient(135deg, #eefbff, #fffaf0);
  background-size: 40px 40px, 40px 40px, auto, auto, auto;
}

.world-map {
  min-height: 390px;
  background:
    linear-gradient(rgba(7, 29, 58, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 29, 58, .08) 1px, transparent 1px),
    radial-gradient(ellipse at 18% 42%, rgba(47, 159, 211, .28) 0 10%, transparent 11%),
    radial-gradient(ellipse at 48% 33%, rgba(15, 143, 112, .2) 0 9%, transparent 10%),
    radial-gradient(ellipse at 60% 48%, rgba(201, 154, 46, .24) 0 8%, transparent 9%),
    radial-gradient(ellipse at 76% 61%, rgba(47, 159, 211, .25) 0 9%, transparent 10%),
    linear-gradient(135deg, #eefbff, #fffaf0);
  background-size: 36px 36px, 36px 36px, auto, auto, auto, auto, auto;
}

.node {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 8px rgba(15, 143, 112, .16);
}

.node.warn {
  background: var(--warn);
  box-shadow: 0 0 0 8px rgba(168, 101, 6, .18);
}

.node.danger {
  background: var(--danger);
  box-shadow: 0 0 0 8px rgba(192, 53, 70, .17);
}

.map-pin {
  position: absolute;
  transform: translate(-7px, -7px);
  z-index: 2;
}

.map-pin .node {
  position: relative;
  display: block;
}

.map-pin.danger .node {
  animation: pulse-danger 1.45s infinite;
}

.pin-label {
  min-width: 148px;
  margin-top: 8px;
  padding: 8px 9px;
  border: 1px solid rgba(7, 29, 58, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 10px 24px rgba(7, 29, 58, .12);
}

.pin-label strong {
  display: block;
  color: var(--navy);
  font-size: 12px;
}

.pin-label small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.threat-card {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: calc(100% - 28px);
  padding: 12px;
  border: 1px solid rgba(192, 53, 70, .32);
  border-radius: 8px;
  color: var(--navy);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.threat-card strong {
  color: var(--danger);
}

.threat-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

@keyframes pulse-danger {
  0% { box-shadow: 0 0 0 6px rgba(192, 53, 70, .2); }
  70% { box-shadow: 0 0 0 18px rgba(192, 53, 70, 0); }
  100% { box-shadow: 0 0 0 6px rgba(192, 53, 70, 0); }
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plans.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.plan {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  border-top: 5px solid var(--tier-accent);
}

.plan-trial {
  --tier-accent: #c99a2e;
  --tier-soft: #fff3ce;
}

.plan-civil {
  --tier-accent: #2f9fd3;
  --tier-soft: #dff5ff;
}

.plan-commercial {
  --tier-accent: #0f8f70;
  --tier-soft: #dff8ef;
}

.plan-military {
  --tier-accent: #5d6780;
  --tier-soft: #eef1f5;
}

.plan-government {
  --tier-accent: #7c5a12;
  --tier-soft: #fff0c7;
}

.plan h4 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 20px;
}

.price {
  margin: 0 0 12px;
  color: var(--tier-accent);
  font-size: 26px;
  font-weight: 900;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(7, 29, 58, .94), rgba(47, 159, 211, .72)),
    linear-gradient(180deg, var(--ivory), var(--sky-soft));
}

.auth-panel {
  width: min(480px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 8px;
  background: rgba(255, 250, 240, .96);
  box-shadow: var(--shadow);
}

.auth-brand {
  color: var(--navy);
  margin-bottom: 24px;
}

.auth-panel h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 28px;
}

.auth-panel p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.login-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.login-mode button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: white;
  font-weight: 800;
}

.login-mode button.active {
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--tier-accent));
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.username-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.username-row span {
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--tier-soft);
  font-weight: 800;
}

.account-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--tier-soft) 55%, white);
}

.account-summary p {
  margin: 4px 0 8px;
  color: var(--muted);
}

.password-required {
  margin-bottom: 16px;
  border-color: rgba(192, 53, 70, .28);
  background: linear-gradient(135deg, rgba(255, 243, 206, .96), rgba(255, 255, 255, .94));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 29, 58, .62);
}

.password-modal {
  width: min(620px, 100%);
  box-shadow: var(--shadow);
}

.reset-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(47, 159, 211, .28);
  border-radius: 8px;
  background: rgba(223, 245, 255, .72);
}

.reset-box p {
  margin: 0;
}

.directory-search {
  max-width: 680px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.directory-card {
  display: grid;
  gap: 9px;
  align-content: start;
  min-height: 210px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .74);
}

.directory-card small,
.directory-card p {
  color: var(--muted);
  line-height: 1.4;
}

.directory-card p {
  margin: 0;
}

.directory-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.link-btn {
  margin-top: 14px;
  border: 0;
  padding: 0;
  color: var(--navy-2);
  background: transparent;
  font-weight: 700;
}

.account-card .btn,
.side-card .btn {
  width: 100%;
}

.tier-chip {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 8px;
  color: white;
  background: color-mix(in srgb, var(--tier-accent) 44%, rgba(7, 29, 58, .38));
  box-shadow: 0 8px 18px rgba(7, 29, 58, .12);
}

.call-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--tier-accent));
  cursor: pointer;
}

.icon-btn svg,
.call-tool svg,
.call-menu-panel svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-only {
  width: 42px;
  padding: 0;
}

.call-menu {
  position: relative;
}

.phone-btn {
  min-width: 48px;
}

.call-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: none;
  min-width: 158px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.call-menu-panel.open {
  display: grid;
}

.call-menu-panel button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  color: white;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.call-menu-panel button:hover {
  background: rgba(255, 255, 255, .12);
}

.call-stage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(7, 29, 58, .96), rgba(17, 41, 68, .96));
  color: white;
}

.incoming-call-banner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  margin: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 143, 112, .32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(7, 29, 58, .96), rgba(15, 143, 112, .86));
  color: white;
  box-shadow: 0 16px 34px rgba(7, 29, 58, .18);
}

.incoming-call-banner strong,
.incoming-call-banner span {
  display: block;
}

.incoming-call-banner span {
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
}

.ring-pulse {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(226, 21, 33, .5);
  animation: ringPulse 1s infinite;
}

.ring-pulse svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn.danger {
  color: white;
  background: var(--red);
}

@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(226, 21, 33, .45); }
  70% { box-shadow: 0 0 0 12px rgba(226, 21, 33, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 21, 33, 0); }
}

.call-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(3, 18, 36, .82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

.call-tool {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(7, 29, 58, .14);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--navy);
  background: white;
  font-weight: 900;
  cursor: pointer;
}

.call-tool.active,
.call-tool:hover {
  color: white;
  background: linear-gradient(135deg, var(--navy), var(--tier-accent));
}

.call-tool.danger {
  color: white;
  background: linear-gradient(135deg, #8d121a, var(--red));
}

.call-tool.wide {
  min-width: 210px;
}

.participants-icon {
  min-width: 64px;
  padding-inline: 10px;
}

.end-call {
  margin-left: auto;
  color: white;
  background: linear-gradient(135deg, #b80f1b, var(--red));
  border-color: rgba(255, 255, 255, .18);
  box-shadow: 0 10px 22px rgba(226, 21, 33, .28);
}

.call-meeting-surface {
  min-height: min(72vh, 720px);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr);
  gap: 12px;
}

.chat-layout.in-call .call-stage {
  position: relative;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  border-bottom: 0;
  border-radius: 0;
  background: #020812;
}

.chat-layout.in-call .call-meeting-surface {
  min-height: 100vh;
  grid-template-columns: 1fr;
  gap: 0;
}

.chat-layout.in-call .call-stage.with-chat .call-meeting-surface {
  grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
}

.chat-layout.in-call .call-toolbar {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 8;
  transform: translateX(-50%);
  justify-content: center;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 8px;
  border-radius: 999px;
  background: rgba(5, 12, 24, .82);
  backdrop-filter: blur(12px);
}

.chat-layout.in-call .call-select {
  display: none;
}

.chat-layout.in-call .camera-toolbar-select {
  width: min(220px, 34vw);
  display: block;
  border-radius: 999px;
}

.chat-layout.in-call .participants-panel {
  display: none;
}

.chat-layout.in-call .call-status {
  position: absolute;
  left: 14px;
  bottom: 20px;
  z-index: 7;
}

.chat-layout.in-call .call-status .pill:not(:first-child) {
  display: none;
}

.chat-layout.in-call .call-tool {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
}

.chat-layout.in-call .call-tool span,
.chat-layout.in-call .end-call span {
  display: none;
}

.chat-layout.in-call .end-call {
  margin-left: 0;
  background: var(--red);
  box-shadow: 0 10px 26px rgba(226, 21, 33, .35);
}

.chat-layout.in-call .participants-icon {
  min-width: 44px;
}

.chat-layout.in-call .call-menu-panel {
  top: auto;
  bottom: calc(100% + 8px);
}

.chat-layout.in-call .call-chat-panel {
  position: relative;
  z-index: 5;
  margin: 12px 12px 12px 0;
  max-height: calc(100vh - 235px);
}

.chat-layout.in-call .primary-tile {
  border: 0;
  border-radius: 0;
  background: #020812;
}

.chat-layout.in-call .video-tile {
  padding: 0;
}

.chat-layout.in-call .video-tile video,
.chat-layout.in-call .profile-only {
  min-height: 100vh;
  border-radius: 0;
}

.chat-layout.in-call .video-tile > span,
.chat-layout.in-call .video-tile > strong,
.chat-layout.in-call .camera-tools,
.chat-layout.in-call .camera-select,
.chat-layout.in-call .video-tile > small {
  position: absolute;
  left: 14px;
  z-index: 6;
}

.chat-layout.in-call .video-tile > span {
  bottom: 52px;
}

.chat-layout.in-call .video-tile > strong {
  bottom: 28px;
}

.chat-layout.in-call .camera-tools,
.chat-layout.in-call .camera-select,
.chat-layout.in-call .video-tile > small {
  display: none;
}

.call-stage.with-chat .call-meeting-surface {
  grid-template-columns: minmax(0, 1.28fr) minmax(250px, .52fr) minmax(290px, .58fr);
}

.call-select {
  min-height: 40px;
  border: 1px solid rgba(7, 29, 58, .14);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--navy);
  background: white;
  font-weight: 800;
}

.call-select.compact {
  max-width: 118px;
}

.call-tool-panel {
  right: auto;
  left: 0;
}

.participants-menu-panel {
  width: min(320px, 78vw);
  right: auto;
  left: 0;
  max-height: 320px;
  overflow-y: auto;
}

.participants-menu-panel button span:last-child {
  display: grid;
  gap: 2px;
}

.participants-menu-panel small {
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
}

.menu-title,
.menu-empty {
  padding: 10px 14px;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.avatar.tiny {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.participants-panel {
  min-height: 100%;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: white;
  background: rgba(255, 255, 255, .08);
}

.participant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.call-stage.group .participant-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.call-stage.solo .participant-grid {
  grid-template-columns: 1fr;
}

.remote-media-panel {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(7, 29, 58, .56), rgba(75, 183, 232, .16));
}

.remote-media-panel video {
  width: 100%;
  max-height: 220px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(7, 29, 58, .9);
}

.remote-media-panel span {
  color: rgba(255, 255, 255, .74);
  font-size: 12px;
  font-weight: 800;
}

.participant-card {
  display: grid;
  gap: 5px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: rgba(255, 255, 255, .94);
  min-height: 132px;
}

.participant-card small {
  color: var(--muted);
}

.participant-card.video {
  border-color: rgba(15, 143, 112, .35);
}

.participant-card.audio {
  border-color: rgba(201, 154, 46, .42);
}

.participant-card.profile {
  border-color: rgba(7, 29, 58, .18);
}

.participant-state {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  width: max-content;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--navy);
  background: var(--tier-soft);
  font-size: 11px;
  font-weight: 800;
}

.icon-remove {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.video-tile {
  min-height: 100%;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 8px;
  color: white;
  background:
    linear-gradient(135deg, rgba(7, 29, 58, .92), color-mix(in srgb, var(--tier-accent) 70%, #071d3a));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.video-tile video {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: min(54vh, 520px);
  object-fit: cover;
  border-radius: 8px;
  background: rgba(0, 0, 0, .35);
}

.local-video-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.local-video-wrap.bg-blur video {
  filter: blur(6px);
  transform: scale(1.04);
}

.local-video-wrap.bg-navy {
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(7, 29, 58, .96), rgba(75, 183, 232, .45)),
    radial-gradient(circle at 70% 20%, rgba(201, 154, 46, .34), transparent 25%);
}

.local-video-wrap.bg-office {
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, .9), rgba(223, 245, 255, .8)),
    repeating-linear-gradient(90deg, rgba(7, 29, 58, .08) 0 1px, transparent 1px 42px);
}

.profile-only {
  min-height: min(54vh, 520px);
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(75, 183, 232, .25), transparent 34%),
    linear-gradient(135deg, rgba(7, 29, 58, .60), rgba(15, 143, 112, .25));
}

.avatar.large {
  width: 108px;
  height: 108px;
  font-size: 32px;
}

.video-tile small {
  color: rgba(255, 255, 255, .72);
  line-height: 1.35;
}

.camera-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  padding: 0 8px;
  color: white;
  background: rgba(7, 29, 58, .72);
}

.camera-tools {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.video-tile span {
  font-size: 12px;
  opacity: .76;
  text-transform: uppercase;
}

.video-tile strong {
  font-size: 20px;
}

.primary-tile {
  min-height: 100%;
}

.call-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.call-chat-panel {
  min-height: 100%;
  min-width: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(2, 12, 26, .88);
}

.call-chat-messages {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  max-height: min(58vh, 560px);
}

.call-chat-message {
  max-width: 92%;
  overflow-wrap: anywhere;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .10);
}

.call-chat-message.me {
  justify-self: end;
  background: rgba(75, 183, 232, .24);
}

.call-chat-message small {
  display: block;
  color: rgba(255, 255, 255, .70);
  font-size: 11px;
  margin-bottom: 4px;
}

.call-chat-message p,
.call-chat-empty {
  margin: 0;
  color: white;
  line-height: 1.35;
}

.call-chat-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.call-attach-btn {
  width: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.call-attach-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.call-attachment-label {
  grid-column: 1 / -1;
  min-height: 16px;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.assistant-box {
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(7, 29, 58, .12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, .92), var(--tier-soft));
}

.assistant-box strong {
  color: var(--navy);
  font-size: 18px;
}

.assistant-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.meeting-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.meeting-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.vpn-status {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(192, 53, 70, .24);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
}

.vpn-status.connected {
  border-color: rgba(15, 143, 112, .28);
  background: linear-gradient(135deg, rgba(223, 248, 239, .92), rgba(255, 255, 255, .92));
}

.vpn-status strong {
  display: block;
  color: var(--navy);
  font-size: 20px;
}

.vpn-status p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.toggle-row {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: white;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.billing-note {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(201, 154, 46, .32);
  border-radius: 8px;
  color: var(--navy);
  background: var(--gold-soft);
  font-size: 13px;
  line-height: 1.45;
}

.plan ul {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  color: white;
  border-radius: 8px;
  background: rgba(7, 29, 58, .95);
  box-shadow: var(--shadow);
  transform: translateY(130%);
  transition: transform .22s ease;
  z-index: 10;
}

.toast.show {
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-card {
    display: none;
  }

  .grid.stats,
  .grid.two,
  .plans,
  .plans.four {
    grid-template-columns: 1fr;
  }

  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .call-stage,
  .call-meeting-surface,
  .call-stage.with-chat .call-meeting-surface {
    grid-template-columns: minmax(0, 1fr);
  }

  .primary-tile {
    min-height: 340px;
  }

  .video-tile video,
  .profile-only {
    min-height: 240px;
  }

  .participants-panel {
    min-height: 0;
  }

  .participant-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .main {
    padding: 14px;
  }

  .topbar,
  .chat-layout,
  .form-grid,
  .call-stage,
  .participant-grid,
  .directory-grid,
  .directory-actions,
  .username-row,
  .sync-actions {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .actions {
    justify-content: stretch;
  }

  .actions .btn,
  .composer .btn {
    width: 100%;
  }

  .participant-grid {
    grid-template-columns: 1fr;
  }

  .video-tile,
  .primary-tile {
    min-height: 280px;
  }

  .video-tile video,
  .profile-only {
    min-height: 210px;
  }

  .incoming-call-banner,
  .call-chat-form {
    grid-template-columns: 1fr;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .channel-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .message {
    max-width: 100%;
  }
}
