/*
 * Postits — a quiet office-wall interface where the notes carry the color.
 * Everything around the postits stays neutral so the notes read first.
 */

:root {
  --wall: #e9edf1;
  --panel: #ffffff;
  --ink: #1d2733;
  --ink-2: #4a5866;
  --ink-3: #6f7c89;
  --line: #d3dae1;
  --line-soft: #e3e8ed;
  --action: #1f4fd1;
  --action-hover: #183fa8;
  --danger: #b42318;
  --focus: 0 0 0 3px rgb(31 79 209 / 0.35);

  /* Postit papers. Ink stays dark warm gray on every color for contrast. */
  --note-yellow: #ffe66e;
  --note-pink: #ffc4d6;
  --note-blue: #bfe2f6;
  --note-green: #c8ecae;
  --note-orange: #ffd2a3;
  --note-purple: #dacff6;
  /* Extra papers so every teammate can have their own color. */
  --note-teal: #b3e6df;
  --note-coral: #ffbfb0;
  --note-periwinkle: #c9d2fb;
  --note-mauve: #ecc8ea;
  --note-sand: #e8dcc9;
  --note-slate: #d2dbe5;
  --note-unassigned: #fbfbfa;
  /* The band across the top of your own postits when they aren't yellow. */
  --band-mine: #fdd23c;
  --note-ink: #2b2a24;
  --note-ink-2: #55524a;

  --radius: 6px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: var(--action); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--action-hover); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.muted { color: var(--ink-3); }

/* ---------- Top bar ---------- */

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}

.topbar__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center; gap: 20px;
}

.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); }

.brand__mark {
  width: 18px; height: 18px; border-radius: 1px;
  background: var(--note-yellow);
  box-shadow: inset 0 4px 0 rgb(0 0 0 / 0.07), 0 1px 2px rgb(29 39 51 / 0.3);
  rotate: -4deg;
}
.brand__mark--large { width: 30px; height: 30px; }

.nav { display: flex; gap: 2px; }

.nav__link {
  padding: 6px 12px; border-radius: var(--radius);
  color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap;
}
.nav__link:hover { background: var(--wall); color: var(--ink); }
.nav__link--current { color: var(--ink); background: var(--wall); }

.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.inbox {
  position: relative; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%; color: var(--ink-2);
}
.inbox:hover { background: var(--wall); color: var(--ink); }
.inbox__count {
  position: absolute; top: 2px; right: 0;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--action); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}

/* Menus built on <details> so they work without JavaScript. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }

.menu__button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius);
  font-weight: 600; max-width: 240px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu__button::after {
  content: ""; width: 7px; height: 7px; margin: -3px 0 0 2px; flex: none;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3);
  rotate: 45deg;
}
.menu__button:hover { border-color: var(--ink-3); }
.menu__button--avatar { border: 0; padding: 0; }
.menu__button--avatar::after { display: none; }

.menu__panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 220px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 12px 28px -10px rgb(29 39 51 / 0.35);
}
.menu--end .menu__panel { left: auto; right: 0; }

.menu__heading { padding: 6px 10px 4px; font-size: 12px; color: var(--ink-3); }
.menu__who { padding: 8px 10px 10px; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu__who strong { color: var(--ink); }

.menu__item {
  display: block; width: 100%; padding: 7px 10px; border-radius: 4px;
  color: var(--ink); text-decoration: none; text-align: left;
  font: inherit; background: none; border: 0; cursor: pointer;
}
.menu__item:hover { background: var(--wall); color: var(--ink); }
.menu__item--current { font-weight: 600; }
.menu__item--action { color: var(--action); border-top: 1px solid var(--line-soft); margin-top: 4px; border-radius: 0 0 4px 4px; }

/* ---------- Page scaffolding ---------- */

.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 80px; }

.flash {
  margin-bottom: 20px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--action);
}
.flash--alert { border-left-color: var(--danger); }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-head__title { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
.page-head__sub { color: var(--ink-2); margin-top: 2px; }

.lede { color: var(--ink-2); margin: 4px 0 20px; }
.narrow { max-width: 480px; }
.narrow .page-head__title { margin-bottom: 4px; }

.crumbs { margin-bottom: 16px; font-size: 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px;
}
.panel + .panel { margin-top: 16px; }
.panel__title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.panel__empty { color: var(--ink-3); margin-bottom: 14px; }

.empty {
  max-width: 460px; margin: 48px auto; text-align: center; color: var(--ink-2);
  display: grid; justify-items: center; gap: 8px;
}
.empty__title { color: var(--ink); font-size: 18px; font-weight: 600; }
.empty .button { margin-top: 10px; }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 20px; padding: 10px 14px; border-radius: var(--radius);
  background: #fff4e5; border: 1px solid #f1d2a8;
}

/* ---------- Buttons and forms ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font: 500 14px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button:hover { border-color: var(--ink-3); color: var(--ink); }
.button--primary { background: var(--action); border-color: var(--action); color: #fff; }
.button--primary:hover { background: var(--action-hover); border-color: var(--action-hover); color: #fff; }
.button--quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.button--quiet:hover { background: rgb(29 39 51 / 0.06); border-color: transparent; }
.button--danger { color: var(--danger); }
.button--danger:hover { color: var(--danger); }
.button--small { height: 30px; padding: 0 10px; font-size: 13px; }
.button--block { width: 100%; height: 40px; }

.link-button {
  background: none; border: 0; padding: 0; font: inherit; font-size: 13px;
  color: var(--ink-3); cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.link-button:hover { color: var(--ink); }
.link-button--danger:hover { color: var(--danger); }

form.button_to { display: inline; }

.stack { display: grid; gap: 16px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-weight: 500; font-size: 14px; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.field__aside { font-size: 13px; }
.field__hint { font-size: 13px; color: var(--ink-3); }

.input {
  width: 100%; min-height: 38px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); font: inherit;
}
.input:hover { border-color: #b9c3cd; }
.input:focus { outline: none; border-color: var(--action); box-shadow: var(--focus); }
textarea.input { resize: vertical; }

.form-actions { display: flex; gap: 8px; align-items: center; }

.form-errors {
  padding: 10px 14px; border-radius: var(--radius);
  background: #fdecea; border: 1px solid #f3c4bf; color: #7a1a12; font-size: 14px;
}
.form-errors ul { margin-top: 4px; padding-left: 18px; list-style: disc; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; }

.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; margin-bottom: -1px;
  color: var(--ink-2); font-weight: 500; text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--ink); }
.tab--current { color: var(--ink); border-bottom-color: var(--ink); }
.tab__count {
  min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--line-soft);
  font-size: 12px; line-height: 20px; text-align: center; color: var(--ink-2);
}

/* ---------- The postit ---------- */

.postit {
  --note: var(--note-yellow);
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 26px 18px 14px;
  color: var(--note-ink);
  /* The top band only shows on your own postits that aren't yellow. */
  --band: transparent;
  background:
    linear-gradient(to bottom, var(--band) 0 16px, transparent 16px),
    var(--note);
  box-shadow: 0 1px 1px rgb(29 39 51 / 0.12), 0 2px 6px -2px rgb(29 39 51 / 0.18);
}

/* The lifted bottom corner: a shadow tucked behind the paper. */
.postit::after {
  content: ""; position: absolute; z-index: -1;
  right: 8px; bottom: 12px; width: 55%; height: 30%;
  box-shadow: 4px 14px 14px rgb(29 39 51 / 0.32);
  transform: rotate(4deg) skewX(8deg);
}

.postit--yellow { --note: var(--note-yellow); }
.postit--pink   { --note: var(--note-pink); }
.postit--blue   { --note: var(--note-blue); }
.postit--green  { --note: var(--note-green); }
.postit--orange { --note: var(--note-orange); }
.postit--purple { --note: var(--note-purple); }
.postit--teal       { --note: var(--note-teal); }
.postit--coral      { --note: var(--note-coral); }
.postit--periwinkle { --note: var(--note-periwinkle); }
.postit--mauve      { --note: var(--note-mauve); }
.postit--sand       { --note: var(--note-sand); }
.postit--slate      { --note: var(--note-slate); }
.postit--unassigned { --note: var(--note-unassigned); }

/* Yours in another color: a yellow band on top, so it still reads as yours. */
.postit--mine:not(.postit--yellow) { --band: var(--band-mine); }

.postit__title { font-size: 16px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.postit__pin + .postit__title { padding-right: 18px; }

/* The assignee sits in the top corner, like a pin. */
.postit__pin { position: absolute; top: 4px; right: 10px; }
.postit__pin .avatar { box-shadow: 0 0 0 2px var(--note); }

/* The whole note is clickable; the check button sits above the link. */
.postit__link { color: inherit; text-decoration: none; }
.postit__link:hover { color: inherit; text-decoration: underline; text-decoration-thickness: 1.5px; }
.postit__link::before { content: ""; position: absolute; inset: 0; }
.postit__link:focus-visible { box-shadow: none; }
.postit:has(.postit__link:focus-visible) { box-shadow: var(--focus); }

.postit__notes {
  font-size: 13.5px; line-height: 1.45; color: var(--note-ink-2);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.postit__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.postit__meta { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 12.5px; color: var(--note-ink-2); }
.postit__comments { display: inline-flex; align-items: center; gap: 3px; }
.postit__comment-match { border-left: 2px solid rgb(43 42 36 / 0.25); padding-left: 8px; }
.postit__comment-author { font-weight: 600; color: var(--note-ink); }
.postit__action { position: relative; z-index: 1; }
.postit__assignee { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }

.due { font-weight: 500; white-space: nowrap; }
.due--today { color: #6b4b00; }
.due--overdue { color: #9a1c12; font-weight: 600; }

.postit--done { --note-ink: #5d5a51; }
.postit--done .postit__title { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: rgb(43 42 36 / 0.45); }

.check {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: 50%; border: 1.5px solid rgb(43 42 36 / 0.55);
  background: rgb(255 255 255 / 0.35); color: transparent; cursor: pointer;
}
.check:hover { background: rgb(255 255 255 / 0.7); color: rgb(43 42 36 / 0.5); }
.check--on { background: var(--note-ink); border-color: var(--note-ink); color: var(--note); }
.check--on:hover { background: var(--note-ink-2); color: var(--note); }

/* ---------- The board ---------- */

/* Wide screens: one column per due-date lane, like sections of a wall. */
.board { display: grid; gap: 36px; }
@media (min-width: 1100px) {
  .board { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; align-items: start; }
  .postits--lane { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 1099px) {
  .lane--empty { display: none; }
}
.lane__title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 16px; }
.lane__title--overdue { color: var(--danger); }
.lane__count { font-weight: 500; color: var(--ink-3); }
.lane__empty {
  display: grid; place-items: center; aspect-ratio: 1;
  border: 1.5px dashed var(--line); border-radius: 2px; color: var(--ink-3); font-size: 13px;
}

.postits {
  display: grid; gap: 28px 24px;
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
  isolation: isolate;
}

/* Each note is pinned at a slight, varied angle, like a real wall. */
.postits__item { transform: rotate(-0.8deg); }
.postits__item:nth-child(3n + 2) { transform: rotate(0.6deg); }
.postits__item:nth-child(4n + 3) { transform: rotate(-0.3deg) translateY(3px); }
.postits__item:nth-child(5n + 4) { transform: rotate(1deg); }
.postits__item .postit { aspect-ratio: 1; }

@media (prefers-reduced-motion: no-preference) {
  .postits__item { transition: transform 160ms ease; }
}
.postits__item:hover { transform: rotate(0) translateY(-3px); }

/* ---------- Followup form (a postit you write on) ---------- */

.note-form { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 340px); gap: 32px; align-items: start; isolation: isolate; }
.note-form > .form-errors { grid-column: 1 / -1; }

.note-form__note { aspect-ratio: 1; padding-top: 30px; }

.note-form__title, .note-form__notes {
  width: 100%; border: 0; background: transparent; color: var(--note-ink); font-family: var(--font);
  padding: 4px 6px; margin: 0 -6px; border-radius: 4px; resize: none;
}
.note-form__title { font-size: 21px; font-weight: 600; line-height: 1.3; }
.note-form__notes { flex: 1; font-size: 15px; line-height: 1.5; }
.note-form__title::placeholder, .note-form__notes::placeholder { color: rgb(43 42 36 / 0.45); }
.note-form__title:focus, .note-form__notes:focus { outline: none; background: rgb(255 255 255 / 0.35); box-shadow: none; }

.note-form__fields { display: grid; gap: 18px; padding-top: 4px; }

/*
 * The note being written previews how it will look to you, without
 * JavaScript. Assigned to you: your picked color, with a yellow band if it isn't yellow.
 * Assigned to a teammate: their color, and the picker is hidden.
 */
.note-form:has(option[data-mine]:checked):not(:has(.swatch__input[value="yellow"]:checked)) .note-form__note { --band: var(--band-mine); }
.note-form:has(option[data-mine]:checked):has(.swatch__input[value="yellow"]:checked) .note-form__note { --note: var(--note-yellow); }
.note-form:has(option[data-mine]:checked):has(.swatch__input[value="pink"]:checked)   .note-form__note { --note: var(--note-pink); }
.note-form:has(option[data-mine]:checked):has(.swatch__input[value="blue"]:checked)   .note-form__note { --note: var(--note-blue); }
.note-form:has(option[data-mine]:checked):has(.swatch__input[value="green"]:checked)  .note-form__note { --note: var(--note-green); }
.note-form:has(option[data-mine]:checked):has(.swatch__input[value="orange"]:checked) .note-form__note { --note: var(--note-orange); }
.note-form:has(option[data-mine]:checked):has(.swatch__input[value="purple"]:checked) .note-form__note { --note: var(--note-purple); }

.note-form:has(option[data-paper="blue"]:checked)       .note-form__note { --note: var(--note-blue); }
.note-form:has(option[data-paper="green"]:checked)      .note-form__note { --note: var(--note-green); }
.note-form:has(option[data-paper="pink"]:checked)       .note-form__note { --note: var(--note-pink); }
.note-form:has(option[data-paper="orange"]:checked)     .note-form__note { --note: var(--note-orange); }
.note-form:has(option[data-paper="purple"]:checked)     .note-form__note { --note: var(--note-purple); }
.note-form:has(option[data-paper="teal"]:checked)       .note-form__note { --note: var(--note-teal); }
.note-form:has(option[data-paper="coral"]:checked)      .note-form__note { --note: var(--note-coral); }
.note-form:has(option[data-paper="periwinkle"]:checked) .note-form__note { --note: var(--note-periwinkle); }
.note-form:has(option[data-paper="mauve"]:checked)      .note-form__note { --note: var(--note-mauve); }
.note-form:has(option[data-paper="sand"]:checked)       .note-form__note { --note: var(--note-sand); }
.note-form:has(option[data-paper="slate"]:checked)      .note-form__note { --note: var(--note-slate); }
.note-form:has(option[data-paper="unassigned"]:checked) .note-form__note { --note: var(--note-unassigned); }

.swatches-hint { font-size: 13px; color: var(--ink-3); }
.note-form:has(option[data-mine]:checked) .swatches-hint,
.note-form:not(:has(option[data-mine]:checked)) .swatches { display: none; }

.swatches { border: 0; padding: 0; margin: 0; }
.swatches legend { padding: 0; margin-bottom: 6px; }
.swatches__list { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch__input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }

.swatch__chip {
  display: block; width: 32px; height: 32px; padding: 0; border-radius: 3px;
  background: var(--chip); border: 1px solid rgb(29 39 51 / 0.18); cursor: pointer;
  box-shadow: inset 0 6px 0 rgb(0 0 0 / 0.05);
}
.swatch__input:checked + .swatch__chip,
.swatch__chip--current { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatch__input:focus-visible + .swatch__chip { box-shadow: var(--focus); }

.swatch--yellow { --chip: var(--note-yellow); }
.swatch--pink   { --chip: var(--note-pink); }
.swatch--blue   { --chip: var(--note-blue); }
.swatch--green  { --chip: var(--note-green); }
.swatch--orange { --chip: var(--note-orange); }
.swatch--purple { --chip: var(--note-purple); }
.swatch--teal       { --chip: var(--note-teal); }
.swatch--coral      { --chip: var(--note-coral); }
.swatch--periwinkle { --chip: var(--note-periwinkle); }
.swatch--mauve      { --chip: var(--note-mauve); }
.swatch--sand       { --chip: var(--note-sand); }
.swatch--slate      { --chip: var(--note-slate); }
.swatch--unassigned { --chip: var(--note-unassigned); }

/* Who's who on the board: a chip of each person's color. */
.color-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; margin: -12px 0 24px; font-size: 13px; color: var(--ink-2); }
.color-key__item { display: inline-flex; align-items: center; gap: 6px; }
a.color-key__item { padding: 3px 8px; margin: -3px -8px; border-radius: 999px; color: var(--ink-2); text-decoration: none; }
a.color-key__item:hover { background: rgb(29 39 51 / 0.06); color: var(--ink); }
a.color-key__item--current { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.color-key__clear { font-size: 13px; }
.color-key__chip { width: 14px; height: 14px; border-radius: 2px; background: var(--chip); border: 1px solid rgb(29 39 51 / 0.15); }

.recolor__note { font-size: 13px; color: var(--ink-3); }
/* ---------- Followup detail ---------- */

.detail { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px; align-items: start; }
.detail__note { display: grid; gap: 18px; isolation: isolate; }
.postit--large { min-height: 340px; padding: 34px 26px 20px; }
.postit--large .postit__title { font-size: 22px; letter-spacing: -0.01em; }
.postit--large .postit__notes { display: block; font-size: 15px; color: var(--note-ink); }
.postit--large .postit__notes p + p { margin-top: 0.7em; }
.postit--large .postit__meta { font-size: 14px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }

.recolor { display: flex; align-items: center; gap: 8px; }
.recolor__label { font-size: 13px; color: var(--ink-2); margin-right: 4px; }
.recolor .swatch__chip { width: 26px; height: 26px; }

.detail__byline { font-size: 13px; color: var(--ink-3); }

.comments { display: grid; gap: 16px; margin-bottom: 16px; }
.comment { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.comment__meta { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.comment__meta time { font-size: 12.5px; color: var(--ink-3); }
.comment__text { margin-top: 2px; overflow-wrap: anywhere; }
.comment-form { display: grid; gap: 8px; justify-items: end; }

.history { display: grid; gap: 0; }
.history__item {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px;
}
.history__item:first-child { border-top: 0; padding-top: 0; }
.history__item time { flex: none; font-size: 12.5px; color: var(--ink-3); }

/* ---------- Avatars ---------- */

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: #2f3e4e; color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }

/* ---------- Feeds: activity and notifications ---------- */

.day + .day { margin-top: 28px; }
.day__title { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }

.feed { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.feed__item {
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 12px;
  padding: 11px 16px; border-top: 1px solid var(--line-soft);
}
.feed__item:first-child { border-top: 0; }
.feed__item time { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.feed__chip { width: 12px; height: 12px; border-radius: 2px; background: var(--chip); border: 1px solid rgb(29 39 51 / 0.15); }
.feed__text { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.feed__text:hover { color: var(--action); text-decoration: underline; }

.feed--notifications .feed__item { grid-template-columns: auto auto 1fr auto auto; }
.feed__dot { width: 8px; height: 8px; border-radius: 50%; }
.feed__item--unread { background: #f5f8ff; }
.feed__item--unread .feed__dot { background: var(--action); }
.feed__item--unread .feed__text { font-weight: 500; }
.feed__team { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* ---------- Members ---------- */

.invite { margin-bottom: 24px; display: grid; gap: 10px; justify-items: start; }
.invite .panel__title { margin-bottom: 0; }
.invite p { color: var(--ink-2); }
.invite__row { display: flex; gap: 8px; width: 100%; max-width: 640px; }
.invite__link { font-size: 14px; color: var(--ink-2); }

.members {
  width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
}
.members th { text-align: left; font-size: 13px; font-weight: 500; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); }
.members td { padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.members tr:first-child td { border-top: 0; }
.members__name { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.members__actions { text-align: right; }

/* ---------- Authentication pages ---------- */

.page--auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.page--auth > .flash { width: min(400px, 100%); margin: 0 auto 16px; }

.auth { width: min(400px, 100%); display: grid; gap: 20px; }
.auth__brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.auth__wordmark { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }

.auth__card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 28px; box-shadow: 0 18px 40px -24px rgb(29 39 51 / 0.4);
}
.auth__title { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.auth__card .lede { margin-bottom: 18px; }
.auth__card .stack { margin-top: 16px; }
.auth__card .lede + .stack { margin-top: 0; }
.auth__switch { text-align: center; color: var(--ink-2); font-size: 14px; }

/* ---------- Search ---------- */

/* Visible on white and on every postit color, unlike the default yellow. */
mark {
  background: rgb(31 79 209 / 0.15); color: inherit;
  box-shadow: inset 0 -2px 0 var(--action); border-radius: 2px 2px 0 0; padding: 0 1px;
}

.topsearch { position: relative; flex: 1; max-width: 340px; margin-left: auto; }
.topsearch__icon { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--ink-3); pointer-events: none; }
.topsearch__input {
  width: 100%; height: 36px; padding: 0 12px 0 32px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--wall);
  font: inherit; font-size: 14px; color: var(--ink);
}
.topsearch__input:focus { outline: none; background: var(--panel); border-color: var(--action); box-shadow: var(--focus); }
.topsearch + .topbar__end { margin-left: 0; }
.detail > .panel + .panel { margin-top: 0; }

.searchbar { display: flex; gap: 8px; max-width: 640px; margin-bottom: 12px; }
.search-summary { color: var(--ink-2); margin-bottom: 28px; }
#search_results[busy] .results, #search_results[busy] .empty { opacity: 0.55; transition: opacity 120ms; }
.searchbar__input { font-size: 16px; min-height: 42px; }
.searchbar .button { height: 42px; }

.results + .results { margin-top: 40px; }
.results__title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.results__none { color: var(--ink-3); }

/* ---------- Knowledge base ---------- */

.kind {
  display: inline-block; padding: 1px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap;
}
.kind--fact   { background: #e4ecfb; color: #1f3f8f; }
.kind--policy { background: #e3f1e8; color: #1d5b36; }

.kb-list { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.kb-item {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: baseline;
  padding: 14px 18px; border-top: 1px solid var(--line-soft);
}
.kb-item:first-child { border-top: 0; }
.kb-item:hover { background: #f8fafc; }
.kb-item .kind { justify-self: start; }
.kb-item__title { font-size: 15px; font-weight: 600; }
.kb-item__link { color: var(--ink); text-decoration: none; }
.kb-item__link::after { content: ""; position: absolute; inset: 0; }
.kb-item__link:hover { color: var(--action); }
.kb-item__body { margin-top: 3px; font-size: 14px; color: var(--ink-2); max-width: 80ch; }
.kb-item__meta { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

.narrow--wide { max-width: 720px; }

.segmented { justify-self: start; display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 2px; }
.segmented__option { position: relative; }
.segmented__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented__option span { display: block; padding: 6px 16px; border-radius: 4px; font-weight: 500; color: var(--ink-2); }
.segmented__option input:checked + span { background: var(--ink); color: #fff; }
.segmented__option input:focus-visible + span { box-shadow: var(--focus); }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }

.detail--article { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
.doc { padding: 28px 32px; display: grid; gap: 14px; justify-items: start; }
.doc__title { font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; }
.doc__body { font-size: 16px; line-height: 1.65; max-width: 70ch; }
.doc__body p + p { margin-top: 0.8em; }

.feed__chip--article { background: #c9d3de; border-radius: 50%; }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .detail, .detail--article, .note-form { grid-template-columns: minmax(0, 1fr); }
  .detail__note, .note-form__note { max-width: 440px; }
}

@media (max-width: 640px) {
  .topbar__inner { padding: 0 16px; gap: 10px; height: auto; min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .topsearch { order: 4; max-width: none; flex-basis: 100%; }
  .topsearch + .topbar__end { margin-left: auto; }
  .nav__link { padding: 6px 9px; }
  .kb-item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .doc { padding: 20px; }
  .switcher .menu__button { max-width: 150px; }
  .page { padding: 20px 16px 64px; }
  .postits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
  .postit { padding: 22px 12px 10px; }
  .postit__title { font-size: 14.5px; }
  .postit__notes { -webkit-line-clamp: 3; }
  .tab { padding: 9px 8px; }
  .postits__item .postit__comments { display: none; }
  .members th:nth-child(2), .members td:nth-child(2), .members th:nth-child(5), .members td:nth-child(5) { display: none; }
  .feed__item, .feed--notifications .feed__item { grid-template-columns: auto 1fr; }
  .feed__item time, .feed__team, .feed__chip { grid-column: 2; }
  .feed__chip { display: none; }
  .invite__row { flex-direction: column; }
}
