/* =============================================================
   PROJECTS — styles pulled from spatialk.com, modernised.
   Palette, gradient, footer grey, thin Futura type, light-grey
   cards with a colored left strip: all taken from the site CSS.
   ============================================================= */

/* Jost = open Futura revival, so the page renders Futura-like even
   where Futura isn't installed. Material Symbols for placeholder icons. */
   @import url("https://fonts.googleapis.com/css2?family=Jost:wght@100;300;400&display=swap");
   @import url("https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@40,100..700,0..1,0");
   
   :root {
     --grad: linear-gradient(to bottom right, #222222, #ababab);  /* exact site body gradient */
     --card-bg:   #F2F2F2;     /* .bkgd_light_grey */
     --card-hover:#ffffff;
     --footer-bg: #444444;     /* .bkgd_grey — darker grey footer */
     --ink:       #444444;     /* text on light cards */
     --ink-soft:  #666666;     /* .container color */
     --orange:    #f55f00;
     --lime:      #B9C60C;
     --c:         #555555;     /* fallback accent — overridden per group/project */
   }
   
   * { box-sizing: border-box; margin: 0; padding: 0; }
   html { -webkit-text-size-adjust: 100%; }
   
   body {
     min-height: 100vh;
     font-family: "Futura", "Century Gothic", "Jost", sans-serif;
     font-weight: 300;                 /* thin, like the site */
     font-size: 12pt;
     color: #ffffff;
     background: var(--grad);
     background-repeat: no-repeat;
     background-attachment: fixed;     /* keep the gradient steady while scrolling */
   }
   
   a          { color: var(--orange); text-decoration: none; }
   a:hover     { color: var(--lime); }
   
   .material-symbols-outlined {
     font-variation-settings: "FILL" 1, "wght" 100, "GRAD" 0, "opsz" 40;
     line-height: 1;
   }
   
   /* ---------- layout shell ---------- */
   .wrap {
     width: 90%;
     max-width: 1400px;
     margin: 0 auto;
     padding: 0 0 40px;
   }
   
   /* ---------- masthead / logo ---------- */
   .brand {
     text-align: center;
     padding: 48px 0 8px;
   }
   .brand-mark {
     font-family: "Futura Light", "Century Gothic", "Jost", sans-serif;
     font-weight: 300;
     font-size: clamp(2.2rem, 8vw, 6rem);
     text-transform: uppercase;
     letter-spacing: 0.2em;
     padding-left: 0.2em;               /* offset trailing tracking so it reads centered */
     line-height: 1;
     color: #919191;                    /* main letters, matching the SpatialK logo grey */
   }
   .brand-mark span { color: #F2F2F2; } /* final letter, echoing the light "K" */
   
   /* ---------- group section ---------- */
   .group { margin: 40px 0 0; }
   
   .group-head {
     display: flex;
     align-items: center;
     gap: 14px;
     margin: 0 0 18px;
     text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);   /* legibility over the lightening gradient */
   }
   .group-head .chip {
     width: 12px; height: 26px;
     background: var(--c);                          /* group color, echoes card strip */
     flex: none;
   }
   .group-head h2 {
     font-weight: 400;
     font-size: 1.5em;
     text-transform: uppercase;
     letter-spacing: 0.06em;
     color: #ffffff;
   }
   .group-head .count {
     font-weight: 300;
     font-size: 0.9em;
     color: #ffffff;
     font-variant-numeric: tabular-nums;
   }
   
   /* ---------- card grid ---------- */
   .grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
     gap: 18px;
   }
   
   /* card = light-grey box + 10px colored left strip (site .padded + _strip) */
   .card {
     display: flex;
     flex-direction: column;
     gap: 14px;
     background: var(--card-bg);
     appearance: none;
     -webkit-appearance: none;
     border: none;
     border-left: 25px solid var(--c);
     padding: 22px 22px 26px;
     min-height: 128px;
     cursor: pointer;
     text-align: left;
     font-family: inherit;
     color: #444444;
     transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease;
     opacity: 0;
     animation: fade .4s ease forwards;
     animation-delay: var(--d, 0ms);
   }
   @keyframes fade { to { opacity: 1; } }
   
   .card:hover {
     background: var(--card-hover);
     transform: translateY(-2px);
     box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.55);
   }
   .card:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }
   
   .card .material-symbols-outlined {
     font-size: 46px;
     color: var(--c);                  /* icon shares the group color */
   }
   .card h3 {
     font-weight: 400;
     font-size: 1em;
     text-transform: uppercase;
     letter-spacing: 0.05em;
     line-height: 1.3;
     color: #444444;
   }
   
   /* ---------- footer ---------- */
   .footer {
     background: var(--footer-bg);
     color: #ffffff;
     margin-top: 56px;
   }
   .footer .inner {
     width: 90%;
     max-width: 1400px;
     margin: 0 auto;
     padding: 26px 0;
     display: flex;
     justify-content: space-between;
     align-items: center;
     flex-wrap: wrap;
     gap: 12px;
   }
   .footer .tally {
     text-transform: uppercase;
     letter-spacing: 0.08em;
     font-size: 0.85em;
     font-weight: 300;
   }
   .footer .credit {
     font-size: 0.75em;
     color: #cfcfcf;
     font-weight: 300;
   }
   .footer a { color: #eeeeee; }
   .footer a:hover { color: #ffffff; }
   
   /* ---------- error state ---------- */
   .error {
     background: var(--card-bg);
     color: #444444;
     border-left: 10px solid var(--orange);
     padding: 22px 24px;
     max-width: 640px;
   }
   .error h2 { font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
   .error p  { margin-bottom: 12px; line-height: 1.4; }
   .error code {
     display: inline-block;
     font-family: ui-monospace, Menlo, monospace;
     font-size: 0.85em;
     background: #e2e2e2;
     padding: 7px 11px;
   }
   
   /* ---------- responsive ---------- */
   @media (max-width: 840px) {
     .brand img { width: 80%; }
     .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
     .footer .inner { flex-direction: column; text-align: center; }
   }
   
   @media (prefers-reduced-motion: reduce) {
     .card { animation: none; opacity: 1; }
     * { transition-duration: 0.001ms !important; }
   }
   
   /* =============================================================
      Project view page (project.html)
      ============================================================= */
   
   .project-view { max-width: 900px; margin: 0 auto; }
   
   .topbar {
     padding: 40px 0 0;
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 16px;
     flex-wrap: wrap;
   }
   .back-link {
     font-weight: 300;
     text-transform: uppercase;
     letter-spacing: 0.14em;
     font-size: 0.85em;
     color: #eeeeee;
   }
   .back-link:hover { color: #ffffff; }
   
   .eyebrow {
     display: inline-flex;
     align-items: center;
     gap: 9px;
     text-transform: uppercase;
     letter-spacing: 0.16em;
     font-size: 0.8em;
     color: #ffffff;
     text-decoration: none;
     text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
   }
   .eyebrow:link, .eyebrow:visited { color: #ffffff; text-decoration: none; }
   .eyebrow:hover { color: #ffffff; text-decoration: underline; }
   .eyebrow .chip { width: 12px; height: 12px; background: var(--c); }
   
   .project-head {
     margin: 22px 0 30px;
     display: flex;
     flex-direction: column;
     gap: 8px;
   }
   /* title reuses .brand-mark (uniform grey, no last-letter variation);
      just slightly smaller than the home wordmark */
   .project-head .brand-mark { font-size: clamp(2rem, 6vw, 4.2rem); }
   .brand-mark.no-accent span { color: inherit; }
   
   /* status: filled with the group's accent color */
   .status-card { background: var(--c); padding: 40px 0 0 0; margin: 0 0 32px; }
   .status-card .label {
     text-transform: uppercase;
     letter-spacing: 0.14em;
     font-size: 1em;
     font-weight: 200;
     padding: 0 0 1rem 2rem;
     color: #ffffff;
     opacity: 1;
   }
   .status-text {
     width: 100%;
     font-weight: 100;
     margin: 0;
     font-size: 1rem;
     line-height: 1.3rem;
     background-color: #dbdbdb;
     color: #222222;
     padding: 2rem;
   }
   
   .tasks-head {
     display: flex;
     align-items: baseline;
     gap: 12px;
     margin: 0 0 14px;
     text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
   }
   .tasks-head h2 {
     font-weight: 300;
     text-transform: uppercase;
     letter-spacing: 0.12em;
     font-size: 1.1em;
     color: #ffffff;
   }
   .tasks-head .done-count {
     font-size: 0.85em;
     color: rgba(255, 255, 255, 0.8);
     font-variant-numeric: tabular-nums;
   }
   
   /* task rows: like index cards (grey box + left color bar) but short & wide */
   .task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
   .task {
     display: flex;
     flex-direction: column;
     background: #dbdbdb;
     min-height: 52px;
     overflow: hidden;
   }
   .task-row {
     display: flex;
     align-items: stretch;
     min-height: 52px;
   }
   .task .handle {
     flex: none;
     width: 25px;
     background: var(--c);
     align-self: stretch;
     min-height: 52px;
   }
   
   .task .task-body {
     flex: 1;
     display: flex;
     align-items: center;
     gap: 14px;
     padding: 10px 16px;
     min-width: 0;
     cursor: pointer;
   }
   .task .task-body:hover { background: #d6d6d6; }
   .task .task-title {
     flex: 1;
     color: #444444;
     font-weight: 300;
     font-size: 1.05rem;
     line-height: 1.3;
     min-width: 0;
   }
   .task.done .task-title { text-decoration: line-through; opacity: 0.5; }
   
   .task-check-ro {
     flex: none;
     align-self: center;
     width: 20px;
     height: 20px;
     margin: 0 14px;
     border: 2px solid var(--c);
     color: var(--c);
     font-size: 0.75em;
     line-height: 18px;
     text-align: center;
   }
   
   /* task groups */
   .task-group { margin: 0 0 28px; }
   .task-group-head {
     display: flex;
     align-items: center;
     gap: 12px;
     margin: 0 0 12px;
     padding: 0 0 6px;
     border-bottom: 1px solid rgba(255, 255, 255, 0.18);
   }
   .task-group-name {
     font-weight: 300;
     font-size: 0.85em;
     text-transform: uppercase;
     letter-spacing: 0.14em;
     color: #ffffff;
     text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
   }
   .task-group-count {
     font-size: 0.78em;
     color: rgba(255, 255, 255, 0.6);
     font-variant-numeric: tabular-nums;
   }
   
   /* collapsible notes panel — full width below the task row */
   .task-notes {
     display: none;
     padding: 1.5rem 1.5rem 1.5rem calc(25px + 1.5rem);
     background: #e9e8e8;
     font-weight: 100;
     font-size: 1rem;
     line-height: 1.5rem;
     color: var(--ink-soft);
     border-top: 1px solid #bfbfbfed;
     width: 100%;
     box-sizing: border-box;
   }
   .task-notes.open { display: block; }

/* =============================================================
   CRUD UI — add button, modals, edit icons, drag, toggle
   ============================================================= */

/* ── + Add button and dropdown in status-card label ─────────── */
.status-card .label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 1rem;
}
.add-menu-wrap {
  position: relative;
  display: inline-flex;
}
.add-menu-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.7);
  color: #fff;
  font-family: inherit;
  font-weight: 300;
  font-size: 1.1em;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.add-menu-btn:hover { background: rgba(255,255,255,0.15); }

.add-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  min-width: 140px;
  z-index: 100;
}
.add-dropdown.open { display: block; }
.add-dropdown button {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  padding: 11px 16px;
  font-family: inherit;
  font-weight: 300;
  font-size: 0.88em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #444444;
  text-align: left;
  cursor: pointer;
}
.add-dropdown button:hover { background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--c); }
.add-dropdown button + button { border-top: 1px solid #eee; }

/* ── Toggle done button ─────────────────────────────────────── */
.toggle-done-btn {
  font-family: inherit;
  font-weight: 300;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.8);
  padding: 4px 10px;
  cursor: pointer;
  margin-left: 12px;
}
.toggle-done-btn:hover { border-color: #fff; color: #fff; }

/* ── Edit button on task row ────────────────────────────────── */
.task-edit-btn {
  flex: none;
  background: transparent;
  border: none;
  color: #444444;
  font-size: 1.15em;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
  font-family: inherit;
  align-self: center;
}
.task:hover .task-edit-btn { opacity: 0.7; }
.task-edit-btn:hover { opacity: 1 !important; color: var(--c); }

/* ── Edit button on task group heading ──────────────────────── */
.task-group-edit-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1em;
  font-weight: 600;
  padding: 0 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease;
  font-family: inherit;
}
.task-group-head:hover .task-group-edit-btn { opacity: 1; }
.task-group-edit-btn:hover { color: #fff; }

/* ── Task group drag handle ─────────────────────────────────── */
.group-handle {
  cursor: move;
  color: rgba(255,255,255,0.35);
  font-size: 1em;
  padding: 0 10px 0 0;
  user-select: none;
}
.task-group-head:hover .group-handle { color: rgba(255,255,255,0.7); }
.task-group.dragging { opacity: 0.5; }
.task-group.drag-over-group { box-shadow: 0 -3px 0 0 rgba(255,255,255,0.5); }

/* ── Task drag handle cursor ────────────────────────────────── */
.handle { cursor: move; }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #F2F2F2;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  border-left: 25px solid var(--c);
  padding: 28px 28px 32px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-weight: 300;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #444444;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 1.1em;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}
.modal-close:hover { color: var(--ink); }

.field-label {
  display: block;
  font-weight: 300;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #888;
  margin-bottom: 10px;
  margin-top: 18px;
}
.modal input[type="text"],
.modal input[type="number"],
.modal input[type="date"],
.modal textarea,
.modal select {
  width: 100%;
  border: 1px solid #ccc;
  padding: 9px 12px;
  font-family: inherit;
  font-weight: 300;
  font-size: 0.95em;
  color: #444444;
  background: #fff;
  box-sizing: border-box;
}
.modal textarea { resize: vertical; }
.modal input:focus,
.modal textarea:focus,
.modal select:focus { outline: 2px solid var(--c); outline-offset: 1px; border-color: transparent; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.progress-type-toggle {
  display: flex;
  gap: 24px;
  margin-top: 6px;
  font-weight: 300;
  font-size: 0.9em;
  color: #444444;
}
.progress-type-toggle label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}
.btn-primary {
  background: var(--c, #444444);
  color: #fff;
  border: none;
  padding: 10px 24px;
  font-family: inherit;
  font-weight: 300;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
  background: transparent;
  color: #444444;
  border: 1px solid #ccc;
  padding: 10px 24px;
  font-family: inherit;
  font-weight: 300;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.btn-secondary:hover { border-color: #999; }

/* percent progress display */
.task-check-ro.is-percent {
  width: auto;
  min-width: 44px;
  padding: 0 8px;
  font-size: 0.8em;
}

/* =============================================================
   Project add/edit & icon picker
   ============================================================= */

/* ── Flash message ──────────────────────────────────────────── */
.flash-success {
  background: color-mix(in srgb, var(--c) 15%, #fff);
  border-left: 6px solid var(--c);
  color: #444444;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-weight: 300;
  font-size: 0.9em;
}

/* ── Add project button on group head ───────────────────────── */
.add-project-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  width: 26px;
  height: 26px;
  font-size: 1.1em;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  flex: none;
}
.add-project-btn:hover { background: rgba(255,255,255,0.15); }

/* ── Project title row with edit pencil ─────────────────────── */
.project-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.project-edit-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.3em;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  flex: none;
  align-self: center;
}
.project-edit-btn:hover { color: #fff; }

/* ── Disabled text field (group name display in add modal) ─── */
.field-disabled {
  background: #e8e8e8 !important;
  color: #888 !important;
  cursor: default;
}

/* ── Icon select row ────────────────────────────────────────── */
.icon-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.icon-select-row input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px dotted #ccc;
  padding: 4px 0;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  color: #888;
  pointer-events: none;
  user-select: none;
}
.icon-preview {
  font-size: 32px;
  color: var(--c);
  flex: none;
  width: 40px;
  text-align: center;
}
.btn--small {
  padding: 7px 12px !important;
  font-size: 0.8em !important;
  white-space: nowrap;
}

/* ── Wide modal variant for icon picker ─────────────────────── */
.modal--wide {
  max-width: 780px;
}

/* ── Icon picker search row ─────────────────────────────────── */
.icon-picker-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.icon-search-input {
  flex: 1;
  border: 1px solid #ccc;
  padding: 9px 12px;
  font-family: inherit;
  font-weight: 300;
  font-size: 0.95em;
  color: #444444;
  background: #fff;
}
.icon-search-input:focus { outline: 2px solid var(--c); border-color: transparent; }

.icon-picker-hint {
  font-size: 0.8em;
  color: #888;
  font-weight: 300;
  margin-bottom: 12px;
}
.icon-picker-empty {
  color: #aaa;
  font-weight: 300;
  font-size: 0.9em;
  padding: 20px 0;
  text-align: center;
}

/* ── Icon grid ──────────────────────────────────────────────── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  height: 440px;      /* fixed height always — no jarring resize */
  overflow-y: auto;
  padding-right: 4px; /* space for scrollbar */
}
.icon-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  background: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .1s ease, background .1s ease;
}
.icon-grid-item:hover {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, #fff);
}
.icon-grid-item .material-symbols-outlined {
  font-size: 48px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 40;
  color: #444444;
}
.icon-grid-item:hover .material-symbols-outlined { color: var(--c); }
.icon-grid-label {
  font-size: 0.78em;
  color: #555;
  text-align: center;
  line-height: 1.2;
  word-break: break-all;
  max-width: 88px;
}

/* ── Icon pagination ─────────────────────────────────────────── */
.icon-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 2px;
  grid-column: 1 / -1;
}

/* ── Global nav bar ─────────────────────────────────────────── */
.global-nav {
  display: flex;
  justify-content: flex-end;
  padding: 10px 5%;
}
.logout-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-weight: 300;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 5px 12px;
  cursor: pointer;
}
.logout-btn:hover { border-color: #fff; color: #fff; }

/* ── Workspace name in nav ──────────────────────────────────── */
.workspace-name {
  font-weight: 300;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.5);
}

/* =============================================================
   Auth pages (login, invite, register)
   ============================================================= */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.login-card {
  background: #F2F2F2;
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
  border-left: 25px solid #919191;
}
.login-card .label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85em;
  color: #666666;
  margin-bottom: 8px;
  display: block;
  font-weight: 300;
}
.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
  width: 100%;
  border: 1px solid #cccccc;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 1em;
  font-weight: 300;
  color: #444444;
  margin-bottom: 20px;
  background: #ffffff;
  box-sizing: border-box;
}
.login-card input:focus {
  outline: 2px solid #919191;
  outline-offset: 1px;
}
.login-card .remember {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666666;
  font-size: 0.85em;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 28px;
}
.login-card .remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #444444;
}
.login-card .btn {
  background: #444444;
  color: #ffffff;
  border: none;
  padding: 14px 24px;
  width: 100%;
  font-family: inherit;
  font-size: 1em;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  display: block;
}
.login-card .btn:hover { background: #222222; }
.error-msg {
  color: #f55f00;
  font-size: 0.85em;
  font-weight: 300;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Empty workspace state ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Add group/task index buttons ───────────────────────────── */
.add-group-index-wrap {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.add-group-index-btn {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.55);
  color: rgba(255,255,255,0.75);
  font-family: inherit;
  font-weight: 300;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 14px 28px;
  cursor: pointer;
}
.add-group-index-btn:hover { border-color: rgba(255,255,255,0.9); color: #fff; }

/* ── Color picker row in add group modal ─────────────────────── */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
.color-picker-row input[type="color"] {
  width: 40px;
  height: 40px;
  border: 1px solid #ccc;
  padding: 2px;
  cursor: pointer;
  background: #fff;
}
.color-swatches {
  display: flex;
  gap: 8px;
}
.swatch {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  cursor: pointer;
  border-radius: 2px;
}
.swatch:hover { border-color: #fff; }

/* ── Empty state hierarchy explainer ────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px 40px;
}
.empty-state-title {
  font-weight: 300;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #ffffff;
  margin-bottom: 12px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.empty-state-intro {
  font-weight: 300;
  font-size: 0.88em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 36px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
.empty-state-hierarchy {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hierarchy-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  width: 380px;
  text-align: left;
  border: none;
  font-family: inherit;
}
.hierarchy-item--action {
  cursor: pointer;
  transition: opacity .15s ease;
}
.hierarchy-item--action:hover { opacity: 0.85; }
.hierarchy-icon {
  font-size: 32px;
  color: rgba(255,255,255,0.75);
  flex: none;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 40;
}
.hierarchy-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.hierarchy-label {
  font-weight: 300;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #ffffff;
}
.hierarchy-example {
  font-weight: 300;
  font-size: 1.1em;
  color: rgba(255,255,255,0.85);
  text-transform: none;
  letter-spacing: 0.02em;
}
.hierarchy-arrow {
  color: rgba(255,255,255,0.3);
  font-size: 1.2em;
  line-height: 1;
}

/* ── Empty group hint — sticky note arrow flag ──────────────── */
.empty-group-hint {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: #f5f5dc;
  color: #444444;
  font-weight: 300;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 5px 12px 5px 18px;
  margin-left: 8px;
  white-space: nowrap;
}
/* The arrow point on the left — triangle made from borders */
.empty-group-hint::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-right: 10px solid #f5f5dc;
}

/* ── Outline add buttons (task and task group) ──────────────── */
.outline-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.55);
  color: rgba(255,255,255,0.75);
  font-family: inherit;
  font-weight: 300;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 14px 28px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color .15s ease, color .15s ease;
}
.outline-add-btn:hover {
  border-color: rgba(255,255,255,0.9);
  color: #ffffff;
}
.outline-add-btn--group {
  margin-top: 20px;
  margin-bottom: 0;
}
.outline-add-icon {
  font-size: 1.2em;
  line-height: 1;
}

/* ── Inline + on task group head ────────────────────────────── */
.task-group-add-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.1em;
  padding: 0 6px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease;
}
.task-group-head:hover .task-group-add-btn { opacity: 1; }
.task-group-add-btn:hover { color: #fff; }

/* ── Spacer between ungrouped tasks and task groups ─────────── */
.ungrouped-spacer { height: 28px; }

/* ── Outline Add Project card in grid ───────────────────────── */
.card--outline {
  border: 1px dashed rgba(255,255,255,0.55);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 22px 26px;
  min-height: 128px;
  width: 100%;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  font-family: inherit;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
  animation: none;
  opacity: 1;
}
.card--outline:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.9);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}
.card--outline-icon {
  font-size: 2em;
  font-weight: 100;
  line-height: 1;
}
.card--outline-label {
  font-weight: 300;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Task move checklist in Add Task Group modal ─────────────── */
.task-move-list {
  margin-top: 8px;
  border: 1px solid #ddd;
  max-height: 220px;
  overflow-y: auto;
}
.task-move-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 300;
  font-size: 0.9em;
  color: #444444;
  border-bottom: 1px solid #eee;
}
.task-move-item:last-child { border-bottom: none; }
.task-move-item:hover { background: #f5f5f5; }
.task-move-item input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: var(--c);
  cursor: pointer;
}
.task-move-selectall {
  background: #f5f5f5;
  font-weight: 400;
  border-bottom: 2px solid #ddd !important;
}

/* ── Progress bar on percent tasks ──────────────────────────── */
.task {
  position: relative;
}
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--c);
  opacity: 0.6;
  transition: width .3s ease;
  pointer-events: none;
}
.progress-bar--complete {
  opacity: 1;
  background: #4caf50;
}

/* ── Task group prompt ───────────────────────────────────────── */
.task-group-prompt {
  text-align: center;
  padding: 0.5em 0 32px;
}
.task-group-prompt-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  font-family: inherit;
  font-weight: 300;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.35);
}
.task-group-prompt-btn:hover {
  color: #fff;
  text-decoration-color: rgba(255,255,255,0.8);
}

/* ── Loose workspace tasks on index page ─────────────────────── */
.loose-tasks-wrap {
  max-width: 900px;
  margin: 2em auto 32px;
  padding: 0 5%;
}

/* ── Loose task drag handle — dark grey on index page ────────── */
.loose-tasks .task .handle {
  background: #444444;
}

/* ── Loose task drag handle ───────────────────────────────────── */
.loose-tasks .task .handle {
  background: #373737;
}

/* =============================================================
   Action Log
   ============================================================= */
.action-log-section {
  border-top: 1px solid #ddd;
  margin-top: 24px;
  padding-top: 20px;
}
.action-log-head {
  margin-bottom: 14px;
}
.action-log-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.action-log-type-select {
  border: 1px solid #ccc;
  padding: 7px 10px;
  font-family: inherit;
  font-weight: 300;
  font-size: 0.85em;
  color: #444444;
  background: #fff;
  width: 100%;
}
.action-log-entry-input {
  border: 1px solid #ccc;
  padding: 8px 10px;
  font-family: inherit;
  font-weight: 300;
  font-size: 0.9em;
  color: #444444;
  background: #fff;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.action-log-submit {
  align-self: flex-end;
  padding: 8px 20px !important;
}

/* entries */
.action-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}
.action-log-empty {
  font-size: 0.85em;
  color: #aaa;
  font-weight: 300;
  font-style: italic;
}
.action-log-entry {
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  padding: 14px 16px;
}
.action-log-entry-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.action-log-type-badge {
  font-size: 0.72em;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--c, #555);
  color: #fff;
  padding: 2px 8px;
  flex: none;
}
.action-log-meta {
  font-size: 0.75em;
  color: #999;
  font-weight: 300;
  flex: 1;
}
.action-log-entry-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s;
}
.action-log-entry:hover .action-log-entry-actions { opacity: 1; }
.action-log-edit-btn,
.action-log-delete-btn {
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85em;
  padding: 0 4px;
}
.action-log-edit-btn:hover { color: var(--c, #555); }
.action-log-delete-btn:hover { color: #f55f00; }
.action-log-entry-body {
  font-size: 0.9em;
  font-weight: 300;
  color: #444444;
  white-space: pre-wrap;
  line-height: 1.5;
}
.action-log-entry-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.action-log-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* =============================================================
   Calendar / Agenda view
   ============================================================= */

/* Nav link */
.nav-link {
  font-family: inherit;
  font-weight: 300;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.nav-link:hover { color: #fff; }

/* Summary bar */
.cal-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.cal-summary-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-weight: 300;
}
.cal-summary-count {
  font-size: 2em;
  line-height: 1;
  font-weight: 200;
}
.cal-summary-label {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.cal-summary-pill--overdue {
  background: #f55f00;
  color: #fff;
}
.cal-summary-pill--today {
  background: #B9C60C;
  color: #fff;
}
.cal-summary-pill--week {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.2);
}
.cal-summary-pill--clear {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  font-style: italic;
  font-size: 0.85em;
  padding: 14px 20px;
}

/* Day groups */
.cal-day {
  margin-bottom: 28px;
}
.cal-day-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.cal-day-label {
  font-weight: 300;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
}
.cal-day-relative {
  font-size: 0.78em;
  color: rgba(255,255,255,0.45);
  font-weight: 300;
}
.cal-day--today .cal-day-label { color: #B9C60C; }
.cal-day--past .cal-day-label  { color: #ffffff; }
.cal-overdue-tag {
  font-size: 0.7em;
  background: #f55f00;
  color: #fff;
  padding: 1px 7px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  vertical-align: middle;
  margin-left: 8px;
}

/* Items */
.cal-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-item {
  display: flex;
  align-items: center;
  background: #F2F2F2;
  text-decoration: none;
  transition: background .12s ease;
  position: relative;
  padding-left: 25px;
}
.cal-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 25px;
  background: var(--item-color, #555555);
}
.cal-item:hover { background: #fff; }
.cal-item--done { opacity: 0.45; text-decoration: line-through; }
.cal-item-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex: 1;
}
.cal-item-type {
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--item-color, #555555);
  font-weight: 400;
  flex: none;
  min-width: 48px;
}
.cal-item-title {
  flex: 1;
  font-weight: 300;
  color: var(--ink);
  font-size: 0.95em;
}
.cal-item-context {
  font-size: 0.75em;
  color: #999;
  font-weight: 300;
  flex: none;
}

/* Empty / pagination */
.cal-empty {
  color: rgba(255,255,255,0.4);
  font-weight: 300;
  font-style: italic;
  text-align: center;
  padding: 40px 0;
}
.cal-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 32px;
}
.cal-page-btn {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.85em;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 16px;
}
.cal-page-btn:hover { border-color: #fff; color: #fff; }
.cal-page-info {
  font-size: 0.8em;
  color: rgba(255,255,255,0.45);
  font-weight: 300;
}

/* =============================================================
   Site Nav Header
   ============================================================= */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: rgba(30, 30, 30, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: transform .3s ease;
}
.site-nav.nav-hidden {
  transform: translateY(-100%);
}
.site-nav-inner {
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
  height: 52px;
  gap: 24px;
}

/* Brand */
.site-nav-brand {
  font-family: 'Futura Light', 'Century Gothic', 'Jost', sans-serif;
  font-weight: 300;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  flex: none;
}
.site-nav-brand span { color: rgba(255,255,255,0.35); }
.site-nav-brand:hover { color: #fff; }
.site-nav-brand:hover span { color: rgba(255,255,255,0.6); }

/* Centre links */
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}
.site-nav-link {
  font-family: inherit;
  font-weight: 300;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 2px;
  transition: color .15s ease, background .15s ease;
}
.site-nav-link:hover { color: rgba(255,255,255,0.85); }
.site-nav-link.is-active {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

/* Utility controls */
.site-nav-utils {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.site-nav-btn {
  font-family: inherit;
  font-weight: 300;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 5px 12px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.site-nav-btn:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* Hamburger (mobile only) */
.site-nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.site-nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: rgba(255,255,255,0.7);
  transition: transform .2s ease, opacity .2s ease;
}
.site-nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.site-nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Push content below fixed nav */
.site-content {
  padding-top: 52px;
}

/* Mobile */
@media (max-width: 640px) {
  .site-nav-hamburger { display: flex; }
  .site-nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(25,25,25,0.97);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 12px 0;
    gap: 0;
    align-items: stretch;
  }
  .site-nav-links.is-open { display: flex; }
  .site-nav-link {
    padding: 14px 5%;
    border-radius: 0;
    font-size: 0.9em;
  }
  .site-nav-utils { gap: 6px; }
  .site-nav-btn { font-size: 0.68em; padding: 4px 8px; }
}

/* Remove old nav styles that are now replaced */
.global-nav { display: none; }
.logout-btn  { display: none; }
.nav-link    { display: none; }

/* ── Timeline task row extras ────────────────────────────────── */
.cal-item-type-badge {
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 400;
  flex: none;
  padding: 0 14px;
  opacity: 0.7;
}
.cal-item-context {
  font-size: 0.78em;
  color: #999;
  font-weight: 300;
  white-space: nowrap;
  padding: 0 8px;
  align-self: center;
  text-align: right;
}