:root {
  --bg: #f7f8fa;
  --surface: #fff;
  --ink: #17191c;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #5b5ce2;
  --accent-dark: #4546b8;
  --accent-soft: #ededff;
  --ok: #16845b;
  --ok-soft: #e4f7ee;
  --warn: #b66c21;
  --warn-soft: #fff1e3;
  --danger: #c2410c;
  --dark: #14171d;
  --dark-2: #1d222a;
  --dark-3: #2a303a;
  --radius: 12px;
  --shadow: 0 16px 40px rgba(26, 32, 44, 0.08);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Pretendard, "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
[hidden] {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 750;
  color: var(--accent);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(247, 248, 250, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 720;
  font-size: 17px;
  letter-spacing: -0.04em;
  text-decoration: none;
}
.brand-mark {
  height: 20px;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  transform: skew(-12deg);
}
.brand-mark i {
  display: block;
  width: 4px;
  border-radius: 3px 3px 1px 1px;
  background: var(--accent);
}
.brand-mark i:nth-child(1) {
  height: 10px;
  opacity: 0.7;
}
.brand-mark i:nth-child(2) {
  height: 15px;
  opacity: 0.85;
}
.brand-mark i:nth-child(3) {
  height: 20px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
}
.crumbs a {
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--ink);
}
.crumbs b {
  color: var(--ink);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
}
.crumbs i {
  font-style: normal;
  color: #c4c7cd;
}
.account {
  margin-left: auto;
  position: relative;
}
.avatar-btn {
  border: 0;
  background: none;
  padding: 0;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  flex: none;
}
.avatar.xs {
  width: 20px;
  height: 20px;
  font-size: 8px;
}
.avatar.more {
  background: #eceef2;
  color: var(--muted);
}
.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
}
.account-who {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.account-who b,
.account-who small {
  display: block;
}
.account-who small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
}
.account-menu button:hover {
  background: var(--bg);
}

/* ---------- Buttons, fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  border-color: #c8c9f5;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn.primary {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
.btn.primary:hover {
  background: #272c35;
}
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost.danger {
  color: var(--danger);
  background: transparent;
  border-color: transparent;
}
.btn.small {
  padding: 7px 11px;
  font-size: 13px;
}
.btn.wide {
  width: 100%;
}
.btn.icon {
  padding: 10px 12px;
}
.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}
.link.danger {
  color: var(--danger);
}
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
}
.field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 400;
  background: var(--surface);
}
.field input:focus,
.copy-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.18);
}
.field small {
  color: var(--muted);
  font-weight: 400;
}
.form-error {
  color: var(--danger);
  background: #ffede5;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  margin: 0 0 12px;
}

/* ---------- Auth ---------- */
.auth {
  min-height: calc(100vh - 60px);
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.auth-card.center {
  text-align: center;
}
.auth-card h1 {
  font-size: 26px;
  letter-spacing: -0.04em;
  margin: 18px 0 6px;
}
.auth-card > p {
  margin: 0 0 20px;
  line-height: 1.5;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 720;
  letter-spacing: -0.04em;
  text-decoration: none;
  margin-bottom: 18px;
}
.seg {
  display: inline-flex;
  background: #eef0f4;
  border-radius: 10px;
  padding: 3px;
  width: 100%;
}
.seg button {
  flex: 1;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.btn.google {
  width: 100%;
}
.g {
  font-weight: 800;
  color: #4285f4;
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.fine {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.inbox-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
}
.auth-card .btn + .btn {
  margin-top: 8px;
}

/* ---------- Pages ---------- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px clamp(16px, 4vw, 40px) 80px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 30px;
  letter-spacing: -0.05em;
  margin: 0;
}
.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.members {
  display: flex;
  align-items: center;
  margin-top: 12px;
}
.members .avatar {
  width: 28px;
  height: 28px;
  font-size: 9px;
  margin-left: -6px;
  border: 2px solid var(--bg);
}
.members .avatar:first-child {
  margin-left: 0;
}
.members .link {
  margin-left: 10px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: #c8c9f5;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 16px 0 4px;
  font-size: 16px;
  letter-spacing: -0.03em;
}
.card p {
  margin: 0;
  font-size: 13px;
}
.card-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
}
.card-mark.big {
  width: 60px;
  height: 60px;
  font-size: 18px;
  margin: 0 auto 16px;
  border-radius: 16px;
}
.empty {
  text-align: center;
  background: var(--surface);
  border: 1px dashed #d4d7de;
  border-radius: 18px;
  padding: 48px 24px;
  max-width: 560px;
  margin: 40px auto;
}
.empty h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
  margin: 14px 0 8px;
}
.empty p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0 auto 20px;
  max-width: 420px;
}
.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
}
.loading {
  padding: 60px 16px;
  text-align: center;
  color: var(--muted);
}
.video-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.video-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  text-decoration: none;
  border-top: 1px solid #f0f1f4;
}
.video-row:first-child {
  border-top: 0;
}
.video-row:hover {
  background: #fbfbfe;
}
.video-thumb {
  width: 64px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #353a50, #131722);
  color: #fff;
  font-size: 12px;
  flex: none;
}
.video-copy {
  flex: 1;
  min-width: 0;
}
.video-copy b,
.video-copy small {
  display: block;
}
.video-copy small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.pill {
  font-size: 12px;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.warn {
  color: var(--warn);
  background: var(--warn-soft);
}
.pill.ok {
  color: var(--ok);
  background: var(--ok-soft);
}
.chev {
  color: #a4aab2;
}

/* ---------- Dialog ---------- */
.dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(460px, calc(100% - 32px));
}
.dialog::backdrop {
  background: rgba(20, 23, 29, 0.4);
  backdrop-filter: blur(2px);
}
.dialog-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
}
.dialog-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.dialog-card > p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 18px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.push-left {
  margin-right: auto;
}
.copy-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.copy-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  background: var(--bg);
}
.member-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  max-height: 360px;
  overflow: auto;
}
.member-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #f0f1f4;
}
.member-list li:first-child {
  border-top: 0;
}
.member-list b,
.member-list small {
  display: block;
}
.member-list small {
  color: var(--muted);
  font-size: 12px;
}
.member-list .link {
  margin-left: auto;
}

/* ---------- Review ---------- */
.review {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px clamp(12px, 3vw, 32px) 60px;
}
.review-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.review-head h1 {
  font-size: 24px;
  letter-spacing: -0.04em;
  margin: 0 0 4px;
}
.review-head p {
  margin: 0;
  font-size: 13px;
}
.take-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.take-tabs a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--muted);
}
.take-tabs a[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
}
.take-tabs .btn {
  margin-left: 6px;
}
.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  background: var(--dark);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 560px;
}
.player-col {
  padding: 18px;
  background: #0f1217;
  display: flex;
  flex-direction: column;
}
.player {
  position: relative;
  background: #0b0d11;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
}
.player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.player.mirrored video {
  transform: scaleX(-1);
}
.player-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: #dbe0f0;
  font-variant-numeric: tabular-nums;
}
.mirror-badge {
  display: none;
  background: rgba(91, 92, 226, 0.4);
  color: #e0e1ff;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11px;
}
.player.mirrored .mirror-badge {
  display: inline;
}
.big-play {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 23, 29, 0.5);
  color: #fff;
  font-size: 18px;
  transition: opacity 0.2s ease;
}
.player.playing .big-play {
  opacity: 0;
}
.player.playing:hover .big-play {
  opacity: 1;
}
.timeline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 10px;
  color: #8f98a8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 5px;
  background: #383d47;
  cursor: pointer;
}
.track::before {
  content: "";
  position: absolute;
  inset: -9px 0;
}
.t-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 5px;
  background: var(--accent);
}
.t-head {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.35);
  pointer-events: none;
  z-index: 3;
}
.t-pin {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #f3ae7a;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.t-range {
  position: absolute;
  top: -3px;
  height: 12px;
  border: 0;
  padding: 0;
  border-radius: 4px;
  background: rgba(143, 180, 242, 0.45);
  box-shadow: inset 0 0 0 1px rgba(143, 180, 242, 0.9);
  z-index: 2;
}
.t-pin.on {
  box-shadow: 0 0 0 4px rgba(243, 174, 122, 0.4);
}
.t-range.on {
  background: rgba(143, 180, 242, 0.75);
}
.t-loop,
.t-draft {
  position: absolute;
  top: -6px;
  height: 18px;
  border-radius: 5px;
  pointer-events: none;
}
.t-loop {
  background: rgba(254, 175, 117, 0.18);
  box-shadow: inset 0 0 0 1.5px rgba(254, 175, 117, 0.85);
}
.t-draft {
  background: rgba(91, 92, 226, 0.25);
  box-shadow: inset 0 0 0 1.5px rgba(170, 170, 255, 0.9);
}
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #aab1bd;
  font-size: 13px;
}
.controls button {
  border: 0;
  background: none;
  color: inherit;
  padding: 6px 9px;
  border-radius: 7px;
}
.controls button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.controls .spacer {
  flex: 1;
}
.toggle-btn[aria-pressed="true"] {
  background: rgba(91, 92, 226, 0.3);
  color: #e0e1ff;
}
.loop-chip:empty {
  display: none;
}
.loop-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(254, 175, 117, 0.16);
  color: #feaf75;
  font-weight: 700;
  font-size: 12px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
}
.loop-chip button {
  padding: 0 6px;
}
.notes-col {
  background: var(--dark-2);
  color: #e3e6ed;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.take-summary {
  font-size: 12px;
  color: #adb5c1;
  background: #151920;
  border: 1px solid #2b3039;
  border-radius: 8px;
  padding: 9px 11px;
}
.take-summary b {
  color: #fff;
}
.take-summary .ok {
  color: #4fd59c;
}
.take-summary .open {
  color: #f3ae7a;
}
.note-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  overflow: auto;
  max-height: 460px;
  align-content: start;
}
.notes-empty {
  color: #8993a1;
  font-size: 13px;
  line-height: 1.5;
}
.note {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}
.note:hover,
.note.selected {
  background: var(--dark-3);
  border-color: #3e4757;
}
.note.selected {
  box-shadow: inset 2px 0 var(--accent);
}
.note.looping {
  box-shadow: inset 2px 0 #feaf75;
}
.note-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.time-chip {
  border: 0;
  background: rgba(170, 171, 255, 0.14);
  color: #c4c5ff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.from {
  font-size: 11px;
  color: #8993a1;
}
.status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 5px;
}
.s-open {
  color: #f3ae7a;
  background: rgba(243, 174, 122, 0.12);
}
.s-practicing {
  color: #aaabff;
  background: rgba(170, 171, 255, 0.14);
}
.s-resolved {
  color: #4fd59c;
  background: rgba(79, 213, 156, 0.12);
}
.note p {
  margin: 9px 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.mention {
  color: #c4c5ff;
  background: rgba(91, 92, 226, 0.25);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 600;
}
.note-foot {
  font-size: 12px;
  color: #8993a1;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.who .avatar {
  background: #2f3542;
  color: #c4c5ff;
}
.role {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  color: #c4c5ff;
  background: rgba(170, 171, 255, 0.14);
}
.r-owner {
  color: #f9a8d4;
  background: rgba(244, 114, 182, 0.14);
}
.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.mini {
  border: 1px solid #3e4757;
  background: transparent;
  color: #c4c9d6;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 999px;
}
.mini:hover {
  border-color: #6b7383;
  color: #fff;
}
.mini.on {
  border-color: #feaf75;
  color: #feaf75;
}
.mini.ok {
  border-color: rgba(79, 213, 156, 0.5);
  color: #4fd59c;
}
.mini.ghost {
  border-color: transparent;
  margin-left: auto;
}
.agrees {
  font-size: 12px;
  color: #c4c9d6;
  padding: 4px 4px;
}
.composer {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #2b3039;
}
.seg.dark {
  background: #151920;
  width: max-content;
}
.seg.dark button {
  color: #8e97a6;
  flex: none;
}
.seg.dark button[aria-selected="true"] {
  background: var(--dark-3);
  color: #fff;
  box-shadow: none;
}
.range-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #8e97a6;
}
.range-row button {
  border: 1px dashed #525d6c;
  background: none;
  color: #c4c9d6;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: 12px;
}
.range-row b {
  color: #fff;
  margin-left: 3px;
}
.composer-field {
  position: relative;
}
.composer-field textarea {
  width: 100%;
  resize: vertical;
  min-height: 64px;
  background: #151920;
  border: 1px solid #3a4250;
  border-radius: 10px;
  color: #e9ecf2;
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.5;
}
.composer-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.25);
}
.mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  padding: 5px;
  z-index: 10;
}
.menu-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa0aa;
  padding: 5px 7px 4px;
}
.mention-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 7px;
  border-radius: 7px;
  font-size: 13px;
  text-align: left;
}
.mention-menu button.active,
.mention-menu button:hover {
  background: var(--accent-soft);
}
.mention-menu small {
  margin-left: auto;
  color: #9aa0aa;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.composer-foot small {
  color: #6b7383;
  font-size: 11px;
}
.composer .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- Upload bar, toast ---------- */
.upload-bar {
  position: fixed;
  left: 50%;
  top: 70px;
  transform: translate(-50%, -20px);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
  background: var(--dark);
  color: #fff;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: min(420px, calc(100% - 32px));
}
.upload-bar.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.upload-bar i {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.upload-bar small {
  color: #9aa2b1;
  font-weight: 400;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100% - 40px));
  background: var(--dark);
  color: #fff;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast[data-kind="error"] {
  background: #7c2d12;
}

@media (max-width: 900px) {
  .review-layout {
    grid-template-columns: 1fr;
  }
  .note-list {
    max-height: none;
  }
}
@media (max-width: 600px) {
  .crumbs {
    display: none;
  }
  .page-head h1 {
    font-size: 25px;
  }
  .review {
    padding: 14px 0 40px;
  }
  .review-head {
    padding: 0 14px;
  }
  .review-layout {
    border-radius: 0;
  }
  .player-col {
    padding: 0 0 12px;
  }
  .player {
    border-radius: 0;
  }
  .timeline,
  .controls {
    padding: 0 12px;
  }
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .player video,
  .upload-bar i {
    transition: none;
    animation: none;
  }
}
.field select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  font-weight: 400;
  background: var(--surface);
}

/* ---------- Phones: back link instead of breadcrumbs ---------- */
.back-link {
  display: none;
  min-width: 0;
  max-width: 55vw;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 4px;
}
@media (max-width: 600px) {
  .topbar .brand span:last-child {
    display: none;
  }
  .back-link:not([hidden]) {
    display: block;
  }
}
.code-form {
  display: flex;
  gap: 8px;
  margin: 4px 0 10px;
}
.code-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 22px;
  letter-spacing: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.code-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.18);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.password {
  position: relative;
  display: block;
}
.password input {
  width: 100%;
  padding-right: 64px;
}
.password .reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: 0;
  background: none;
  padding: 6px 8px;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.link-btn {
  display: block;
  margin: -4px 0 12px auto;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- App shell: sidebar (wide screens) and tab bar (phones) ---------- */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  padding: 0;
  flex: none;
}
.icon-btn:hover {
  background: #eceef2;
  color: var(--ink);
}
.sidebar svg,
.tabbar svg,
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.side-open {
  display: none;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 4px 0 8px;
  margin-bottom: 12px;
}
.side-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}
.side-new svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}
.side-nav a,
.side-projects a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 560;
  color: #3b4048;
  text-decoration: none;
}
.side-nav a:hover,
.side-projects a:hover {
  background: var(--bg);
}
.side-nav a[aria-current],
.side-projects a[aria-current] {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 650;
}
.side-projects a span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-label {
  margin: 16px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-projects {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.side-empty {
  margin: 4px 10px;
  font-size: 13px;
  color: var(--muted);
}
.card-mark.xs {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 9px;
  flex: none;
}
.side-account {
  position: relative;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.account-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  padding: 8px;
  border-radius: 10px;
  text-align: left;
}
.account-btn:hover {
  background: var(--bg);
}
.account-btn-copy {
  min-width: 0;
}
.account-btn-copy b,
.account-btn-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-btn-copy b {
  font-size: 14px;
}
.account-btn-copy small {
  font-size: 12px;
  color: var(--muted);
}
.side-account .account-menu {
  top: auto;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  width: auto;
}
.tabbar {
  display: none;
}

/* Me page */
.page.narrow {
  max-width: 560px;
}
.me-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.me-card h1 {
  margin: 0 0 2px;
  font-size: 24px;
  letter-spacing: -0.03em;
}
.me-card p {
  margin: 0;
}
.avatar.xl {
  width: 64px;
  height: 64px;
  font-size: 20px;
}
.list-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.list-group button,
.list-group a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  background: none;
  font-size: 15px;
  text-align: left;
}
.list-group > * + * {
  border-top: 1px solid var(--line);
}
.list-group button:hover,
.list-group a:hover {
  background: var(--bg);
}
.list-group small {
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-group i {
  font-style: normal;
  color: #b4b8c0;
  font-size: 20px;
}
.danger-text {
  color: var(--danger);
}

/* Action sheet (＋ New) */
.sheet-actions {
  display: grid;
  gap: 6px;
  margin: 4px 0 10px;
}
.sheet-action {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
}
.sheet-action:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.sheet-action b {
  font-size: 15px;
}
.sheet-action small {
  color: var(--muted);
  font-size: 13px;
}

@media (min-width: 901px) {
  body.signed-in {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
  }
  body.signed-in.side-hidden {
    grid-template-columns: minmax(0, 1fr);
  }
  body.signed-in.side-hidden .sidebar {
    display: none;
  }
  body.signed-in:not(.side-hidden) .topbar .brand {
    display: none;
  }
  body.signed-in.side-hidden .side-open {
    display: inline-grid;
  }
}
@media (max-width: 900px) {
  .sidebar {
    display: none !important;
  }
  body.signed-in:not(.is-review) .tabbar:not([hidden]) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 6px 24px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 6px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
  }
  .tabbar a svg {
    width: 24px;
    height: 24px;
  }
  .tabbar a[aria-current] {
    color: var(--ink);
  }
  .tabbar a[aria-current] svg {
    stroke-width: 2.2;
  }
  .tab-new {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 18px;
    border: 0;
    border-radius: 50%;
    background: var(--dark);
    color: #fff;
    box-shadow: 0 8px 20px rgba(20, 23, 29, 0.25);
  }
  .tab-new svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.2;
  }
  .tab-new:active {
    transform: scale(0.96);
  }
  body.signed-in:not(.is-review) .page {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }
  body.signed-in:not(.is-review) .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .sheet {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
  }
  .sheet .dialog-card {
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

/* ---------- Workspace screens: shared building blocks ---------- */
.page.narrow-wide {
  max-width: 860px;
}
.page-head .sub {
  margin: 6px 0 0;
  font-size: 14px;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: -8px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover {
  color: var(--ink);
}
.tabs a[aria-current] {
  color: var(--ink);
}
.tabs a[aria-current]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}
.tabs .count,
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tabs .count {
  background: #eceef2;
  color: var(--muted);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.seg.small {
  width: auto;
}
.seg a {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.seg a span {
  margin-left: 4px;
  font-weight: 600;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.seg a[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.select-wrap select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}

/* Rows */
.list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.list.flush {
  border: 0;
  border-radius: 0;
  margin: 0 -20px -8px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
}
.list.flush .row {
  padding: 12px 20px;
}
.list > .row + .row {
  border-top: 1px solid var(--line);
}
a.row:hover {
  background: #fafbfc;
}
.row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.row-title,
.row-text {
  font-size: 14px;
  line-height: 1.45;
}
.note-row .row-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.row-meta {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-meta b {
  color: #3b4048;
  font-weight: 600;
}
.row-quote {
  font-size: 13px;
  color: #3b4048;
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.row-side small {
  color: var(--muted);
  font-size: 12px;
  min-width: 48px;
  text-align: right;
}
.time-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-dark);
}
.agree-count {
  font-size: 12px;
  color: var(--muted);
}
.pill.info {
  color: var(--accent-dark);
  background: var(--accent-soft);
}
.inbox-row.unread {
  background: #fbfbff;
}
.inbox-row.unread .row-text {
  font-weight: 500;
}
.inbox-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 10px;
}
.avatar.lg {
  width: 48px;
  height: 48px;
  font-size: 15px;
}
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #eceef2;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  vertical-align: middle;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
}
.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: #3b4048;
  text-decoration: none;
  white-space: nowrap;
}
.role {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.role.owner {
  color: var(--accent-dark);
}
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.member-row .person {
  flex: 1;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.block {
  display: block;
}
.fine.left {
  text-align: left;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 8px;
  margin-bottom: 16px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.panel-head p {
  margin: 3px 0 0;
  font-size: 13px;
}
.panel-head .eyebrow {
  margin-bottom: 4px;
}
.panel-head .link {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}
.panel-empty {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.home-grid .panel {
  margin: 0;
}
.checklist ol {
  list-style: none;
  margin: 12px 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.checklist li > span:nth-child(2) {
  flex: 1;
}
.checklist li.done {
  color: var(--muted);
  font-weight: 500;
}
.checklist li.done > span:nth-child(2) {
  text-decoration: line-through;
}
.check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #c8ccd3;
  display: grid;
  place-items: center;
  font-size: 11px;
  flex: none;
}
.done .check {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.progress {
  height: 4px;
  border-radius: 2px;
  background: #eceef2;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--ok);
  border-radius: 2px;
}
.activity {
  list-style: none;
  margin: 0 -20px 4px;
  padding: 0;
}
.activity a {
  display: flex;
  gap: 10px;
  padding: 9px 20px;
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
  color: #3b4048;
}
.activity a:hover {
  background: #fafbfc;
}
.activity .avatar {
  margin-top: 1px;
}
.activity small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.stat b {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* Tables */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tr[data-href] {
  cursor: pointer;
}
.table tr[data-href]:hover td {
  background: #fafbfc;
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table a {
  text-decoration: none;
  font-weight: 600;
}
.table.compact {
  margin: 0 -20px 4px;
  width: calc(100% + 40px);
}
.table.compact th:first-child,
.table.compact td:first-child {
  padding-left: 20px;
}
.table.compact th:last-child,
.table.compact td:last-child {
  padding-right: 20px;
}
.meter {
  display: inline-block;
  width: 64px;
  height: 6px;
  border-radius: 3px;
  background: #eceef2;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}
.meter.wide {
  display: block;
  width: 100%;
  margin: 8px 0 0;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--ok);
  border-radius: 3px;
}
.meter i.over {
  background: var(--warn);
}

/* Chart: notes left vs fixed */
.legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.key {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.key.line {
  width: 12px;
  height: 2px;
  border-radius: 1px;
}
.key.left {
  background: var(--accent);
}
.key.fixed {
  background: var(--ok);
}
.bars {
  position: relative;
  height: 220px;
  margin: 8px 0 30px 28px;
}
.bars-grid div {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #f0f1f4;
}
.bars-grid span {
  position: absolute;
  left: -28px;
  top: -8px;
  width: 22px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bars-plot {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
}
.bars-col {
  position: relative;
  display: flex;
  justify-content: center;
  outline: none;
  border-radius: 6px;
}
.bars-col.hover,
.bars-col:focus-visible {
  background: rgba(91, 92, 226, 0.05);
}
.bars-pair {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: min(70%, 34px);
  height: 100%;
}
.bar {
  flex: 1;
  min-height: 0;
  border-radius: 4px 4px 0 0;
}
.bar.left {
  background: var(--accent);
}
.bar.fixed {
  background: var(--ok);
}
.bars-x {
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.chart-tip {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20, 23, 29, 0.12);
  padding: 8px 10px;
  min-width: 110px;
  pointer-events: none;
}
.chart-tip small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.tip-row b {
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.table-toggle {
  margin: 0 0 10px;
  font-size: 13px;
}
.table-toggle summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Settings */
.settings-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.settings-nav {
  display: grid;
  gap: 2px;
  position: sticky;
  top: 80px;
}
.settings-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #3b4048;
  text-decoration: none;
}
.settings-nav a:hover {
  background: #eceef2;
}
.settings-nav a[aria-current] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.settings-body {
  max-width: 680px;
}
.settings-stack {
  max-width: 720px;
}
.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}
.inline-form .field {
  flex: 1;
  margin: 0;
}
.inline-form .avatar {
  margin-bottom: 0;
}
.inline-form input:disabled {
  background: var(--bg);
  color: var(--muted);
}
.toggle-row {
  cursor: pointer;
}
.switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: #d4d7de;
  transition: background 0.15s ease;
  pointer-events: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}
.switch input:checked + i {
  background: var(--accent);
}
.switch input:checked + i::after {
  transform: translateX(16px);
}
.switch input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.25);
}
.usage {
  display: grid;
  gap: 16px;
  margin: 4px 0 14px;
}
.usage div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 14px;
}
.usage b {
  font-variant-numeric: tabular-nums;
}
.danger-zone {
  border-color: #f5d0c0;
}
.btn.ghost.danger {
  color: var(--danger);
}

/* Sidebar additions */
a.side-label {
  display: block;
  text-decoration: none;
  border-radius: 6px;
  padding: 2px 0;
}
a.side-label:hover,
a.side-label[aria-current] {
  color: var(--ink);
}
.side-nav .badge {
  margin-left: auto;
}
.side-bottom {
  margin-top: 6px;
}
.bell {
  position: relative;
  display: none;
  margin-left: auto;
}
.bell .badge {
  position: absolute;
  top: 1px;
  right: -1px;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  padding: 0 4px;
}
.list-group .badge {
  margin-left: auto;
}
.list-group .badge + i {
  margin-left: 8px;
}
.list-group a {
  color: inherit;
  text-decoration: none;
}
.project-head .members {
  text-decoration: none;
}

@media (max-width: 900px) {
  body.signed-in .bell:not([hidden]) {
    display: inline-grid;
  }
  body.signed-in:not(.is-review) .tabbar:not([hidden]) {
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    padding-left: 8px;
    padding-right: 8px;
  }
  .tab-new {
    margin: 0 10px;
  }
  .home-grid {
    grid-template-columns: 1fr;
  }
  .checklist ol {
    grid-template-columns: 1fr 1fr;
  }
  .settings-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .settings-nav a {
    white-space: nowrap;
  }
}
@media (max-width: 600px) {
  .checklist ol {
    grid-template-columns: 1fr;
  }
  .row {
    padding: 12px 14px;
  }
  .row-side small {
    display: none;
  }
  .note-row .row-side .agree-count {
    display: none;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat b {
    font-size: 22px;
  }
  .table .hide-sm,
  .table-wrap .chips {
    display: none;
  }
  .inline-form {
    flex-wrap: wrap;
  }
  .inline-form .avatar {
    display: none;
  }
}
.list-group a > span:first-child,
.list-group button > span:first-child {
  flex: 1;
}
.list-group a > small {
  margin-left: 0;
}

/* ---------- AI recaps: light glass, same family as the landing card ---------- */
.recap-card {
  position: relative;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(91, 92, 226, 0.09), transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(22, 132, 91, 0.06), transparent 60%),
    var(--surface);
  border: 1px solid #e3e3fb;
  border-radius: 18px;
  padding: 26px 28px 18px;
  box-shadow: 0 18px 50px rgba(69, 70, 184, 0.08);
}
.recap-head h1 {
  margin: 12px 0 6px;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}
.recap-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--muted);
}
.chip.ai {
  border-color: #d9d9fb;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 650;
}
.recap-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.recap-stale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}
.recap-body {
  margin-top: 8px;
}
.recap-section h3 {
  margin: 20px 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.recap-section ul,
ul.todo {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.recap-section li {
  position: relative;
  padding-left: 16px;
  font-size: 15px;
  line-height: 1.55;
}
.recap-section ul:not(.todo) li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.68em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b9baf3;
}
ul.todo li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-left: 0;
}
ul.todo input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--ok);
  flex: none;
  cursor: pointer;
}
ul.todo li.done > span:last-child {
  color: var(--muted);
  text-decoration: line-through;
}
.todo-dot {
  width: 14px;
  height: 14px;
  margin-top: 4px;
  border-radius: 4px;
  border: 1.5px solid #c8ccd3;
  flex: none;
}
.todo-dot.done {
  background: var(--ok);
  border-color: var(--ok);
}
ul.todo.compact {
  margin: 0 0 12px;
}
ul.todo.compact li {
  font-size: 14px;
}
.cite {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 2px;
  border: 0;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}
.cite:hover {
  background: #dcdcfb;
}
.cite-pop {
  position: absolute;
  z-index: 60;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 23, 29, 0.14);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}
.cite-pop p {
  margin: 0 0 8px;
  white-space: normal;
}
.cite-pop .link {
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.recap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.recap-actions .push-right {
  margin-left: auto;
}
.btn.on {
  border-color: #c8c9f5;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.recap-row + .recap-row {
  border-top: 1px solid var(--line);
}
.spark-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  flex: none;
}
.versions {
  padding: 0 16px 10px 56px;
  font-size: 13px;
}
.versions summary {
  cursor: pointer;
  color: var(--muted);
  list-style: none;
}
.versions a {
  display: block;
  padding: 4px 0;
  color: #3b4048;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-title {
  margin: 22px 0 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.recap-teaser {
  border-color: #e3e3fb;
  background: radial-gradient(120% 90% at 100% 0%, rgba(91, 92, 226, 0.08), transparent 60%), var(--surface);
}
.recap-teaser h2 {
  font-size: 17px;
  line-height: 1.35;
}
.recap-busy {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(247, 248, 250, 0.7);
  backdrop-filter: blur(4px);
}
.recap-busy-legacy {
  display: grid;
  justify-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid #e3e3fb;
  border-radius: 16px;
  padding: 24px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
.recap-busy-legacy small {
  color: var(--muted);
}
.spark {
  font-size: 26px;
  color: var(--accent);
  animation: spark-pulse 1.2s ease-in-out infinite;
}
@keyframes spark-pulse {
  50% {
    transform: scale(1.25) rotate(20deg);
    opacity: 0.6;
  }
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choices label {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 400;
}
.choices label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.choices input {
  position: absolute;
  opacity: 0;
}
.choices b {
  font-size: 14px;
}
.choices small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.date-row input,
.field select {
  min-width: 0;
}
@media (max-width: 600px) {
  .recap-card {
    padding: 20px 18px 14px;
    border-radius: 14px;
  }
  .recap-head h1 {
    font-size: 21px;
  }
  .choices {
    grid-template-columns: 1fr;
  }
  .cite-pop {
    width: calc(100vw - 24px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .spark {
    animation: none;
  }
}
@media (max-width: 600px) {
  .recap-teaser .panel-head {
    flex-direction: column;
  }
}

/* ---------- AI output: quiet and honest ----------
   Conventions from established design systems: the sparkle never appears without words ("Summary by AI"),
   it marks the group once rather than every line, no special gradients or motion, sources are visible,
   and there is a plain reminder to check them. */
.ai-spark {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--accent);
}
.ai-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent-dark);
}
/* In panel headers the generic `.panel-head p` margin used to win and glue the label to the headline. */
.panel-head .ai-label {
  margin: 0 0 8px;
}
.ai-label span {
  color: var(--muted);
  font-weight: 500;
}
.recap-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(20, 23, 29, 0.04), 0 8px 24px rgba(20, 23, 29, 0.04);
}
.recap-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.recap-headline {
  margin: 4px 0 10px !important;
}
.recap-card .chip.ai {
  border-color: var(--line);
  background: var(--bg);
  color: #3b4048;
  font-weight: 600;
}
.recap-card .recap-section h3 {
  color: var(--muted);
}
.recap-card .cite {
  background: #eef0f4;
  color: #3b4048;
}
.recap-card .cite:hover,
.recap-card .cite:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.recap-sources {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 13px;
}
.recap-sources summary {
  cursor: pointer;
  font-weight: 600;
  color: #3b4048;
}
.recap-sources ol {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.recap-sources li {
  display: flex;
  gap: 10px;
}
.recap-sources a {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.recap-sources a:hover {
  background: var(--bg);
}
.src-n {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 7px;
  border-radius: 5px;
  background: #eef0f4;
  font-size: 11px;
  font-weight: 700;
  color: #3b4048;
  flex: none;
}
.recap-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.ai-disclaimer {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.feedback {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  font-size: 12px;
  color: var(--muted);
}
.feedback span {
  margin-right: 4px;
}
.feedback .icon-btn {
  width: 30px;
  height: 30px;
  font-size: 14px;
  filter: grayscale(1);
  opacity: 0.7;
}
.feedback .icon-btn.on,
.feedback .icon-btn:hover {
  filter: none;
  opacity: 1;
  background: var(--accent-soft);
}
/* Just generated: one short fade, nothing more. */
.recap-card.is-fresh .recap-body {
  animation: ai-fade 0.4s ease-out;
}
@keyframes ai-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
.recap-busy {
  background: rgba(247, 248, 250, 0.75);
  backdrop-filter: blur(2px);
}
.busy-card {
  display: grid;
  gap: 4px;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px 20px;
  box-shadow: var(--shadow);
}
.busy-card b {
  font-size: 16px;
}
.busy-card small {
  color: var(--muted);
}
.ai-skeleton {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.ai-skeleton span {
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, #eef0f4 25%, #e2e4ea 50%, #eef0f4 75%);
  background-size: 200% 100%;
  animation: ai-shimmer 1.2s linear infinite;
}
.ai-skeleton span:nth-child(2) {
  width: 86%;
}
.ai-skeleton span:nth-child(3) {
  width: 64%;
}
@keyframes ai-shimmer {
  to {
    background-position: -200% 0;
  }
}
.recap-teaser {
  border-color: var(--line);
  background: var(--surface);
}
.spark-mark {
  background: var(--accent-soft);
}
.spark-mark .ai-spark {
  width: 13px;
  height: 13px;
}
@media (max-width: 600px) {
  .recap-foot {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  .recap-card.is-fresh .recap-body,
  .ai-skeleton span {
    animation: none;
  }
}

/* ---------- Requests ---------- */
.due.overdue {
  color: var(--danger);
  font-weight: 600;
}
.due.soon {
  color: var(--warn);
  font-weight: 600;
}
.pill.danger {
  color: var(--danger);
  background: #ffede5;
}
.pill:not(.warn):not(.ok):not(.info):not(.danger) {
  color: var(--muted);
  background: #eef0f4;
}
.count-fig {
  min-width: 0 !important;
  font-variant-numeric: tabular-nums;
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
}
.banner.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.brief {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.brief-ref {
  margin: 0 0 12px;
  font-size: 14px;
}
.brief-ref .link {
  font-weight: 650;
  text-decoration: none;
}
.field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 400;
  resize: vertical;
  background: var(--surface);
}
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.18);
}
.pick-people {
  display: grid;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  margin: -4px 0 14px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.pick-people label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.pick-people label:hover {
  background: var(--bg);
}
.pick-people input {
  accent-color: var(--accent);
}
.date-row.three {
  grid-template-columns: 1.4fr 1fr 1fr;
}
.queue-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.queue-nav small {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Calendar ---------- */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.cal-toolbar h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.cal-nav,
.cal-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-nav h2 {
  min-width: 170px;
  text-align: center;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}
.cal-legend span::before,
.cal-dot {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--k);
  flex: none;
}
.k-rehearsal {
  --k: var(--accent);
  --k-soft: var(--accent-soft);
  --k-ink: var(--accent-dark);
}
.k-show {
  --k: #db2777;
  --k-soft: #fde8f0;
  --k-ink: #9d174d;
}
.k-other {
  --k: #6b7280;
  --k-soft: #eef0f4;
  --k-ink: #3b4048;
}
.k-due {
  --k: var(--warn);
  --k-soft: var(--warn-soft);
  --k-ink: #8a4b12;
}
/* Team-named event types */
.k-c0 { --k: #0d9488; --k-soft: #e0f5f2; --k-ink: #0f5f58; }
.k-c1 { --k: #7c3aed; --k-soft: #efe7fd; --k-ink: #5b21b6; }
.k-c2 { --k: #2563eb; --k-soft: #e5edfd; --k-ink: #1e40af; }
.k-c3 { --k: #c2410c; --k-soft: #fcebe2; --k-ink: #8a2f0a; }
.k-c4 { --k: #4d7c0f; --k-soft: #ecf4df; --k-ink: #3a5d0b; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--line);
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-dow {
  background: var(--bg);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.cal-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 108px;
  padding: 6px;
  background: var(--surface);
  cursor: pointer;
  min-width: 0;
}
.cal-cell:hover {
  background: #fcfcfd;
}
.cal-cell.other {
  background: #fafbfc;
}
.cal-cell.other .cal-date {
  color: #b4b8c0;
}
.cal-date {
  align-self: flex-start;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 650;
  color: #3b4048;
}
.cal-cell.today .cal-date {
  background: var(--ink);
  color: #fff;
}
.cal-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 3px 6px;
  background: var(--k-soft);
  color: var(--k-ink);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-item.closed {
  opacity: 0.55;
  text-decoration: line-through;
}
.cal-more {
  border: 0;
  background: none;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  text-align: left;
}
.agenda {
  display: grid;
  gap: 18px;
}
.agenda-day h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.agenda-day h3 b {
  color: var(--ink);
}
.agenda-day.today h3 b::after {
  content: " · Today";
  color: var(--accent);
}
.agenda-item {
  width: 100%;
  border: 0;
  background: var(--surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.agenda-item:hover {
  background: #fafbfc;
}
.list > .agenda-item + .agenda-item {
  border-top: 1px solid var(--line);
}

/* Home: three small panels */
.home-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.home-strip .panel {
  margin: 0;
}
@media (max-width: 900px) {
  .home-strip {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .cal-nav h2 {
    min-width: 0;
    font-size: 16px;
  }
  .date-row.three {
    grid-template-columns: 1fr 1fr;
  }
  .date-row.three .field:first-child {
    grid-column: span 2;
  }
  .queue-nav {
    width: 100%;
    justify-content: space-between;
  }
}

/* ---------- ⌘K palette ---------- */
.side-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  margin-bottom: 4px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  text-align: left;
}
.side-search:hover {
  border-color: #c8c9f5;
}
.side-search span {
  flex: 1;
}
kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font: 600 11px/1.5 ui-sans-serif, system-ui, sans-serif;
  color: var(--muted);
}
.dialog.palette {
  width: min(620px, calc(100% - 24px));
  margin-top: 12vh;
}
.palette-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.palette-input svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  flex: none;
}
.palette-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font-size: 16px;
  background: none;
}
.palette-list {
  max-height: min(420px, 60vh);
  overflow-y: auto;
  padding: 6px;
}
.palette-group {
  margin: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: left;
}
.palette-item.active {
  background: var(--accent-soft);
}
.palette-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #eef0f4;
  font-size: 10px;
  font-weight: 750;
  color: #3b4048;
  flex: none;
}
.palette-text {
  display: grid;
  min-width: 0;
}
.palette-text b {
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-text small {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-empty {
  margin: 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.palette-foot {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.palette-foot kbd {
  margin-right: 3px;
}
@media (max-width: 600px) {
  .dialog.palette {
    margin-top: 8px;
  }
  .palette-foot {
    display: none;
  }
}
.search-btn + .bell {
  margin-left: 0;
}
.choices.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.check-row input {
  margin-top: 3px;
  accent-color: var(--accent);
}
.check-row b {
  display: block;
  font-size: 14px;
}
.check-row small {
  color: var(--muted);
  font-size: 12px;
}
.groups-panel {
  margin-top: 20px;
}
.groups-panel .chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
@media (max-width: 600px) {
  .choices.three {
    grid-template-columns: 1fr;
  }
}

/* ---------- Overview ---------- */
.overview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.overview-grid .panel {
  margin: 0;
}
.music {
  margin: 0 0 12px;
  font-size: 14px;
}
.music .link {
  text-decoration: none;
  font-weight: 600;
}
.countdown {
  padding-bottom: 16px;
}
.big-num {
  display: block;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 2px 0 6px;
}
.big-num.small {
  font-size: 22px;
}
.countdown p {
  margin: 0;
  font-size: 13px;
}
a.link-stat {
  color: inherit;
  text-decoration: none;
}
a.link-stat:hover {
  border-color: #c8c9f5;
}
.video-thumb.sm {
  width: 40px;
  height: 26px;
  font-size: 10px;
  flex: none;
}

/* ---------- Count sheet ---------- */
.sheet-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}
.sheet-summary .progress {
  flex: 1;
  max-width: 320px;
}
.table.sheet td {
  padding: 6px 8px;
}
.table.sheet th:first-child,
.table.sheet td:first-child {
  padding-left: 8px;
}
.grip {
  width: 64px;
  white-space: nowrap;
}
.grip .icon-btn {
  width: 26px;
  height: 26px;
  font-size: 13px;
}
.grip .icon-btn:disabled {
  opacity: 0.25;
}
.cell {
  width: 100%;
  min-width: 90px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 8px;
  background: transparent;
  font: inherit;
  font-size: 14px;
}
.cell:hover {
  border-color: var(--line);
}
.cell:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.15);
}
.cell.narrow {
  min-width: 80px;
  max-width: 110px;
}
.cell.wide {
  min-width: 200px;
}
.cell.time {
  width: 64px;
  min-width: 64px;
  font-variant-numeric: tabular-nums;
}
td.ref {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 260px;
}
td.ref .play {
  text-decoration: none;
  font-size: 13px;
  padding: 4px;
}
.cell.status {
  min-width: 112px;
  font-weight: 650;
  border-color: transparent;
}
.cell.status.s-learning {
  background: #eef0f4;
  color: #3b4048;
}
.cell.status.s-practicing {
  background: var(--warn-soft);
  color: var(--warn);
}
.cell.status.s-clean {
  background: var(--ok-soft);
  color: var(--ok);
}
@media (max-width: 900px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Sharing ---------- */
.share-form {
  display: grid;
  gap: 0;
  margin-bottom: 8px;
}
.share-form .btn {
  justify-self: start;
}
.share-link {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.share-link .fine {
  margin-top: 4px;
}
.link-btn.inline {
  display: inline;
  margin: 0;
  font-size: inherit;
}
.link-btn.danger {
  color: var(--danger);
}
.how-to {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.8;
  color: #3b4048;
}
.guest-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.guest-video {
  width: 100%;
  border-radius: 14px;
  background: var(--dark);
  max-height: 72vh;
}
.guest-notes {
  max-height: 72vh;
  overflow-y: auto;
}
.guest-notes ul {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 12px;
}
.guest-notes li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.guest-notes p {
  margin: 0 0 2px;
  font-size: 14px;
  line-height: 1.5;
}
.guest-notes small {
  color: var(--muted);
  font-size: 12px;
}
.time-chip.light {
  flex: none;
  border: 0;
  border-radius: 6px;
  padding: 3px 7px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}
.guest-foot {
  margin-top: 24px;
}
@media (max-width: 900px) {
  .guest-layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- Pages ---------- */
.page-icon {
  width: 28px;
  text-align: center;
  font-size: 16px;
  flex: none;
}
.doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.doc-meta {
  margin: 0;
  font-size: 13px;
}
.save-state {
  font-size: 12px;
  color: var(--muted);
}
.save-state.error {
  color: var(--danger);
}
.doc-title {
  margin: 8px 0 18px;
  font-size: 34px;
  letter-spacing: -0.04em;
}
.doc-title-input {
  width: 100%;
  margin: 8px 0 14px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  font-family: inherit;
  font-size: 34px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.04em;
  padding: 2px 0;
}
.doc-title-input:focus {
  outline: none;
  border-bottom-color: var(--line);
}
.doc-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.doc-editor textarea {
  min-height: 60vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: vertical;
  background: var(--surface);
}
.doc-editor textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 92, 226, 0.15);
}
.doc-editor .doc {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 60vh;
  overflow: auto;
}
.doc {
  font-size: 16px;
  line-height: 1.7;
  color: #23272e;
}
.doc h2,
.doc h3,
.doc h4 {
  margin: 1.4em 0 0.4em;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.doc h2 {
  font-size: 24px;
}
.doc h3 {
  font-size: 19px;
}
.doc h4 {
  font-size: 16px;
}
.doc > :first-child {
  margin-top: 0;
}
.doc p {
  margin: 0 0 0.8em;
}
.doc ul,
.doc ol {
  margin: 0 0 0.8em;
  padding-left: 1.4em;
}
.doc ul.tasks {
  list-style: none;
  padding-left: 0;
}
.doc ul.tasks li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.doc ul.tasks .box {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1.5px solid #c8ccd3;
  border-radius: 4px;
  font-size: 11px;
  flex: none;
  transform: translateY(2px);
}
.doc ul.tasks li.done {
  color: var(--muted);
  text-decoration: line-through;
}
.doc ul.tasks li.done .box {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.doc blockquote {
  margin: 0 0 0.8em;
  padding: 4px 14px;
  border-left: 3px solid var(--line);
  color: #4b5160;
}
.doc code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #eef0f4;
  font-size: 0.9em;
}
.doc hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.4em 0;
}
.doc a {
  color: var(--accent-dark);
}
@media (max-width: 900px) {
  .doc-editor {
    grid-template-columns: 1fr;
  }
  .doc-editor .doc {
    display: none;
  }
  .doc-title,
  .doc-title-input {
    font-size: 26px;
  }
}
.cant-play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(20, 23, 29, 0.92);
  color: #fff;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}
.cant-play span {
  max-width: 440px;
  color: #c9cdd6;
}

/* ---------- Replies and private notes ---------- */
.note.private {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(139, 92, 246, 0.08);
}
.private-tag {
  margin: 0 0 6px !important;
  font-size: 11.5px !important;
  font-weight: 650;
  color: #c4b5fd;
}
.thread {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
  cursor: default;
}
.reply {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.reply > div {
  flex: 1;
  min-width: 0;
}
.reply p {
  margin: 0 !important;
  font-size: 13px !important;
}
.reply small {
  color: #8a92a3;
  font-weight: 400;
}
.reply-form {
  display: flex;
  gap: 6px;
}
.reply-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid #3e4757;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #e3e6ed;
  padding: 7px 10px;
  font-size: 13px;
}
.reply-form input:focus {
  outline: none;
  border-color: var(--accent);
}
.reply-form .btn {
  background: transparent;
  color: #e3e6ed;
  border-color: #3e4757;
}
.visibility select {
  max-width: 190px;
  border: 1px solid #3e4757;
  border-radius: 8px;
  background: #232935;
  color: #e3e6ed;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
}
.lock {
  font-size: 12px;
}

/* ---------- Sketches on the frame ---------- */
.sketch-layer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  pointer-events: none;
  overflow: visible;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.player.mirrored .sketch-layer {
  transform: scaleX(-1);
}
.player.drawing .sketch-layer {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
  outline: 1px dashed rgba(255, 255, 255, 0.35);
  outline-offset: -1px;
}
.player.drawing .big-play {
  display: none;
}
.player-badge {
  z-index: 3;
}
.sketch-bar {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 10px;
  background: rgba(20, 23, 29, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-width: calc(100% - 16px);
}
.sketch-bar[hidden] {
  display: none;
}
.sketch-group {
  display: flex;
  gap: 2px;
  padding-right: 6px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}
.sketch-bar button {
  min-width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #dbe0f0;
  font-size: 15px;
}
.sketch-bar button:hover {
  background: rgba(255, 255, 255, 0.08);
}
.sketch-bar button[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.sketch-bar .swatch {
  min-width: 26px;
  display: grid;
  place-items: center;
}
.sketch-bar .swatch::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.sketch-bar .swatch[aria-pressed='true']::before {
  box-shadow: 0 0 0 2px #14171d, 0 0 0 4px var(--c);
}
.sketch-bar .sketch-done {
  padding: 0 12px;
  background: #fff;
  color: #14171d;
  font-size: 13px;
  font-weight: 650;
}
.sketch-bar .sketch-done:hover {
  background: #e9ebf0;
}
.draw-btn[aria-pressed='true'] {
  background: rgba(91, 92, 226, 0.18);
  color: #c9caff;
}
.sketch-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #c9caff;
  white-space: nowrap;
}
.sketch-chip[hidden] {
  display: none;
}
.sketch-chip button {
  border: 0;
  background: none;
  color: inherit;
  padding: 2px 4px;
  font-size: 11px;
}
.sketch-tag {
  font-size: 11px;
  color: #c9caff;
  background: rgba(91, 92, 226, 0.16);
  border-radius: 5px;
  padding: 2px 6px;
}
@media (max-width: 720px) {
  .sketch-bar {
    bottom: 8px;
    gap: 4px;
    padding: 4px;
  }
  .sketch-group {
    padding-right: 4px;
  }
  .sketch-bar button {
    min-width: 30px;
    height: 30px;
  }
  .sketch-bar .swatch {
    min-width: 24px;
  }
}
.composer-foot {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.composer-foot .btn.primary {
  margin-left: auto;
}
.composer-foot .draw-btn {
  border: 1px solid #3e4757;
  border-radius: 8px;
  background: #232935;
  color: #e3e6ed;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}
.guest-player {
  position: relative;
}
.guest-player .guest-video {
  display: block;
}
.player {
  scroll-margin-top: 72px;
}

/* ---------- Photos and project images ---------- */
.avatar,
.card-mark {
  overflow: hidden;
}
.avatar img,
.card-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-mark.head {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
  flex: none;
}
.card-mark.lg {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  font-size: 20px;
  flex: none;
}
.project-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.image-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.image-row .muted {
  margin: 2px 0 8px;
  font-size: 13px;
}
.image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .card-mark.head {
    width: 40px;
    height: 40px;
  }
}

/* ---------- Video list thumbnails ---------- */
.video-row .video-thumb {
  position: relative;
  width: 112px;
  height: 63px;
  flex: none;
  overflow: hidden;
  border-radius: 8px;
}
.video-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.video-thumb.has-img img {
  opacity: 1;
}
.video-thumb i {
  position: relative;
  font-style: normal;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  background: rgba(20, 23, 29, 0.45);
  backdrop-filter: blur(4px);
}
.video-thumb em {
  position: absolute;
  right: 5px;
  bottom: 4px;
  font-style: normal;
  font-size: 10px;
  font-weight: 650;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(20, 23, 29, 0.7);
}
@media (max-width: 720px) {
  .video-row .video-thumb {
    width: 88px;
    height: 50px;
  }
}

/* ---------- Scrubbing the timeline ---------- */
.track {
  touch-action: none;
}
.track::before {
  inset: -12px 0;
}
.track.scrubbing .t-head {
  width: 17px;
  height: 17px;
}
.track.scrubbing .t-fill,
.track.scrubbing .t-head {
  transition: none;
}

/* Korean: break lines between words, not inside them */
:lang(ko) body { word-break: keep-all; overflow-wrap: anywhere; }

/* ---------- Compare: two videos side by side ---------- */
.player-pair {
  display: grid;
  gap: 8px;
}
.player-pair.comparing {
  grid-template-columns: 1fr 1fr;
}
.player-pair.comparing .player {
  aspect-ratio: 9 / 10;
}
.pair-label {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  display: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(20, 23, 29, 0.72);
  color: #e3e6ed;
  font-size: 11px;
  font-weight: 650;
}
.player-pair.comparing .pair-label {
  display: block;
}
.compare-pane video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.compare-pane.mirrored video {
  transform: scaleX(-1);
}
.compare-pane[hidden] {
  display: none;
}
.compare-bar,
.counts-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #171b22;
  border: 1px solid #2a303a;
  color: #c3c9d6;
  font-size: 12px;
}
.compare-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.compare-bar[hidden],
.counts-panel[hidden] {
  display: none;
}
.compare-pick {
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-pick select {
  max-width: 220px;
  border: 1px solid #3e4757;
  border-radius: 8px;
  background: #232935;
  color: #e3e6ed;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
}
.compare-align {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.compare-offset {
  color: #8f98a8;
  margin-right: 4px;
  white-space: nowrap;
}

/* ---------- Counts ---------- */
.count-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  display: grid;
  justify-items: center;
  min-width: 52px;
  padding: 5px 9px 6px;
  border-radius: 10px;
  background: rgba(20, 23, 29, 0.72);
  backdrop-filter: blur(6px);
  color: #fff;
  pointer-events: none;
}
.count-badge[hidden] {
  display: none;
}
.count-badge small {
  font-size: 10px;
  color: #a5a6ff;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.count-badge b {
  font-size: 26px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.t-eight {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: rgba(255, 255, 255, 0.22);
  pointer-events: none;
}
.t-eight.major {
  background: rgba(165, 166, 255, 0.6);
}
.count-tag {
  font-size: 11px;
  font-weight: 650;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(165, 166, 255, 0.16);
  color: #c9caff;
  font-variant-numeric: tabular-nums;
}
.counts-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tap-btn {
  border: 1px solid #4a4cc4;
  background: rgba(91, 92, 226, 0.2);
  color: #e0e1ff;
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.tap-btn small {
  color: #a5a6ff;
  font-weight: 500;
}
.tap-btn.pulse {
  animation: tapPulse 0.25s ease;
}
@keyframes tapPulse {
  50% {
    transform: scale(0.95);
    background: rgba(91, 92, 226, 0.45);
  }
}
.bpm-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8f98a8;
}
.bpm-field input {
  width: 74px;
  border: 1px solid #3e4757;
  border-radius: 8px;
  background: #232935;
  color: #fff;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 650;
}
.counts-panel .btn.small {
  background: #232935;
  border-color: #3e4757;
  color: #e3e6ed;
}
.counts-panel .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.counts-hint {
  margin: 8px 0;
  color: #8f98a8;
}
.counts-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.check-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 720px) {
  .player-pair.comparing {
    grid-template-columns: 1fr;
  }
  .player-pair.comparing .player {
    aspect-ratio: 16 / 9;
  }
  .compare-bar,
  .counts-panel {
    margin: 10px 12px 0;
  }
  .compare-align {
    margin-left: 0;
  }
}

/* ---------- Guest page: what made this, and a way to start ---------- */
.guest-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -8px 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.guest-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.guest-brand .brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  transform: skewX(-12deg);
}
.guest-brand .brand-mark i {
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
}
.guest-brand .brand-mark i:nth-child(1) { height: 9px; opacity: 0.55; }
.guest-brand .brand-mark i:nth-child(2) { height: 13px; opacity: 0.8; }
.guest-brand .brand-mark i:nth-child(3) { height: 18px; }
.guest-bar .spacer {
  flex: 1;
}
.guest-cta {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  border-radius: 16px;
  background: var(--dark);
  color: #eef0f5;
  position: relative;
  overflow: hidden;
}
.guest-cta::before {
  content: "";
  position: absolute;
  inset: -60% 40% auto -10%;
  height: 200%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(91, 92, 226, 0.35), transparent 70%);
  pointer-events: none;
}
.guest-cta > * {
  position: relative;
}
.guest-cta .eyebrow {
  color: #a5a6ff;
}
.guest-cta h2 {
  margin: 4px 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.guest-cta p:not(.eyebrow) {
  margin: 0;
  max-width: 560px;
  color: #aab1bf;
  font-size: 14px;
  line-height: 1.55;
}
.guest-cta-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.guest-cta .btn.ghost {
  color: #e3e6ed;
}
.guest-player .count-badge {
  bottom: 56px;
}
@media (max-width: 720px) {
  .guest-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
  }
  .guest-cta-actions {
    width: 100%;
  }
  .guest-cta-actions .btn {
    flex: 1;
  }
}
body.is-guest .topbar {
  display: none;
}
.guest-cta .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.guest-cta .btn.ghost {
  border-color: #3a4150;
}
.sketch-bar .sketch-done,
.sketch-bar button {
  white-space: nowrap;
}

/* ---------- First run: sample project, welcome steps, tips ---------- */
.sample-tag {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.side-projects a > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-tag {
  flex: none;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.sample-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid #dcdcfa;
}
.sample-banner p {
  flex: 1;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #34366e;
}
.sample-banner b {
  color: var(--accent-dark);
}
.sample-dot {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
}
.sample-actions {
  display: flex;
  gap: 6px;
  flex: none;
}
.empty .btn + .btn {
  margin-left: 8px;
}
.checklist-sample {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.checklist-sample .link-btn {
  display: inline;
  margin: 0;
  font-weight: 650;
}
.welcome-card {
  width: min(460px, 100%);
}
.welcome-card h1 {
  margin-top: 14px;
}
.welcome-card .chips {
  margin: 0 0 16px;
  gap: 8px;
}
.welcome-card .chip {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.welcome-card .chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.welcome-card > .btn.wide + .btn.wide {
  margin-top: 8px;
}
.welcome-card .copy-row {
  margin-bottom: 10px;
}
.welcome-share {
  margin-bottom: 8px;
}
.steps {
  display: flex;
  align-items: center;
  gap: 6px;
}
.steps i {
  width: 28px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
}
.steps i.done,
.steps i.now {
  background: var(--accent);
}
.steps small {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.welcome-alt {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 16px;
}
.welcome-alt .link-btn {
  margin: 0;
}
.welcome-alt .link-btn[data-skip],
.welcome-alt .link-btn[data-later] {
  color: var(--muted);
}
.film-tips {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.film-tips li {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 2px;
}
.film-tips b {
  font-size: 13px;
}
.film-tips span {
  font-size: 12px;
  color: var(--muted);
}
.welcome-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 12px;
}
.welcome-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.welcome-list b {
  display: block;
  font-size: 14px;
}
.welcome-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.wl-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.fine.left {
  text-align: left;
}
.coach {
  position: fixed;
  z-index: 60;
  background: var(--dark);
  color: #fff;
  border-radius: 12px;
  padding: 14px 16px 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: coach-in 0.2s ease-out;
}
.coach small {
  color: #a5a9b4;
  font-size: 11px;
  font-weight: 650;
}
.coach b {
  display: block;
  margin: 2px 0 4px;
  font-size: 15px;
}
.coach p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #d6d9e0;
}
.coach div {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.coach .btn.ghost {
  color: #c4c8d2;
}
.coach-target {
  position: relative;
  z-index: 2;
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
@keyframes coach-in {
  from { opacity: 0; transform: translateY(4px); }
}
@media (max-width: 600px) {
  .sample-banner {
    flex-wrap: wrap;
  }
  .sample-actions {
    width: 100%;
  }
  .sample-actions .btn {
    flex: 1;
  }
  .empty .btn + .btn {
    margin: 8px 0 0;
  }
  .empty .btn {
    display: flex;
    justify-content: center;
    width: 100%;
  }
}
:lang(ko) .welcome-card,
:lang(ko) .welcome-dialog,
:lang(ko) .coach,
:lang(ko) .sample-banner {
  word-break: keep-all;
}

/* Review: "Fixed in this take?" on notes carried from an earlier take */
.fixed-ask {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 2px;
  padding: 7px 8px 7px 10px;
  border-radius: 8px;
  background: rgba(91, 92, 226, 0.16);
  font-size: 12px;
  font-weight: 650;
  color: #d9daff;
}
.fixed-ask span {
  margin-right: auto;
}

/* ---------- Insights: next-rehearsal lines, where feedback piles up ---------- */
.insight-lines .lines {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.insight-lines li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.li-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}
.li-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.45;
}
.heat-list {
  display: grid;
  gap: 18px;
  margin-top: 6px;
}
.heat-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.heat-head a {
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
}
.heat-head a:hover {
  text-decoration: underline;
}
.heat-head small {
  color: var(--muted);
  font-size: 12px;
}
.heat {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 4px;
}
.heat-cell {
  position: relative;
  height: 44px;
  border-radius: 7px;
  background:
    linear-gradient(rgba(91, 92, 226, calc(0.12 + var(--o) * 0.88)), rgba(91, 92, 226, calc(0.12 + var(--o) * 0.88))),
    rgba(22, 132, 91, calc(var(--f) * 0.5));
  background-color: #eef0f4;
  text-decoration: none;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.heat-cell:hover,
.heat-cell:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(26, 32, 44, 0.14);
}
.heat-cell span {
  position: absolute;
  bottom: -17px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.heat-cell b {
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.heat-row {
  padding-bottom: 16px;
}
.heat-row .fine {
  margin-top: 22px;
}
.key.heat-open {
  background: var(--accent);
}
.key.heat-fixed {
  background: rgba(22, 132, 91, 0.5);
}
.who-stack {
  display: flex;
  align-items: center;
  gap: 2px;
}
.who-stack small {
  margin-left: 4px;
  font-size: 12px;
  color: var(--muted);
}
.agree-count {
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .heat {
    gap: 3px;
  }
  .heat-cell {
    height: 38px;
  }
  .heat-cell span {
    font-size: 9px;
  }
  .insight-lines li {
    flex-wrap: wrap;
  }
  .insight-lines li .btn {
    margin-left: 42px;
  }
}
@media (max-width: 600px) {
  .insight-lines .li-text {
    flex-basis: calc(100% - 42px);
  }
  .heat-panel .panel-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .heat-panel .legend {
    order: -1;
    width: 100%;
    justify-content: flex-end;
  }
  .heat-head {
    flex-wrap: wrap;
    gap: 2px 10px;
  }
}

/* Sign-up: age and terms agreement */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}
.consent input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}
.consent a,
.fine a {
  color: inherit;
  text-decoration: underline;
}

/* ---------- Account deletion ---------- */
.form-note {
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  margin: 0 0 12px;
}
.btn.danger-outline {
  border-color: #f3c3ae;
  color: var(--danger);
  background: var(--surface);
  white-space: nowrap;
}
.btn.danger-outline:hover {
  background: #fff3ee;
}
.btn.danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.danger-zone {
  border-color: #f6d6c8;
}
.me-delete {
  text-align: center;
  margin: 18px 0 0;
  font-size: 13px;
}
.me-delete a {
  color: var(--muted);
}
.delete-account .da-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.delete-account h3 {
  margin: 4px 0 6px;
  font-size: 14px;
}
.delete-account ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.6;
}
.da-gone {
  color: var(--danger);
}
.da-stays {
  color: var(--ok);
}
.da-projects {
  display: grid;
  gap: 10px;
}
.da-project {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.da-project.deleting {
  border-color: #f3c3ae;
  background: #fff8f5;
}
.da-project-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.da-project-head small {
  color: var(--muted);
}
.da-choice,
.da-reason {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.da-choice > span {
  flex: 0 1 auto;
}
.da-choice:not(:has(select)) > span {
  flex: 1;
}
.da-choice select {
  margin-left: 4px;
  min-width: 0;
  max-width: 220px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 14px;
}
.da-reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.da-confirm .field input {
  width: 100%;
}
.da-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
@media (max-width: 600px) {
  .delete-account .da-columns,
  .da-reasons {
    grid-template-columns: 1fr;
  }
  .danger-zone .panel-head {
    flex-wrap: wrap;
    gap: 10px;
  }
  .da-choice:has(select) {
    flex-wrap: wrap;
  }
}

/* Wordmark logo: sidebar, phone header, sign-in card, guest page */
.brand-logo { display: block; height: 22px; width: auto; }
.auth-brand .brand-logo { height: 28px; }
.guest-brand .brand-logo { height: 20px; }
