:root {
  --bg: #0f1c18;
  --bg-panel: #152621;
  --ink: #eef3f0;
  --ink-dim: #9db3ac;
  --sage: #7ea896;
  --sage-deep: #5b8c7b;
  --clay: #3b4a45;
  --line: #223a33;
  --error: #d98c7a;
  --radius: 18px;
}

* { box-sizing: border-box; }

button, input, select, textarea {
  -webkit-appearance: none;
  appearance: none;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.hidden { display: none !important; }

/* ---------- Login ---------- */

#login-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(126,168,150,0.08), transparent 45%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.seal {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 1.5px solid var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage);
  transition: transform 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.seal.pulse {
  transform: scale(0.92);
  color: var(--sage-deep);
  border-color: var(--sage-deep);
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 30px;
  margin: 0 0 6px;
  letter-spacing: 0.2px;
}

.tagline {
  color: var(--ink-dim);
  font-size: 14px;
  margin: 0 0 32px;
}

#login-form { text-align: left; }

label {
  display: block;
  margin-bottom: 16px;
}

label span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--sage);
}

.hint {
  font-size: 12.5px;
  color: var(--ink-dim);
  line-height: 1.5;
  margin: -4px 0 18px;
}

.error {
  color: var(--error);
  font-size: 13px;
  min-height: 18px;
  margin: 0 0 10px;
}

button[type="submit"] {
  width: 100%;
  padding: 13px;
  background: var(--sage-deep);
  color: #0f1c18;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease;
}

button[type="submit"]:hover { background: var(--sage); }

.switch-account {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-dim);
  margin: 14px 0 0;
}

.switch-account button {
  background: none;
  border: none;
  color: var(--sage);
  font-size: 12.5px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ---------- Chat ---------- */

#chat-screen header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px calc(14px + env(safe-area-inset-top, 0px));
  padding-top: max(18px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

#chat-screen h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 18px;
  margin: 0;
}

#conversation-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

#conversation-switch-btn svg { color: var(--ink-dim); flex-shrink: 0; }

.header-spacer { flex: 1; }

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

#call-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#call-btn:hover { border-color: var(--sage); color: var(--sage); }

#pinned-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#pinned-toggle-btn.expanded { background: var(--sage-deep); color: #0f1c18; border-color: var(--sage-deep); }

#call-menu {
  left: auto;
  right: 0;
  bottom: auto;
  top: calc(100% + 8px);
}

#conversation-panel {
  position: absolute;
  top: 0;
  left: 12px;
  right: 12px;
  z-index: 20;
  margin-top: 62px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

#conversation-panel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(0, 0, 0, 0.35);
}

#conversation-list { max-height: 240px; overflow-y: auto; }

.conversation-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
}

.conversation-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.conversation-item:hover { background: var(--bg); }
.conversation-item.active { color: var(--sage); font-weight: 500; }

.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--sage-deep);
  color: #0f1c18;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

#scroll-bottom-btn {
  position: absolute;
  right: 20px;
  bottom: 90px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.conversation-delete-btn {
  width: 40px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0;
}

.conversation-delete-btn:hover { color: var(--error); background: var(--bg); }

#new-conversation-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}

#new-conversation-name {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}

#new-conversation-name:focus { outline: none; border-color: var(--sage); }

#new-conversation-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--sage-deep);
  color: #0f1c18;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#disappearing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}

#disappearing-row label {
  font-size: 13px;
  color: var(--ink-dim);
}

#disappearing-select {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
}

#disappearing-badge {
  color: var(--sage);
  flex-shrink: 0;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(126,168,150,0.18);
}

#pinned-bar {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-panel);
}

.pinned-chip {
  flex-shrink: 0;
  max-width: 160px;
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--sage);
  color: var(--sage);
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

#messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble-wrap {
  position: relative;
  max-width: 78%;
  animation: rise 0.18s ease-out;
}

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

.bubble-wrap.flash .bubble-content { outline: 2px solid var(--sage); }

.bubble-wrap.mine { align-self: flex-end; }
.bubble-wrap.theirs { align-self: flex-start; }

.bubble-wrap.pinned::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
}

.bubble-content {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: filter 0.15s;
}

.bubble-content.pressing {
  filter: brightness(0.85);
}

.text-content {
  white-space: pre-wrap;
}

.bubble-wrap.mine .text-content,
.bubble-wrap.mine .attachment-file,
.bubble-wrap.mine .attachment-location {
  padding-right: 30px;
}

.bubble-wrap.theirs .text-content,
.bubble-wrap.theirs .attachment-file,
.bubble-wrap.theirs .attachment-location {
  padding-left: 30px;
}

.bubble-wrap.mine .text-content {
  background: var(--sage-deep);
  color: #0f1c18;
  border-bottom-right-radius: 4px;
}

.bubble-wrap.theirs .text-content {
  background: var(--clay);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.bubble-wrap .bubble-content:has(.attachment-image),
.bubble-wrap .bubble-content:has(.attachment-file),
.bubble-wrap .bubble-content:has(.attachment-location),
.bubble-wrap .bubble-content:has(.attachment-audio),
.bubble-wrap .bubble-content:has(.attachment-video) {
  padding: 0;
}

.quote-strip {
  padding: 6px 10px;
  margin-bottom: 3px;
  border-left: 2px solid var(--sage);
  border-radius: 0 8px 8px 0;
  background: var(--bg-panel);
  color: var(--ink-dim);
  font-size: 12.5px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble-time {
  font-size: 11px;
  color: var(--ink-dim);
  margin-top: 3px;
  padding: 0 4px;
}

.bubble-wrap.mine .bubble-time { text-align: right; }
.bubble-wrap.theirs .bubble-time { text-align: left; }

.read-tick {
  display: inline-flex;
  margin-left: 3px;
  vertical-align: middle;
  color: var(--ink-dim);
}

.read-tick.read { color: #4ade80; }

.message-link {
  color: inherit;
  text-decoration: underline;
  word-break: break-all;
}

#lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#lightbox-content {
  max-width: 100%;
  max-height: 100%;
}

#lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 10px;
  display: block;
}

#lightbox-close-btn {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.date-separator {
  align-self: center;
  font-size: 11.5px;
  color: var(--ink-dim);
  background: var(--bg-panel);
  padding: 4px 12px;
  border-radius: 12px;
  margin: 8px 0 2px;
}

.call-log-entry {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-dim);
  background: var(--bg-panel);
  padding: 6px 14px;
  border-radius: 14px;
  margin: 4px 0;
}

.call-log-time {
  opacity: 0.7;
  margin-left: 2px;
}

.bubble-action-btn {
  position: absolute;
  top: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  display: flex;
  border-radius: 50%;
}

.bubble-wrap.mine .bubble-action-btn {
  right: 4px;
  color: rgba(15, 28, 24, 0.55);
}

.bubble-wrap.theirs .bubble-action-btn {
  left: 4px;
  color: rgba(238, 243, 240, 0.55);
}

.bubble-action-btn:hover { background: rgba(0, 0, 0, 0.12); }

.action-menu {
  position: absolute;
  bottom: 100%;
  margin-bottom: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  z-index: 5;
}

.reaction-row {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}

.reaction-option {
  background: transparent;
  border: none;
  font-size: 20px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

.reaction-option:hover { background: var(--bg); }

.reaction-badge {
  position: absolute;
  bottom: -8px;
  font-size: 13px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1px 5px;
  line-height: 1.4;
  z-index: 2;
}

.bubble-wrap.mine .reaction-badge { right: 8px; }
.bubble-wrap.theirs .reaction-badge { left: 8px; }

.bubble-wrap.mine .action-menu { right: 0; }
.bubble-wrap.theirs .action-menu { left: 0; }

.action-menu button {
  display: block;
  width: 100%;
  padding: 9px 16px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.action-menu button:hover { background: var(--bg); }

.action-menu.menu-below {
  bottom: auto;
  top: 100%;
  margin-bottom: 0;
  margin-top: 4px;
}

.bubble-wrap:has(.attachment-image) .bubble-action-btn,
.bubble-wrap:has(.attachment-video) .bubble-action-btn {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border-radius: 50%;
}

.bubble-wrap:has(.attachment-image) .bubble-action-btn:hover,
.bubble-wrap:has(.attachment-video) .bubble-action-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

#confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}

#confirm-modal {
  width: 100%;
  max-width: 320px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
}

#confirm-modal-message {
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.5;
  margin: 0 0 20px;
}

#confirm-modal-actions {
  display: flex;
  gap: 10px;
}

#confirm-modal-actions button {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
}

#confirm-modal-cancel {
  background: var(--bg);
  color: var(--ink-dim);
  border: 1px solid var(--line);
}

#confirm-modal-confirm {
  background: var(--error);
  color: #0f1c18;
  border: none;
}

/* ---------- Reply preview strip ---------- */

#typing-indicator {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12.5px;
  color: var(--ink-dim);
  background: var(--bg);
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-dim);
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

#reply-preview {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
}

.reply-preview-bar {
  width: 3px;
  align-self: stretch;
  background: var(--sage);
  border-radius: 2px;
}

.reply-preview-body { flex: 1; min-width: 0; }

.reply-preview-label {
  font-size: 11px;
  color: var(--sage);
  margin: 0;
}

.reply-preview-text {
  font-size: 13px;
  color: var(--ink-dim);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#reply-cancel-btn {
  border: none;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- Composer ---------- */

#chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg-panel);
  position: relative;
  flex-shrink: 0;
  z-index: 3;
}

#message-input {
  flex: 1;
  padding: 11px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.4;
}

#message-input:focus {
  outline: none;
  border-color: var(--sage);
}

#send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--sage-deep);
  color: #0f1c18;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s ease;
}

#send-btn:active { transform: scale(0.9); }

#recording-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg-panel);
}

.recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--error);
  flex-shrink: 0;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

#recording-timer {
  flex: 1;
  font-size: 14px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

#recording-cancel-btn, #recording-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#recording-cancel-btn {
  background: transparent;
  color: var(--ink-dim);
}

#recording-send-btn {
  background: var(--sage-deep);
  color: #0f1c18;
}

.plus-wrap, .emoji-wrap { position: relative; flex-shrink: 0; }

#plus-btn, #emoji-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

#plus-btn { display: flex; }
#emoji-btn { display: none; }

@media (hover: hover) and (pointer: fine) {
  #emoji-btn { display: flex; }
}

#plus-btn:hover, #emoji-btn:hover { border-color: var(--sage); color: var(--sage); }
#plus-btn:disabled { opacity: 0.5; cursor: default; }

.popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  z-index: 10;
}

.popover button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.popover button:hover { background: var(--bg); }

.emoji-popover {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 8px;
  width: 220px;
}

.emoji-option {
  width: 32px;
  height: 32px;
  font-size: 18px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-option:hover { background: var(--bg); }

/* ---------- Attachments ---------- */

.attachment-image {
  max-width: 220px;
  max-height: 260px;
  border-radius: 14px;
  display: block;
  cursor: pointer;
}

.attachment-audio {
  width: 230px;
  height: 40px;
}

.attachment-video {
  max-width: 220px;
  max-height: 260px;
  border-radius: 14px;
  display: block;
}

.attachment-location-map {
  display: block;
  position: relative;
  width: 256px;
  height: 256px;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
}

.location-tile {
  width: 256px;
  height: 256px;
  display: block;
}

.location-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.location-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11.5px;
  padding: 6px 10px;
  text-align: center;
}

.live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 10px;
}

.live-badge.ended {
  background: rgba(0, 0, 0, 0.55);
  color: var(--ink-dim);
}

.stop-live-btn {
  display: block;
  width: 256px;
  margin-top: 6px;
  padding: 8px;
  background: var(--clay);
  color: var(--ink);
  border: none;
  border-radius: 10px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}

.attachment-file, .attachment-location {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  max-width: 220px;
  word-break: break-word;
}

.bubble-wrap.mine .attachment-file,
.bubble-wrap.mine .attachment-location {
  background: var(--sage-deep);
  color: #0f1c18;
  border-bottom-right-radius: 4px;
}

.bubble-wrap.theirs .attachment-file,
.bubble-wrap.theirs .attachment-location {
  background: var(--clay);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

#call-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #0a1512;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 60px 24px 40px;
}

#remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a1512;
}

#local-video {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: 20px;
  width: 96px;
  height: 128px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid var(--line);
  background: #152621;
  z-index: 2;
}

#local-video.hidden { display: none; }

#call-info {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--ink);
}

#call-status-text {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 6px;
}

#call-timer {
  font-size: 14px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

#call-controls, #incoming-call-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 20px;
  align-items: center;
}

.call-control-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
}

.call-control-btn.hangup { background: var(--error); color: #0f1c18; }
.call-control-btn.answer { background: var(--sage-deep); color: #0f1c18; }
.call-control-btn.active { background: var(--sage-deep); color: #0f1c18; }

#clear-chat-btn {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  color: var(--error);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

#clear-chat-btn:hover { background: var(--bg); }
