/* Layout & components — neutral surfaces, green only for standout elements */

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  padding: 0 clamp(16px, 5vw, 40px); /* same outer gutter as `main` */
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  border: 0; color: inherit;
  font-size: 1.2em; /* bump the whole header logo relative to body */
}
/* Inline SVG logo — `stroke="currentColor"` so it tints with --accent and
   `fill="var(--bg-raised)"` on the front square so the two layers read as
   a classic copy/clipboard icon in either light or dark mode. */
.brand-mark {
  display: inline-block;
  width: 1.6em; height: 1.3em;
  color: var(--accent);
  flex-shrink: 0;
  overflow: visible;
}
.brand-mark.small { width: 1.35em; height: 1.1em; font-size: 1em; }
.brand-text {
  font-family: var(--font-sans);
  font-size: 1em;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--fg-muted);
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--fg-muted); background: var(--bg-sunken); }
.theme-toggle svg { width: 15px; height: 15px; }
/* Show the icon of the mode you'd switch TO:
   light mode → moon (click to go dark), dark mode → sun (click to go light). */
[data-theme="dark"] .theme-toggle .moon { display: none; }
:root:not([data-theme="dark"]) .theme-toggle .sun { display: none; }

/* Header room-only cluster */
.room-only { display: none; align-items: center; gap: 12px; }
body:has(#room:not([hidden])) .room-only { display: inline-flex; }
body:has(#room:not([hidden])) .landing-only { display: none; }

.room-badge {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  letter-spacing: 0.15em;
  background: var(--bg-raised);
  border-radius: 6px;
  transition: border-color .15s, background .15s;
}
.room-badge:hover { border-color: var(--accent); }
.room-badge[data-flash] { background: var(--accent); color: var(--bg-raised); border-color: var(--accent); }

.status-dot {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
  padding-left: 14px; position: relative;
}
.status-dot::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--fg-dim);
}
.status-dot[data-state="online"]::before     { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 20%, transparent); }
.status-dot[data-state="connecting"]::before { background: oklch(75% 0.15 90); animation: pulse 1s infinite; }
.status-dot[data-state="offline"]::before    { background: var(--danger); }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

.peer-count { color: var(--fg-muted); font-size: 0.85rem; font-family: var(--font-mono); }
.peer-count .small { color: var(--fg-dim); margin-left: 4px; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }

.header-btn.ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--fg-muted);
  font-size: 0.82rem;
  transition: color .15s, border-color .15s, background .15s;
}
.header-btn.ghost:hover { color: var(--danger); border-color: var(--danger); background: var(--bg-sunken); }

/* Kebab menu — desktop hides it, mobile shows it in place of the inline buttons. */
.header-menu-wrap { position: relative; display: none; }
.header-menu-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--fg-muted);
  transition: color .15s, border-color .15s, background .15s;
}
.header-menu-btn:hover,
.header-menu-btn[aria-expanded="true"] {
  color: var(--fg); border-color: var(--fg-muted); background: var(--bg-sunken);
}
.header-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  z-index: 30;
}
/* Equal-specificity tie with UA `[hidden]{display:none}` means the rule that
   came later wins — without this override, `.header-menu { display:flex }`
   keeps the menu visible even when the `hidden` attribute is set. */
.header-menu[hidden] { display: none; }
.header-menu-item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 0; border-radius: 6px;
  color: var(--fg);
  font-size: 0.9rem;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.header-menu-item i { width: 16px; text-align: center; color: var(--fg-muted); }
.header-menu-item:hover { background: var(--bg-sunken); }
.header-menu-item.danger:hover { color: var(--danger); background: var(--bg-sunken); }
.header-menu-item.danger:hover i { color: var(--danger); }

/* ---------- Landing ---------- */
main { padding: 0 clamp(16px, 5vw, 40px); }
#landing { max-width: 1080px; margin: 0 auto; padding-bottom: 120px; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 14px;
}

.hero { padding: 80px 0 72px; }
.hero-title {
  font-family: var(--font-sans);
  font-weight: 600;
  max-width: 22ch;
  margin-bottom: 22px;
  color: var(--fg);
}
.hero-title em {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: -0.015em;
}
.hero-sub {
  max-width: 78ch;
  color: var(--fg-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 40px;
}

.entry {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  grid-template-areas:
    "pwd   pwd"
    "code  submit"
    "error error";
  gap: 18px 16px;
  align-items: end;
  max-width: 680px;
  padding: 22px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.field-pwd   { grid-area: pwd; }
.field-code  { grid-area: code; }
.entry .primary { grid-area: submit; }
.entry .entry-note { grid-column: 1 / -1; }
.entry .entry-error { grid-area: error; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.field input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  padding: 8px 2px;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.04em;
  transition: border-color .15s;
  width: 100%;
  color: var(--fg);
}
.field input:focus { outline: none; border-bottom-color: var(--accent); }
.field input::placeholder { color: var(--fg-dim); }
.field-code input { text-transform: uppercase; letter-spacing: 0.25em; text-align: center; }

.primary {
  padding: 11px 22px;
  background: var(--accent);
  color: var(--bg-raised);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  transition: background .15s, border-color .15s, transform .05s;
}
.primary:hover { background: var(--accent-hot); border-color: var(--accent-hot); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: 0.55; cursor: progress; }

/* Loading state for any button: inline spinner (prepend) + dimmed, click-proofed.
   Works on .primary and .card-btn alike. The button text stays in place so the
   layout doesn't jump; the spinner is absolutely positioned at the start padding. */
button.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.75;
  cursor: progress;
}
button.is-loading > i,
button.is-loading > svg {
  visibility: hidden;
}
button.is-loading::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: ctrlcv-spin 0.7s linear infinite;
  opacity: 0.9;
}
/* Push the label past the spinner so they don't overlap. All loading-capable
   buttons in this app wrap their label in a <span>; icon-only buttons (like
   the composer send) have no span and the spinner just draws on top of the
   visibility:hidden icon — no padding needed for those. */
button.is-loading > span {
  padding-left: 20px;
}
@keyframes ctrlcv-spin { to { transform: rotate(360deg); } }

/* Card-body chunked-upload progress bar. Renders while a file item is mid-
   upload on the sender side or mid-download on the receiver side. The bar
   fills left-to-right from 0 → 100%; .progress-fill width is mutated in
   place by updateCardProgress so the bar animates smoothly without a full
   card re-render. */
.chunk-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 18px 6px;
}
.progress {
  height: 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .2s ease-out;
}
.progress-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  min-width: 3.5em;
  text-align: right;
}

/* A standalone inline-text spinner (no button) for places like a modal cmd
   pre-block that says "generating…". Usage: <span class="inline-spinner"></span>. */
.inline-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  vertical-align: -2px;
  opacity: 0.7;
  animation: ctrlcv-spin 0.7s linear infinite;
}

.entry-error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1em;
}

.entry-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.entry-note.warn {
  border: 1px solid color-mix(in oklch, oklch(72% 0.12 85) 30%, var(--line));
  background: color-mix(in oklch, oklch(86% 0.04 85) 34%, var(--bg-raised));
  color: var(--fg-muted);
}

.entry-note.warn i {
  color: oklch(62% 0.13 85);
  margin-top: 2px;
}

.entry-note.error {
  border: 1px solid color-mix(in oklch, var(--danger) 24%, var(--line));
  background: color-mix(in oklch, var(--danger) 8%, var(--bg-raised));
  color: var(--fg-muted);
}

.entry-note.error i {
  color: var(--danger);
  margin-top: 2px;
}

/* How / Features */
.how, .features, .faq { margin-top: 88px; }

.steps {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.steps > li {
  background: var(--bg-raised);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}
.steps h3 { margin-bottom: 8px; font-size: 1.02rem; }
.steps p { color: var(--fg-muted); font-size: 0.93rem; }

.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: 28px;
}
.feature {
  background: var(--bg-raised);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.feature h3 { font-size: 0.95rem; margin-bottom: 8px; color: var(--fg); }
.feature p  { color: var(--fg-muted); font-size: 0.9rem; }

/* Use cases */
.usecases { margin-top: 88px; }
.usecase-list {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden;
}
.usecase-list > li {
  background: var(--bg-raised);
  padding: 20px 22px;
}
.usecase-list h3 {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.98rem;
  color: var(--fg);
  margin-bottom: 6px;
  line-height: 1.4;
}
.usecase-list h3 i {
  color: var(--accent);
  font-size: 0.9rem;
  width: 1.1rem;
  flex: 0 0 1.1rem;
  margin-top: 0.18rem;
}
.usecase-list h3 span { min-width: 0; }
.usecase-list p { color: var(--fg-muted); font-size: 0.9rem; line-height: 1.55; }
@media (max-width: 820px) { .usecase-list { grid-template-columns: 1fr; } }

/* Guides / stories */
.stories { margin-top: 88px; }
.stories-lead {
  margin-top: 20px;
  max-width: 70ch;
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.6;
}
.story-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.story-card {
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent-soft) 32%, var(--bg-raised)) 0%, var(--bg-raised) 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
.story-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.story-card h3 {
  font-size: 1rem;
  color: var(--fg);
  margin-bottom: 8px;
}
.story-card p {
  color: var(--fg-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
@media (max-width: 820px) { .story-grid { grid-template-columns: 1fr; } }

/* Transparency / read-the-source */
.transparency { margin-top: 88px; }
.transparency h2 em {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.transparency-lead {
  margin-top: 20px;
  max-width: 68ch;
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.6;
}
.source-files {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden;
}
.source-files > li {
  background: var(--bg-raised);
  padding: 14px 20px;
  display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap;
}
.source-files a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-bottom: 0;
  flex-shrink: 0;
  min-width: 16ch;
}
.source-files a i {
  color: var(--accent);
  font-size: 0.98rem;
  width: 1rem;
  text-align: center;
  flex: 0 0 1rem;
}
.source-files a code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--accent);
  background: transparent;
  padding: 0;
}
.source-files a:hover code { color: var(--accent-hot); text-decoration: underline; }
.source-files span { color: var(--fg-muted); font-size: 0.9rem; }

/* Audit file list inside the FAQ answer */
.audit-files {
  list-style: none; padding: 0;
  margin: 10px 0 0;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.92rem;
}
.audit-files li { padding: 3px 0; color: var(--fg-muted); }
.audit-files code a { color: var(--accent); border: 0; font-family: var(--font-mono); }
.audit-files code a:hover { text-decoration: underline; }

/* FAQ */
.qa { margin-top: 28px; display: grid; gap: 28px; }
.qa dt {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--fg);
  margin-bottom: 6px;
}
.qa dd {
  margin: 0;
  color: var(--fg-muted);
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 72ch;
}

/* ---------- Room ---------- */
#room { max-width: 1080px; margin: 32px auto 96px; padding: 0; }

.banner {
  background: var(--accent-soft);
  color: var(--fg);
  padding: 10px 16px;
  border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.room-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--fg-muted);
  background: var(--bg-raised);
  transition: color .15s, border-color .15s, background .15s;
}
.filter-chip:hover { color: var(--fg); border-color: var(--fg-muted); }
.filter-chip.active {
  color: var(--bg-raised);
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Composer (chat-style input) ---------- */
.composer {
  margin: 8px 0 20px;
  padding: 8px 8px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--bg-raised);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 15%, transparent);
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.composer-input {
  flex: 1 1 auto;
  min-width: 0;           /* allow flex child to shrink below its intrinsic width */
  /* Global reset is box-sizing: border-box, so min-height here is the total
     box (incl. padding). One line at line-height 1.4 × font-size 0.95rem is
     ~21 px, plus 16 px of padding = ~37 px — round up to 38 so the glyphs
     never clip at the top/bottom in Edge/Chrome. */
  min-height: 38px;
  max-height: 240px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.4;
  resize: none;
  /* Default to hidden — autogrow() flips it to 'auto' only when content
     actually exceeds max-height. Prevents the stacked-arrow scroll gripper
     that some mobile browsers draw as soon as a textarea has overflow:auto,
     even when there's nothing to scroll. */
  overflow-y: hidden;
}
.composer-input:focus { outline: none; }
/* Belt-and-suspenders on older WebKit that ignores `resize: none` with
   `overflow:auto`. Kills the bottom-right resize gripper. */
.composer-input::-webkit-resizer { display: none; }
.composer-input::placeholder { color: var(--fg-dim); }

.composer-actions { display: inline-flex; align-items: center; gap: 2px; }
.composer-icon-btn, .composer-send {
  width: 36px; height: 36px;
  border: 0; border-radius: 10px;
  display: grid; place-items: center;
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 0.95rem;
  transition: color .15s, background .15s, transform .05s;
}
.composer-icon-btn:hover,
.composer-send:not([disabled]):hover {
  color: var(--fg); background: var(--bg-sunken);
}
.composer-icon-btn:active:not([disabled]) { transform: translateY(1px); }
.composer-send:not([disabled]) { color: var(--accent); }
.composer-send:not([disabled]):active { transform: translateY(1px); }
.composer-send[disabled] { opacity: 0.35; cursor: default; }
.composer-icon-btn[disabled] { opacity: 0.45; cursor: default; }

.composer-hint {
  margin: 4px 10px 2px;
  color: var(--fg-dim);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}
.composer-hint kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--fg-muted);
  background: var(--bg);
}

/* Full-screen drag overlay. Kicks in whenever the user is dragging files
   anywhere in the tab — the user doesn't need to aim at a specific box. */
.drag-overlay {
  position: fixed; inset: 0;
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 50;
  pointer-events: none;
}
.drag-overlay[hidden] { display: none; }
.drag-overlay-inner {
  padding: 22px 32px;
  display: inline-flex; align-items: center; gap: 14px;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: var(--bg-raised);
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 500;
}
.drag-overlay-inner i { font-size: 1.4rem; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-dim);
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 1.05rem;
}

/* Cards */
.cards { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  animation: cardIn .22s ease-out;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(-3px);} to { opacity: 1; transform: none;} }

.card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  flex-wrap: wrap;
}
.card-meta { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--fg-muted);
  background: var(--bg-sunken);
}
.card-name {
  color: var(--fg); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; flex: 1;
}
.card-size { color: var(--fg-dim); font-size: 0.78rem; font-family: var(--font-mono); }

.card-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.card-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  background: transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.card-btn i { font-size: 0.82em; }
.card-btn:hover { color: var(--fg); border-color: var(--fg-muted); background: var(--bg-sunken); }
.card-btn.ghost:hover { color: var(--danger); border-color: var(--danger); background: transparent; }

.card-body { padding: 16px; }
.card-body pre.text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--fg);
}
.preview-image {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: var(--bg-sunken);
  border-radius: 4px;
  cursor: zoom-in;
}
.preview-video {
  width: 100%;
  max-height: 60vh;
  background: #000;
  border-radius: 4px;
}
.file-icon { font-size: 2rem; color: var(--fg-dim); display: block; }
.locked {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--danger);
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 0.95rem;
}

/* ---------- Modal (CLI transfer) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in oklch, var(--n-0) 60%, transparent);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 24px 26px 22px;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 30px 60px -20px color-mix(in oklch, var(--n-0) 30%, transparent);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.modal-head h3 {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.05rem;
}
.modal-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: var(--fg-muted);
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--fg); background: var(--bg-sunken); }
.modal-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
  line-height: 1.55;
}
.modal-sub.tiny { font-size: 0.82rem; margin-top: 14px; margin-bottom: 0; color: var(--fg-dim); }
.modal-sub strong { color: var(--fg); font-weight: 600; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.cli-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px 10px;
  margin-bottom: 14px;
  position: relative;
  background: var(--bg-sunken);
}
.cli-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.cli-label em { font-family: var(--font-editorial); font-style: italic; font-size: 0.95em; letter-spacing: 0; color: var(--accent); }
.cli-cmd {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding-right: 84px;  /* room for the copy button */
  line-height: 1.5;
}
.cli-copy {
  position: absolute;
  top: 10px; right: 10px;
  padding: 5px 10px;
  font-size: 0.75rem;
}

.cli-source {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}
.cli-source summary {
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--fg-muted);
  font-size: 0.88rem;
  user-select: none;
  list-style: none;
}
.cli-source summary::-webkit-details-marker { display: none; }
.cli-source summary::before {
  content: "\25B8"; /* ▸ */
  display: inline-block;
  transition: transform .15s;
  color: var(--fg-dim);
  width: 0.7em;
}
.cli-source[open] summary::before { transform: rotate(90deg); }
.cli-source summary:hover { color: var(--fg); }
.cli-source summary small { color: var(--fg-dim); font-weight: 400; }
.cli-source summary small a { color: var(--accent); border-bottom-color: transparent; }
.cli-source summary small a:hover { border-bottom-color: currentColor; }

.cli-source-body {
  margin: 12px 0 0;
  padding: 14px 16px;
  max-height: 320px;
  overflow: auto;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg);
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
.cli-source-body code { background: transparent; padding: 0; font-size: inherit; }

.compose-field { display: block; }
.compose-input {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-sunken);
  color: var(--fg);
  padding: 14px 16px;
  font: inherit;
  line-height: 1.55;
}
.compose-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 16%, transparent);
}
.compose-input-code {
  min-height: 140px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-all;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Insecure-mode warning on the Quick-link modal */
.modal-sub.insecure-warn {
  background: oklch(95% 0.06 50);
  border: 1px solid oklch(70% 0.15 60);
  color: oklch(32% 0.1 45);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
}
[data-theme="dark"] .modal-sub.insecure-warn {
  background: oklch(24% 0.07 50);
  border-color: oklch(55% 0.13 55);
  color: oklch(90% 0.08 55);
}
.modal-sub.insecure-warn i { margin-right: 4px; }
#quick-filename { font-family: var(--font-mono); color: var(--fg); text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 28px clamp(16px, 5vw, 40px); /* matches main's gutter */
  color: var(--fg-dim);
  font-size: 0.82rem;
}
.foot-cols {
  max-width: 1080px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
}
.foot-cols > div:first-child { display: inline-flex; align-items: center; gap: 10px; }
.site-footer a { color: var(--fg-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .entry {
    grid-template-columns: 1fr;
    grid-template-areas: "pwd" "code" "submit" "error";
  }
  .entry .primary { align-self: stretch; }
  .steps, .feature-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 40px; }
  .brand-text { display: none; }
  .peer-count .small { display: none; }
  .composer { padding: 6px 6px 4px; border-radius: 12px; }
  .composer-hint { display: none; }
  .composer-input { font-size: 1rem; padding: 7px 8px; } /* bump past iOS's 16px zoom threshold */
  .modal-card { width: min(640px, calc(100vw - 20px)); padding: 20px 18px 18px; }
}

/* Narrow viewports: collapse header-inline buttons into the kebab menu. We gate
   this at 640px rather than 820px so tablets still see the spelled-out buttons,
   and on phones (where horizontal space is the actual constraint) the header
   stays uncluttered. Also drops the "online/offline" word — the dot is enough. */
@media (max-width: 640px) {
  .header-inline { display: none !important; }
  .header-menu-wrap { display: inline-block; }
  .status-dot {
    font-size: 0;              /* hide the word, keep the dot (which is an ::before) */
    padding-left: 10px;
    width: 10px; height: 10px;
  }
  .room-only { gap: 8px; }
  .site-header { padding: 0 14px; }
  .site-header-inner { padding: 10px 0; gap: 8px; }
}
