/* ==========================================================================
   Mello — a Trello-shaped board that stays out of the way.
   ========================================================================== */

:root {
  --card-bg: #ffffff;
  --card-fg: #1b2233;
  --muted: #64708a;
  --line: #e3e7ef;
  --list-bg: #f1f3f8;
  --accent: #6b5bd2;
  --accent-fg: #ffffff;
  --green: #3aa76d;
  --red: #d8574f;
  --amber: #d99a2b;
  --radius: 10px;
  --shadow-sm: 0 1px 1px rgba(20, 26, 46, 0.12), 0 0 1px rgba(20, 26, 46, 0.14);
  --shadow-md: 0 8px 24px rgba(16, 20, 38, 0.18);
  --shadow-lg: 0 24px 60px rgba(12, 16, 32, 0.34);
  --topbar: rgba(14, 18, 38, 0.28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Board backgrounds. */
body[data-bg="dusk"]     { background: linear-gradient(150deg, #7b6cf6 0%, #a97ae0 42%, #f0a3b4 100%); }
body[data-bg="ocean"]    { background: linear-gradient(150deg, #1c92d2 0%, #2a5eb0 55%, #123a72 100%); }
body[data-bg="forest"]   { background: linear-gradient(150deg, #2f9e6f 0%, #1f7a5c 50%, #14503f 100%); }
body[data-bg="sunset"]   { background: linear-gradient(150deg, #ff8a5c 0%, #e5566d 55%, #7a3b7e 100%); }
body[data-bg="midnight"] { background: linear-gradient(150deg, #232a45 0%, #161a2c 55%, #0b0d18 100%); }
body[data-bg="slate"]    { background: linear-gradient(150deg, #6b7690 0%, #4a5468 55%, #2e3444 100%); }

* { box-sizing: border-box; }

/* Our display rules would otherwise beat the UA stylesheet's [hidden]. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--card-fg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/*
 * An uploaded photo. The gradient stays underneath as the background-color
 * layer, so it shows while the photo loads and reappears the moment it's
 * removed — no flash of white either way.
 */
body.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

/* --------------------------------------------------------------------------
   Buttons and small shared bits
   -------------------------------------------------------------------------- */
.btn {
  border: 0;
  border-radius: 7px;
  padding: 7px 13px;
  font-weight: 600;
  font-size: 14px;
  background: var(--accent);
  color: var(--accent-fg);
  transition: filter 0.12s ease, background 0.12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: default; filter: none; }

.btn-quiet {
  background: rgba(20, 26, 46, 0.07);
  color: var(--card-fg);
}
.btn-quiet:hover { background: rgba(20, 26, 46, 0.12); filter: none; }

.btn-danger { background: transparent; color: var(--red); }
.btn-danger:hover { background: rgba(216, 87, 79, 0.1); filter: none; }

.btn-ghost {
  background: transparent;
  border: 0;
  color: var(--muted);
  border-radius: 6px;
  padding: 5px 8px;
}
.btn-ghost:hover { background: rgba(20, 26, 46, 0.08); color: var(--card-fg); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  line-height: 1;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.16); }

:focus-visible {
  outline: 2px solid #ffd479;
  outline-offset: 2px;
}

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

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
/*
 * Optical centring. A box sitting on the exact vertical middle reads as low —
 * the eye places the centre of a space slightly above the geometric one. The
 * extra bottom padding lifts the card to roughly 44% of the height, which is
 * what actually looks centred.
 *
 * min-height rather than height so the page can still grow and scroll on a
 * short window instead of clipping the card.
 */
.login-page,
.gate {
  display: grid;
  place-items: center;
  min-height: 100%;
  height: auto;
  padding: 24px 24px calc(24px + 10vh);
}

/* Below about 560px tall the lift costs more than it buys — centre it. */
@media (max-height: 560px) {
  .login-page,
  .gate {
    padding: 24px;
  }
}

.login-card {
  width: min(400px, 100%);
  background: var(--card-bg);
  border-radius: 16px;
  padding: 34px 30px 30px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.login-brand h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; }

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7b6cf6, #f0a3b4);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.login-tagline {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 12px 0 24px;
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #29303f;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.google-button:hover { background: #f7f8fb; box-shadow: var(--shadow-sm); }

.login-error {
  background: #fdeceb;
  color: #a2372f;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin-bottom: 16px;
  text-align: left;
}

.login-note {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  text-align: left;
}
.login-note code, .mono { font-family: var(--mono); font-size: 12.5px; }

.dev-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 14px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.dev-divider::before, .dev-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.dev-form { display: grid; gap: 8px; }
.dev-form input {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: var(--topbar);
  backdrop-filter: blur(8px);
  color: #fff;
  flex: 0 0 auto;
  z-index: 30;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.topbar-brand .logo-mark { width: 20px; height: 20px; border-radius: 6px; }

.board-title {
  background: transparent;
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  padding: 5px 9px;
  border-radius: 7px;
  min-width: 60px;
  max-width: 320px;
}
.board-title:hover { background: rgba(255, 255, 255, 0.16); }
.board-title:focus { background: rgba(255, 255, 255, 0.95); color: var(--card-fg); outline: none; }

.topbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.28);
}

.topbar-spacer { flex: 1; }

.board-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 0;
  border-radius: 7px;
  padding: 6px 26px 6px 10px;
  font-size: 13.5px;
  font-weight: 600;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23fff' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.board-select:hover { background-color: rgba(255, 255, 255, 0.26); }

/* On a narrow window the topbar runs out of room before the board does. */
@media (max-width: 860px) {
  .search { width: 130px; }
  .search:focus { width: 160px; }
  .board-title { max-width: 150px; }
  .avatar-stack { display: none; }
}
@media (max-width: 620px) {
  .search, .topbar-divider { display: none; }
}

.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -7px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex: 0 0 auto;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-lg { width: 36px; height: 36px; font-size: 14px; }

.search {
  background: rgba(255, 255, 255, 0.16);
  border: 0;
  border-radius: 7px;
  padding: 7px 11px;
  color: #fff;
  width: 200px;
  font-size: 13.5px;
}
.search::placeholder { color: rgba(255, 255, 255, 0.72); }
.search:focus { background: #fff; color: var(--card-fg); outline: none; width: 260px; }
.search:focus::placeholder { color: var(--muted); }

/* --------------------------------------------------------------------------
   Board
   -------------------------------------------------------------------------- */
.board-scroll {
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px;
}

.board {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

/*
 * A slot is one horizontal position on the board. Columns sharing a slot stack
 * vertically inside it: sized ones keep their height, the rest share whatever
 * room is left, and each scrolls internally.
 */
.slot {
  width: 286px;
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.list {
  width: 100%;
  flex: 1 1 auto;
  min-height: 120px;
  background: var(--list-bg);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.list.is-sized { flex: 0 0 auto; }

/* Grip along the bottom edge. Invisible until you go near it. */
.list-resize {
  height: 10px;
  flex: 0 0 auto;
  cursor: ns-resize;
  border-radius: 0 0 12px 12px;
  position: relative;
}
.list-resize::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 34px;
  height: 3px;
  border-radius: 3px;
  transform: translateX(-50%);
  background: rgba(20, 26, 46, 0.18);
  opacity: 0;
  transition: opacity 0.12s ease;
}
.list:hover .list-resize::after { opacity: 1; }
.list-resize:hover::after { background: var(--accent); opacity: 1; }
body.is-resizing { cursor: ns-resize !important; user-select: none !important; }

/* Where a dragged column would land. */
.stack-drop {
  height: 60px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.22);
}
.slot-drop {
  width: 90px;
  flex: 0 0 auto;
  height: 100%;
  border-radius: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.18);
}
.list.is-dragging { opacity: 0.4; }

.list-header {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 8px 6px 12px;
  cursor: grab;
}
.list-header .list-owner, .list-header .icon-btn { margin-top: 2px; }
.list-header .list-count { margin-top: 7px; }
.list-header:active { cursor: grabbing; }

.list-name {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.35;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--card-fg);
  resize: none;
  overflow: hidden;
}
.list-name:hover { background: rgba(20, 26, 46, 0.06); }
.list-name:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); outline: none; }

.list-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
}

.list-owner { display: flex; align-items: center; }

.list-cards {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 8px;
  scrollbar-width: thin;
}
.list-cards::-webkit-scrollbar { width: 8px; }
.list-cards::-webkit-scrollbar-thumb { background: rgba(20, 26, 46, 0.18); border-radius: 8px; }

.list-footer { padding: 4px 8px 8px; }

.add-card-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 9px;
  border-radius: 8px;
  font-size: 13.5px;
  text-align: left;
}
.add-card-btn:hover { background: rgba(20, 26, 46, 0.07); color: var(--card-fg); }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
/* Dragging a card used to leave a trail of highlighted text behind it. */
.card, .list-header, .add-card-btn, .list-count { user-select: none; }
body.is-dragging, body.is-dragging * { user-select: none !important; cursor: grabbing !important; }

.card {
  background: var(--card-bg);
  border-radius: 9px;
  padding: 8px 10px 7px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.12s ease, transform 0.06s ease;
  touch-action: none;
}
.card:hover { box-shadow: 0 2px 6px rgba(20, 26, 46, 0.22); }
.card.is-dragging { opacity: 0.35; }
.card.is-complete .card-title { color: var(--muted); text-decoration: line-through; }

.card-ghost {
  position: fixed;
  z-index: 1000;
  width: 262px;
  pointer-events: none;
  transform: rotate(3deg);
  box-shadow: var(--shadow-md);
  cursor: grabbing;
}

.drop-slot {
  border-radius: 9px;
  background: rgba(20, 26, 46, 0.1);
  flex: 0 0 auto;
}

/* Cover image: the card's first attachment, shown on the board. */
.card-cover {
  margin: -8px -10px 8px;
  border-radius: 9px 9px 0 0;
  overflow: hidden;
  max-height: 160px;
  background: var(--line);
}
.card-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
}

/* Images on the card back. */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.image-tile {
  margin: 0;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}
.image-tile img { display: block; width: 100%; height: 110px; object-fit: cover; }
.image-tile .image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--red);
  opacity: 0;
  box-shadow: var(--shadow-sm);
}
.image-tile:hover .image-remove, .image-tile:focus-within .image-remove { opacity: 1; }

.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.card-label {
  height: 8px;
  min-width: 38px;
  border-radius: 4px;
}
.label-blue   { background: #5b8def; }
.label-red    { background: #eb5a46; }
.label-green  { background: #61bd4f; }
.label-yellow { background: #f2d600; }
.label-purple { background: #a06fd8; }
.label-orange { background: #ff9f1a; }
.label-sky    { background: #4fc3e8; }
.label-lime   { background: #9fd837; }
.label-pink   { background: #ef7ab8; }
.label-grey   { background: #8b93a6; }

.card-main { display: flex; gap: 8px; align-items: flex-start; }

.check {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.6px solid #b6bfd0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.check:hover { border-color: var(--green); }
.check svg { width: 11px; height: 11px; opacity: 0; }
.check.is-on { background: var(--green); border-color: var(--green); }
.check.is-on svg { opacity: 1; }

.card-title {
  font-size: 14px;
  line-height: 1.38;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 6px 0 0 25px;
  color: var(--muted);
  font-size: 11.5px;
}
.card-badges:empty { display: none; }
.badge { display: inline-flex; align-items: center; gap: 3px; }
.badge svg { width: 13px; height: 13px; }
.badge.is-done { color: var(--green); font-weight: 650; }
.badge.is-due-soon { color: var(--amber); font-weight: 650; }
.badge.is-overdue { color: var(--red); font-weight: 650; }

/* Composer (new card / new column) */
.composer { display: grid; gap: 7px; }
.composer textarea, .composer input {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  box-shadow: var(--shadow-sm), inset 0 0 0 2px var(--accent);
  resize: none;
  font-size: 14px;
  line-height: 1.4;
}
.composer textarea:focus, .composer input:focus { outline: none; }
.composer-row { display: flex; align-items: center; gap: 8px; }

.add-list {
  width: 286px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 10px;
  color: #fff;
}
.add-list .add-list-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 4px 2px;
  text-align: left;
}
.add-list .composer { background: var(--list-bg); border-radius: 9px; padding: 9px; color: var(--card-fg); }
.add-list select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  background: #fff;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Activity drawer — deliberately shaped like the Discord messages the team
   already reads, so the two feeds look like the same thing.
   -------------------------------------------------------------------------- */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: #12151f;
  color: #dfe3ec;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  z-index: 40;
}
.drawer.is-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.drawer-header h2 { margin: 0; font-size: 15.5px; font-weight: 700; }
.drawer-header .icon-btn { color: #aeb6c8; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 20px;
}

.feed-entry {
  display: flex;
  gap: 11px;
  padding: 11px 16px;
  border-left: 3px solid transparent;
}
.feed-entry:hover { background: rgba(255, 255, 255, 0.035); }
.feed-entry[data-kind="create"]   { border-left-color: #5b8def; }
.feed-entry[data-kind="complete"] { border-left-color: #57b97a; }
.feed-entry[data-kind="reopen"]   { border-left-color: #d99a2b; }
.feed-entry[data-kind="move"]     { border-left-color: #a06fd8; }
.feed-entry[data-kind="remove"]   { border-left-color: #d8574f; }
.feed-entry[data-kind="neutral"]  { border-left-color: #4a5468; }

.feed-body { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.62; }
.feed-heading { font-weight: 700; color: #fff; }
.feed-line { color: #b9c0d0; }
.feed-line .feed-label { color: #8a93a8; }
.feed-by { color: #8a93a8; }
.feed-by em { color: #cdd3e0; font-style: italic; }

.chip {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1.5px 5px;
  color: #e6e9f2;
  word-break: break-word;
}

.feed-time {
  color: #6d768a;
  font-size: 11.5px;
  margin-top: 3px;
}

.feed-empty, .drawer-note {
  color: #79819a;
  font-size: 13.5px;
  padding: 22px 16px;
  text-align: center;
  line-height: 1.6;
}

.feed-more { display: block; margin: 8px auto 0; }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 30, 0.62);
  display: grid;
  place-items: start center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}
.overlay[hidden] { display: none; }

.modal {
  width: min(720px, 100%);
  background: #f7f8fb;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-narrow { width: min(460px, 100%); }

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 16px 12px 18px;
}
.modal-header h2 { margin: 0; font-size: 17px; }

.modal-title {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  padding: 6px 8px;
  border-radius: 8px;
  resize: none;
  overflow: hidden;
  font-family: inherit;
}
.modal-title:hover { background: rgba(20, 26, 46, 0.05); }
.modal-title:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); outline: none; }

.modal-sub {
  padding: 0 18px 12px 52px;
  color: var(--muted);
  font-size: 13px;
  margin-top: -8px;
}
.modal-sub strong { color: var(--card-fg); font-weight: 650; }

.modal-body {
  display: grid;
  grid-template-columns: 1fr 168px;
  gap: 18px;
  padding: 0 18px 20px;
}
@media (max-width: 640px) {
  .modal-body { grid-template-columns: 1fr; }
}

.section { margin-bottom: 20px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 8px;
}

.field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(107, 91, 210, 0.15); }

.description-view {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  cursor: text;
  min-height: 42px;
  color: var(--card-fg);
}
.description-view.is-empty { color: var(--muted); }
.description-view a { color: var(--accent); }

.checklist { display: grid; gap: 2px; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 7px;
}
.check-row:hover { background: rgba(20, 26, 46, 0.045); }
.check-row input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
  flex: 0 0 auto;
  cursor: pointer;
}
.check-row .check-text { flex: 1; font-size: 14px; line-height: 1.45; word-break: break-word; }
.check-row.is-checked .check-text { color: var(--muted); text-decoration: line-through; }
.check-row .icon-btn { opacity: 0; width: 24px; height: 24px; color: var(--muted); }
.check-row:hover .icon-btn { opacity: 1; }
.check-row .icon-btn:hover { background: rgba(20, 26, 46, 0.08); }

.progress {
  height: 6px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 9px;
}
.progress span { display: block; height: 100%; background: var(--green); transition: width 0.2s ease; }

.comment {
  display: flex;
  gap: 9px;
  padding: 8px 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.comment-meta strong { color: var(--card-fg); font-size: 13px; }
.comment-text {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.sidebar-actions { display: grid; gap: 6px; align-content: start; }
.sidebar-actions .btn-quiet { text-align: left; width: 100%; }

.label-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.label-swatch {
  width: 42px;
  height: 26px;
  border-radius: 6px;
  border: 0;
  position: relative;
}
.label-swatch[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
}
.member-row:last-child { border-bottom: 0; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 14px; font-weight: 600; }
.member-email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.member-row select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 7px;
  background: #fff;
  font-size: 13px;
}

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(107, 91, 210, 0.12);
  color: var(--accent);
}
.pill-warn { background: rgba(217, 154, 43, 0.16); color: #9a6c12; }

.bg-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.bg-swatch { width: 54px; height: 36px; border-radius: 8px; border: 2px solid transparent; }
.bg-swatch[aria-pressed="true"] { border-color: var(--accent); }
.bg-dusk     { background: linear-gradient(150deg, #7b6cf6, #f0a3b4); }
.bg-ocean    { background: linear-gradient(150deg, #1c92d2, #123a72); }
.bg-forest   { background: linear-gradient(150deg, #2f9e6f, #14503f); }
.bg-sunset   { background: linear-gradient(150deg, #ff8a5c, #7a3b7e); }
.bg-midnight { background: linear-gradient(150deg, #232a45, #0b0d18); }
.bg-slate    { background: linear-gradient(150deg, #6b7690, #2e3444); }

/* --------------------------------------------------------------------------
   Menus, toasts, misc
   -------------------------------------------------------------------------- */
.menu {
  position: fixed;
  z-index: 60;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  min-width: 190px;
}
.menu button, .menu a {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--card-fg);
  text-decoration: none;
}
.menu button:hover, .menu a:hover { background: rgba(20, 26, 46, 0.07); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 2px; }
.menu-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 6px 10px 4px;
  font-weight: 700;
}

.toast-stack {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 70;
}
.toast {
  background: #1b2233;
  color: #fff;
  padding: 10px 15px;
  border-radius: 9px;
  font-size: 13.5px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.18s ease;
}
.toast.is-error { background: #a2372f; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Layout for .gate lives with .login-page above — both are a card in space. */
.gate-card {
  background: #fff;
  border-radius: 14px;
  padding: 30px;
  max-width: 420px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.gate-card h1 { margin: 0 0 10px; font-size: 21px; }
.gate-card p { color: var(--muted); line-height: 1.6; font-size: 14.5px; }

.dim { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: grid; gap: 10px; }
.card-hidden { display: none !important; }
