:root {
  --ink: #1c1c1a;
  --muted: #5c5c57;
  --line: #d9d9d4;
  --field: #c9c9c4;
  --soft: #f4f4f1;
  --fill: #e2e2de;
  --page: #ffffff;
  --ground: #efefeb;
  --link: #2458c6;
  --mark: #fff1b8;
  --mark-ink: #7a5a00;
  --bad: #9e2a1a;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: 'IBM Plex Sans', 'Helvetica Neue', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--link); }
button, input, textarea { font: inherit; color: inherit; }
.app {
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--page);
  display: flex;
  flex-direction: column;
}
.top { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px; border-bottom: 1px solid #ecece8; }
.top .back { width: 44px; height: 44px; margin-left: -10px; display: flex; align-items: center; justify-content: center; color: var(--ink); border-radius: 12px; text-decoration: none; }
.top .title { font-weight: 600; }
.top .tag { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.logo { width: 24px; height: 24px; border-radius: 7px; background: var(--fill); border: 1px dashed #9a9a94; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 10px 20px 0; }
.steps span { height: 4px; border-radius: 2px; background: var(--fill); }
.steps span.on { background: var(--ink); }
main { flex: 1; padding: 24px 20px 24px; display: flex; flex-direction: column; gap: 18px; }
h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -0.3px; }
h2 { margin: 0; font-size: 18px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.fine { font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.btn {
  height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--field); background: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.link { background: none; border: none; color: var(--link); font-weight: 500; cursor: pointer; padding: 10px 0; font-size: 15px; }
.chip {
  height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--field); background: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.chip.on, .choice.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice { height: 46px; border-radius: 12px; border: 1px solid var(--field); background: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
label, .label { font-size: 14px; font-weight: 600; }
.opt { font-weight: 400; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
input[type=text], input:not([type]), textarea {
  width: 100%; border: 1px solid var(--field); border-radius: 12px; padding: 12px 14px; font-size: 17px; background: #fff;
}
input[type=text], input:not([type]) { height: 50px; }
textarea { resize: vertical; min-height: 130px; line-height: 1.45; }
.hint { font-size: 13px; color: var(--muted); }
.count { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.count .bar { flex: 1; height: 4px; border-radius: 2px; background: var(--ground); overflow: hidden; }
.count .bar i { display: block; height: 4px; background: var(--muted); }
.bottom {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid #ecece8;
  padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 8px;
}
.bottom .row > * { flex: 1; }
.bottom .row > .back-btn { flex: none; padding: 0 16px 0 10px; gap: 2px; }
.back-btn svg { width: 22px; height: 22px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.on { border: 2px solid var(--ink); }
.card audio { width: 100%; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: #fff; }
.song-list a { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #ecece8; color: var(--ink); text-decoration: none; }
.song-list .who { flex: 1; min-width: 0; }
.song-list .who b { display: block; }
.song-list .state { font-size: 13px; color: var(--muted); white-space: nowrap; }
.lyrics { display: flex; flex-direction: column; gap: 16px; }
.section-name { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.line {
  display: flex; width: calc(100% + 16px); margin: 0 -8px; padding: 2px 8px; border: none; border-radius: 6px; background: transparent;
  text-align: left; font-size: 18px; line-height: 1.45; cursor: pointer; gap: 8px; align-items: baseline;
}
.line:hover { background: var(--soft); }
.line.changed { background: var(--mark); }
.line .tag { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--mark-ink); margin-left: auto; }
.editing { display: flex; flex-direction: column; gap: 8px; margin: 4px 0; }
.note { font-size: 14px; color: var(--muted); }
.banner { border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.banner.bad { background: #fbe9e5; color: var(--bad); }
.banner.info { background: var(--soft); }
.busy { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }
.spin { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.spin i { display: block; width: 40%; height: 4px; background: var(--ink); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
.icon { width: 64px; height: 64px; border-radius: 50%; background: var(--ground); display: flex; align-items: center; justify-content: center; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.32); z-index: 10; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 460px; z-index: 11;
  background: #fff; border-radius: 20px 20px 0 0; padding: 12px 20px 24px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.14);
}
.grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: #d0d0cb; }
.sheet .row > *, .editing .row > * { flex: 1; }
.sheet { max-height: 88vh; overflow-y: auto; }
.sheet > * { flex-shrink: 0; }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bad { color: var(--bad); }
.small-btn { height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; flex: none; }
/* pictures */
.between { justify-content: space-between; align-items: baseline; }
.fill { display: flex; gap: 2px; }
.fill i { flex: 1; height: 10px; border-radius: 2px; background: var(--fill); }
.fill i.on { background: var(--ink); }
.fill.full i.on { background: #2f7d4a; }
.moments { display: flex; flex-direction: column; }
#mine:empty, #moments:empty, #fill:empty { display: none; }
.moment { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 0; border: none; border-bottom: 1px solid #ecece8;
  background: none; text-align: left; cursor: pointer; color: var(--ink); }
.moment-pic { flex: none; width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.moment-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.moment.missing .moment-pic { border: 1.5px dashed #b4b4ae; background: #fff; }
.moment.guess .moment-pic { outline: 3px solid #f2cf4a; outline-offset: 1px; }
.moment-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.moment .state { color: var(--muted); }
.moment.guess .state { color: var(--mark-ink); font-weight: 600; }
.moment .more { flex: none; color: #9a9a94; }
.to-find { margin-top: 6px; color: var(--muted); }
.to-find b { color: var(--ink); }
.tile.busy img { animation: blink 1.2s ease-in-out infinite; }
.looking i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 6px; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles:empty { display: none; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--soft); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; text-align: center; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-pic { width: 100%; height: 100%; padding: 0; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ours { display: flex; gap: 12px; align-items: center; }
.ours img { width: 88px; height: 88px; flex: none; object-fit: cover; border-radius: 10px; border: 2px solid var(--ink); }
.big-pic img { display: block; max-width: 100%; max-height: 42vh; margin: 0 auto; border-radius: 12px; }
.line-choice { height: auto; min-height: 46px; padding: 10px 14px; text-align: left; line-height: 1.3; }
.btn.danger { color: var(--bad); }
.tile .x { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.tile .kind, .tile .used { position: absolute; bottom: 4px; font-size: 11px; font-weight: 700; background: rgba(0, 0, 0, 0.6);
  color: #fff; padding: 2px 6px; border-radius: 6px; }
.tile .kind { left: 4px; }
.tile .used { right: 4px; }
.tiles.four .x { width: 24px; height: 24px; font-size: 16px; }
.tiles.four .kind { top: 4px; bottom: auto; }
.tiles.four .used { left: 4px; right: auto; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick { padding: 0; cursor: pointer; }
.pick.on { outline: 3px solid var(--ink); outline-offset: -3px; }
.upload { display: flex; flex-direction: column; gap: 4px; }
.upload .bar { height: 4px; border-radius: 2px; background: var(--ground); overflow: hidden; }
.upload .bar i { display: block; height: 4px; background: var(--ink); }
.upload.failed .bar i { background: var(--bad); }
/* the video */
.player { display: block; height: 72vh; width: auto; max-width: 100%; aspect-ratio: 9 / 16; margin: 0 auto; background: #000; border-radius: 14px; }
.shots { display: flex; flex-direction: column; }
.shot { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #ecece8; }
.shot-pic { flex: none; width: 54px; height: 96px; padding: 0; border: none; border-radius: 8px; overflow: hidden; background: var(--soft); cursor: pointer; }
.shot-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; line-height: 1.35; }
.shot.changed { background: var(--mark); margin: 0 -20px; padding: 8px 20px; }
.shot .new { color: var(--mark-ink); font-weight: 700; }
.shot .undo { align-self: flex-start; padding: 2px 0; font-size: 14px; }
.terms { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.add-tile { border: 1.5px dashed #9a9a94; background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); padding: 8px; }
.top .tell { background: #fff; cursor: pointer; color: var(--ink); padding: 6px 12px; }
textarea.short { min-height: 88px; }
.said { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.answer-head { align-items: center; }
.mic { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--field); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; flex: none; }
.mic.on { background: #c62828; border-color: #c62828; color: #fff; }
.mic:disabled { opacity: 0.6; cursor: default; }
textarea.auto { min-height: 56px; resize: none; overflow: hidden; }

/* sending the video on: the file, or a link (sendSheet) */
.send-way { gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.send-way .fine { margin: 0; }
.send-way .bar { height: 4px; border-radius: 2px; background: var(--ground); overflow: hidden; }
.send-way .bar i { display: block; height: 4px; background: var(--ink); transition: width .2s; }
.linkbox { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.linkbox .link { padding: 8px; }
.link.danger { color: var(--bad); padding: 0; font-size: inherit; }
[hidden] { display: none !important; }
