/* Agenda and the today cards. The morning brief stays in the agent drawer. */

.agenda-page {
  display: grid;
  gap: 16px;
  padding: 20px 22px 32px;
  min-width: 0;
}

.agenda-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.agenda-views {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-right: auto;
  min-width: 0;
}

.agenda-views button {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  border-radius: 0;
  padding: 2px 8px 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.agenda-views button + button { box-shadow: inset 1px 0 0 var(--line); }
.agenda-views button.is-on { font-weight: 650; box-shadow: inset 0 -2px 0 var(--mark); }
.agenda-views button + button.is-on {
  box-shadow: inset 1px 0 0 var(--line), inset 0 -2px 0 var(--mark);
}

.agenda-owner {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  max-width: 11rem;
}

.agenda-summary {
  flex-basis: 100%;
  margin: 0;
  min-height: 1.3em;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.agenda-summary .is-late { color: var(--sold); }

.agenda-board {
  --cols: 18px minmax(0, 1fr) minmax(0, 220px) minmax(0, 110px) minmax(0, 220px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  overflow: hidden;
  min-width: 0;
}

.agenda-board .list-cols {
  column-gap: 12px;
  padding-left: 12px;
  padding-right: 12px;
}

.agenda-board .group,
.agenda-board .group-body { min-width: 0; }

.agenda-board .group-head.is-on { box-shadow: inset 0 -2px 0 var(--mark); }
.agenda-board .group-note .is-late { color: var(--sold); }

.agenda-row {
  display: grid;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  column-gap: 12px;
  border-top: 1px solid var(--line-2);
}

.agenda-check {
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agenda-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.agenda-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.agenda-subject,
.agenda-detail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-subject {
  font-weight: 600;
  color: var(--ink);
}

.agenda-detail {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.agenda-high {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 0.4rem;
  border-radius: var(--r-pill);
  background: var(--soon-bg);
  color: var(--soon-ink);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.6;
}

.agenda-codes,
.agenda-when {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

.agenda-codes .code {
  font-family: var(--mono);
  color: var(--muted);
}

.agenda-plus,
.agenda-when {
  font-variant-numeric: tabular-nums;
}

.agenda-when.is-late { color: var(--sold); }

.agenda-row .agenda-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.agenda-extras {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.text-action.is-armed { text-decoration: underline; }

@media (min-width: 701px) {
  .agenda-row {
    grid-template-columns: var(--cols);
  }

  .agenda-main,
  .agenda-meta { display: contents; }

  .agenda-line,
  .agenda-codes,
  .agenda-when,
  .agenda-actions,
  .agenda-check { min-width: 0; }
}

.agenda-empty {
  color: var(--muted);
  margin: 0;
}

.agenda-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.agenda-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.agenda-form input,
.agenda-form select,
.agenda-form textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

.agenda-form textarea {
  min-height: 72px;
  resize: vertical;
}

.agenda-form .agenda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agenda-focus {
  padding: 8px 0;
  background: var(--rail-bg);
  border-radius: 12px;
  border-top: 0;
}

.agent-brief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agent-brief-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.agent-brief-slot {
  padding: 8px var(--agent-gutter, 0.85rem) 0;
}

.agent-brief {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.agent-brief .agent-tag.is-brief {
  color: var(--brand);
}

.agent-brief-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.agent-brief-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.agent-brief-fold,
.agent-brief-more,
.agent-brief-group {
  border: 0;
  background: transparent;
  font: inherit;
  line-height: 1.35;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.agent-brief-fold,
.agent-brief-more { color: var(--muted); }

.agent-brief-group { color: var(--ink); }

.agent-brief-groups {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 0 0 14px;
}

button.agent-brief.is-folded {
  width: fit-content;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.agent-task-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

@media (max-width: 700px) {
  .agenda-page { padding: 16px 14px 28px; }

  .agenda-views {
    order: 1;
    flex-basis: 100%;
    margin-right: 0;
  }

  .agenda-summary {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
  }

  .agenda-top > .primary { order: 3; }

  .agenda-owner {
    order: 4;
    flex-basis: 100%;
    max-width: none;
  }

  .agenda-row {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    row-gap: 4px;
    align-items: start;
  }

  .agenda-check { grid-column: 1; grid-row: 1; }
  .agenda-main {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .agenda-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
  }

  .agenda-row .agenda-actions { display: contents; }
  .agenda-open { grid-column: 3; grid-row: 1; align-self: center; }
  .agenda-extras {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
}

.today-title {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.today-grid {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 700px) {
  .today-grid { grid-template-columns: 1fr; }
}
