/* Team-Chat – Apple Glasmorphism */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: linear-gradient(145deg,#eef2f7 0%,#e4ecf4 25%,#dfe8f0 50%,#e8eef5 75%,#f0f4f8 100%);
  --nav-bg: rgba(255,255,255,0.55);
  --nav-border: rgba(255,255,255,0.5);
  --card-bg: rgba(255,255,255,0.45);
  --card-border: rgba(255,255,255,0.6);
  --card-hover-bg: rgba(255,255,255,0.65);
  --card-shadow: 0 2px 16px rgba(0,0,0,0.04);
  --text-primary: #1c1c1e;
  --text-secondary: #636366;
  --text-tertiary: #8e8e93;
  --border-color: rgba(0,0,0,0.08);
  --toggle-bg: rgba(0,0,0,0.06);
  --toggle-knob: #fff;
  --accent: #04b3d6;
  --accent-bubble: #04b3d6;
  --bubble-own-text: #fff;
  --bubble-other-bg: rgba(255,255,255,0.75);
  --bubble-other-text: #1c1c1e;
  --input-bg: rgba(255,255,255,0.7);
  --compose-bg: rgba(240,244,248,0.92);
  --system-msg-color: #8e8e93;
  --online-dot: #30d158;
}

[data-theme="dark"] {
  --bg: linear-gradient(145deg,#0a0a1a 0%,#0f1528 20%,#151022 40%,#1a0f1e 60%,#12111a 80%,#0d1318 100%);
  --nav-bg: rgba(255,255,255,0.05);
  --nav-border: rgba(255,255,255,0.09);
  --card-bg: rgba(255,255,255,0.06);
  --card-border: rgba(255,255,255,0.1);
  --card-hover-bg: rgba(255,255,255,0.1);
  --card-shadow: 0 2px 16px rgba(0,0,0,0.2);
  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #636366;
  --border-color: rgba(255,255,255,0.08);
  --toggle-bg: rgba(255,255,255,0.1);
  --toggle-knob: #1c1c1e;
  --accent: #04b3d6;
  --accent-bubble: #04b3d6;
  --bubble-own-text: #fff;
  --bubble-other-bg: rgba(255,255,255,0.09);
  --bubble-other-text: #f5f5f7;
  --input-bg: rgba(255,255,255,0.08);
  --compose-bg: rgba(15,21,40,0.95);
  --system-msg-color: #636366;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
  min-height: 100dvh;
  background: var(--bg);
  background-size: 400% 400%;
  animation: gs 20s ease infinite;
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
}
@keyframes gs {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── Navigation ── */
nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(44px) saturate(180%);
  -webkit-backdrop-filter: blur(44px) saturate(180%);
  border-bottom: 1px solid var(--nav-border);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-left { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; flex: 1; }
.nav-back-btn {
  display: flex; align-items: center; gap: 4px;
  color: var(--accent); text-decoration: none; font-size: 15px; font-weight: 500;
  flex-shrink: 0;
}
.nav-back-btn svg { width: 18px; height: 18px; }
.nav-logo { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.nav-brand { font-size: 17px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; white-space: nowrap; }
.nav-divider { width: 1px; height: 18px; background: var(--card-border); margin: 0 6px; flex-shrink: 0; }
.nav-subtitle { font-size: 15px; color: var(--text-secondary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: none; cursor: pointer;
  color: var(--accent); transition: background .2s;
}
.nav-icon-btn:hover { background: rgba(4,179,214,0.12); }
.user-info { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-secondary); }
.user-dot { width: 8px; height: 8px; border-radius: 50%; background: #30d158; flex-shrink: 0; }
.theme-toggle { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.theme-toggle .toggle-icon { font-size: 13px; color: var(--text-tertiary); }
.theme-toggle .toggle-track { position: relative; width: 34px; height: 20px; background: var(--toggle-bg); border-radius: 10px; transition: background .3s; }
.theme-toggle .toggle-knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--toggle-knob); border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.15); transition: transform .3s; }
[data-theme="dark"] .theme-toggle .toggle-knob { transform: translateX(14px); }
.logout-btn { background: rgba(255,69,58,.1); color: #ff453a; border: 0; padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.logout-btn:hover { background: rgba(255,69,58,.18); }

/* ── Chat-Header (chat.html) ── */
.chat-header-info { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.chat-header-info .avatar { width: 36px; height: 36px; flex-shrink: 0; }
.chat-header-text { min-width: 0; }
.chat-header-name { font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-status { font-size: 12px; color: var(--text-secondary); }
.chat-header-status.online { color: var(--online-dot); }

/* ── Avatar ── */
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; position: relative;
  display: block;
}
.avatar-wrap { position: relative; flex-shrink: 0; }
.avatar-initials {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #04b3d6, #0090b0);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.avatar-initials.sm { width: 28px; height: 28px; font-size: 12px; }
.online-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--online-dot);
  border: 2px solid var(--nav-bg);
}

/* ── Unread badge ── */
.unread-badge {
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Conversation List ── */
.conv-list { padding: 0; }
.conv-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer; text-decoration: none;
  transition: background .15s;
  background: transparent;
}
.conv-item:hover, .conv-item:active { background: var(--card-hover-bg); }
.conv-item-body { flex: 1; min-width: 0; }
.conv-item-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.conv-item-name { font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item-time { font-size: 12px; color: var(--text-secondary); flex-shrink: 0; white-space: nowrap; }
.conv-item-last { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item-last.unread-text { color: var(--text-primary); font-weight: 500; }
.conv-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }

/* ── Search ── */
.search-bar-wrap { padding: 12px 16px 8px; }
.search-bar {
  width: 100%; padding: 9px 14px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.search-bar:focus { border-color: var(--accent); }
.search-bar::placeholder { color: var(--text-tertiary); }

/* ── Messages area ── */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  -webkit-overflow-scrolling: touch;
}
.messages-area::-webkit-scrollbar { width: 4px; }
.messages-area::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

/* ── Message bubbles ── */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 2px;
}
.msg-row.own { flex-direction: row-reverse; }
.msg-row.system { justify-content: center; }

.msg-avatar-space { width: 28px; flex-shrink: 0; }

.msg {
  max-width: 80%;
  padding: 9px 12px;
  border-radius: 18px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}
.msg-own {
  background: var(--accent-bubble);
  color: var(--bubble-own-text);
  border-bottom-right-radius: 5px;
}
.msg-other {
  background: var(--bubble-other-bg);
  color: var(--bubble-other-text);
  border-bottom-left-radius: 5px;
  backdrop-filter: blur(20px);
}
.msg-system {
  background: transparent;
  color: var(--system-msg-color);
  font-size: 12px;
  padding: 4px 12px;
  text-align: center;
  max-width: 100%;
}

.msg-sender-name {
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  margin-bottom: 3px;
}

/* Reply preview */
.msg-reply-preview {
  border-left: 3px solid rgba(255,255,255,0.5);
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.1);
  font-size: 12px;
  line-height: 1.3;
}
.msg-own .msg-reply-preview { border-left-color: rgba(255,255,255,0.5); }
.msg-other .msg-reply-preview { border-left-color: var(--accent); background: rgba(4,179,214,0.1); }
.msg-reply-preview-name { font-weight: 600; margin-bottom: 2px; }
.msg-reply-preview-text { opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Time + checks */
.msg-meta {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px; justify-content: flex-end;
}
.msg-time { font-size: 11px; color: rgba(255,255,255,0.7); }
.msg-other .msg-time { color: var(--text-tertiary); }
.msg-checks { font-size: 12px; color: rgba(255,255,255,0.6); }
.msg-checks.read { color: #fff; }

/* Translation */
.msg-original {
  font-size: 11px; font-style: italic;
  opacity: 0.65; margin-top: 5px;
  cursor: pointer; user-select: none;
}
.msg-original-toggle { text-decoration: underline; }
.msg-original-text { display: none; margin-top: 2px; }
.msg-original-text.open { display: block; }

/* Media */
.msg-image {
  max-width: 260px; max-height: 260px;
  border-radius: 12px; display: block;
  cursor: pointer; object-fit: cover;
  margin-bottom: 4px;
}
.msg-file {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit;
  padding: 2px 0;
}
.msg-file-icon { font-size: 22px; flex-shrink: 0; }
.msg-file-info { min-width: 0; }
.msg-file-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-file-size { font-size: 11px; opacity: 0.7; }

.msg-voice {
  display: flex; align-items: center; gap: 8px;
  min-width: 140px;
}
.voice-play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: inherit;
  transition: background .2s;
}
.voice-play-btn:hover { background: rgba(255,255,255,0.3); }
.voice-duration { font-size: 13px; opacity: 0.85; }

/* ── Typing indicator ── */
.typing-bar {
  height: 24px; padding: 0 16px;
  display: flex; align-items: center;
  font-size: 12px; color: var(--text-secondary);
  gap: 6px;
}
.typing-dots { display: flex; gap: 3px; align-items: center; }
.typing-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-secondary);
  animation: blink 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%,80%,100% { opacity: 0.3; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ── Compose bar ── */
.compose-bar {
  position: sticky;
  bottom: 0;
  background: var(--compose-bg);
  backdrop-filter: blur(44px) saturate(180%);
  -webkit-backdrop-filter: blur(44px) saturate(180%);
  border-top: 1px solid var(--nav-border);
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.compose-input {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  resize: none;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
  font-family: inherit;
  transition: border-color .2s;
}
.compose-input:focus { border-color: var(--accent); }
.compose-input::placeholder { color: var(--text-tertiary); }
.compose-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  transition: background .2s, transform .15s;
  background: var(--input-bg);
  color: var(--text-secondary);
}
.compose-btn:hover { background: var(--card-hover-bg); color: var(--accent); }
.compose-btn.send-btn {
  background: var(--accent); color: #fff;
}
.compose-btn.send-btn:hover { background: #03a0bf; transform: scale(1.06); }
.compose-btn.record-active { background: #ff453a; color: #fff; animation: pulse-red 1s infinite; }
@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,69,58,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,69,58,0); }
}
.hidden-file-input { display: none; }

/* Reply preview in compose */
.compose-reply {
  border-left: 3px solid var(--accent);
  padding: 6px 10px;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px;
}
.compose-reply-close { background: none; border: none; cursor: pointer; color: var(--text-secondary); font-size: 16px; flex-shrink: 0; }
.compose-reply-name { font-size: 12px; font-weight: 600; color: var(--accent); }
.compose-reply-text { font-size: 12px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Scroll-to-bottom button ── */
.scroll-to-bottom {
  position: absolute;
  bottom: 80px; right: 16px;
  background: var(--accent);
  color: #fff;
  border: none; cursor: pointer;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(4,179,214,0.35);
  display: none;
  animation: fadeup .2s ease;
  z-index: 50;
}
.scroll-to-bottom.visible { display: block; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom));
  right: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none; cursor: pointer;
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(4,179,214,0.4);
  z-index: 100;
  transition: transform .2s, box-shadow .2s;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(4,179,214,0.5); }
.fab:active { transform: scale(0.96); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-content {
  background: var(--nav-bg);
  backdrop-filter: blur(44px) saturate(180%);
  -webkit-backdrop-filter: blur(44px) saturate(180%);
  border: 1px solid var(--nav-border);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%; max-width: 600px;
  max-height: 90dvh; overflow-y: auto;
  transform: translateY(20px);
  transition: transform .25s;
}
.modal-overlay.open .modal-content { transform: translateY(0); }
.modal-title {
  font-size: 17px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); font-size: 22px; line-height: 1;
}
.modal-input {
  width: 100%; padding: 10px 14px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  font-size: 15px; outline: none; margin-bottom: 12px;
}
.modal-input:focus { border-color: var(--accent); }
.modal-section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); font-weight: 600; margin-bottom: 8px; }
.user-checkbox-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}
.user-checkbox-item:last-child { border-bottom: none; }
.user-checkbox-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.user-checkbox-label { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.user-checkbox-name { font-size: 15px; color: var(--text-primary); }
.modal-btn {
  width: 100%; padding: 13px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 14px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  margin-top: 16px; transition: background .2s;
}
.modal-btn:hover { background: #03a0bf; }
.modal-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  display: none;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 95vw; max-height: 92dvh; border-radius: 8px; object-fit: contain; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.15); border: none; cursor: pointer;
  color: #fff; font-size: 24px; width: 44px; height: 44px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 150;
  background: var(--nav-bg);
  backdrop-filter: blur(44px) saturate(180%);
  -webkit-backdrop-filter: blur(44px) saturate(180%);
  border-top: 1px solid var(--nav-border);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(60px + env(safe-area-inset-bottom));
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; flex: 1;
  text-decoration: none;
  color: var(--text-tertiary);
  font-size: 10px; font-weight: 500;
  padding: 8px 0;
  transition: color .2s;
  min-height: 44px;
}
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--accent); }
.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-badge {
  position: absolute;
  top: 4px; right: calc(50% - 18px);
  background: #ff453a; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}
.bottom-nav-item { position: relative; }
.bottom-nav-label { font-size: 10px; }

/* ── Page layout for chat ── */
.chat-page {
  display: flex; flex-direction: column;
  height: 100dvh;
}
.chat-page nav { flex-shrink: 0; }
.chat-page .messages-area { flex: 1; overflow-y: auto; }
.chat-page .compose-bar { flex-shrink: 0; }

/* ── List page ── */
.list-page { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── Profile page ── */
.profile-section {
  max-width: 480px; margin: 0 auto;
  padding: 24px 16px calc(80px + env(safe-area-inset-bottom));
}
.profile-avatar-wrap {
  display: flex; justify-content: center; margin-bottom: 28px;
}
.profile-avatar-btn {
  position: relative; cursor: pointer;
  width: 96px; height: 96px;
}
.profile-avatar-btn .avatar { width: 96px; height: 96px; }
.profile-avatar-btn .avatar-initials { width: 96px; height: 96px; font-size: 36px; }
.profile-avatar-edit {
  position: absolute; bottom: 0; right: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; border: 2px solid var(--nav-bg);
}
.profile-field { margin-bottom: 16px; }
.profile-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); font-weight: 600; margin-bottom: 6px; }
.profile-input {
  width: 100%; padding: 11px 14px;
  border-radius: 12px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary); font-size: 15px; outline: none;
  transition: border-color .2s; font-family: inherit;
}
.profile-input:focus { border-color: var(--accent); }
.profile-input:disabled { opacity: 0.55; }
.radio-group { display: flex; gap: 16px; }
.radio-item { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; color: var(--text-primary); }
.radio-item input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.save-btn {
  width: 100%; padding: 13px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 14px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .2s; margin-top: 8px;
}
.save-btn:hover { background: #03a0bf; }
.save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.save-feedback { text-align: center; font-size: 13px; color: #30d158; margin-top: 10px; min-height: 20px; }

/* ── Loading skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--card-bg) 25%, var(--card-hover-bg) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Context menu (long press) ── */
.ctx-menu {
  position: fixed; z-index: 300;
  background: var(--nav-bg);
  backdrop-filter: blur(30px);
  border: 1px solid var(--nav-border);
  border-radius: 14px;
  padding: 6px 0;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 14px; cursor: pointer; color: var(--text-primary);
  transition: background .15s;
}
.ctx-item:hover { background: var(--card-hover-bg); }
.ctx-item.danger { color: #ff453a; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: calc(80px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: rgba(30,30,34,0.92); color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: 14px; z-index: 600;
  pointer-events: none;
  transition: opacity .3s;
}
.toast.hidden { opacity: 0; }
