/* Ding Web: the app's own look. White + graphite on the mist backdrop,
   glass panels, SF Pro with Inter after it. */

:root {
  --ink: #2E3237;
  --on-ink: #FFFFFF;
  --steel: #8A9097;
  --mist-1: #F0F3F7;
  --mist-2: #DEE4EC;
  --mist-3: #CCD5E0;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --hair: rgba(46, 50, 55, 0.10);
  --soft: rgba(46, 50, 55, 0.06);
  --light: rgba(255, 255, 255, 0.9);
  --shadow: 0 0 0 0.5px rgba(46, 50, 55, 0.06), 0 10px 36px rgba(46, 50, 55, 0.10);
  --danger: #C2413B;
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EEF1F5;
    --on-ink: #15181C;
    --steel: #8E959E;
    --mist-1: #1C2026;
    --mist-2: #15181C;
    --mist-3: #0F1114;
    --glass: rgba(44, 48, 55, 0.55);
    --glass-strong: rgba(52, 57, 65, 0.85);
    --glass-edge: rgba(255, 255, 255, 0.09);
    --hair: rgba(255, 255, 255, 0.09);
    --soft: rgba(255, 255, 255, 0.06);
    --light: rgba(120, 132, 150, 0.22);
    --shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.4), 0 10px 36px rgba(0, 0, 0, 0.35);
    --danger: #FF7A72;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #EEF1F5;
  --on-ink: #15181C;
  --steel: #8E959E;
  --mist-1: #1C2026;
  --mist-2: #15181C;
  --mist-3: #0F1114;
  --glass: rgba(44, 48, 55, 0.55);
  --glass-strong: rgba(52, 57, 65, 0.85);
  --glass-edge: rgba(255, 255, 255, 0.09);
  --hair: rgba(255, 255, 255, 0.09);
  --soft: rgba(255, 255, 255, 0.06);
  --light: rgba(120, 132, 150, 0.22);
  --shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.4), 0 10px 36px rgba(0, 0, 0, 0.35);
  --danger: #FF7A72;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: linear-gradient(180deg, var(--mist-1) 0%, var(--mist-2) 55%, var(--mist-3) 100%) fixed;
  background-color: var(--mist-2);
  -webkit-font-smoothing: antialiased;
}

/* The Settings-glass lights over the mist. */
.lights {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(40vmax 30vmax at 12% 8%, var(--light), transparent 70%),
    radial-gradient(36vmax 28vmax at 92% 30%, var(--light), transparent 70%),
    radial-gradient(50vmax 30vmax at 50% 105%, var(--light), transparent 70%);
}

h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
img { display: block; }

.muted { color: var(--steel); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--steel); margin: 22px 4px 10px; }

/* Glass */
.panel, .glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
}
.panel { border-radius: var(--radius); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.small { height: 36px; padding: 0 15px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn.ink { background: var(--ink); color: var(--on-ink); }
.btn.glass { color: var(--ink); }
.btn:disabled { opacity: 0.38; cursor: default; transform: none; }
.btn.danger { color: var(--danger); }
/* Apple's own: black, or white in the dark. */
.btn.apple { background: #000; color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.apple { background: #fff; color: #000; } }
:root[data-theme="dark"] .btn.apple { background: #fff; color: #000; }
.google-slot { display: flex; justify-content: center; min-height: 44px; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 999px; border: 0; display: inline-grid; place-items: center;
  background: var(--soft); color: var(--ink); cursor: pointer; flex: none;
}
.icon-btn svg { width: 16px; height: 16px; }

/* Fields */
.field {
  width: 100%; height: 46px; padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--hair);
  background: var(--glass-strong); outline: none;
}
.field:focus { border-color: var(--steel); }
.field.slim { height: 36px; border-radius: 999px; font-size: 14px; padding: 0 14px; }
.field::placeholder { color: var(--steel); }

svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Start */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.boot img { border-radius: 15px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.55; transform: scale(0.96); } }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }

/* Home page */
.landing { max-width: 1080px; margin: 0 auto; padding: 24px 20px 40px; }
.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 48px; align-items: start; padding-top: 28px; }
.hero h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 700; }
.lede { margin-top: 20px; font-size: 18px; max-width: 30em; color: var(--steel); }
.hero-mock { position: relative; margin-top: 40px; height: 230px; max-width: 470px; }
.mock-drop { position: absolute; inset: 0 40px 30px 0; padding: 18px; }
.mock-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mock-zone {
  margin-top: 16px; height: 110px; border-radius: 16px; border: 1.5px dashed var(--hair);
  display: grid; place-items: center; color: var(--steel); font-weight: 500;
}
.mock-note {
  position: absolute; right: 0; bottom: 0; width: 290px; padding: 12px 14px;
  display: flex; gap: 11px; align-items: center; border-radius: 20px; background: var(--glass-strong);
}
.mock-note img { border-radius: 8px; flex: none; }
.mock-note div { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; min-width: 0; }
.mock-note em { margin-left: auto; align-self: flex-start; font-style: normal; font-size: 12px; color: var(--steel); }

.signin { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.signin h2 { font-size: 22px; letter-spacing: -0.02em; }
.signin form { display: flex; flex-direction: column; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--steel); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.form-note { font-size: 13px; min-height: 0; }
.form-note:empty { display: none; }
.form-note.bad { color: var(--danger); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 64px; }
.feature { padding: 22px; }
.feature h3 { font-size: 16px; margin: 14px 0 6px; }
.feature p { color: var(--steel); font-size: 14px; }
.feature-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; }
.feature-icon svg { width: 22px; height: 22px; }
.footer { text-align: center; color: var(--steel); font-size: 12px; padding: 30px 20px 40px; }

.center { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 20px; }
.center .signin { width: min(400px, 100%); }

/* App */
.app-top { padding-top: 12px; padding-bottom: 12px; }
.tabs {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
}
.tabs a {
  position: relative; padding: 7px 16px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 14px; color: var(--steel);
}
.tabs a.on { background: var(--ink); color: var(--on-ink); }
.me { width: 34px; height: 34px; border-radius: 999px; overflow: hidden; text-decoration: none; flex: none; }
.badge {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: var(--ink); color: var(--on-ink);
  font-size: 11px; font-style: normal; font-weight: 700; vertical-align: 1px;
}
.tabs a.on .badge, .segment button.on .badge { background: var(--on-ink); color: var(--ink); }

.page { max-width: 880px; margin: 0 auto; padding: 8px 20px 60px; }
.view { animation: rise 0.25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* Avatars */
.avatar {
  width: 100%; height: 100%; border-radius: 999px; display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink); font-weight: 600; font-size: 13px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.device { background: var(--soft); color: var(--ink); }
/* Someone without a photo: their glass face (faces.js), white initials on it. */
.glass-face {
  background-color: #8E979E; background-size: cover; background-position: center;
  color: #fff; letter-spacing: 0.01em; text-shadow: 0 1px 3px rgba(11, 16, 32, 0.3);
}
.avatar.device svg { width: 55%; height: 55%; }

/* Chips (the pages' pickers) */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 5px;
  border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--glass);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.mock-chips .chip { height: 32px; padding: 0 12px; font-size: 13px; }
.chip .chip-face { width: 28px; height: 28px; flex: none; }
.chip.on { background: var(--ink); color: var(--on-ink); border-color: transparent; }
.chip.on .avatar { box-shadow: 0 0 0 1.5px var(--on-ink); }
.chip.on .avatar.device { background: rgba(255,255,255,0.16); color: var(--on-ink); }

.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: var(--glass-strong); border: 1px solid var(--hair);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.tile img.thumb, .tile video.thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .tile-body { position: relative; padding: 9px 10px; font-size: 12px; line-height: 1.3; }
.tile .tile-name { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.tile .tile-sub { color: var(--steel); font-size: 11px; }
.tile.has-thumb .tile-body { color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.55)); }
.tile.has-thumb .tile-sub { color: rgba(255,255,255,0.8); }
.tile .tile-icon { position: absolute; top: 12px; left: 12px; width: 30px; height: 30px; color: var(--steel); }
.tile .tile-icon svg { width: 100%; height: 100%; }
.tile .note { position: absolute; inset: 10px 10px 30px; font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; word-break: break-word; }
.tile .remove {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 999px; border: 0;
  background: rgba(0,0,0,0.55); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.tile .remove svg { width: 12px; height: 12px; stroke-width: 2.4; }
.tile .play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); width: 34px; height: 34px; border-radius: 999px; background: rgba(0,0,0,0.45); display: grid; place-items: center; color: #fff; }
.tile .play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; margin-left: 2px; }

/* Segments (the pages' tabs) */
.segment {
  display: inline-flex; padding: 4px; border-radius: 999px; background: var(--glass);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
}
.segment button { border: 0; background: none; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--steel); cursor: pointer; }
.segment button.on { background: var(--ink); color: var(--on-ink); }
.empty { text-align: center; color: var(--steel); padding: 60px 20px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.more { display: flex; justify-content: center; margin-top: 16px; }

/* You */
.profile { display: flex; align-items: center; gap: 16px; padding: 18px; margin-top: 10px; }
.profile .face { width: 60px; height: 60px; flex: none; }
.profile .face .avatar { font-size: 22px; }
.profile h2 { font-size: 20px; letter-spacing: -0.02em; }
.profile .username { border: 0; background: none; padding: 0; color: var(--steel); cursor: pointer; font-size: 14px; }
.list { padding: 4px 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.row + .row { border-top: 1px solid var(--hair); }
.row .face { width: 36px; height: 36px; flex: none; }
.row .row-words { flex: 1; min-width: 0; }
.row .row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .row-sub { color: var(--steel); font-size: 12px; }
.row .tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--steel); margin-left: 6px; vertical-align: 1px; }
.row .row-actions { display: flex; gap: 6px; }
.row input.field { height: 34px; border-radius: 10px; }
.you-foot { display: flex; justify-content: center; margin-top: 28px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center;
  animation: rise 0.2s ease;
}

/* Phone width: tabs move to the foot. */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 8px; }
  .hero-mock { height: 210px; }
  .features { grid-template-columns: 1fr; margin-top: 40px; }
  .topbar { padding: 12px 16px; }
  .landing, .page { padding-left: 16px; padding-right: 16px; }
  .page { padding-bottom: 110px; }
  .tabs {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 20;
  }
  .tabs a { padding: 10px 18px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .mock-note { width: 250px; }
}

/* Home page: sections */
.block { margin-top: 72px; }
.block-title { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.025em; }
.block-lede { color: var(--steel); font-size: 16px; margin-top: 10px; max-width: 38em; }
.block .features { margin-top: 22px; grid-template-columns: repeat(4, 1fr); }
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 22px; }
.ring { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.ring b { font-size: 17px; }
.ring span { color: var(--steel); font-size: 14px; }
.cta { padding: 34px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cta .btn { margin-top: 16px; }

.mock-chat { position: absolute; inset: 0 60px 34px 0; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.mock-bubble { align-self: flex-start; display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 18px; background: var(--glass-strong); font-size: 14px; font-weight: 500; }
.mock-bubble.out { align-self: flex-end; background: var(--ink); color: var(--on-ink); }
.mock-bubble em { font-style: normal; font-size: 12px; color: var(--steel); }
.mock-play { width: 22px; height: 22px; border-radius: 999px; background: var(--ink); position: relative; }
.mock-play::after { content: ""; position: absolute; left: 8px; top: 6px; border-left: 8px solid var(--on-ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.mock-wave { display: inline-flex; align-items: center; gap: 2px; height: 22px; }
.mock-wave i { width: 3px; border-radius: 2px; background: var(--steel); height: 30%; }
.mock-wave i:nth-child(3n) { height: 80%; } .mock-wave i:nth-child(4n+1) { height: 55%; } .mock-wave i:nth-child(5n+2) { height: 100%; }

/* Chats */
.page:has(#view-chats:not([hidden])) { max-width: 1080px; }
.chats { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 96px); min-height: 460px; }
.chat-list { overflow-y: auto; padding: 6px 0; }
.chat-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; }
.chat-row:hover { background: var(--soft); }
.chat-row.on { background: var(--soft); }
.chat-row .face { width: 42px; height: 42px; flex: none; }
.chat-row .row-words { flex: 1; min-width: 0; }
.chat-row .row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .row-sub { color: var(--steel); font-size: 12px; }
.chat-row .badge { margin-left: 0; }
.list-head { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--steel); padding: 12px 16px 4px; }

.chat { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px; }
.chat-empty img { border-radius: 13px; margin-bottom: 8px; }
.chat-open { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.chat-head .face { width: 36px; height: 36px; flex: none; }
.chat-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.chat-head .back { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; font-size: 12px; color: var(--steel); font-weight: 600; margin: 12px 0 6px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 460px); margin-top: 6px; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg .sender { font-size: 12px; color: var(--steel); margin: 0 10px 2px; }
.bubble { border-radius: 20px; padding: 9px 13px; background: var(--glass-strong); border: 1px solid var(--hair); display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.msg.out .bubble { background: var(--ink); color: var(--on-ink); border-color: transparent; }
.bubble .text { white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.bubble .things { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; min-width: min(260px, 60vw); }
.bubble .things .tile { cursor: pointer; color: var(--ink); }
.bubble .sealed { font-size: 14px; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.voice .play-btn { width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.msg.out .voice .play-btn { background: var(--on-ink); color: var(--ink); }
.voice .play-btn svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.voice .play-btn.loading { opacity: 0.5; }
.voice .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 28px; --done: 0%; }
.voice .wave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: 0.35; }
.voice .wave i.lit { opacity: 1; }
.voice .length { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.7; }
.msg .meta { font-size: 11px; color: var(--steel); margin: 3px 10px 0; display: flex; gap: 6px; align-items: center; }
.msg .meta .tag { font-weight: 700; color: var(--ink); }
.msg .new-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--ink); display: inline-block; }
.msg .reactions { font-size: 15px; margin: 2px 8px 0; }

.composer { border-top: 1px solid var(--hair); padding: 10px 12px 12px; }
.composer-tray { margin-bottom: 8px; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.composer-take { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 6px 8px 6px 6px; border-radius: 999px; background: var(--soft); }
.composer-take .voice { flex: 1; min-width: 0; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer .plus { width: 40px; height: 40px; }
.message-field { height: 40px; min-height: 40px; max-height: 140px; resize: none; padding: 9px 14px; border-radius: 20px; line-height: 1.4; flex: 1; }
.ring-pill {
  height: 40px; border-radius: 999px; border: 1px solid var(--hair); background: var(--glass-strong);
  padding: 0 28px 0 14px; font-weight: 600; font-size: 14px; color: var(--ink); cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px; background-size: 5px 5px; background-repeat: no-repeat;
}
.mic, .send { width: 48px; height: 48px; border-radius: 999px; border: 0; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; cursor: pointer; flex: none; margin-bottom: -4px; transition: transform 0.15s ease; }
.mic:active, .send:active { transform: scale(0.94); }
.mic svg, .send svg { width: 22px; height: 22px; stroke-width: 2; }
.mic.recording { background: var(--danger); color: #fff; }
.mic.recording svg { display: none; }
.mic.recording::after { content: ""; width: 14px; height: 14px; border-radius: 3px; background: #fff; }
.composer-note:empty { display: none; }
.composer-note { margin: 6px 4px 0; }
.composer-note.bad { color: var(--danger); }
.rec-level { width: 22px; height: 22px; border-radius: 999px; background: var(--danger); flex: none; transition: transform 0.06s linear; }

@media (max-width: 760px) {
  .rings, .block .features { grid-template-columns: 1fr 1fr; }
  .block { margin-top: 48px; }
  .chats { display: block; height: auto; }
  .chats .chat-list { min-height: 50vh; }
  .chats.opened .chat-list { display: none; }
  .chats:not(.opened) .chat { display: none; }
  .chats .chat { height: calc(100vh - 170px - env(safe-area-inset-bottom)); }
  .chat-head .back { display: inline-grid; }
  .msg { max-width: 88%; }
  .ring-pill { padding: 0 24px 0 10px; font-size: 13px; }
}
@media (max-width: 420px) {
  .rings, .block .features { grid-template-columns: 1fr; }
}
.page:has(#view-chats:not([hidden])) { padding-bottom: 16px; }
@media (max-width: 760px) { .page:has(#view-chats:not([hidden])) { padding-bottom: 96px; } }

/* ── The app's frame: a rail at the far left on a computer, the page using
   the rest of the screen; a tab bar at the foot on a phone. ── */
#app:not([hidden]) { display: grid; grid-template-columns: 84px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  border-right: 1px solid var(--glass-edge);
}
.rail-brand span { display: none; }
.rail-brand { margin-bottom: 12px; }
.rail-items { display: flex; flex-direction: column; gap: 2px; flex: 1; width: 100%; }
.rail-items a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 2px 7px; border-radius: 14px; text-decoration: none; color: var(--steel);
  font-size: 11px; font-weight: 600; letter-spacing: -0.01em; text-align: center;
}
.rail-items a svg { width: 22px; height: 22px; }
.rail-items a:hover { background: var(--soft); color: var(--ink); }
.rail-items a.on { background: var(--ink); color: var(--on-ink); }
.rail-items a .badge { position: absolute; top: 3px; right: 8px; margin: 0; }
.rail-items a.on .badge { background: var(--on-ink); color: var(--ink); }
.rail .me { width: 38px; height: 38px; margin-top: 8px; }
.phone-top { display: none; }

#app .page { max-width: none; width: 100%; margin: 0; padding: 18px 24px 40px; }
#app .page > .view:not(.chats) { max-width: 1180px; margin: 0 auto; }

/* Chats: the list right by the rail, the chat taking all the rest. */
#app .chats {
  grid-template-columns: clamp(280px, 26vw, 380px) minmax(0, 1fr);
  height: calc(100vh - 24px); gap: 12px; margin: 0;
}
.page:has(#view-chats:not([hidden])) { padding: 12px !important; }
.chat-head { padding: 14px 20px; }
.messages { padding: 20px clamp(16px, 3vw, 40px); }
.msg { max-width: min(68%, 620px); }
.composer { padding: 12px clamp(12px, 2vw, 28px) 14px; }

@media (max-width: 760px) {
  #app:not([hidden]) { display: block; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--glass-edge);
  }
  .rail-brand, .rail .me, .rail-items a[data-more] { display: none; }
  .rail-items { flex-direction: row; justify-content: space-around; }
  .rail-items a { flex: 1; padding: 6px 2px 5px; font-size: 10px; }
  .phone-top {
    position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: var(--glass); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
    border-bottom: 1px solid var(--glass-edge);
  }
  .phone-top .brand img { border-radius: 7px; }
  .phone-title { flex: 1; font-size: 17px; letter-spacing: -0.01em; }
  .phone-top .icon-btn { width: 36px; height: 36px; text-decoration: none; }
  .phone-top .icon-btn svg { width: 19px; height: 19px; }
  #app .page { padding: 12px 16px 96px; }
  .page:has(#view-chats:not([hidden])) { padding: 8px 8px 84px !important; }
  #app .chats { display: block; height: auto; }
  #app .chats .chat { height: calc(100dvh - 76px - env(safe-area-inset-top)); }
  /* In a chat, the chat has the whole screen. */
  body:has(#view-chats.opened:not([hidden])) .rail { display: none; }
  body:has(#view-chats.opened:not([hidden])) .page { padding-bottom: 8px !important; }
  body:has(#view-chats.opened:not([hidden])) #app .chats .chat { height: calc(100dvh - 72px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .msg { max-width: 86%; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
#app .page:has(#view-chats:not([hidden])) { max-width: none; }
.chat-row .row-words { display: flex; flex-direction: column; gap: 1px; }

/* ── The frame, take two (user, 2026-10-30): tabs across the top, the chat
   list at the screen's left edge, the chat taking the rest. ── */
#app:not([hidden]) { display: flex; flex-direction: column; min-height: 100vh; }
.topnav {
  position: sticky; top: 0; z-index: 20; height: 62px;
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  border-bottom: 1px solid var(--glass-edge);
}
.topnav .brand { flex: none; }
.topnav-items {
  display: flex; gap: 2px; margin: 0 auto; padding: 4px; border-radius: 999px;
  background: var(--soft);
}
.topnav-items a {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--steel); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.topnav-items a svg { width: 18px; height: 18px; flex: none; }
.topnav-items a:hover { color: var(--ink); }
.topnav-items a.on { background: var(--ink); color: var(--on-ink); }
.topnav-items a .badge { margin-left: 0; }
.topnav-items a.on .badge { background: var(--on-ink); color: var(--ink); }
.topnav-settings { flex: none; width: 36px; height: 36px; text-decoration: none; }
.topnav-settings.on { background: var(--ink); color: var(--on-ink); }
.topnav-settings svg { width: 18px; height: 18px; }
.topnav .me { width: 34px; height: 34px; flex: none; }
#app .page { flex: 1; }
#app .chats { height: calc(100vh - 62px - 24px); }

@media (max-width: 1060px) {
  .topnav-items a span { display: none; }
  .topnav-items a { padding: 9px 13px; }
  .topnav .brand span { display: none; }
}

@media (max-width: 760px) {
  #app:not([hidden]) { display: block; }
  .topnav {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-bottom: 0; border-top: 1px solid var(--glass-edge);
  }
  .topnav .brand, .topnav .me, .topnav-settings, .topnav-items a[data-more] { display: none; }
  .topnav-items { margin: 0; width: 100%; padding: 0; background: none; justify-content: space-around; }
  .topnav-items a { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px 5px; font-size: 10px; border-radius: 12px; }
  .topnav-items a span { display: block; }
  .topnav-items a svg { width: 22px; height: 22px; }
  .topnav-items a .badge { position: absolute; top: 2px; right: calc(50% - 22px); }
  body:has(#view-chats.opened:not([hidden])) .topnav { display: none; }
}

/* ── File Share: a drop. The space is empty until something's added; Send to
   (a glass pane of faces) under it; what's sent to you waits on top. ── */
#app .page > #view-share { max-width: 860px; }
.fs-head { margin: 2px 2px 14px; }
.fs-head h1 { font-size: 28px; letter-spacing: -0.025em; }

/* Sent to you: a card each, until Save or ✕ */
.fs-inbox { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.fs-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "face words thumbs acts";
  align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; animation: rise 0.25s ease;
}
.fs-card .face { grid-area: face; width: 40px; height: 40px; }
.fs-card-words { grid-area: words; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.fs-card-words b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-thumbs { grid-area: thumbs; display: flex; gap: 6px; min-width: 0; }
.fs-thumb {
  position: relative; flex: none; width: 46px; height: 46px; padding: 0; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--hair); background: var(--glass-strong); color: var(--steel);
  display: grid; place-items: center; cursor: pointer;
}
.fs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fs-thumb > svg { width: 20px; height: 20px; }
.fs-thumb .play { position: absolute; width: 20px; height: 20px; border-radius: 999px; background: rgba(0,0,0,0.45); color: #fff; display: grid; place-items: center; }
.fs-thumb .play svg { width: 9px; height: 9px; fill: currentColor; stroke: none; margin-left: 1px; }
.fs-thumb-note { align-self: start; width: 100%; padding: 4px; font-size: 8px; line-height: 1.25; color: var(--ink); text-align: left; overflow: hidden; overflow-wrap: anywhere; }
.fs-thumb-more { font-weight: 600; font-size: 13px; color: var(--ink); }
.fs-card-acts { grid-area: acts; display: flex; align-items: center; gap: 8px; }

/* The space: one Add, and drops anywhere on the page */
.fs-space { position: relative; border-radius: var(--radius); }
.fs-space.over { outline: 2px dashed var(--steel); outline-offset: -2px; }
.fs-over {
  display: none; position: absolute; inset: 0; z-index: 2; place-items: center; border-radius: inherit;
  background: var(--glass-strong); font-weight: 600; font-size: 17px; pointer-events: none;
}
.fs-space.over .fs-over { display: grid; }
.fs-empty {
  min-height: min(56vh, 460px); padding: 32px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.fs-empty-icon {
  width: 64px; height: 64px; margin-bottom: 12px; border-radius: 999px; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
}
.fs-empty-icon svg { width: 28px; height: 28px; }
.fs-empty-title { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.fs-add { margin-top: 18px; min-width: 112px; }
.fs-add svg { width: 18px; height: 18px; stroke-width: 2.2; }

/* What's going: tiles, each with its upload line */
.fs-tray { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; padding: 2px 0 16px; }
.fs-tray .tile { cursor: pointer; transition: opacity 0.2s ease; }
.fs-tray .tile.fs-new { animation: fs-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
@keyframes fs-in { from { opacity: 0; transform: scale(0.88); } }
.fs-tray.away .tile { opacity: 0; transition-duration: 0.15s; }
.fs-up { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none; transition: opacity 0.3s ease; }
.fs-up i { display: block; width: 0; height: 100%; background: var(--ink); transition: width 0.2s ease; }
.tile.has-thumb .fs-up i { background: #fff; }
.tile.fs-done .fs-up, .tile.fs-failed .fs-up { opacity: 0; }
.tile.fs-failed { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.fs-more-tile {
  align-items: center; justify-content: center; gap: 4px; padding: 0;
  background: transparent; border: 1.5px dashed var(--hair); color: var(--steel); font-weight: 600; font-size: 13px;
}
.fs-more-tile svg { width: 22px; height: 22px; }
.fs-more-tile:hover { color: var(--ink); border-color: var(--steel); }

/* Send to: faces, ringed when picked; the ring is the send's progress while it goes */
.fs-send { padding: 16px 18px; animation: rise 0.3s ease; }
.fs-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--steel); }
.fs-row-label { font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.fs-faces { display: flex; flex-wrap: wrap; gap: 2px 6px; }
.fs-face {
  display: flex; flex-direction: column; align-items: center; gap: 7px; width: 80px; padding: 8px 0 4px;
  border: 0; background: none; color: var(--ink); cursor: pointer;
}
.fs-pic { position: relative; width: 56px; height: 56px; transition: transform 0.15s ease; }
.fs-pic .avatar { font-size: 18px; }
.fs-face:active .fs-pic { transform: scale(0.94); }
.fs-ring { position: absolute; inset: -6px; width: 68px; height: 68px; transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.fs-ring circle { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.fs-ring .track { opacity: 0; transition: opacity 0.2s ease; }
.fs-ring .bar { stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; transition: stroke-dashoffset 0.3s ease, opacity 0.15s ease; }
.fs-face.on .fs-ring .bar { stroke-dashoffset: 0; opacity: 1; }
.fs-to.sending .fs-face.on .fs-ring .track { opacity: 0.16; }
.fs-to.sending .fs-face:not(.on) { opacity: 0.35; transition: opacity 0.2s ease; }
.fs-to.sent .fs-face.on .fs-pic { animation: fs-sent 0.5s ease; }
@keyframes fs-sent { 40% { transform: scale(1.1); } }
.fs-name {
  max-width: 100%; font-size: 12px; line-height: 1.25; font-weight: 500; text-align: center; word-break: break-word;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.fs-face.on .fs-name { font-weight: 700; }
.fs-none { margin: 2px 0 6px; }
.fs-fail { margin-top: 12px; color: var(--danger); font-size: 13px; font-weight: 500; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fs-fail .link-btn { color: inherit; font-size: 13px; padding: 0; text-decoration: underline; }
.fs-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair); }
.fs-foot p { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-foot .btn { min-width: 112px; flex: none; }

/* A tile flying into a face */
.fs-ghost { position: fixed; z-index: 70; margin: 0; pointer-events: none; will-change: transform, opacity; }
.fs-ghost .remove, .fs-ghost .fs-up { display: none; }

/* Add's menu, and a device's */
.fs-menu {
  position: fixed; z-index: 60; min-width: 200px; padding: 6px; border-radius: 18px;
  background: var(--glass-strong); display: flex; flex-direction: column; animation: fs-pop 0.16s ease;
}
@keyframes fs-pop { from { opacity: 0; transform: scale(0.96); } }
.fs-menu-item {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border: 0; border-radius: 12px;
  background: none; color: var(--ink); font-weight: 500; font-size: 15px; text-align: left; cursor: pointer;
}
.fs-menu-item:hover, .fs-menu-item:focus-visible { background: var(--soft); outline: none; }
.fs-menu-item svg { width: 19px; height: 19px; color: var(--steel); }
.fs-menu-item.danger, .fs-menu-item.danger svg { color: var(--danger); }

/* Link, Note and Rename; and the viewer */
.fs-dialog {
  padding: 0; border: 1px solid var(--glass-edge); border-radius: var(--radius); color: var(--ink);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: var(--shadow);
}
.fs-dialog::backdrop { background: rgba(10, 12, 15, 0.34); }
.fs-write { width: min(440px, calc(100vw - 32px)); }
.fs-write form { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.fs-write b { font-size: 17px; }
.fs-write-note { height: auto; min-height: 150px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.fs-write-foot { display: flex; justify-content: flex-end; gap: 8px; }
.fs-view { width: min(1040px, calc(100vw - 32px)); height: min(88vh, 900px); max-width: none; max-height: none; overflow: hidden; }
.fs-view[open] { display: flex; flex-direction: column; }
.fs-view-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--hair); }
.fs-view-words { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.fs-view-words b, .fs-view-words span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-view-body { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px; }
.fs-view-body img, .fs-view-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.fs-view-body iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; }
.fs-view-note { width: 100%; max-width: 640px; height: 100%; overflow: auto; font-size: 17px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
textarea.fs-view-note { padding: 16px; border-radius: 16px; resize: none; }
.fs-view-file { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: min(100%, 520px); text-align: center; word-break: break-word; }
.fs-view-icon { width: 56px; height: 56px; margin-bottom: 6px; color: var(--steel); }
.fs-view-icon svg { width: 100%; height: 100%; }
.fs-view-file .btn { margin-top: 12px; }
.fs-wait { width: 34px; height: 34px; border-radius: 999px; border: 2.5px solid var(--hair); border-top-color: var(--ink); animation: fs-spin 0.8s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }
.fs-step {
  position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--glass-edge); background: var(--glass-strong); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow);
}
.fs-step svg { width: 18px; height: 18px; }
.fs-step.prev { left: 12px; }
.fs-step.next { right: 12px; }

@media (max-width: 760px) {
  .fs-head h1 { display: none; }
  .fs-head { margin: 0; }
  .fs-card { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "face words acts" "thumbs thumbs thumbs"; gap: 10px 12px; }
  .fs-card-words b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .fs-thumbs { overflow-x: auto; scrollbar-width: none; }
  .fs-thumbs::-webkit-scrollbar { display: none; }
  .fs-thumb { width: 56px; height: 56px; }
  .fs-empty { min-height: 52vh; }
  .fs-tray { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
  .fs-send { padding: 14px 16px; }
  /* Faces in a strip, edge to edge in the pane */
  .fs-faces { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 10px; scrollbar-width: none; }
  .fs-faces::-webkit-scrollbar { display: none; }
  .fs-face { flex: none; width: 74px; }
  .fs-view { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; border: 0; border-radius: 0; }
  .fs-view-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .fs-view-body { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  #view-share, .fs-card, .fs-send, .fs-tray .tile.fs-new, .fs-menu, .fs-to.sent .fs-pic { animation: none !important; }
  .fs-ring .bar, .fs-ring .track, .fs-up, .fs-up i, .fs-pic { transition: none; }
}
