/* Keep the board's primary actions visible without repeating project metadata. */
.topbar {
  height: 68px;
  gap: 14px;
  padding: 0 34px;
}

.search {
  position: relative;
  max-width: 560px;
  height: 42px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.search:focus-within {
  border-color: #bdb2ec;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(115, 87, 234, .1);
}

.search input { width: 100%; }

.clear-search {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #e8e7ed;
  color: #676572;
  font-size: 18px;
  line-height: 1;
}

.clear-search:hover { background: #dedce5; color: #34313d; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-actions > * {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-actions .project-link {
  gap: 7px;
  margin-left: 11px;
}

.ui-reload-status { color: #765000; background: #fff0ad; border: 1px solid #e7c65c; }
.ui-reload-status[hidden] { display: none; }

@media (max-width: 800px) {
  .topbar.reload-pending { height: auto; min-height: 112px; flex-wrap: wrap; padding-block: 8px; }
  .topbar.reload-pending .topbar-actions { order: 3; flex: 1 0 100%; margin-left: 0; flex-wrap: wrap; }
}

.mac-mini-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  box-sizing: border-box;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid #dedee5;
  border-radius: 8px;
  background: #f6f6f8;
  color: #686875;
  font-size: 12px;
  font-weight: 700;
}

.mac-mini-label { line-height: 16px; }
.mac-task-indicators { position: absolute; bottom: 4px; left: 50%; width: calc(100% - 27px); max-width: 73px; transform: translateX(-50%); height: 5px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.mac-task-indicator, .mac-background-slot { box-sizing: border-box; border: 1px solid currentColor; border-radius: 2px; background: transparent; color: #2e9b69; opacity: .55; }
.mac-task-indicator { display: flex; align-items: center; justify-content: center; }
.mac-task-indicator svg { width: 5px; height: 3px; fill: currentColor; }
.mac-background-slots { grid-column: 2 / span 5; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
.mac-task-indicator.is-active, .mac-background-slot.is-active { background: #2e9b69; color: #2e9b69; opacity: 1; }

.mac-task-indicator.is-active svg { fill: white; }

.mac-mini-status strong {
  font: inherit;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.mac-mini-status[data-usage-state="warning"] strong { color: #a36b06; }
.mac-mini-status[data-usage-state="critical"] strong { color: #b3314b; }

.mac-mini-status i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9797a1;
  box-shadow: 0 0 0 3px rgba(151, 151, 161, .13);
}

.mac-mini-status[data-state="active"] {
  border-color: #b9ddcb;
  background: #f1faf5;
  color: #176b4a;
}

.mac-mini-status[data-state="active"] i {
  background: #2e9b69;
  box-shadow: 0 0 0 3px rgba(46, 155, 105, .14);
}

.mac-mini-status[data-state="attention"] {
  border-color: #e3ca98;
  background: #fff9eb;
  color: #865b0d;
}

.mac-mini-status[data-state="attention"] i {
  background: #d39a23;
  box-shadow: 0 0 0 3px rgba(211, 154, 35, .16);
}

.workspace {
  display: flex;
  flex-direction: column;
  padding-top: 0;
  padding-bottom: 40px;
  background: var(--bg);
}

.workspace[data-project-accent] {
  background:
    linear-gradient(
      180deg,
      rgba(var(--project-accent-rgb), .07) 0,
      rgba(var(--project-accent-rgb), .02) 210px,
      rgba(var(--project-accent-rgb), 0) 430px
    ),
    var(--bg);
}

.workspace[data-project-accent] .column {
  border-color: rgba(var(--project-accent-rgb), .21);
  background: rgba(var(--project-accent-rgb), .055);
}

.workspace[data-project-accent] .column-head .total {
  background: rgba(var(--project-accent-rgb), .11);
}

.workspace[data-project-accent] .task-card { border-color: rgba(var(--project-accent-rgb), .23); }
.workspace[data-project-accent] .task-card:hover { border-color: rgba(var(--project-accent-rgb), .36); }

.workspace > .board {
  /* Fill the workspace; Archive uses the shared 40px bottom gutter. */
  flex: 1;
  height: auto;
  padding-top: 26px;
  padding-bottom: 0;
}

.topbar button:focus-visible,
.topbar a:focus-visible,
.topbar input:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.search input:focus-visible { outline: 0; }

@media (max-width: 900px) {
  .topbar { padding: 0 20px; }
  .topbar-actions .project-link { padding-inline: 12px; }
  .topbar-actions .project-link .action-label { display: none; }
  .workspace > .board {
    padding-top: 12px;
  }
}

@media (max-width: 800px) {
  .topbar.project-tools-visible {
    height: auto;
    min-height: 112px;
    flex-wrap: wrap;
    align-content: center;
    padding-block: 8px;
  }
  .topbar.project-tools-visible .topbar-actions {
    order: 3;
    flex: 1 0 100%;
    margin-left: 0;
  }
  .topbar.project-tools-visible .topbar-actions > * {
    padding: 9px 5px;
    font-size: 11px;
  }
  .topbar.project-tools-visible .topbar-actions > button {
    min-width: 0;
    width: 0;
    flex: 1 1 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 680px) {
  .topbar {
    height: 64px;
    gap: 8px;
    padding: 0 12px;
  }

  .search { height: 40px; min-width: 0; }
  .search > span { display: none; }
  .search input { min-width: 0; }
  .topbar-actions { gap: 6px; }
  .mac-mini-status { min-width: 0; }
  .topbar-actions .project-link { display: none; }
  .workspace { padding-top: 0; }
  .workspace > .board {
    padding-top: 8px;
  }
  .workspace[data-project-accent] {
    background:
      linear-gradient(
        180deg,
        rgba(var(--project-accent-rgb), .07) 0,
        rgba(var(--project-accent-rgb), .018) 170px,
        rgba(var(--project-accent-rgb), 0) 330px
      ),
      var(--bg);
  }
}

.backlog-column-group { display: flex; flex-direction: column; min-width: 280px; min-height: 0; height: 100%; }
.backlog-column-group > .column { max-height: calc(100% - 64px); }
/* Reserve the footer even while hidden so status updates cannot resize card lists. */
.mac-queue-slot { flex: 0 0 64px; height: 64px; min-height: 0; padding: 8px 2px 0; overflow-y: auto; overscroll-behavior-y: contain; }
#board-feedback-fallback { width: 290px; max-width: 100%; }
#board-feedback-fallback:empty { display: none; }
.board-feedback { display: grid; gap: 6px; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.board-feedback .form-error { height: auto; margin: 0; line-height: inherit; }
.board-feedback button { font-size: inherit; white-space: normal; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.board-feedback .form-error button { margin-left: 6px; }
.mac-queue-status { font-size: 11px; line-height: 1.4; color: var(--muted); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 6px; }
#mac-queue-summary { overflow-wrap: anywhere; }
