/* ─── JuggedSMS Native-Feel Telegram Mini App Stylesheet v3.0 ─── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-color: #0b0d13;
  --bg-surface: #12151e;
  --card-bg: #171b26;
  --card-border: #222736;
  --card-hover: #1d2230;
  --input-bg: #12151f;
  --input-border: #262c3e;
  --input-focus: #2481cc;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #2481cc;
  --primary-hover: #1e70b0;
  --primary-glow: rgba(36, 129, 204, 0.28);
  --primary-dark: #16568c;
  --accent-green: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --warning: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --font-mono: 'JetBrains Mono', monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #272d3f;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  background: var(--bg-color);
  overflow: hidden;
}

/* ─── Top Account Header (Compact & Native) ─── */
.account-header {
  padding: 8px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  padding-top: max(8px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2481cc 0%, #174f80 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-sm);
}

.status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: var(--accent-green);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
}

.user-meta-compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.assigned-number-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #171b26;
  border: 1px solid #232838;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.assigned-number-pill:hover {
  background: #1d2232;
  border-color: #2e354b;
  color: var(--text-main);
}

.assigned-number-pill .num-text {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: -0.3px;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.copy-btn:hover {
  color: var(--primary);
}

.header-right {
  flex-shrink: 0;
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.plan-pill.active {
  background: rgba(36, 129, 204, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.plan-pill.inactive {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid #282f42;
}

.plan-pill:hover {
  transform: translateY(-1px);
}

/* ─── Main Content Container ─── */
.content-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 72px; /* space for bottom nav */
}

.view.active {
  display: flex;
}

/* ─── View Headers & Actions ─── */
.view-header {
  padding: 12px 14px 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--bg-color);
  border-bottom: 1px solid rgba(34, 39, 54, 0.5);
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-header h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

.header-count {
  font-size: 12px;
  font-weight: 600;
  background: #1f2536;
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #171b26;
  border: 1px solid #232838;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.icon-circle-btn:hover {
  background: #202636;
  border-color: #2e354c;
  color: var(--text-main);
  transform: translateY(-1px);
}

.icon-circle-btn:active {
  transform: scale(0.95);
}

/* ─── Search Box & Filter Pills ─── */
.search-bar-wrap {
  position: relative;
  margin: 10px 14px 6px 14px;
}

.search-bar-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-bar-wrap input {
  width: 100%;
  padding: 8px 34px 8px 34px;
  background: #141722;
  border: 1px solid #222738;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
  transition: all 0.15s ease;
}

.search-bar-wrap input:focus {
  border-color: var(--primary);
  background: #171b28;
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.filter-pills-row {
  display: flex;
  gap: 6px;
  padding: 4px 14px 10px 14px;
}

.pill-btn {
  padding: 5px 12px;
  background: #141722;
  border: 1px solid #222738;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pill-btn:hover {
  background: #1a1e2c;
  color: var(--text-main);
}

.pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px var(--primary-glow);
}

.pill-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  line-height: 1;
}

/* ─── Threads List ─── */
.threads-list {
  flex: 1;
  padding: 0 10px;
  overflow-y: auto;
}

.thread-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  border-bottom: 1px solid rgba(34, 39, 54, 0.3);
}

.thread-item:hover {
  background: #141722;
}

.thread-item:active {
  background: #1a1e2c;
  transform: scale(0.995);
}

.thread-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #181d2a;
  border: 1px solid #252b3d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
}

.thread-unread-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border: 2px solid var(--bg-color);
  border-radius: 50%;
}

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

.thread-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.thread-peer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-size: 11.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.thread-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.thread-snippet {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.thread-snippet.unread {
  color: var(--text-main);
  font-weight: 600;
}

.thread-mms-badge {
  font-size: 10px;
  font-weight: 600;
  background: rgba(36, 129, 204, 0.15);
  color: #38bdf8;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

/* ─── Empty & Loading States ─── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #141722;
  border: 1px solid #222738;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.empty-state h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-dim);
  max-width: 260px;
  line-height: 1.4;
}

/* ─── 2. Thread Chat View ─── */
.thread-header {
  gap: 10px;
  border-bottom: 1px solid var(--card-border);
  padding: 8px 12px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: transform 0.1s ease;
}

.back-btn:active {
  transform: scale(0.92);
}

.thread-peer-info {
  flex: 1;
  min-width: 0;
}

.peer-number-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.peer-flag {
  font-size: 15px;
}

.thread-peer-info h4 {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.thread-status {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

.messages-container {
  flex: 1;
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 6px 0;
}

.msg-date-divider span {
  background: #141722;
  border: 1px solid #222738;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* Chat Bubbles */
.msg-bubble {
  max-width: 80%;
  padding: 8px 12px;
  position: relative;
  font-size: 14px;
  line-height: 1.42;
  word-wrap: break-word;
  animation: fadeInBubble 0.15s ease-out;
}

@keyframes fadeInBubble {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-bubble.inbound {
  align-self: flex-start;
  background: #171b26;
  border: 1px solid #232838;
  color: var(--text-main);
  border-radius: 16px 16px 16px 4px;
}

.msg-bubble.outbound {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 2px 6px var(--primary-glow);
}

/* Flush Edge-to-Edge Media inside Chat Bubbles */
.msg-bubble.media-only {
  padding: 0;
  overflow: hidden;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.msg-bubble.media-only .msg-media-wrap {
  margin: 0;
  border-radius: 14px;
}

.msg-bubble.media-only .msg-meta {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
  z-index: 2;
  font-size: 10.5px;
}

.msg-bubble.media-only .media-zoom-overlay {
  top: 8px;
  right: 8px;
  bottom: auto;
}

.msg-media-wrap {
  margin: -8px -12px 6px -12px;
  overflow: hidden;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  position: relative;
  cursor: pointer;
  background: #0d0f14;
}

.msg-media-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.msg-media-wrap:hover .msg-media-img {
  opacity: 0.9;
}

.media-zoom-overlay {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.msg-content {
  margin-bottom: 2px;
}

.msg-bubble.has-media .msg-content {
  margin-top: 6px;
  margin-bottom: 2px;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10.5px;
  margin-top: 2px;
}

.msg-bubble.inbound .msg-meta {
  color: var(--text-dim);
}

.msg-bubble.outbound .msg-meta {
  color: rgba(255, 255, 255, 0.75);
}

.msg-status-icon {
  font-size: 11px;
  letter-spacing: -1px;
}

.mms-badge-tag {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* Quick Templates Bar */
.quick-templates-bar {
  padding: 4px 12px;
  background: transparent;
  flex-shrink: 0;
}

.templates-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.template-chip {
  background: #141722;
  border: 1px solid #232838;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.template-chip:hover {
  background: #1c2130;
  border-color: #2f374c;
  color: var(--text-main);
}

.template-chip:active {
  transform: scale(0.96);
}

/* Chat Attachment Preview Tray */
.chat-attachment-tray {
  padding: 6px 14px;
  background: #141722;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.attachment-thumb-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: #000;
  flex-shrink: 0;
}

.attachment-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-attachment-btn {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  color: #fff;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attachment-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.attachment-type-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}

.attachment-filename {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chat Input Bar */
.chat-input-bar {
  padding: 8px 12px;
  background: rgba(18, 21, 30, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.attach-btn {
  color: var(--text-muted);
  border-color: #24293a;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
}

.attach-btn.has-attachment {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(36, 129, 204, 0.12);
}

.input-wrapper {
  flex: 1;
  background: #12151f;
  border: 1px solid #232838;
  border-radius: 20px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s;
}

.input-wrapper:focus-within {
  border-color: var(--primary);
  background: #151824;
}

.input-wrapper textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
}

.char-counter {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-align: right;
  margin-top: 2px;
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--primary-glow);
  transition: all 0.15s ease;
}

.send-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.send-btn:active {
  transform: scale(0.92);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── 3. Compose View ─── */
.compose-container {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.country-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.chips-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chips-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.country-chip {
  padding: 4px 10px;
  background: #141722;
  border: 1px solid #232838;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.country-chip:hover {
  background: #1c2130;
  color: var(--text-main);
}

.country-chip.active {
  background: rgba(36, 129, 204, 0.15);
  border-color: var(--primary);
  color: #38bdf8;
  font-weight: 600;
}

.compose-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.label-with-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.compose-char-counter {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.input-with-icon {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 0 10px;
  transition: border-color 0.15s;
}

.input-with-icon:focus-within {
  border-color: var(--primary);
}

.input-flag {
  font-size: 16px;
  margin-right: 8px;
}

.input-with-icon input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 10px 0;
  font-size: 14px;
  font-family: var(--font-mono);
}

.input-action-btn {
  background: #1d2232;
  border: 1px solid #2b3248;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.input-action-btn:hover {
  background: #252c40;
  color: var(--text-main);
}

.recent-recipients {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.recent-label {
  font-size: 11px;
  color: var(--text-dim);
}

.recents-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.recent-chip {
  padding: 2px 8px;
  background: #141722;
  border: 1px solid #232838;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.recent-chip:hover {
  border-color: var(--primary);
  color: var(--text-main);
}

.compose-card textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  line-height: 1.45;
  transition: border-color 0.15s;
}

.compose-card textarea:focus {
  border-color: var(--primary);
}

/* MMS Controls in Compose */
.mms-compose-section {
  background: #141722;
  border: 1px solid #232838;
  border-radius: var(--radius-md);
  padding: 12px;
}

.mms-badge-label {
  font-size: 11px;
  color: var(--text-dim);
}

.mms-attach-controls {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.mms-url-box {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.mms-url-box input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text-main);
  outline: none;
}

.mms-url-box input:focus {
  border-color: var(--primary);
}

.mms-preview-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  background: #181d2a;
  border: 1px solid #283044;
  border-radius: var(--radius-sm);
  padding: 8px;
}

.preview-thumb-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.preview-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.preview-info strong {
  font-size: 12.5px;
  color: #38bdf8;
}

.preview-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.compose-templates-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.templates-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.compose-templates {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-outline {
  background: transparent;
  border: 1px solid #2b3248;
  color: var(--text-muted);
}

.btn-outline:hover {
  background: #171b28;
  border-color: #3a4460;
  color: var(--text-main);
}

.btn-secondary {
  background: #1f2536;
  border: 1px solid #2b3348;
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: #252d42;
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px var(--danger-glow);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 18px;
  font-size: 14.5px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* ─── 4. Numbers & Pool View ─── */
.numbers-container {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.premium-card {
  background: linear-gradient(135deg, #171c2a 0%, #111420 100%);
  border-color: #272f44;
  position: relative;
}

.card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #38bdf8;
  margin-bottom: 8px;
}

.number-display-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.num-large-flag {
  font-size: 28px;
}

.num-details h3 {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.status-online {
  font-size: 12px;
  color: var(--accent-green);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-online::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

.number-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: #111420;
  border: 1px solid #1f2536;
  border-radius: var(--radius-md);
  padding: 10px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.meta-label {
  font-size: 10.5px;
  color: var(--text-dim);
}

.meta-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.text-green {
  color: var(--accent-green) !important;
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(34, 39, 54, 0.4);
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-row span {
  color: var(--text-muted);
}

.info-row strong {
  color: var(--text-main);
}

/* Collapsible Test Console */
.test-card {
  border-color: #242a3c;
}

.test-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.test-card-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.test-desc-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 1px;
}

.expand-icon {
  font-size: 16px;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.expand-icon.open {
  transform: rotate(180deg);
}

.simulator-body {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid #232838;
  padding-top: 12px;
}

.simulator-body input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}

.simulator-body input:focus {
  border-color: var(--primary);
}

/* ─── 5. Plans & Subscription View ─── */
.plans-container {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-banner-card {
  background: linear-gradient(135deg, #171d2b 0%, #121622 100%);
  border: 1px solid #273046;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-banner-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.pulse-chip {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent-green);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.countdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.countdown-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0f121a;
  border: 1px solid #1f2536;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  min-width: 54px;
}

.countdown-val {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.countdown-lbl {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.countdown-sep {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dim);
}

.progress-bar-wrap {
  height: 4px;
  background: #181d2a;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2481cc, #38bdf8);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.banner-expiry {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

/* Pricing Cards */
.plan-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: all 0.15s ease;
}

.plan-card.popular {
  border-color: #2b70b8;
  background: linear-gradient(135deg, #182030 0%, #151926 100%);
  box-shadow: 0 4px 16px rgba(36, 129, 204, 0.15);
}

.plan-badge-top {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #1b2132;
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid #29324a;
}

.popular-badge {
  background: rgba(36, 129, 204, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.plan-header h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.plan-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.plan-price .period {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0;
}

.plan-features li {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-features li::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: 700;
  font-size: 11px;
}

/* ─── Bottom Navigation Bar (Refined & Minimal) ─── */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: rgba(14, 16, 23, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 12px;
  transition: all 0.15s ease;
  flex: 1;
}

.nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
}

.nav-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: -0.1px;
}

.nav-item:hover {
  color: var(--text-muted);
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-label {
  font-weight: 600;
}

/* ─── Modal Dialogs ─── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.modal-card h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

/* Lightbox Modal */
.lightbox-card {
  background: #111420;
  border: 1px solid #232838;
  border-radius: var(--radius-lg);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.lightbox-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
}

.lightbox-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.lightbox-body {
  padding: 10px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080a0e;
}

.lightbox-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-footer {
  padding: 10px 14px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--card-border);
}

/* ─── Toast Notifications ─── */
.toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(23, 27, 38, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid #2d3448;
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 300;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
