:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #15202b;
  --muted: #64748b;
  --line: #d7dee8;
  --line-strong: #b9c4d3;
  --accent: #0f766e;
  --accent-weak: #d9f4ef;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #157347;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

button {
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

button.secondary {
  color: var(--text);
  background: #fff;
  border-color: var(--line-strong);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 21px;
  line-height: 1.2;
}

h2 {
  font-size: 15px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 14px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-topbar {
  position: static;
}

.subline {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.auth,
.actions,
.toggles {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.auth input {
  width: min(360px, 54vw);
}

.login-screen {
  min-height: calc(100vh - 68px);
  display: grid;
  place-items: start center;
  padding: 48px 16px;
}

.login-panel {
  width: min(420px, 100%);
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px 22px 28px;
}

.client-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.sidebar,
.workspace {
  display: grid;
  align-content: start;
  gap: 16px;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.stat-card {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 14px;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-soft) 100%);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.08);
}

.stat-card span,
.stat-card em,
small,
.message-meta {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.stat-card strong {
  font-size: 28px;
  line-height: 1.1;
  color: var(--accent);
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--line);
}

.tab {
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tab:hover {
  color: var(--accent);
}

.tab.active {
  color: var(--accent);
  background: transparent;
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.list,
.timeline {
  display: grid;
  gap: 8px;
}

.list-item,
.list-card,
.call-row,
.message {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  transition: all 0.2s ease;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  color: var(--text);
  text-align: left;
  border-color: var(--line);
  cursor: pointer;
}

.list-item:hover {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.06);
}

.list-item.selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-weak) 0%, #f0fffe 100%);
  font-weight: 500;
}

.list-item strong,
.list-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.list-item small,
.list-card small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.3;
}

.right {
  display: grid;
  justify-items: end;
  max-width: 180px;
}

.list-card {
  padding: 10px;
}

.call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  max-width: 100%;
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--muted);
  background: #edf2f7;
  font-size: 12px;
  font-weight: 600;
}

.ok {
  color: var(--ok);
}

.bad {
  color: var(--danger);
}

.kv {
  display: grid;
  gap: 12px;
}

.kv div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.kv div:last-child {
  border-bottom: none;
}

.kv span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kv strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.message {
  padding: 10px;
}

.message.inbound {
  border-left: 4px solid var(--accent);
}

.message.outbound {
  border-left: 4px solid var(--warning);
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.message-meta {
  margin-top: 8px;
}

.table {
  max-height: 560px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fff;
  font-weight: 600;
}

td {
  overflow-wrap: anywhere;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 12px;
  margin: 0 0 12px;
}

.check-grid label,
.toggles label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text);
}

.check-grid input,
.toggles input {
  width: auto;
  min-height: auto;
}

.empty {
  min-height: 52px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 13px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--danger);
}

.client-body {
  background: #edf2f6;
}

.client-phone {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 12px 84px;
}

.client-login {
  margin: 48px auto;
}

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

.icon-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  color: var(--text);
  background: #fff;
  border-color: var(--line);
  font-size: 20px;
}

.client-gateway-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.client-gateway-strip label {
  margin-bottom: 0;
}

.line-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: #edf2f7;
  font-size: 13px;
  font-weight: 600;
}

.line-status.online {
  color: var(--ok);
  background: #e7f6ee;
}

.line-status.offline {
  color: var(--danger);
  background: #fdecea;
}

.incoming-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 16px;
  color: #fff;
  background: #164e63;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.incoming-card span {
  opacity: 0.82;
  font-size: 13px;
}

.incoming-card strong {
  overflow-wrap: anywhere;
  font-size: 24px;
}

.call-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.answer-button,
.decline-button,
.wide-button {
  width: 100%;
  min-height: 46px;
  font-weight: 700;
}

.answer-button {
  background: #15803d;
  border-color: #15803d;
}

.decline-button {
  background: var(--danger);
  border-color: var(--danger);
}

.client-nav {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  padding: 6px;
  background: rgba(237, 242, 246, 0.96);
  backdrop-filter: blur(10px);
}

.client-nav-button {
  min-height: 38px;
  color: var(--text);
  background: #fff;
  border-color: var(--line);
}

.client-nav-button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.client-tab-panel {
  display: none;
}

.client-tab-panel.active {
  display: block;
}

.client-card {
  box-shadow: none;
}

.phone-input {
  min-height: 48px;
  margin-bottom: 10px;
  font-size: 19px;
  font-weight: 650;
}

.compact-list {
  margin-top: 12px;
}

@media (max-width: 1060px) {
  .sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    width: 100%;
    max-width: 280px;
    padding: 16px 12px 28px 12px;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid var(--line);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

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

  .stats {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .topbar-right {
    gap: 6px;
  }

  .topbar-right button {
    padding: 0 8px;
    font-size: 13px;
  }
}

@media (max-width: 680px) {
  .topbar {
    flex-direction: row;
    padding: 10px 12px;
    min-height: auto;
    gap: 10px;
  }

  .topbar-left,
  .topbar-right {
    gap: 8px;
  }

  .topbar-title h1 {
    font-size: 18px;
  }

  .topbar-title .subline {
    display: none;
  }

  .topbar-right {
    min-width: 0;
    flex-wrap: wrap;
  }

  .topbar-right span {
    display: none;
  }

  .topbar-right button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .icon-button {
    width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 18px;
  }

  .admin-shell,
  .client-shell {
    padding: 10px 12px 80px;
  }

  .auth input {
    width: 100%;
  }

  .auth button,
  .actions button {
    flex: 1 1 110px;
    min-height: 38px;
  }

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

  .right {
    justify-items: start;
    max-width: none;
  }

  .list-item {
    grid-template-columns: 1fr;
    min-height: 60px;
  }

  .kv div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .tab {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
    min-height: 34px;
    font-size: 12px;
  }

  .panel {
    padding: 12px;
  }

  .panel-header h2 {
    font-size: 14px;
  }

  label {
    font-size: 12px;
    gap: 4px;
    margin-bottom: 10px;
  }

  input,
  select,
  textarea {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 16px;
  }

  button {
    min-height: 44px;
    padding: 0 14px;
  }
}

/* Mini App Enhanced Styles */
.client-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), #0d9488);
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.25);
}

.client-login h2 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 24px;
  color: var(--text);
}

.client-header-info {
  flex: 1;
  min-width: 0;
}

.client-status-line {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.client-gateway-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.client-gateway-card label {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}

.incoming-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 12px;
  padding: 20px;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.3);
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 12px 32px rgba(15, 118, 110, 0.3);
  }
  50% {
    box-shadow: 0 12px 48px rgba(15, 118, 110, 0.5);
  }
}

.incoming-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  animation: ring-pulse 1s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.9;
  }
}

.incoming-info {
  text-align: center;
}

.incoming-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.incoming-info strong {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.call-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.call-actions button svg {
  flex-shrink: 0;
}

.client-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.client-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.client-nav-button svg {
  flex-shrink: 0;
}

.client-nav-button.active {
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

/* Call Screen */
.call-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.call-display {
  padding: 24px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.phone-display {
  width: 100%;
  min-height: 60px;
  border: none;
  padding: 0;
  font-size: 32px;
  font-weight: 650;
  text-align: center;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--text);
  caret-color: var(--accent);
}

.phone-display::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

.call-status-badge {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.dial-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.dial-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.dial-button:active {
  transform: scale(0.95);
  background: var(--panel-soft);
}

.dial-button .digit {
  font-size: 28px;
  font-weight: 650;
  line-height: 1;
  color: var(--text);
}

.dial-button .letters {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.call-actions-main {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 0 16px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.call-button-main {
  width: 100%;
  height: 64px;
  min-height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 32px;
  background: linear-gradient(135deg, #15803d, #16a34a);
  border-color: #15803d;
  box-shadow: 0 6px 20px rgba(21, 128, 61, 0.35);
  transition: all 0.2s ease;
}

.call-button-main:active {
  transform: scale(0.96);
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.25);
}

.calls-history {
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.calls-history-header {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.call-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.call-history-item:last-child {
  border-bottom: none;
}

.call-history-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--muted);
  flex-shrink: 0;
}

.call-history-icon.active {
  background: #e7f6ee;
  color: var(--ok);
  animation: call-active-pulse 2s ease-in-out infinite;
}

@keyframes call-active-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.call-history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.call-history-info strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-history-info span {
  font-size: 12px;
  color: var(--muted);
}

/* SMS Screen */
.sms-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sms-form-card {
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.sms-length {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.sms-send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #0d9488);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.25);
}

.sms-history {
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.sms-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sms-history-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message-item {
  display: flex;
  width: 100%;
}

.message-item.outgoing {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-soft);
}

.message-item.incoming .message-bubble {
  background: #e0f2f1;
  border-bottom-left-radius: 4px;
}

.message-item.outgoing .message-bubble {
  background: var(--accent-weak);
  border-bottom-right-radius: 4px;
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.message-header strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.message-time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.message-text {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  word-wrap: break-word;
}

.message-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.message-gateway,
.message-status {
  font-weight: 500;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
