@font-face { font-family: Nunito; src: url(fonts/Nunito-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: Nunito; src: url(fonts/Nunito-Bold.ttf); font-weight: 700; font-display: swap; }
@font-face { font-family: Nunito; src: url(fonts/Nunito-ExtraBold.ttf); font-weight: 800; font-display: swap; }

/* The website's palette (src/app/globals.css). */
:root {
  --cream: #fff7ea;
  --cream-deep: #ffebcc;
  --card: #ffffff;
  --ink: #2d2a4a;
  --ink-soft: #6b6890;
  --line: #eadfcb;
  --grape: #7c4dff;
  --grape-shade: #5524e0;
  --grape-tint: #efe9ff;
  --leaf: #2ebd6b;
  --leaf-shade: #1f8a4d;
  --leaf-tint: #e3f7ea;
  --sunshine: #ffc43d;
  --sunshine-tint: #fff3d1;
  --coral: #ff6b6b;
  --sky: #3fa7f5;
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1d1b2e;
    --cream-deep: #2a2742;
    --card: #26233b;
    --ink: #f3f0ff;
    --ink-soft: #aba6cf;
    --line: #3a3657;
    --grape: #9b7bff;
    --grape-shade: #7c4dff;
    --grape-tint: #332a5c;
    --leaf: #3fd07f;
    --leaf-shade: #2ebd6b;
    --leaf-tint: #1f3b2c;
    --sunshine-tint: #463a1a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 16px/1.5 Nunito, ui-rounded, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }

.btn {
  border: 0; border-radius: 12px; padding: 8px 16px;
  background: var(--grape); color: #fff; font-weight: 800;
  box-shadow: 0 3px 0 var(--grape-shade);
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--grape-shade); }
.btn.quiet { background: var(--cream-deep); color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.link { border: 0; background: none; padding: 0; color: var(--ink-soft); text-decoration: underline; font-weight: 700; }
.error { color: var(--coral); font-weight: 700; }

/* ---------- Sign in ---------- */
.login { max-width: 460px; margin: 12vh auto 0; padding: 0 16px; text-align: center; display: grid; justify-items: center; gap: 16px; }
.login img { border-radius: 24px; }
.login h1 { margin: 0; font-weight: 800; font-size: 2rem; }
.login p { margin: 0; color: var(--ink-soft); }
.login form { display: flex; gap: 8px; }
.login input { padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px max(16px, calc((100vw - 980px) / 2));
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; }
.brand img { border-radius: 10px; }
.langs { display: flex; gap: 6px; flex-wrap: wrap; }
.modes { flex: 1; }
.modes button.on { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.langs button {
  border: 2px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 4px 12px; font-weight: 800;
}
.langs button.on { border-color: var(--grape); background: var(--grape); color: #fff; }
.langs small { font-weight: 700; opacity: .75; margin-left: 4px; }
.me { display: flex; gap: 10px; align-items: center; color: var(--ink-soft); font-weight: 700; font-size: .9rem; }

main, .summary, .toolbar, .chips, .keys, .list, .empty { max-width: 980px; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }

.summary { margin-top: 16px; }
.progress { height: 10px; border-radius: 999px; background: var(--cream-deep); overflow: hidden; display: flex; }
#progress-ok { background: var(--leaf); }
#progress-open { background: var(--sunshine); }
#summary-text { margin: 6px 0 0; color: var(--ink-soft); font-weight: 700; font-size: .95rem; }

.toolbar { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  border: 2px solid var(--line); border-radius: 12px; background: var(--card); padding: 7px 12px; min-height: 44px;
}
.toolbar input { flex: 1 1 220px; }
.speed { display: flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.speed button { border: 0; background: none; padding: 0 12px; font-weight: 800; min-width: 44px; }
.speed button.on { background: var(--grape-tint); color: var(--grape); }

.chips { display: flex; gap: 6px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; scrollbar-width: thin; }
.chips button {
  flex: none; border: 2px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 3px 12px; font-weight: 700; font-size: .9rem;
}
.chips button.on { border-color: var(--grape); color: var(--grape); background: var(--grape-tint); }
.chips small { opacity: .7; margin-left: 3px; }

.keys { color: var(--ink-soft); font-size: .82rem; margin-top: 4px; margin-bottom: 0; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 0 5px; margin: 0 2px; background: var(--card); font: inherit; font-size: .78rem; }
@media (hover: none) { .keys { display: none; } }

/* ---------- Clips ---------- */
.list { list-style: none; margin-top: 12px; margin-bottom: 80px; display: grid; gap: 8px; }
.item {
  background: var(--card); border: 2px solid transparent; border-radius: var(--radius);
  padding: 10px 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  box-shadow: 0 1px 0 var(--line);
}
.item.sel { border-color: var(--grape); }
.item.is-ok { background: linear-gradient(90deg, var(--leaf-tint), var(--card) 60%); }
.item.has-open { background: linear-gradient(90deg, var(--sunshine-tint), var(--card) 60%); }
.play {
  width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--grape); color: #fff; box-shadow: 0 3px 0 var(--grape-shade);
}
.play.playing { background: var(--grape-shade); box-shadow: none; transform: translateY(2px); }
.play svg { width: 22px; height: 22px; }
.item .title { font-size: 1.1rem; font-weight: 800; line-height: 1.3; }
.thumb { border: 0; padding: 0; background: none; border-radius: 10px; overflow: hidden; width: 92px; box-shadow: 0 2px 8px rgba(45, 42, 74, .18); cursor: zoom-in; }
.thumb img { display: block; width: 100%; height: auto; }
.topic-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--grape-tint); color: var(--grape); }
.topic-icon svg { width: 24px; height: 24px; }
.item.kind-topic { border-style: dashed; border-color: var(--line); }
.item.kind-topic.sel { border-color: var(--grape); }
.area-head { list-style: none; margin-top: 18px; }
.area-head:first-child { margin-top: 0; }
.area-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.subject { color: var(--ink); margin-left: 4px; }
.zoom { position: fixed; inset: 0; z-index: 20; background: rgba(20, 18, 35, .82); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
.item .text { font-size: 1.2rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.item .meta { font-size: .8rem; color: var(--ink-soft); font-weight: 700; display: flex; gap: 4px 10px; flex-wrap: wrap; }
.meta .who-ok { color: var(--leaf-shade); }
.meta .stale { color: var(--coral); }
.actions { display: flex; gap: 6px; }
.actions button {
  min-height: 44px; border: 2px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 0 10px; font-weight: 800; display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.actions svg { width: 18px; height: 18px; }
.actions .ok.on { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.actions .talk.has { border-color: var(--sunshine); }
.actions .talk.open { background: var(--grape-tint); border-color: var(--grape); color: var(--grape); }
@media (max-width: 560px) {
  .top { position: static; }
  .brand { flex: 1; }
  .me { order: 2; }
  .modes { order: 3; flex-basis: 100%; }
  #langs { order: 4; }
  .item { grid-template-columns: auto 1fr; }
  .actions { grid-column: 1 / -1; justify-content: flex-end; }
  .actions .label { display: none; }
}

/* ---------- Threads ---------- */
.threads { grid-column: 1 / -1; margin-top: 8px; display: grid; gap: 10px; }
.thread { border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.thread.resolved { opacity: .8; }
.thread-head {
  display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 6px 10px; background: var(--cream-deep); font-size: .82rem; font-weight: 700; color: var(--ink-soft);
}
.badge { border-radius: 999px; padding: 1px 8px; font-weight: 800; font-size: .75rem; }
.badge.open { background: var(--sunshine); color: #2d2a4a; }
.badge.done { background: var(--leaf); color: #fff; }
.badge.take { background: var(--coral); color: #fff; }
.comment { padding: 8px 10px; border-top: 1px solid var(--line); }
.comment:first-of-type { border-top: 0; }
.comment .by { font-size: .82rem; color: var(--ink-soft); font-weight: 700; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.comment .by b { color: var(--ink); }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comment .tools { margin-left: auto; display: flex; gap: 10px; }
.thread form, .new-thread { padding: 8px 10px; display: grid; gap: 6px; border-top: 1px solid var(--line); }
.new-thread { border: 2px dashed var(--line); border-radius: 14px; }
textarea {
  width: 100%; min-height: 64px; resize: vertical; border: 2px solid var(--line); border-radius: 10px;
  padding: 8px 10px; background: var(--card);
}
.row-buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.collapsed-note { padding: 6px 10px; }

.empty { text-align: center; color: var(--ink-soft); font-weight: 700; margin-top: 40px; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10;
  background: var(--ink); color: var(--cream); padding: 10px 18px; border-radius: 12px; font-weight: 700;
  max-width: calc(100vw - 32px);
}
