/* ── GLOBAL TOKENS ── */
:root {
  --bg: #faf8ff;
  --surface: #ffffff;
  --surface-low: #f3f3fc;
  --surface-mid: #ededf6;
  --surface-high: #e7e7f1;
  --surface-highest: #e1e2eb;
  --border: #c3c6d5;
  --outline: #737784;

  --primary: #003c90;
  --primary-container: #0f52ba;
  --primary-fixed: #d9e2ff;
  --primary-fixed-dim: #b0c6ff;
  --on-primary: #ffffff;
  --on-primary-container: #bcceff;

  --secondary: #735c00;
  --secondary-container: #fed65b;
  --secondary-fixed: #ffe088;
  --on-secondary: #ffffff;
  --on-secondary-container: #745c00;

  --tertiary: #732900;
  --tertiary-container: #993900;
  --tertiary-fixed: #ffdbcd;
  --on-tertiary: #ffffff;

  --error: #ba1a1a;
  --green: #1a6630;
  --green-light: #edf7ef;
  --green-dot: #22c55e;

  --text: #191b22;
  --text-mid: #434653;
  --muted: #737784;

  --dark: #0e0c0a;
  --cream: #f0ead8;

  --blue: #003c90;
  --blue-light: #d9e2ff;
  --red: #ba1a1a;
  --yellow: #fed65b;
  --surface-old: #faf9f5;
  --border-old: #ccc8b8;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  vertical-align: middle;
}

.fill-icon {
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* ── APP SHELL ── */
.app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.screens {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow: hidden;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
}

/* ── HOME ── */
#home {
  background: var(--bg);
}

.home-topbar {
  background: rgba(250, 248, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding-top: max(0px, env(safe-area-inset-top));
  position: relative;
  z-index: 10;
}

.home-topbar-brand {
  font-family: "Courier Prime", monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}
.home-topbar-brand span {
  color: var(--secondary);
}
.home-topbar-actions {
  display: flex;
  gap: 4px;
}
.home-topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-mid);
  transition: background 0.15s;
  font-size: 20px;
}
.home-topbar-btn:active {
  background: var(--surface-mid);
}

.home-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

/* Connection pill */
.conn-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-low);
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
}
.conn-pill-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.conn-dot-wrap {
  position: relative;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.conn-dot-ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green-dot);
  opacity: 0.6;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.conn-dot-core {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--green-dot);
}
.conn-dot-ping.red {
  background: #ef4444;
}
.conn-dot-core.red {
  background: #ef4444;
}
.conn-dot-ping.amber {
  background: #f59e0b;
  animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.conn-dot-core.amber {
  background: #f59e0b;
}
@keyframes ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}
.conn-status-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-mid);
}
.conn-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 60, 144, 0.06);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}
.conn-badge .material-symbols-outlined {
  font-size: 14px;
}

/* Funny card */
.funny-card {
  background: rgba(254, 214, 91, 0.18);
  border: 1px solid rgba(254, 214, 91, 0.6);
  border-radius: 20px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.funny-card-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 6px;
}
.funny-card-eyebrow .material-symbols-outlined {
  font-size: 14px;
}
.funny-card-text {
  font-size: 12px;
  color: var(--on-secondary-container, #5a4600);
  line-height: 1.65;
  font-style: italic;
  font-weight: 500;
}
.funny-card-bg-icon {
  position: absolute;
  right: -8px;
  bottom: -10px;
  font-size: 64px;
  opacity: 0.07;
  color: var(--secondary);
}
.funny-card-bg-icon .material-symbols-outlined {
  font-size: 64px;
}

/* Section label */
.section-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.3px;
  margin-bottom: -4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-label-action {
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.section-label-action:active {
  opacity: 0.75;
}

/* Device card */
.device-card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(0, 60, 144, 0.04);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.device-card:active {
  transform: translateY(1px);
  box-shadow: none;
}
.device-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--primary-fixed);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.device-card-icon .material-symbols-outlined {
  font-size: 22px;
  color: var(--primary);
}
.device-card-info {
  flex: 1;
  min-width: 0;
}
.device-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.device-card-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.device-online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-dot);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  flex-shrink: 0;
}
.device-offline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

/* Empty card */
.empty-card {
  background: var(--surface);
  border-radius: 20px;
  border: 1px dashed var(--border);
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-card .material-symbols-outlined {
  font-size: 32px;
  color: var(--border);
}
.empty-card-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 500;
}
.empty-card-action {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary-fixed);
  color: var(--primary);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.empty-card-action:active {
  background: var(--primary-fixed-dim);
}

/* Activity items */
.activity-item {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  box-shadow: 0 1px 6px rgba(0, 60, 144, 0.03);
}
.activity-item:active {
  transform: translateY(1px);
}
.activity-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.activity-item-icon.sent {
  background: var(--primary-fixed);
}
.activity-item-icon.sent .material-symbols-outlined {
  color: var(--primary);
  font-size: 20px;
}
.activity-item-icon.received {
  background: var(--green-light);
}
.activity-item-icon.received .material-symbols-outlined {
  color: var(--green);
  font-size: 20px;
}
.activity-item-icon.error {
  background: #fdf0f0;
}
.activity-item-icon.error .material-symbols-outlined {
  color: var(--error);
  font-size: 20px;
}
.activity-item-info {
  flex: 1;
  min-width: 0;
}
.activity-item-name {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.activity-item-meta {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.2px;
}
.activity-item-time {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

/* Bento grid */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bento-card {
  border-radius: 20px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.bento-card:active {
  transform: scale(0.97);
}
.bento-card.primary-card {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 20px rgba(0, 60, 144, 0.25);
}
.bento-card.secondary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}
.bento-card .material-symbols-outlined {
  font-size: 28px;
}
.bento-card.primary-card .material-symbols-outlined {
  color: rgba(255, 255, 255, 0.9);
}
.bento-card.secondary-card .material-symbols-outlined {
  color: var(--primary);
}
.bento-card-label {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}
.bento-card.primary-card .bento-card-label {
  color: rgba(255, 255, 255, 0.95);
}
.bento-card.secondary-card .bento-card-label {
  color: var(--text);
}
.bento-bg-icon {
  position: absolute;
  right: -6px;
  bottom: -6px;
  font-size: 56px;
  opacity: 0.08;
}
.bento-bg-icon .material-symbols-outlined {
  font-size: 56px;
  color: currentColor;
}

/* FAB */
.home-fab {
  position: absolute;
  bottom: 20px;
  right: 16px;
  width: 52px;
  height: 52px;
  background: var(--primary);
  border-radius: 16px;
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 60, 144, 0.35);
  z-index: 10;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.home-fab:active {
  transform: scale(0.93);
  box-shadow: 0 2px 8px rgba(0, 60, 144, 0.2);
}
.home-fab .material-symbols-outlined {
  font-size: 26px;
}

/* ── OTHER SCREENS (retro style preserved) ── */
.topbar {
  background: var(--blue);
  color: #fff;
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding-top: max(14px, env(safe-area-inset-top));
}
.topbar-title {
  font-family: "Courier Prime", monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
}
.topbar-title span {
  color: var(--yellow);
}
.topbar-icons {
  display: flex;
  gap: 14px;
  font-size: 20px;
  cursor: pointer;
}

#send-screen {
  background: var(--surface-old, #faf9f5);
}
.send-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.card {
  background: var(--surface-old, #faf9f5);
  border: 1px solid var(--border-old, #ccc8b8);
}
.card-header {
  background: var(--blue);
  color: #fff;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body {
  padding: 10px;
}
.drop-zone {
  border: 2px dashed var(--blue);
  background: var(--blue-light);
  padding: 36px 16px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.drop-zone:active {
  background: #c8d4e8;
}
.drop-zone-icon {
  font-size: 44px;
}
.drop-zone-text {
  font-size: 13px;
  color: var(--blue);
  font-weight: 700;
}
.drop-zone-hint {
  font-size: 11px;
  color: var(--muted);
}
.send-btn {
  background: var(--blue);
  color: #fff;
  border: 2px solid #1a3a8f;
  padding: 14px;
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 2px;
  text-align: center;
  box-shadow: 3px 3px 0 #1a1a1a;
}
.send-btn:active {
  box-shadow: 1px 1px 0 #1a1a1a;
  transform: translate(2px, 2px);
}
.send-btn.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.progress-wrap {
  display: none;
  flex-direction: column;
  gap: 6px;
}
.progress-wrap.visible {
  display: flex;
}
.progress-bar-bg {
  height: 8px;
  background: #fff;
  border: 1px solid var(--border-old, #ccc8b8);
  overflow: hidden;
  border-radius: 4px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--blue);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 4px;
}
.progress-label {
  font-size: 11px;
  color: var(--muted);
}
.funny-box {
  background: #fff8dc;
  border: 1px solid #c49a00;
  padding: 10px 12px;
  font-size: 11px;
  color: #664400;
  font-style: italic;
  line-height: 1.6;
}

#pair-screen {
  background: var(--surface-old, #faf9f5);
}
.pair-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}
.code-number {
  font-family: "Courier Prime", monospace;
  font-size: 44px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 12px;
}
.or-divider {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-old, #ccc8b8);
}
.input-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.retro-input {
  background: #fff;
  border: 1px solid #7f9db9;
  border-top-color: #b0b0b0;
  border-left-color: #b0b0b0;
  padding: 12px 8px;
  font-family: "Space Mono", monospace;
  font-size: 16px;
  color: var(--text);
  outline: none;
  width: 100%;
  text-align: center;
  letter-spacing: 8px;
}
.retro-input:focus {
  border-color: var(--blue);
}
.retro-btn {
  background: #ece9d8;
  border: 1px solid var(--border-old, #ccc8b8);
  border-top-color: #fff;
  border-left-color: #fff;
  padding: 12px;
  font-family: "Space Mono", monospace;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}
.retro-btn:active {
  border-top-color: var(--border-old, #ccc8b8);
  border-left-color: var(--border-old, #ccc8b8);
  border-right-color: #fff;
  border-bottom-color: #fff;
}
.retro-btn.primary {
  background: var(--yellow);
  border-color: #c49a00;
}
.retro-btn.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

#activity-screen {
  background: var(--surface-old, #faf9f5);
}
.activity-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
.log-entry {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border-old, #ccc8b8);
  border-left: 3px solid transparent;
}
.log-entry.sent {
  border-left-color: var(--blue);
}
.log-entry.received {
  border-left-color: #006600;
}
.log-entry.error {
  border-left-color: var(--red);
}
.log-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.log-content {
  flex: 1;
  min-width: 0;
}
.log-filename {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Space Mono", monospace;
}
.log-detail {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.log-time {
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── TELEGRAM SCREEN ── */
#telegram-screen {
  background: var(--surface-old, #faf9f5);
}
.tg-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.tg-file-row {
  background: #fff;
  border: 1px solid var(--border-old, #ccc8b8);
  border-left: 3px solid var(--blue);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}
.tg-file-row:active {
  background: var(--blue-light);
}
.tg-file-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Space Mono", monospace;
}
.tg-file-summary {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.tg-file-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.tg-tag {
  background: var(--blue-light);
  border: 1px solid var(--blue);
  color: var(--blue);
  font-size: 10px;
  padding: 2px 6px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.tg-category {
  background: var(--yellow);
  border: 1px solid #c49a00;
  color: #664400;
  font-size: 10px;
  padding: 2px 6px;
  font-weight: 700;
}
.tg-source {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.tg-search {
  background: #fff;
  border: 1px solid #7f9db9;
  border-top-color: #b0b0b0;
  border-left-color: #b0b0b0;
  padding: 10px 8px;
  font-family: "Space Mono", monospace;
  font-size: 13px;
  color: var(--text);
  outline: none;
  width: 100%;
}
.tg-search:focus {
  border-color: var(--blue);
}
.tg-empty {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 24px 0;
}
.tg-link-box {
  background: #fff8dc;
  border: 1px solid #c49a00;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tg-link-title {
  font-size: 12px;
  font-weight: 700;
  color: #664400;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.tg-link-code {
  font-family: "Courier Prime", monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 8px;
  text-align: center;
  padding: 10px 0;
}
.tg-link-hint {
  font-size: 11px;
  color: #664400;
  line-height: 1.6;
}
.tg-linked-badge {
  background: #e8f5e8;
  border: 1px solid #006600;
  padding: 8px 12px;
  font-size: 11px;
  color: #006600;
  font-weight: 700;
  text-align: center;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  display: flex;
  background: rgba(250, 248, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  gap: 3px;
  border-top: 2px solid transparent;
  transition: color 0.2s;
  font-family: "Manrope", sans-serif;
}
.nav-item.active {
  color: var(--primary);
  border-top-color: var(--primary);
}
.nav-item .material-symbols-outlined {
  font-size: 22px;
}
.nav-item.active .material-symbols-outlined {
  font-variation-settings:
    "FILL" 1,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
}

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-radius: 20px;
  overflow: hidden;
}
.modal-title {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Manrope", sans-serif;
}
.modal-close {
  cursor: pointer;
  opacity: 0.7;
  font-size: 18px;
}
.modal-body {
  padding: 16px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-mid);
}
.modal-footer {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
#incoming-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.incoming-filename {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  word-break: break-all;
}
.incoming-size {
  font-size: 11px;
  color: var(--muted);
}
.incoming-progress-bg {
  height: 6px;
  background: var(--surface-mid);
  border-radius: 3px;
  overflow: hidden;
}
.incoming-progress-fill {
  height: 100%;
  background: #1a6630;
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 3px;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(25, 27, 34, 0.92);
  color: #fff;
  padding: 10px 18px;
  font-size: 12px;
  z-index: 300;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  font-family: "Manrope", sans-serif;
  font-weight: 600;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── SCROLLBARS ── */
::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ── LEGACY DEVICE ROW ── */
.device-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-old, #ccc8b8);
}
.device-row:last-child {
  border-bottom: none;
}
.device-icon {
  width: 40px;
  height: 40px;
  background: var(--blue-light);
  border: 1px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.device-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.device-status {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.device-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  border: 1px solid #888;
  flex-shrink: 0;
}
.device-dot.online {
  background: #39b54a;
  border-color: #1a8a2a;
}
