/* ---------------------------------------------------------------- dashboard */

.dash {
  gap: var(--space-6);
}

.capture {
  display: flex;
  gap: var(--space-2);
}

.capture-input {
  flex: 1;
  height: var(--control-h);
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.capture-input::placeholder { color: var(--ink-faint); }

/* Hover is for devices that hover.
 *
 * Every rule below that reacts to a pointer is wrapped in (hover: hover). On a
 * phone there is no pointer to leave, so a tap used to apply the hover colour
 * and leave it there until the next tap somewhere else — the toolbar, the
 * actions tray, every row in the notification list, all of them stuck looking
 * half-pressed.
 *
 * Wrapped where each rule stands rather than gathered at the end of the file:
 * moving a rule moves it in the cascade, and this must change nothing a desktop
 * sees. */
@media (hover: hover) {
  .capture-input:hover { border-color: var(--border-strong); }
}

.capture-input:focus {
  outline: none;
  border-color: var(--primary);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--space-6);
  align-items: start;
}

/* A new account has no side column, and a track reserved for something that is
   not there is 280px of nothing beside the one thing on the page. */
.dash-grid:not(:has(.dash-side)) {
  grid-template-columns: minmax(0, 1fr);
}

.dash-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.dash-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dash-heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--ink-muted);
}

.dash-heading:first-child { margin-top: 0; }

.dash-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  text-decoration: none;
}

@media (hover: hover) {
  .dash-more:hover { color: var(--primary); }
}

/* ---------------------------------------------------------------- chart */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 56px;
}

.chart-col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

/* Scaled rather than resized. Animating height puts a bar chart through layout,
   paint and composite on every frame; scaleY is composite only, and a bar grows
   from its base because that is where transform-origin is. */
.chart-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 2px;
  background: var(--primary);
  height: 100%;
  transform-origin: bottom;
  transition: transform var(--duration-slow) var(--ease-out);
}

.chart-bar.is-empty {
  height: 2px;
  background: var(--surface-3);
}

/* Fixed steps rather than an inline height: the page is served under a strict
   CSP that refuses style attributes. See ActivityPanel.Height. */
.chart-bar.h-5 { transform: scaleY(0.05); }
.chart-bar.h-10 { transform: scaleY(0.10); }
.chart-bar.h-15 { transform: scaleY(0.15); }
.chart-bar.h-20 { transform: scaleY(0.20); }
.chart-bar.h-25 { transform: scaleY(0.25); }
.chart-bar.h-30 { transform: scaleY(0.30); }
.chart-bar.h-35 { transform: scaleY(0.35); }
.chart-bar.h-40 { transform: scaleY(0.40); }
.chart-bar.h-45 { transform: scaleY(0.45); }
.chart-bar.h-50 { transform: scaleY(0.50); }
.chart-bar.h-55 { transform: scaleY(0.55); }
.chart-bar.h-60 { transform: scaleY(0.60); }
.chart-bar.h-65 { transform: scaleY(0.65); }
.chart-bar.h-70 { transform: scaleY(0.70); }
.chart-bar.h-75 { transform: scaleY(0.75); }
.chart-bar.h-80 { transform: scaleY(0.80); }
.chart-bar.h-85 { transform: scaleY(0.85); }
.chart-bar.h-90 { transform: scaleY(0.90); }
.chart-bar.h-95 { transform: scaleY(0.95); }
.chart-bar.h-100 { transform: scaleY(1.00); }

.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-3xs);
  color: var(--ink-faint);
}

/* ---------------------------------------------------------------- welcome */

/* Centred and narrow. First run is the one screen with nothing else on it, so
   it gets to breathe in a way the dense chrome elsewhere deliberately does not. */
.welcome {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--space-6);
  background: var(--surface-2);
}

.welcome-card {
  width: 100%;
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--bg);
}

.welcome-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.welcome-step {
  font-size: var(--text-2xs);
  color: var(--ink-faint);
}

.welcome-card h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.welcome-lead {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 46ch;
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.welcome-quiet,
.welcome-warn {
  font-size: var(--text-2xs);
  line-height: 1.55;
  max-width: 52ch;
}

.welcome-quiet { color: var(--ink-faint); }
.welcome-warn { color: var(--warning); }

/* Three choices as rows rather than cards: they are a list of options, and a
   grid of equal boxes would be dressing that up as something grander. */
.use-cases {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.use-case {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out);
}

.use-case .icon {
  grid-row: 1 / -1;
  align-self: center;
  color: var(--ink-muted);
}

@media (hover: hover) {
  .use-case:hover { border-color: var(--border-strong); }
}

.use-case.is-picked {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.use-case.is-picked .icon { color: var(--primary); }

.use-case-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink);
}

.use-case-note {
  font-size: var(--text-2xs);
  color: var(--ink-muted);
}

/* Sign-up confirmation notice: a status, not an error, and styled as one. */
.auth-notice {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-2);
  font-size: var(--text-xs);
  line-height: 1.55;
}

.auth-notice-quiet { color: var(--ink-faint); }

/* ---------------------------------------------------------------- summary */

.summary-panel { gap: var(--space-2); }

/* Prose, so it gets a readable measure and line height rather than the dense
   chrome the rest of the dashboard uses. */
.summary-text {
  max-width: 72ch;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}

/* ---- everything still to be done ----
   Grouped by the note each item was written in, because an item out of its
   context is often not enough to act on and the note is one click away. */

.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: var(--measure);
}

.task-group-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-block-end: var(--space-2);
}

.task-note {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--ink-muted);
  /* One line: a long title should not push the items it heads down the page. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 28ch;
}

@media (hover: hover) {
  .task-note:hover {
    color: var(--ink);
  }
}

.task-due,
.task-progress {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

/* The one thing on this page that is not neutral. A date somebody set and then
   passed is the only state here worth a colour. */
.task-due.is-overdue {
  color: var(--danger);
}

.task-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* The row holds the label and, when there is one, the date at its end. The
   label keeps the whole width it can so the tick target stays large; the date
   sits against the far edge rather than under the text, which is where it
   landed when the row was not a row. */
.task-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.task-item .task-check {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.task-item .task-due {
  flex-shrink: 0;
}

/* The whole row is the target, so a tick does not need aim. */
.task-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-1);
  min-block-size: var(--touch-min);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

@media (hover: hover) {
  .task-check:hover {
    background: var(--surface-hover);
  }
}

.task-check input {
  /* Aligned to the first line of the text rather than centred on a wrapped
     item, which would leave the box floating beside the middle of a sentence. */
  margin-block-start: 0.15em;
  flex: none;
}

.task-text {
  line-height: var(--leading-body);
  overflow-wrap: break-word;
  min-inline-size: 0;
}

/* ------------------------------------------------------------ what happened

   The inbox. Rows rather than cards: these are one line each, they are read in
   order, and a card around a sentence is a border around a sentence.

   The whole row is the control where there is somewhere to go, because a line
   of text with a small "open" at the end of it is a smaller target for the same
   job. */

.notif-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}

.notif {
  border-bottom: 1px solid var(--border-subtle);
}

.notif-open {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  inline-size: 100%;
  padding: var(--space-3) var(--space-2);
  border: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  text-align: start;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
}

@media (hover: hover) {
  .notif-open:hover {
    background: var(--surface-hover);
  }
}

/* The same row when there is nowhere to go — an unshared note, a deleted
   notebook. It keeps the shape so the list does not jump, and loses the cursor
   and the hover so it does not offer something it cannot do. */
.notif-open.is-flat {
  cursor: default;
  color: var(--ink-muted);
}

.notif-icon {
  flex: none;
  color: var(--ink-faint);
  align-self: center;
}

.notif-text {
  flex: 1;
  min-inline-size: 0;
}

.notif-when {
  flex: none;
  color: var(--ink-faint);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

/* Unread.
 *
 * Weight and a mark, not a colour fill. A list where the unread rows have a
 * tinted background is a list that looks broken once most of it is unread,
 * which is the normal state of an inbox somebody has not opened today. */
.notif.is-unread .notif-open {
  font-weight: var(--weight-medium);
}

.notif.is-unread .notif-icon {
  color: var(--primary);
}

/* The count beside the sidebar link.
 *
 * Louder than the note count next to it, because they answer different
 * questions: one is how much you have, which is a fact, and the other is how
 * much is waiting for you, which is a request. */
.nav-count-loud {
  background: var(--primary);
  color: var(--bg);
  border-radius: 999px;
  padding: 0 6px;
  min-inline-size: 18px;
  text-align: center;
}
