:root {
  --bg: #040c09;
  --panel: rgba(12, 28, 20, 0.55);
  --text: #e8f0eb;
  --muted: #7f9588;
  --accent: #3ecf8e;
  --line: rgba(56, 140, 90, 0.28);
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(62, 207, 142, 0.12), transparent 55%),
    radial-gradient(700px 480px at 90% 0%, rgba(94, 200, 255, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.top-brand {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(0.95rem, 4.2vw, 1.35rem);
  letter-spacing: 0.28em;
  text-indent: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(105deg, rgba(46, 184, 114, 0.55) 0%, rgba(210, 255, 228, 0.98) 50%, rgba(30, 143, 90, 0.55) 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero {
  text-align: center;
  padding: 0.2rem 0 0.15rem;
}

.hero h1 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: clamp(1.2rem, 4vw, 1.55rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(210, 255, 228, 0.96);
}

.hero h1 iconify-icon { font-size: 1.15em; }

.tagline {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.install-hint {
  margin: 0.45rem 0 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(210, 255, 228, 0.55);
}

.install-hint.is-installed { display: none; }

.who, .bound-ok {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: rgba(210, 255, 228, 0.8);
}

.bound-ok { color: var(--accent); }

.err {
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(180, 70, 70, 0.16);
  color: #ffc9c9;
  font-size: 0.78rem;
  line-height: 1.35;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.place-grid,
.place-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.place-extra { margin-top: 0.5rem; }

.place-card,
.day-card { margin: 0; }

.place-card button,
.day-card button {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.place-card button { min-height: 88px; }

.place-card.is-mine button,
.day-card.is-mine button {
  border-color: rgba(62, 207, 142, 0.7);
  background: rgba(62, 207, 142, 0.16);
}

.day-card.is-today button {
  box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.45);
}

.day-card button {
  min-height: 62px;
  align-items: center;
  gap: 0.2rem;
  padding: 0.4rem 0.2rem;
  text-align: center;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
  margin-top: 0.65rem;
}

.day-name {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(210, 255, 228, 0.7);
}

.day-who {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  color: var(--text);
}

.shift-line {
  margin: 0.55rem 0 0;
  font-size: 0.9rem;
}

.shift-line strong { color: var(--accent); font-weight: 600; }

.shift-next {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.chip-empty { background: rgba(255, 255, 255, 0.04); color: var(--muted); }

.q-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.q-card {
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.q-meta, .q-counts { margin: 0; font-size: 0.68rem; color: var(--muted); }
.q-body { margin: 0.4rem 0; font-size: 0.88rem; line-height: 1.35; }

.q-new {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.kind-grid {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.kind-grid legend {
  padding: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.kind-chip { margin: 0; cursor: pointer; }

.kind-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.kind-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.75rem;
}

.kind-chip input:checked + span,
.kind-chip input:focus-visible + span {
  border-color: rgba(62, 207, 142, 0.7);
  background: rgba(62, 207, 142, 0.16);
  color: rgba(210, 255, 228, 0.96);
}

.q-compose {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.q-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.55rem;
}

.q-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem 0.75rem;
  font-size: 0.72rem;
}

.q-links a,
.q-links .linkish {
  color: rgba(210, 255, 228, 0.72);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-plus {
  min-width: 40px;
  padding: 0;
  font-size: 1.1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.place-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.place-name {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(210, 255, 228, 0.85);
}

.place-people { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(62, 207, 142, 0.14);
  color: inherit;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.chip-since {
  margin-left: 0.28rem;
  font-size: 0.62rem;
  color: var(--muted);
}

.chip-stale {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.checkin { margin-top: 0.75rem; }

.checkin label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.q-new select,
.q-new input[type="text"],
.stack input[type="password"],
.stack input[type="file"] {
  min-height: 40px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: 400 0.85rem/1.3 inherit;
  text-transform: none;
  letter-spacing: 0;
}

.tiny {
  margin: 0.7rem 0 0;
  font-size: 0.68rem;
  color: var(--muted);
}

.tiny a { color: rgba(210, 255, 228, 0.75); }

.revoke { margin: 0; text-align: center; }

.linkish {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.32);
  font: 500 0.68rem/1.3 inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 42%), var(--panel);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 0.85rem 1rem;
}

.strip h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(210, 255, 228, 0.9);
}

.empty {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font: 700 0.78rem/1 inherit;
  color: rgba(232, 248, 240, 0.96);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 48%), rgba(62, 207, 142, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 48%), rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.anchors {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.anchors .btn { width: 100%; }

.footer {
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.04em;
}

@media (min-width: 640px) {
  .anchors { flex-direction: row; }
}

.phone { max-width: 430px; }

body.home {
  padding-bottom: 0;
  height: 100dvh;
  overflow: hidden;
}

body.home .wrap.phone {
  height: 100dvh;
  max-height: 100dvh;
  padding: max(0.7rem, env(safe-area-inset-top)) 1rem max(0.55rem, env(safe-area-inset-bottom));
  gap: 0.4rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.mast {
  flex: 0 0 auto;
  text-align: left;
  padding: 0.15rem 0 0.25rem;
}

.mast h1 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: clamp(1.15rem, 5vw, 1.45rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(210, 255, 228, 0.96);
}

.me-line {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: rgba(210, 255, 228, 0.88);
}

.chat-btn {
  display: inline-flex;
  margin-top: 0.55rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(210, 255, 228, 0.9);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed { padding-bottom: 0.4rem; }

.feed-card {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.feed-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.feed-who {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(210, 255, 228, 0.82);
}

.feed-time {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.compose {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.15rem 0.7rem 0.15rem;
  background: rgba(0, 0, 0, 0.16);
}

.compose summary {
  cursor: pointer;
  min-height: 40px;
  display: flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(210, 255, 228, 0.9);
}

.compose[open] { padding-bottom: 0.7rem; }

.fold {
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 42%), var(--panel);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.fold-head {
  width: 100%;
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.fold-head::after {
  content: "▸";
  font-size: 0.72rem;
  color: var(--muted);
}

.fold.is-open .fold-head::after { content: "▾"; }

.fold.is-open .fold-head {
  border-bottom: 1px solid var(--line);
}

.fold-panel[hidden] { display: none; }

.who-where h2,
.shift-block h2,
.fold h2,
.fold-head {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(210, 255, 228, 0.8);
}

.fold-body,
.fold .place-board {
  padding: 0.55rem 0.7rem 0.7rem;
}

.chat-window {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  margin-top: 0.15rem;
  overflow: hidden;
  background: rgba(0, 8, 6, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chat-window.is-open {
  flex: 1 1 auto;
  min-height: 180px;
}

.chat-window.has-unread:not(.is-open) .fold-head {
  color: rgba(210, 255, 228, 0.98);
}

.chat-fold-head {
  flex: 0 0 auto;
}

.fold-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.fold-title {
  letter-spacing: 0.08em;
}

.fold-badge {
  margin-left: auto;
  min-width: 1.35rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #04140c;
  font: 700 0.68rem/1.2 inherit;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
}

.fold-badge[hidden] { display: none; }

.chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-bar-hint {
  font-size: 0.65rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.chat-window .chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0.75rem 0.75rem 1rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scroll-behavior: smooth;
}

.chat-empty {
  margin: auto;
  padding: 1.6rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.chat-row {
  display: flex;
  position: relative;
  width: fit-content;
  max-width: 82%;
  touch-action: pan-y;
}

.chat-row.is-them { align-self: flex-start; }
.chat-row.is-mine { align-self: flex-end; }
.chat-row.is-follow { margin-top: -0.28rem; }
.chat-row.has-react { margin-bottom: 0.85rem; }
.chat-row.is-new { animation: row-in 0.24s ease; }

.swipe-hint {
  position: absolute;
  left: -1.35rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: var(--accent);
  font-size: 0.95rem;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.chat-row.is-swiping .swipe-hint { opacity: 1; }

.bubble {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0.48rem 0.72rem 0.4rem;
  border-radius: 18px 18px 18px 5px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 6px 18px rgba(0, 0, 0, 0.22);
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
}

.bubble::after {
  content: "";
  display: table;
  clear: both;
}

.chat-row.is-picked .bubble,
.chat-row.is-focus .bubble {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 18px rgba(0, 0, 0, 0.22),
    0 0 0 1.5px rgba(62, 207, 142, 0.5);
}

.chat-row.is-focus .bubble {
  animation: focus-pulse 1.1s ease;
}

.chat-all-mark {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.22rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: rgba(62, 207, 142, 0.18);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(190, 255, 220, 0.95);
}

.chat-row.is-all .bubble {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 18px rgba(0, 0, 0, 0.22),
    inset 2.5px 0 0 rgba(62, 207, 142, 0.8);
}

.chat-row.is-mine .bubble {
  border-radius: 18px 18px 5px 18px;
  background: rgba(62, 207, 142, 0.22);
}

.chat-name {
  margin: 0 0 0.14rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  color: rgba(120, 235, 180, 0.95);
}

.chat-window .bubble .chat-body {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.36;
  letter-spacing: 0;
  text-align: left;
  word-break: break-word;
}

.chat-meta {
  float: right;
  display: flex;
  align-items: flex-end;
  gap: 0.2rem;
  margin: 0.28rem 0 -0.05rem 0.55rem;
  min-height: 0;
}

.chat-time {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.64rem;
  line-height: 1.1;
  color: rgba(150, 175, 160, 0.78);
  white-space: nowrap;
}

.chat-row.is-mine .chat-time {
  color: rgba(180, 220, 200, 0.72);
}

.chat-quote {
  margin: 0 0 0.3rem;
  padding: 0.3rem 0.5rem;
  border-radius: 10px;
  border-left: 2px solid rgba(62, 207, 142, 0.55);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 15.5rem;
}

.react-mark {
  position: absolute;
  left: -0.05rem;
  bottom: -0.42rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.1rem 0.38rem;
  border: 1px solid rgba(62, 207, 142, 0.4);
  border-radius: 999px;
  background: #101c16;
  color: rgba(210, 255, 228, 0.95);
  font: 600 0.62rem/1.25 inherit;
  letter-spacing: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.react-mark.is-on {
  background: #1a3a2a;
  border-color: rgba(62, 207, 142, 0.7);
}

.react-mark.is-fresh { animation: react-in 0.28s cubic-bezier(0.2, 0.85, 0.3, 1.15); }
.react-mark.is-gone { animation: react-out 0.16s ease forwards; }

.react-mark::after {
  content: attr(data-who);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 4;
  min-width: 4.5rem;
  max-width: 10rem;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  background: #101a15;
  color: rgba(210, 255, 228, 0.92);
  font: 500 0.68rem/1.3 inherit;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.react-mark:hover::after,
.react-mark.is-who::after {
  opacity: 1;
  transform: translateY(0);
}

.react-mark:not([data-who])::after,
.react-mark[data-who=""]::after {
  content: none;
}

.reply-chip,
.composer-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  background: rgba(62, 207, 142, 0.08);
  border-left: 2px solid var(--accent);
  font-size: 0.72rem;
  color: var(--muted);
}

.reply-chip[hidden],
.composer-banner[hidden] { display: none; }

#reply-clear,
#edit-clear {
  margin-left: auto;
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent);
  font: 500 0.72rem/1 inherit;
  cursor: pointer;
}

.chat-sheet[hidden] {
  display: block;
  pointer-events: none;
}

.chat-sheet {
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.chat-sheet.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.chat-sheet-back {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
}

.chat-sheet-card {
  position: absolute;
  z-index: 1;
  min-width: 188px;
  padding: 0.3rem 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101a15;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transform: scale(0.94) translateY(8px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.18s ease;
}

.chat-sheet.is-open .chat-sheet-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.chat-sheet-line {
  margin: 0;
  padding: 0.2rem 0.85rem 0.4rem;
  font-size: 0.68rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-sheet-card button,
.chat-sheet-card form button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0 0.85rem;
  border: 0;
  background: none;
  color: var(--text);
  font: 500 0.86rem/1 inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.chat-sheet-card form { margin: 0; }

@media (hover: hover) {
  .chat-sheet-card button:hover,
  .chat-sheet-card form button:hover {
    background: rgba(62, 207, 142, 0.16);
  }

  .chat-sheet-card .pick-del:hover {
    background: rgba(255, 120, 120, 0.14);
  }
}

.chat-sheet-card button:focus,
.chat-sheet-card button:focus-visible,
.chat-sheet-card form button:focus,
.chat-sheet-card form button:focus-visible,
.chat-sheet-card button.is-lit,
.chat-sheet-card form button.is-lit {
  background: rgba(62, 207, 142, 0.22);
  outline: none;
}

.chat-sheet-card button:active,
.chat-sheet-card form button:active {
  background: rgba(62, 207, 142, 0.3);
}

.chat-sheet-card .pick-del:focus-visible,
.chat-sheet-card .pick-del:active {
  background: rgba(255, 120, 120, 0.2);
}

.pick-del { color: #ffb4b4; }

.chat-dock {
  position: relative;
  padding: 0.5rem 0.6rem 0.65rem;
  border-top: 1px solid var(--line);
  background: rgba(4, 12, 9, 0.97);
}

.composer-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0.2rem 0.22rem 0.2rem 0.65rem;
  border: 1px solid rgba(56, 140, 90, 0.2);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  overflow: visible;
}

.composer-bar:focus-within {
  border-color: rgba(62, 207, 142, 0.42);
  background: rgba(255, 255, 255, 0.06);
}

.chat-dock textarea#chat-body {
  flex: 1;
  min-height: 38px;
  max-height: 7rem;
  margin: 0;
  padding: 0.4375rem 0.15rem;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
  resize: none;
  outline: none;
  box-sizing: border-box;
  field-sizing: content;
  -webkit-text-size-adjust: 100%;
}

.chat-dock textarea#chat-body::placeholder {
  color: rgba(127, 149, 136, 0.68);
  font-size: 1rem;
}

.send-cluster {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin: 0;
  overflow: visible;
}

.send-broadcast {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.send-broadcast-row {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  transform: translateY(0) scale(0.88);
  transform-origin: 100% 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.32s cubic-bezier(0.34, 1.14, 0.64, 1),
    opacity 0.12s ease,
    visibility 0.32s;
}

.send-cluster.is-open .send-broadcast-row {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(calc(-100% - 8px)) scale(1);
}

.send-broadcast-label {
  display: inline-flex;
  align-items: center;
  height: 22px;
  max-width: 0;
  margin-right: 0;
  padding: 0;
  overflow: hidden;
  border: 0 solid rgba(62, 207, 142, 0.14);
  border-radius: 999px;
  background: rgba(8, 18, 13, 0.38);
  color: rgba(186, 230, 205, 0.58);
  font: 500 0.54rem/1 inherit;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateX(10px);
  transform-origin: 100% 50%;
  transition:
    max-width 0.26s cubic-bezier(0.2, 0.85, 0.25, 1) 0.14s,
    margin 0.26s cubic-bezier(0.2, 0.85, 0.25, 1) 0.14s,
    padding 0.26s cubic-bezier(0.2, 0.85, 0.25, 1) 0.14s,
    border-width 0.01s linear 0.14s,
    opacity 0.2s ease 0.16s,
    transform 0.26s cubic-bezier(0.2, 0.85, 0.25, 1) 0.14s;
}

.send-cluster.is-open .send-broadcast-label {
  max-width: 9.5rem;
  margin-right: 0.42rem;
  padding: 0 0.48rem;
  border-width: 1px;
  opacity: 0.82;
  transform: translateX(0);
}

.chat-send-broadcast {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 1.5px solid rgba(62, 207, 142, 0.72);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(62, 207, 142, 0.58);
  color: rgba(4, 20, 12, 0.92);
  font-size: 1.02rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.send-cluster.is-open .chat-send-broadcast {
  background: rgba(62, 207, 142, 0.68);
  border-color: rgba(62, 207, 142, 0.82);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(62, 207, 142, 0.18);
}

.send-cluster.is-open .chat-send-broadcast:hover {
  background: rgba(62, 207, 142, 0.78);
  border-color: rgba(62, 207, 142, 0.92);
}

.send-cluster.is-open .chat-send-broadcast:active:not(:disabled) {
  transform: scale(0.94);
}

.send-cluster.is-open .chat-send-broadcast:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.chat-send {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: transparent;
  font-size: 1.08rem;
  cursor: default;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-send:not(:disabled) {
  background: var(--accent);
  color: #04140c;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  transform: none;
}

.chat-send:not(:disabled):active {
  transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
  .send-broadcast-row,
  .send-broadcast-label {
    transition: opacity 0.01s linear;
    transform: none;
  }

  .send-cluster.is-open .send-broadcast-row {
    transform: translateY(calc(-100% - 8px));
  }

  .send-cluster.is-open .send-broadcast-label {
    max-width: 9.5rem;
    margin-right: 0.42rem;
    padding: 0 0.48rem;
  }
}

.q-more {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.q-more summary { cursor: pointer; }
.q-more[open] { color: var(--text); }

.dock {
  position: sticky;
  bottom: 0;
  margin: 0.4rem -1rem -2rem;
  padding: 0.65rem 1rem max(0.85rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(4, 12, 9, 0.92);
  backdrop-filter: blur(14px);
}

.dock h2 {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(210, 255, 228, 0.8);
}

.place-board {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.who-where .place-grid,
.place-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  overflow: visible;
}

.dock-scroller {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.dock-card {
  margin: 0;
}

.dock-card {
  margin: 0;
  padding: 0.4rem 0.45rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
}

.dock-card.is-mine {
  border-color: rgba(62, 207, 142, 0.7);
  background: rgba(62, 207, 142, 0.16);
}

.place-go {
  width: 100%;
  min-height: 32px;
  padding: 0.1rem 0.05rem 0.3rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.who-card {
  margin-top: 0.15rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(62, 207, 142, 0.35);
  border-radius: 10px;
  background: #101a15;
}

.who-card-name {
  margin: 0 0 0.15rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.who-card-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.shift-link {
  display: block;
  margin-top: 0.55rem;
  text-align: center;
  color: rgba(210, 255, 228, 0.78);
  font-size: 0.78rem;
}

.back { margin: 0 0 0.35rem; }
.back a { color: rgba(210, 255, 228, 0.7); font-size: 0.75rem; }

.arrive {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.6rem;
}

.arrive-places,
.arrive-date {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.arrive-places .place-grid { margin-top: 0.2rem; }

.arrive input[type="date"] {
  min-height: 40px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: 400 0.85rem/1.3 inherit;
  text-transform: none;
}

body.chat-page {
  min-height: 100dvh;
}

.chat-wrap {
  min-height: 100dvh;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes react-in {
  from { transform: scale(0.35); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes react-out {
  to { transform: scale(0.35); opacity: 0; }
}

@keyframes focus-pulse {
  from { box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.95); }
  to { box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-row.is-new,
  .react-mark.is-fresh,
  .react-mark.is-gone,
  .chat-sheet,
  .chat-sheet-card,
  .react-mark::after {
    animation: none;
    transition: none;
  }
}
