/*
 * Campsite design system
 * A warm, calm, friendly workspace. Our own palette — not Basecamp's.
 */

:root {
  /* Warm light palette */
  --bg:            #f6f1e9;
  --bg-soft:       #efe8dc;
  --surface:       #ffffff;
  --surface-sunk:  #faf6ef;
  --ink:           #2c2925;
  --ink-soft:      #5f584f;
  --ink-faint:     #8d857a;
  --line:          #e7ddcd;
  --line-strong:   #d8ccb8;

  /* Brand — campfire teal + warm ember accents (ours, not 37signals') */
  --brand:         #1f7a6d;
  --brand-dark:    #155f55;
  --brand-tint:    #e4f1ee;
  --ember:         #c2562f;
  --ember-dark:    #a4451f;
  --gold:          #c79100;
  --danger:        #b03a5b;

  --radius:        16px;
  --radius-sm:     10px;
  --radius-pill:   999px;
  --shadow:        0 1px 2px rgba(44, 41, 37, .06), 0 6px 18px rgba(44, 41, 37, .07);
  --shadow-lift:   0 4px 10px rgba(44, 41, 37, .10), 0 14px 34px rgba(44, 41, 37, .13);

  --maxw:          1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.page { padding: 32px 0 80px; }
.stack > * + * { margin-top: 16px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; color: var(--ink); letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--ember));
  display: grid; place-items: center; color: #fff; font-size: 16px;
}
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a {
  color: var(--ink-soft); padding: 7px 12px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .92rem;
}
.topnav a:hover { background: var(--bg-soft); text-decoration: none; }
.topnav a.is-active { background: var(--brand-tint); color: var(--brand-dark); }
.topbar__spacer { flex: 1; }

.usermenu { display: flex; align-items: center; gap: 12px; }

/* ---------- Avatars ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
  display: inline-grid; place-items: center; flex: none;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem;
  overflow: hidden;
}
.avatar--lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar--sm { width: 26px; height: 26px; font-size: .7rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: .95rem;
  padding: 11px 18px; border-radius: var(--radius-pill);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .04s ease, box-shadow .15s ease, background .15s ease;
  background: var(--bg-soft); color: var(--ink);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ember { background: var(--ember); color: #fff; }
.btn--ember:hover { background: var(--ember-dark); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn--ghost:hover { background: var(--surface); }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--sm { padding: 7px 13px; font-size: .85rem; }
.btn--lg { padding: 14px 24px; font-size: 1.05rem; }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- Page header ---------- */
.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.pagehead h1 { margin: 0; }
.pagehead .sub { color: var(--ink-faint); margin: 4px 0 0; }

/* ---------- Project card grid ---------- */
.grid-cards {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.pcard {
  position: relative; display: block; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .12s ease, box-shadow .15s ease;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; }
.pcard__bar { height: 10px; }
.pcard__body { padding: 20px 22px 22px; }
.pcard__title { font-size: 1.25rem; font-weight: 750; color: var(--ink); margin: 0 0 6px; }
.pcard__desc { color: var(--ink-soft); font-size: .95rem; margin: 0 0 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__foot { display: flex; align-items: center; gap: 8px; color: var(--ink-faint); font-size: .85rem; }
.avatars-stack { display: flex; }
.avatars-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatars-stack .avatar:first-child { margin-left: 0; }

/* ---------- Tool tiles (6 tools inside a project) ---------- */
.grid-tools {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
.tool {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 24px; min-height: 150px;
  transition: transform .12s ease, box-shadow .15s ease;
}
.tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; }
.tool__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 26px; color: #fff;
}
.tool__title { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 0; }
.tool__desc { color: var(--ink-faint); font-size: .9rem; margin: 0; }
.tool--soon { opacity: .72; }
.tool__badge {
  align-self: flex-start; font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-faint);
  background: var(--surface-sunk); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: var(--radius-pill);
}

/* ---------- Forms ---------- */
.form { max-width: 560px; }
.form .field { margin-bottom: 18px; }
.form label { display: block; font-weight: 650; font-size: .9rem; margin-bottom: 6px; color: var(--ink-soft); }
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=date], .form input[type=color], .form select, .form textarea, .input {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm); transition: border-color .12s ease, box-shadow .12s ease;
}
.form input:focus, .form select:focus, .form textarea:focus, .input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint);
}
.form .hint { color: var(--ink-faint); font-size: .82rem; margin-top: 5px; }
.form trix-editor { min-height: 140px; background: var(--surface); border-radius: var(--radius-sm); }
.form .actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }

.auth-card { max-width: 420px; margin: 8vh auto 0; }
.auth-card .card { padding: 32px; }
.auth-card .brand { justify-content: center; margin-bottom: 18px; font-size: 1.4rem; }
.auth-links { margin-top: 18px; font-size: .9rem; color: var(--ink-faint); display: flex; flex-direction: column; gap: 4px; }

/* ---------- Color swatches (project accent picker) ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 38px; height: 38px; border-radius: 10px; cursor: pointer; border: 3px solid transparent; }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatch:has(input:checked) { border-color: var(--ink); }

/* ---------- Tables / lists ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.table tr:last-child td { border-bottom: none; }
.userrow { display: flex; align-items: center; gap: 12px; }

/* ---------- Badges / chips ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-pill); text-transform: capitalize;
}
.tag--admin   { background: #f3e7c9; color: #8a6d00; }
.tag--member  { background: var(--brand-tint); color: var(--brand-dark); }
.tag--guest   { background: #efe6f6; color: #6b4fa0; }
.tag--active  { background: #def0e6; color: #2f7a4f; }
.tag--archived{ background: var(--bg-soft); color: var(--ink-faint); }
.tag--off     { background: #f7dde5; color: var(--danger); }

/* ---------- Flash ---------- */
.flash { margin: 16px auto 0; max-width: var(--maxw); padding: 0 24px; }
.flash__msg {
  padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 600; margin-bottom: 8px;
  border: 1px solid; display: flex; gap: 8px; align-items: center;
}
.flash__msg--notice { background: #def0e6; border-color: #b7dcc6; color: #2f7a4f; }
.flash__msg--alert  { background: #f7dde5; border-color: #eeb9c7; color: var(--danger); }

/* ---------- Member management ---------- */
.member-list { list-style: none; padding: 0; margin: 0; }
.member-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member-list li:last-child { border-bottom: none; }
.member-list .spacer { flex: 1; }

.empty {
  text-align: center; padding: 60px 20px; color: var(--ink-faint);
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-sunk);
}
.empty__emoji { font-size: 2.4rem; display: block; margin-bottom: 8px; }

.backlink { color: var(--ink-faint); font-weight: 600; font-size: .9rem; display: inline-block; margin-bottom: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .grid-tools { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-tools { grid-template-columns: 1fr; }
  .topnav { display: none; }
  h1 { font-size: 1.6rem; }
  .wrap, .topbar__inner { padding-left: 16px; padding-right: 16px; }
}

/* ============================================================
   Phase 2 — To-dos
   ============================================================ */
.todolists { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }

.todolist { padding: 0; overflow: hidden; }
.todolist.is-collapsed .todolist__progress small { display: none; }
.todolist__head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.todolist__drag { cursor: grab; color: var(--ink-faint); font-size: 1.1rem; user-select: none; }
.todolist__drag:active { cursor: grabbing; }
.todolist__toggle {
  border: none; background: transparent; cursor: pointer; font-size: 1rem;
  color: var(--ink-faint); padding: 2px 4px; line-height: 1;
}
.todolist__titlewrap { flex: 1; min-width: 0; }
.todolist__title { font-size: 1.2rem; font-weight: 750; margin: 0; }
.todolist__desc { color: var(--ink-faint); font-size: .88rem; margin: 2px 0 0; }
.todolist__progress { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 90px; }
.todolist__progress .bar { width: 90px; height: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.todolist__progress .bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s ease; }
.todolist__progress small { color: var(--ink-faint); font-size: .76rem; }
.todolist__menu { display: flex; gap: 6px; }
.todolist__menu form { margin: 0; }

.todos { list-style: none; margin: 0; padding: 6px 10px; min-height: 8px; }
.todos--done { opacity: .85; }

.todo {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.todo:hover { background: var(--surface-sunk); }
.todo.sortable-ghost { opacity: .4; background: var(--brand-tint); }
.todo__check-form { margin: 0; }
.todo__check {
  flex: none; width: 22px; height: 22px; border-radius: 50%; margin-top: 1px;
  border: 2px solid var(--line-strong); background: var(--surface); cursor: pointer;
  display: grid; place-items: center; color: #fff; font-size: 13px; padding: 0;
  transition: background .12s ease, border-color .12s ease;
}
.todo__check:hover { border-color: var(--brand); }
.todo--done .todo__check { background: var(--brand); border-color: var(--brand); }
.todo__check--lg { width: 30px; height: 30px; font-size: 17px; }
.todo__main { flex: 1; min-width: 0; }
.todo__content { color: var(--ink); font-weight: 500; }
.todo__content:hover { color: var(--brand-dark); }
.todo--done .todo__content, h1.todo--done { text-decoration: line-through; color: var(--ink-faint); }
.todo__meta { display: flex; gap: 12px; margin-top: 2px; font-size: .8rem; color: var(--ink-faint); }
.todo__due.is-overdue { color: var(--danger); font-weight: 600; }
.todo__assignees { flex: none; padding-top: 2px; }

.todo-add { display: flex; align-items: center; gap: 10px; padding: 8px 12px 14px; }
.todo-add__check { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--line-strong); display: grid; place-items: center; color: var(--ink-faint); font-size: 14px; }
.todo-add__input { flex: 1; border: none; background: transparent; padding: 6px 0; font: inherit; }
.todo-add__input:focus { outline: none; }
.todo-add form { margin: 0; }

.completed-group { padding: 4px 12px 14px; }
.completed-group summary { cursor: pointer; color: var(--ink-faint); font-weight: 600; font-size: .85rem; padding: 6px 0; }

.newlist { padding: 16px 18px; }
.newlist__trigger { width: 100%; justify-content: center; }

/* To-do detail */
.todo-detail__head { display: flex; align-items: flex-start; gap: 14px; }
.assignee-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.assignee-pick {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-pill); cursor: pointer;
  font-size: .88rem; font-weight: 500;
}
.assignee-pick input { margin: 0; }
.assignee-pick:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-dark); }

/* Comments */
.comments { display: flex; flex-direction: column; gap: 16px; margin: 14px 0 20px; }
.comment { display: flex; gap: 12px; }
.comment__body { flex: 1; }
.comment__head { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--ink-faint); }
.comment__time { font-size: .8rem; }
.comment__delete { border: none; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: .8rem; padding: 0; text-decoration: underline; }
.comment__text { margin-top: 4px; }
.comment-form .trix-content, .comment-form trix-editor { background: var(--surface); }

/* @mention chip + autocomplete menu */
.mention {
  display: inline-block; padding: 1px 7px; border-radius: var(--radius-pill);
  background: var(--brand-tint); color: var(--brand-dark); font-weight: 600;
}
.mention-menu {
  z-index: 100; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); padding: 6px;
  max-height: 260px; overflow-y: auto;
}
.mention-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: none; background: transparent; padding: 7px 10px; border-radius: 8px;
  cursor: pointer; font: inherit; color: var(--ink);
}
.mention-menu__item.is-active, .mention-menu__item:hover { background: var(--brand-tint); }

.sortable-ghost { opacity: .4; }
.todolist.sortable-ghost { background: var(--brand-tint); }

/* ============================================================
   Phase 3 — Message Board
   ============================================================ */
.message-feed { display: flex; flex-direction: column; gap: 18px; }
.msg-card { display: block; transition: transform .12s ease, box-shadow .15s ease; }
.msg-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); text-decoration: none; }
.msg-card__top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.msg-card__comments { margin-left: auto; color: var(--ink-faint); font-size: .85rem; }
.msg-card__title { font-size: 1.3rem; font-weight: 750; margin: 0 0 6px; color: var(--ink); }
.msg-card__excerpt { color: var(--ink-soft); margin: 0 0 14px; }
.msg-card__foot { display: flex; align-items: center; gap: 8px; color: var(--ink-faint); font-size: .85rem; }
.msg-card__dot { opacity: .6; }
.message-body { font-size: 1.05rem; line-height: 1.7; }
.message-body img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* ============================================================
   Phase 4 — Campfire (realtime chat)
   ============================================================ */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 420px; overflow: hidden; }
.chat__messages { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.chat__empty { color: var(--ink-faint); text-align: center; margin: auto; }

.chat-msg { display: flex; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); }
.chat-msg:hover { background: var(--surface-sunk); }
.chat-msg__head { display: flex; align-items: baseline; gap: 8px; }
.chat-msg__head strong { font-size: .92rem; }
.chat-msg__time { font-size: .72rem; color: var(--ink-faint); }
.chat-msg__text { line-height: 1.5; }
.chat-msg__text p { margin: 0; }
.chat-msg__text img { max-width: 320px; height: auto; border-radius: var(--radius-sm); margin-top: 4px; }

.chat__divider { text-align: center; margin: 12px 0; position: relative; }
.chat__divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--ember); opacity: .35; }
.chat__divider span { position: relative; background: var(--surface); color: var(--ember); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 0 12px; }

.chat-composer { border-top: 1px solid var(--line); padding: 14px 18px; background: var(--surface); }
.chat-composer__form { display: flex; gap: 10px; align-items: flex-end; }
.chat-composer__form .trix-button-row { flex-wrap: wrap; }
.chat-composer__form trix-editor { flex: 1; min-height: 44px; max-height: 180px; overflow-y: auto; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 12px; }
.chat-composer__form input[type=submit] { flex: none; }

/* Unread badge on the Campfire tool tile */
.tool__count {
  position: absolute; top: 16px; right: 16px; min-width: 22px; height: 22px;
  padding: 0 7px; border-radius: 999px; background: var(--ember); color: #fff;
  font-size: .78rem; font-weight: 700; display: grid; place-items: center;
}
.tool { position: relative; }

/* ============================================================
   Phase 5 — Docs & Files (Vault)
   ============================================================ */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; margin-bottom: 18px; color: var(--ink-faint); }
.breadcrumb__sep { color: var(--ink-faint); }
.breadcrumb__current { color: var(--ink); font-weight: 600; }

.vault-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }

.vault-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.vault-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 16px; min-height: 150px; justify-content: center;
  transition: transform .12s ease, box-shadow .15s ease;
}
.vault-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; }
.vault-item--folder { background: var(--surface-sunk); }
.vault-item__icon { font-size: 2.4rem; line-height: 1; }
.vault-item__thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }
.vault-item__name { font-weight: 650; color: var(--ink); word-break: break-word; }
.vault-item__meta { font-size: .76rem; color: var(--ink-faint); }

.upload-preview img { max-width: 100%; max-height: 540px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.upload-preview__file { display: flex; align-items: center; gap: 16px; padding: 24px; background: var(--surface-sunk); border-radius: var(--radius); }
.upload-preview__icon { font-size: 2.6rem; }

/* ============================================================
   Phase 6 — Schedule
   ============================================================ */
.sched-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.seg { display: inline-flex; background: var(--bg-soft); border-radius: var(--radius-pill); padding: 4px; }
.seg__btn { padding: 7px 16px; border-radius: var(--radius-pill); font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.seg__btn:hover { text-decoration: none; }
.seg__btn.is-active { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow); }
.sched-nav { display: flex; align-items: center; gap: 10px; }
.sched-nav strong { min-width: 150px; text-align: center; }

.calendar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.calendar__head, .calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar__dow { padding: 10px; text-align: center; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
.calendar__cell { min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.calendar__cell:nth-child(7n) { border-right: none; }
.calendar__cell.is-outside { background: var(--surface-sunk); }
.calendar__cell.is-outside .calendar__date { color: var(--ink-faint); }
.calendar__date { align-self: flex-start; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.calendar__date:hover { background: var(--brand-tint); text-decoration: none; }
.calendar__cell.is-today .calendar__date { background: var(--brand); color: #fff; }
.cal-event { display: flex; gap: 5px; align-items: baseline; padding: 2px 6px; border-radius: 6px; background: var(--brand-tint); color: var(--brand-dark); font-size: .76rem; overflow: hidden; white-space: nowrap; }
.cal-event:hover { text-decoration: none; filter: brightness(.97); }
.cal-event--allday { background: #f3e7c9; color: #8a6d00; }
.cal-event.is-past { opacity: .55; }
.cal-event__time { font-weight: 700; flex: none; }
.cal-event__title { overflow: hidden; text-overflow: ellipsis; }

.upcoming { display: flex; flex-direction: column; gap: 12px; }
.upcoming__item { display: flex; gap: 18px; align-items: center; transition: transform .12s ease, box-shadow .15s ease; }
.upcoming__item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); text-decoration: none; }
.upcoming__item.is-past { opacity: .6; }
.upcoming__date { flex: none; width: 58px; text-align: center; }
.upcoming__mon { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--ember); }
.upcoming__day { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--ink); }
.upcoming__body strong { font-size: 1.1rem; }

.sched-when { color: var(--ink-soft); font-weight: 600; }

@media (max-width: 720px) {
  .calendar__cell { min-height: 84px; }
  .cal-event__time { display: none; }
}

/* ============================================================
   Phase 7 — Check-ins
   ============================================================ */
.checkin-feed { display: flex; flex-direction: column; gap: 18px; }
.checkin-occ__head { margin-bottom: 12px; }
.checkin-occ__prompt { font-size: 1.15rem; }
.checkin-answer { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.checkin-answer:first-of-type { border-top: none; }
.checkin-answer__body { flex: 1; }
.checkin-answer__body .trix-content p { margin: 2px 0; }
.checkin-answer__discuss { margin-left: auto; font-size: .8rem; color: var(--ink-faint); }
.checkin-form { margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.checkin-form__label { display: block; font-weight: 650; font-size: .85rem; color: var(--ink-soft); margin-bottom: 6px; }
.checkin-form trix-editor { min-height: 70px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; }
.checkin-form .btn { margin-top: 8px; }

/* ============================================================
   Phase 8 — Notifications, Activity, Search
   ============================================================ */
.topsearch { margin-left: auto; }
.topsearch__input {
  width: 200px; padding: 7px 14px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--line); background: var(--surface-sunk); font: inherit; font-size: .9rem;
}
.topsearch__input:focus { outline: none; border-color: var(--brand); background: var(--surface); width: 240px; }

.bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 18px; text-decoration: none; }
.bell:hover, .bell.is-active { background: var(--bg-soft); text-decoration: none; }
.bell__badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--ember); color: #fff; font-size: .68rem; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--surface);
}

.notif { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: none; background: transparent; cursor: pointer; font: inherit; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
.notif:last-child { border-bottom: none; }
.notif:hover { background: var(--surface-sunk); }
.notif--unread { background: var(--brand-tint); }
.notif--unread:hover { background: #d8ece8; }
.notif__text { flex: 1; }
.notif__ctx { color: var(--ink-faint); }
.notif__time { color: var(--ink-faint); font-size: .8rem; flex: none; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: flex; gap: 14px; padding: 12px 0; border-left: 2px solid var(--line); margin-left: 14px; padding-left: 18px; position: relative; }
.timeline__icon { position: absolute; left: -15px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-size: 14px; }
.timeline__body { flex: 1; }
.timeline__link { color: var(--ink); }
.timeline__subject { color: var(--ink-soft); }
.timeline__time { color: var(--ink-faint); font-size: .8rem; margin-top: 2px; }

@media (max-width: 760px) { .topsearch { display: none; } }
