:root {
  color-scheme: dark;
  --bg: #09111f;
  --panel: #111c2f;
  --panel-2: #18263d;
  --panel-3: #20314c;
  --border: #263955;
  --text: #f2f6ff;
  --muted: #93a4bd;
  --blue: #4f7cff;
  --blue-2: #3564eb;
  --green: #35d19b;
  --amber: #f6b84a;
  --red: #fb7185;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 90% -5%, rgba(79, 124, 255, .16), transparent 28rem),
    linear-gradient(180deg, #0b1424 0%, var(--bg) 38%);
  color: var(--text);
  overscroll-behavior-y: none;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .45;
}

.hidden,
.role-denied {
  display: none !important;
}

.safe-top {
  height: env(safe-area-inset-top, 0px);
  background: rgba(9, 17, 31, .96);
}

.auth-shell {
  min-height: calc(100vh - env(safe-area-inset-top, 0px));
  display: grid;
  place-items: center;
  padding: 28px 20px calc(28px + var(--safe-bottom));
}

.auth-card {
  width: min(100%, 420px);
  padding: 30px 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(17, 28, 47, .97);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .38);
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 17px;
  box-shadow: 0 12px 32px rgba(79, 124, 255, .24);
}

.eyebrow,
.section-kicker {
  margin: 15px 0 4px;
  color: #8ca9ff;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: 1.9rem;
}

.subtle,
.muted-line {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

label {
  display: block;
  margin: 18px 0 7px;
  color: #cbd6e8;
  font-size: .84rem;
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
  background: #0b1526;
  color: var(--text);
}

input {
  min-height: 49px;
  padding: 0 14px;
}

textarea {
  min-height: 106px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .16);
}

.primary,
.secondary,
.ghost,
.danger-button,
.danger-ghost,
.text-button,
.icon-button {
  min-height: 42px;
  border-radius: 11px;
  font-weight: 780;
}

.primary {
  padding: 0 18px;
  background: var(--blue);
  color: white;
}

.primary:active {
  background: var(--blue-2);
}

.secondary {
  padding: 0 16px;
  border: 1px solid rgba(79, 124, 255, .38);
  background: rgba(79, 124, 255, .15);
  color: #b0c3ff;
}

.ghost,
.danger-ghost {
  padding: 0 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: #c9d4e5;
}

.danger-button {
  padding: 0 16px;
  border: 1px solid rgba(251, 113, 133, .45);
  background: rgba(251, 113, 133, .16);
  color: #ffb3c0;
}

.danger-ghost {
  border-color: rgba(251, 113, 133, .34);
  color: #ffa3b3;
}

.wide {
  width: 100%;
  min-height: 50px;
  margin-top: 22px;
}

.error-text {
  min-height: 20px;
  margin: 12px 0 0;
  color: #fda4af;
  font-size: .84rem;
}

.back-link {
  display: inline-block;
  margin-top: 18px;
  color: #9fb5ef;
  font-size: .86rem;
}

.app-shell {
  width: min(100%, 780px);
  min-height: calc(100vh - env(safe-area-inset-top, 0px));
  margin: 0 auto;
  padding: 0 14px calc(104px + var(--safe-bottom));
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  margin: 0 -14px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(38, 57, 85, .78);
  background: rgba(9, 17, 31, .92);
  backdrop-filter: blur(18px);
}

.app-header .eyebrow {
  margin: 0 0 2px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.header-actions,
.push-actions,
.reply-actions,
.session-actions,
.confirm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.text-button,
.icon-button {
  background: transparent;
  color: #acbbd0;
}

.icon-button {
  min-width: 42px;
  padding: 0;
  font-size: 1.5rem;
}

.icon-button.small {
  min-width: 34px;
  min-height: 34px;
}

.notice-card,
.push-card,
.content-section {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(17, 28, 47, .92);
}

.notice-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px;
  border-color: rgba(246, 184, 74, .38);
  background: rgba(246, 184, 74, .08);
}

.notice-card p,
.push-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.page {
  padding-top: 14px;
}

.status-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 21px 18px;
  overflow: hidden;
  border: 1px solid rgba(79, 124, 255, .32);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(79, 124, 255, .24), transparent 17rem),
    linear-gradient(145deg, #14233b, #101a2c 65%);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}

.status-hero h2 {
  margin: 10px 0 5px;
  font-size: 1.35rem;
}

.status-hero p {
  max-width: 460px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
}

.pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(53, 209, 155, .14);
  color: #87edc8;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.pill.warn {
  background: rgba(246, 184, 74, .14);
  color: #ffd58a;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 12px;
}

.metric-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 720;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.45rem;
}

.content-section {
  padding: 15px;
}

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

.section-heading .section-kicker {
  margin: 0 0 3px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.08rem;
}

.page-heading {
  align-items: flex-start;
  margin: 2px 2px 16px;
}

.page-heading h2 {
  font-size: 1.35rem;
}

.page-heading .muted-line {
  margin: 5px 0 0;
}

.compact-list,
.health-list,
.session-list {
  display: grid;
  gap: 9px;
}

.compact-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 52px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(38, 57, 85, .62);
  text-align: left;
  background: transparent;
  color: var(--text);
}

.compact-row:last-child {
  border-bottom: 0;
}

.live-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(53, 209, 155, .12);
}

.live-dot.paused {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(246, 184, 74, .12);
}

.live-dot.stopping {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(251, 113, 133, .12);
}

.compact-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.compact-copy strong,
.compact-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-copy small,
.row-meta,
.group-heading small,
.audit-row small {
  color: var(--muted);
  font-size: .74rem;
}

.row-meta {
  text-transform: capitalize;
}

.inline-empty {
  margin: 8px 0;
  color: var(--muted);
  font-size: .84rem;
}

.alert-row,
.audit-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(38, 57, 85, .62);
}

.alert-row:last-child,
.audit-row:last-child {
  border-bottom: 0;
}

.alert-mark {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: rgba(246, 184, 74, .14);
  color: var(--amber);
  font-size: .76rem;
  font-weight: 900;
}

.alert-row div,
.audit-row div {
  flex: 1;
  min-width: 0;
}

.alert-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.alert-row time,
.audit-row time {
  flex: 0 0 auto;
  color: #72839d;
  font-size: .7rem;
}

.push-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.push-copy {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #53627a;
  box-shadow: 0 0 0 5px rgba(83, 98, 122, .12);
}

.status-dot.on {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(53, 209, 155, .13);
}

.status-dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(246, 184, 74, .13);
}

.session-group {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px;
}

.group-heading div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.small-action {
  min-height: 34px;
  padding: 0 10px;
  font-size: .72rem;
}

.session-card,
.health-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.session-top,
.health-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.session-top p,
.health-top p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .76rem;
}

.session-state,
.reachability {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(53, 209, 155, .12);
  color: #85edc7;
  font-size: .66rem;
  font-weight: 850;
  text-transform: uppercase;
}

.session-state.paused {
  background: rgba(246, 184, 74, .12);
  color: #ffd58a;
}

.session-state.stopping,
.reachability.offline {
  background: rgba(251, 113, 133, .11);
  color: #ffa7b5;
}

.session-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 16px;
  margin: 14px 0;
  font-size: .78rem;
}

.session-details dt {
  color: #72839c;
}

.session-details dd {
  overflow: hidden;
  margin: 0;
  color: #cbd6e7;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-actions {
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid rgba(38, 57, 85, .72);
}

.health-line {
  margin: 12px 0 0;
  color: #b5c2d5;
  font-size: .8rem;
}

.health-warning {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(246, 184, 74, .09);
  color: #ffd58a;
  font-size: .78rem;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(17, 28, 47, .72);
}

.filter {
  flex: 1;
  min-height: 38px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 750;
}

.filter.active {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .2);
}

.filter span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: .7rem;
}

.ticket-list {
  display: grid;
  gap: 9px;
}

.ticket {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  text-align: left;
  background: var(--panel);
  color: var(--text);
}

.ticket.unread {
  border-color: rgba(79, 124, 255, .56);
  background: linear-gradient(135deg, rgba(79, 124, 255, .11), var(--panel) 44%);
}

.ticket-top,
.ticket-bottom,
.thread-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ticket-subject {
  overflow: hidden;
  font-size: .96rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-customer,
.ticket-time,
.thread-head p,
.system-message {
  color: var(--muted);
  font-size: .78rem;
}

.ticket-customer {
  margin-top: 4px;
}

.ticket-bottom {
  margin-top: 8px;
}

.ticket-bottom > span:first-child {
  overflow: hidden;
  color: #b7c3d5;
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-status {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(246, 184, 74, .12);
  color: #ffd58a;
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ticket-status.answered {
  background: rgba(53, 209, 155, .11);
  color: #8aedc9;
}

.ticket-status.closed {
  background: rgba(146, 161, 186, .11);
  color: #aebbd0;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
}

.empty-state p {
  margin-top: 5px;
}

.empty-icon {
  color: var(--green);
  font-size: 2rem;
}

.thread-view {
  padding-top: 2px;
}

.thread-nav {
  min-height: 42px;
}

.text-button.back {
  padding: 0;
  color: #a9bfff;
}

.thread-head {
  margin: 10px 0 16px;
}

.thread-head h2 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.thread-head p {
  margin-bottom: 0;
}

.compose-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
}

.compose-card label:first-child {
  margin-top: 0;
}

.message-list {
  display: grid;
  gap: 10px;
  min-height: 220px;
  max-height: calc(100vh - 390px);
  overflow-y: auto;
  padding: 5px 1px 18px;
  scroll-behavior: smooth;
}

.message-row {
  display: flex;
  justify-content: flex-start;
}

.message-row.mine {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px 14px 14px 4px;
  background: var(--panel-2);
  color: #e4ebf7;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-row.mine .message-bubble {
  border-radius: 14px 14px 4px;
  background: var(--blue-2);
  color: white;
}

.message-meta {
  margin-top: 5px;
  color: rgba(220, 230, 246, .62);
  font-size: .67rem;
  font-weight: 650;
}

.system-message {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 20px;
  text-align: center;
  line-height: 1.45;
}

.reply-form {
  position: sticky;
  bottom: calc(70px + var(--safe-bottom));
  margin: 0 -14px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(9, 17, 31, .96);
  backdrop-filter: blur(16px);
}

.reply-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.reply-actions .primary {
  min-width: 84px;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding: 14px 2px;
  color: #667891;
  font-size: .72rem;
}

.app-footer a {
  color: #8ca8ed;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: min(100%, 780px);
  min-height: calc(66px + var(--safe-bottom));
  margin: auto;
  padding: 7px 8px calc(7px + var(--safe-bottom));
  border-top: 1px solid rgba(38, 57, 85, .88);
  background: rgba(9, 17, 31, .96);
  backdrop-filter: blur(22px);
}

.nav-item {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  border-radius: 12px;
  background: transparent;
  color: #71829b;
  font-size: .68rem;
  font-weight: 760;
}

.nav-item span {
  font-size: 1.05rem;
}

.nav-item.active {
  background: rgba(79, 124, 255, .12);
  color: #a9bcff;
}

.confirm-dialog {
  width: min(calc(100% - 34px), 420px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .55);
}

.confirm-dialog::backdrop {
  background: rgba(3, 8, 16, .72);
  backdrop-filter: blur(4px);
}

.confirm-dialog form {
  padding: 21px;
}

.confirm-dialog h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.confirm-dialog p {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.confirm-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: calc(82px + var(--safe-bottom));
  left: 16px;
  max-width: 520px;
  margin: auto;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #1b2941;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
  color: var(--text);
  font-size: .88rem;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: .2s ease;
}

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

.toast.error {
  border-color: rgba(251, 113, 133, .5);
  background: #3b1822;
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 560px) {
  .status-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .status-hero .danger-button {
    width: 100%;
  }

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

  .push-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .push-actions {
    width: 100%;
  }

  .push-actions button {
    flex: 1;
  }

  .reply-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .reply-actions .primary {
    grid-column: 1 / -1;
    min-height: 46px;
  }

  .message-list {
    max-height: calc(100vh - 430px);
  }
}

@media (display-mode: standalone) {
  .safe-top {
    position: sticky;
    z-index: 25;
    top: 0;
  }
}

/* ── Remote Control visual refresh ─────────────────────────────────────── */
:root {
  --bg: #07101d;
  --panel: #101b2c;
  --panel-2: #16243a;
  --panel-3: #1c2d47;
  --border: rgba(145, 166, 199, .16);
  --text: #f6f8fc;
  --muted: #8495ad;
  --blue: #6587ff;
  --blue-2: #4e72f2;
  --green: #39d7a4;
  --amber: #f6bf5b;
  --red: #ff6f87;
}

html {
  background: #050b14;
}

body {
  background:
    radial-gradient(circle at 12% -12%, rgba(83, 121, 255, .22), transparent 28rem),
    radial-gradient(circle at 100% 28%, rgba(29, 202, 189, .08), transparent 25rem),
    linear-gradient(180deg, #091321 0%, #07101d 46%, #050b14 100%);
  background-attachment: fixed;
}

button {
  transition: transform .14s ease, border-color .14s ease, background-color .14s ease, opacity .14s ease;
}

button:not(:disabled):active {
  transform: scale(.97);
}

.safe-top {
  background: rgba(7, 16, 29, .94);
}

.auth-shell {
  padding: 26px 18px calc(26px + var(--safe-bottom));
}

.auth-card {
  position: relative;
  width: min(100%, 410px);
  padding: 28px 23px 24px;
  overflow: hidden;
  border-color: rgba(138, 161, 198, .2);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0, rgba(101, 135, 255, .2), transparent 17rem),
    rgba(12, 23, 39, .96);
  box-shadow: 0 36px 100px rgba(0, 0, 0, .52), inset 0 1px rgba(255, 255, 255, .035);
}

.auth-card::before {
  position: absolute;
  width: 150px;
  height: 150px;
  top: -90px;
  right: -70px;
  border: 1px solid rgba(117, 148, 255, .2);
  border-radius: 50%;
  content: "";
}

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

.auth-brand > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-brand strong {
  font-size: .94rem;
  letter-spacing: -.01em;
}

.auth-brand span {
  color: #8093af;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.auth-logo {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(50, 87, 220, .3);
}

.auth-card .eyebrow {
  margin: 0 0 9px;
}

.auth-card h1 {
  max-width: 320px;
  margin-bottom: 10px;
  font-size: clamp(1.9rem, 9vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.auth-card .subtle {
  max-width: 330px;
  margin-bottom: 28px;
  font-size: .9rem;
}

.auth-card label {
  margin-top: 16px;
  color: #b4c0d2;
  font-size: .76rem;
  letter-spacing: .01em;
}

.auth-card input {
  min-height: 52px;
  border-color: rgba(145, 166, 199, .18);
  border-radius: 14px;
  background: rgba(4, 11, 20, .62);
}

.auth-card .wide {
  min-height: 54px;
  border-radius: 15px;
  box-shadow: 0 13px 30px rgba(58, 93, 225, .28);
}

.auth-card .back-link {
  width: 100%;
  text-align: center;
}

.app-shell {
  width: min(100%, 680px);
  padding: 0 16px calc(112px + var(--safe-bottom));
}

.app-header {
  min-height: 78px;
  margin: 0 -16px;
  padding: 10px 18px;
  border-bottom-color: rgba(145, 166, 199, .1);
  background: rgba(7, 16, 29, .82);
  box-shadow: 0 12px 30px rgba(3, 8, 15, .12);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.app-header-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.app-header-brand img {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  box-shadow: 0 9px 22px rgba(44, 76, 193, .26);
}

.app-header-brand > div {
  min-width: 0;
}

.app-header .eyebrow {
  color: #788ba7;
  font-size: .58rem;
  letter-spacing: .12em;
}

.app-header h1 {
  overflow: hidden;
  font-size: 1.13rem;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  gap: 3px;
}

.header-actions .text-button {
  padding: 0 8px;
  color: #8294ae;
  font-size: .76rem;
}

.header-actions .icon-button {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #c0cbdb;
  font-size: 1.28rem;
}

.header-actions .icon-button:active {
  border-color: var(--border);
  background: rgba(255, 255, 255, .05);
}

.page {
  padding-top: 18px;
}

.notice-card {
  align-items: center;
  margin-top: 16px;
  padding: 13px 14px;
  border-color: rgba(101, 135, 255, .24);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(101, 135, 255, .13), rgba(16, 27, 44, .92));
}

.notice-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: rgba(101, 135, 255, .17);
  color: #aebeff;
  font-size: 1.1rem;
  font-weight: 800;
}

.notice-card > div {
  flex: 1;
  min-width: 0;
}

.notice-card p {
  color: #93a3ba;
}

.status-hero {
  position: relative;
  align-items: center;
  min-height: 186px;
  padding: 24px 21px;
  border-color: rgba(111, 143, 255, .3);
  border-radius: 25px;
  background:
    radial-gradient(circle at 105% -5%, rgba(95, 132, 255, .42), transparent 16rem),
    radial-gradient(circle at 20% 140%, rgba(45, 213, 171, .12), transparent 15rem),
    linear-gradient(145deg, #152746 0%, #0f1c30 72%);
  box-shadow: 0 24px 60px rgba(0, 4, 12, .35), inset 0 1px rgba(255, 255, 255, .045);
}

.status-hero::after {
  position: absolute;
  width: 86px;
  height: 86px;
  right: 26px;
  top: 20px;
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(255, 255, 255, .018), 0 0 0 36px rgba(255, 255, 255, .012);
  content: "";
  pointer-events: none;
}

.status-hero > div {
  position: relative;
  z-index: 1;
}

.status-hero h2 {
  max-width: 430px;
  margin: 13px 0 7px;
  font-size: clamp(1.45rem, 6vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.status-hero p {
  max-width: 400px;
  color: #9aabc1;
  font-size: .86rem;
}

.pill {
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(57, 215, 164, .22);
  background: rgba(57, 215, 164, .11);
  color: #7ae9c4;
  font-size: .6rem;
  letter-spacing: .1em;
}

.pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  content: "";
}

.pill.warn {
  border-color: rgba(246, 191, 91, .23);
}

.status-hero .danger-button {
  position: relative;
  z-index: 2;
  min-height: 48px;
  padding: 0 17px;
  border-color: rgba(255, 111, 135, .34);
  border-radius: 14px;
  background: rgba(126, 27, 48, .35);
  box-shadow: 0 12px 30px rgba(15, 1, 5, .22);
  color: #ffc0ca;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.metric-card {
  position: relative;
  min-width: 0;
  padding: 15px 12px 13px;
  overflow: hidden;
  border-color: rgba(145, 166, 199, .13);
  border-radius: 17px;
  background: rgba(15, 27, 45, .84);
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}

.metric-card::after {
  position: absolute;
  width: 32px;
  height: 32px;
  right: -14px;
  bottom: -16px;
  border: 8px solid rgba(101, 135, 255, .035);
  border-radius: 50%;
  content: "";
}

.metric-card span {
  overflow: hidden;
  color: #778aa5;
  font-size: clamp(.58rem, 2.5vw, .68rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card strong {
  margin-top: 7px;
  font-size: clamp(1.25rem, 6vw, 1.65rem);
  letter-spacing: -.035em;
}

.metric-card:nth-child(2) strong { color: #75e5c0; }
.metric-card:nth-child(3) strong { color: #ffd07a; }
.metric-card:nth-child(4) strong { color: #ff95a7; }

.content-section,
.push-card {
  margin-top: 12px;
  border-color: rgba(145, 166, 199, .13);
  border-radius: 20px;
  background: rgba(15, 27, 45, .78);
  box-shadow: inset 0 1px rgba(255, 255, 255, .024);
}

.content-section {
  padding: 17px;
}

.section-heading {
  align-items: center;
  margin-bottom: 14px;
}

.section-heading .section-kicker {
  color: #6f83a1;
  font-size: .58rem;
  letter-spacing: .12em;
}

.section-heading h2 {
  font-size: 1.03rem;
  letter-spacing: -.02em;
}

.section-heading .text-button {
  min-height: 34px;
  padding: 0 7px;
  color: #8fa9ff;
  font-size: .72rem;
}

.page-heading {
  margin: 2px 2px 17px;
}

.page-heading .section-kicker {
  color: #7186a5;
}

.page-heading h2 {
  font-size: 1.6rem;
  letter-spacing: -.035em;
}

.compact-list,
.health-list,
.session-list {
  gap: 10px;
}

.compact-row {
  min-height: 58px;
  padding: 10px 2px;
  border-bottom-color: rgba(145, 166, 199, .1);
}

.compact-row:active {
  padding-right: 7px;
  padding-left: 7px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .035);
}

.live-dot {
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 5px rgba(57, 215, 164, .1), 0 0 18px rgba(57, 215, 164, .35);
}

.compact-copy {
  gap: 4px;
}

.compact-copy strong {
  font-size: .86rem;
}

.compact-copy small,
.row-meta,
.group-heading small,
.audit-row small {
  color: #7588a4;
}

.row-meta {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  font-size: .61rem;
  font-weight: 750;
}

.inline-empty {
  padding: 9px 0;
  text-align: center;
}

.alert-row,
.audit-row {
  padding: 10px 0;
  border-bottom-color: rgba(145, 166, 199, .1);
}

.alert-mark {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}

.push-card {
  padding: 15px 16px;
}

.status-dot {
  box-shadow: 0 0 0 5px rgba(83, 98, 122, .1);
}

.primary,
.secondary,
.ghost,
.danger-button,
.danger-ghost,
.text-button,
.icon-button {
  border-radius: 13px;
}

.primary {
  background: linear-gradient(135deg, #6b8cff, #5577f3);
  box-shadow: 0 10px 24px rgba(48, 79, 195, .2);
}

.secondary {
  border-color: rgba(101, 135, 255, .3);
  background: rgba(101, 135, 255, .12);
  color: #b7c6ff;
}

.ghost,
.danger-ghost {
  min-height: 43px;
  border-color: rgba(145, 166, 199, .17);
  background: rgba(255, 255, 255, .025);
}

.danger-ghost {
  border-color: rgba(255, 111, 135, .24);
  background: rgba(255, 111, 135, .055);
}

.session-group {
  gap: 10px;
  margin-bottom: 22px;
}

.group-heading {
  padding: 0 5px 2px;
}

.session-card,
.health-card {
  position: relative;
  padding: 17px;
  overflow: hidden;
  border-color: rgba(145, 166, 199, .14);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(26, 43, 69, .72), rgba(13, 24, 40, .92));
  box-shadow: 0 16px 38px rgba(0, 4, 12, .16), inset 0 1px rgba(255, 255, 255, .025);
}

.session-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--green);
  content: "";
}

.session-top strong,
.health-top strong {
  font-size: .94rem;
  letter-spacing: -.015em;
}

.session-owner {
  color: #8193ad !important;
}

.session-state,
.reachability {
  border: 1px solid rgba(57, 215, 164, .16);
  background: rgba(57, 215, 164, .09);
  font-size: .58rem;
  letter-spacing: .07em;
}

.session-state.paused {
  border-color: rgba(246, 191, 91, .18);
}

.session-state.stopping,
.reachability.offline {
  border-color: rgba(255, 111, 135, .18);
}

.session-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 15px 0;
}

.session-details dt {
  display: none;
}

.session-details dd {
  position: relative;
  min-width: 0;
  padding: 20px 10px 8px;
  overflow: hidden;
  border: 1px solid rgba(145, 166, 199, .1);
  border-radius: 12px;
  background: rgba(2, 8, 16, .22);
  color: #c8d3e2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-details dd::before {
  position: absolute;
  top: 6px;
  left: 10px;
  color: #627590;
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.session-details dd:nth-of-type(1)::before { content: "Device"; }
.session-details dd:nth-of-type(2)::before { content: "Game"; }
.session-details dd:nth-of-type(3)::before { content: "Version"; }
.session-details dd:nth-of-type(4)::before { content: "Last seen"; }

.session-actions {
  gap: 9px;
  padding-top: 13px;
  border-top-color: rgba(145, 166, 199, .11);
}

.session-actions button {
  min-width: 90px;
}

.health-warning {
  border: 1px solid rgba(246, 191, 91, .13);
}

.filter-tabs {
  gap: 4px;
  padding: 4px;
  border-color: rgba(145, 166, 199, .14);
  border-radius: 16px;
  background: rgba(5, 13, 23, .45);
}

.filter {
  min-height: 42px;
  border-radius: 12px;
}

.filter.active {
  background: #17263d;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .03);
}

.ticket {
  padding: 17px;
  border-color: rgba(145, 166, 199, .14);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(20, 35, 57, .88), rgba(13, 24, 40, .94));
}

.ticket.unread {
  border-color: rgba(101, 135, 255, .42);
  background:
    radial-gradient(circle at 100% 0, rgba(101, 135, 255, .16), transparent 13rem),
    linear-gradient(145deg, rgba(20, 35, 57, .92), rgba(13, 24, 40, .96));
}

.ticket-subject {
  font-size: .94rem;
}

.empty-state {
  padding: 70px 20px;
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto;
  place-items: center;
  border: 1px solid rgba(57, 215, 164, .18);
  border-radius: 18px;
  background: rgba(57, 215, 164, .07);
  font-size: 1.45rem;
}

.compose-card {
  padding: 18px;
  border-color: rgba(145, 166, 199, .14);
  border-radius: 20px;
  background: rgba(15, 27, 45, .82);
}

.message-list {
  gap: 12px;
  padding-top: 8px;
}

.message-bubble {
  padding: 11px 14px;
  border: 1px solid rgba(145, 166, 199, .11);
  border-radius: 18px 18px 18px 5px;
  background: #17263d;
  box-shadow: 0 8px 18px rgba(0, 4, 12, .1);
}

.message-row.mine .message-bubble {
  border-color: rgba(117, 145, 255, .35);
  border-radius: 18px 18px 5px;
  background: linear-gradient(135deg, #607ff2, #4d6de2);
}

.reply-form {
  bottom: calc(78px + var(--safe-bottom));
  margin: 0 -16px;
  padding: 12px 16px;
  border-top-color: rgba(145, 166, 199, .12);
  background: rgba(7, 16, 29, .91);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.reply-form textarea {
  border-color: rgba(145, 166, 199, .15);
  background: rgba(3, 10, 18, .58);
}

.app-footer {
  margin-top: 28px;
  padding: 16px 4px 4px;
  color: #52647f;
}

.bottom-nav {
  right: 10px;
  bottom: calc(8px + var(--safe-bottom));
  left: 10px;
  width: min(calc(100% - 20px), 650px);
  min-height: 70px;
  padding: 7px 8px;
  border: 1px solid rgba(145, 166, 199, .16);
  border-radius: 22px;
  background: rgba(12, 22, 37, .91);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .48), inset 0 1px rgba(255, 255, 255, .035);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
}

.nav-item {
  gap: 4px;
  border-radius: 16px;
  color: #657792;
  font-size: .62rem;
}

.nav-glyph {
  display: grid;
  width: 29px;
  height: 26px;
  place-items: center;
  border-radius: 9px;
  font-size: 1rem !important;
  line-height: 1;
}

.nav-item.active {
  background: rgba(101, 135, 255, .12);
  color: #b8c5ff;
}

.nav-item.active .nav-glyph {
  background: rgba(101, 135, 255, .14);
  box-shadow: 0 7px 18px rgba(37, 63, 165, .14);
}

.confirm-dialog {
  border-color: rgba(145, 166, 199, .2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(101, 135, 255, .12), transparent 14rem),
    #111d30;
}

.confirm-dialog form {
  padding: 24px;
}

.confirm-actions button {
  min-height: 46px;
  min-width: 96px;
}

.toast {
  bottom: calc(94px + var(--safe-bottom));
  padding: 14px 17px;
  border-color: rgba(145, 166, 199, .18);
  border-radius: 16px;
  background: rgba(23, 38, 61, .97);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .46);
  backdrop-filter: blur(18px);
}

@media (max-width: 560px) {
  .app-shell {
    padding-right: 13px;
    padding-left: 13px;
  }

  .app-header {
    margin-right: -13px;
    margin-left: -13px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .status-hero {
    min-height: 0;
    padding: 21px 18px 18px;
  }

  .status-hero::after {
    width: 68px;
    height: 68px;
    top: 18px;
    right: 17px;
  }

  .status-hero .danger-button {
    width: 100%;
  }

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

  .metric-card {
    padding: 13px 9px 11px;
    border-radius: 15px;
  }

  .metric-card strong {
    font-size: 1.3rem;
  }

  .page-heading {
    align-items: flex-start;
  }

  .page-heading > .danger-button,
  .page-heading > .primary {
    min-height: 42px;
    padding: 0 12px;
    font-size: .72rem;
  }

  .push-card {
    align-items: stretch;
  }

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

  .session-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .session-actions button {
    width: 100%;
    min-width: 0;
  }

  .reply-form {
    margin-right: -13px;
    margin-left: -13px;
    padding-right: 13px;
    padding-left: 13px;
  }
}

@media (max-width: 365px) {
  .app-header-brand img {
    display: none;
  }

  .metric-card {
    padding-right: 6px;
    padding-left: 6px;
  }

  .metric-card span {
    font-size: .55rem;
  }

  .nav-item {
    font-size: .58rem;
  }
}

/* Customer session controls */
.customer-control-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(101, 135, 255, .28);
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0, rgba(57, 215, 164, .12), transparent 10rem),
    linear-gradient(135deg, rgba(101, 135, 255, .13), rgba(16, 29, 48, .94));
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}

.customer-control-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: rgba(101, 135, 255, .15);
  color: #b8c5ff;
  font-size: 1.12rem;
}

.customer-control-copy span {
  display: block;
  margin-bottom: 3px;
  color: #77e8c1;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.customer-control-copy h2 {
  font-size: 1.04rem;
  letter-spacing: -.015em;
}

.customer-control-copy p {
  margin: 4px 0 0;
  color: #8fa0b9;
  font-size: .76rem;
  line-height: 1.45;
}

.compact-session {
  padding: 0 0 11px;
  border-bottom: 1px solid rgba(145, 166, 199, .1);
}

.compact-session:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.compact-session .compact-row {
  border-bottom: 0;
}

.compact-session-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 0 2px;
}

.compact-session-actions button {
  min-height: 32px;
  padding: 6px 12px;
  font-size: .7rem;
}

.empty-state .secondary {
  margin-top: 18px;
}

.nav-item .nav-label {
  font-size: .62rem;
}

@media (max-width: 560px) {
  .customer-control-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }

  .customer-control-card > .primary {
    grid-column: 1 / -1;
    width: 100%;
  }
}
