/* Pieces used on every page. */

/* --- buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms, border-color 120ms, box-shadow 120ms;
}

.btn:hover {
  border-color: #b9c6b8;
  background: var(--sunk);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--brand);
  padding: 0 10px;
}

.btn-quiet:hover {
  background: var(--brand-tint);
  border-color: transparent;
}

.btn-icon {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* --- cards ------------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.page > .card {
  margin-bottom: 18px;
}

.card-flush {
  padding: 6px 0;
}

.card-flush > h2.section-title {
  padding: 14px 22px 4px;
}

/* --- entry rows: one line per thing that happened ------------------------------ */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 128px 56px;
  align-items: center;
  gap: 14px;
  padding: 11px 22px;
  border-top: 1px solid var(--line-soft);
}

.entries > .entry:first-child {
  border-top: 0;
}

.entry-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
}

.entry.is-late .entry-badge {
  background: var(--late-tint);
  color: var(--late);
}

.entry-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-meta {
  color: var(--ink-2);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-clock {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.entry-verdict {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

.entry.is-late .entry-verdict {
  color: var(--late);
}

.entry-date {
  text-align: right;
  font: 600 13px/1.2 var(--display);
  color: var(--ink-2);
}

/* --- the week ruler: seven days from the event to the deadline ------------------ */

.ruler {
  display: flex;
  align-items: center;
  gap: 3px;
}

.ruler-day {
  width: 10px;
  height: 14px;
  border-radius: 3px;
  background: var(--line-soft);
  box-shadow: inset 0 0 0 1px rgba(22, 35, 27, 0.05);
}

.ruler-day.is-used {
  background: var(--brand);
}

.ruler.is-late .ruler-day {
  background: var(--late);
  opacity: 0.85;
}

.ruler-over {
  margin-left: 4px;
  font: 600 12px/1 var(--display);
  color: var(--late);
  white-space: nowrap;
}

.ruler-lg .ruler-day {
  width: auto;
  flex: 1;
  height: 26px;
  border-radius: 5px;
}

.ruler-lg .ruler-over {
  font-size: 14px;
}

/* The same ruler, large, inside a form: how late would this entry be? */
.clock {
  margin-top: 6px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--sunk);
  border: 1px solid var(--line-soft);
}

.clock-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font: 600 12px/1 var(--display);
  color: var(--ink-3);
}

.clock-text {
  margin-top: 12px;
  font-weight: 600;
  color: var(--brand-deep);
}

.clock.is-late .clock-text {
  color: var(--late);
}

/* --- chips and segmented choices ------------------------------------------------ */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  height: 32px;
  padding: 0 13px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.chip:hover {
  border-color: #b9c6b8;
}

.chip.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.choice {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

.choice-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.choice-item .icon {
  width: 24px;
  height: 24px;
}

.choice-item:hover {
  border-color: #b9c6b8;
  color: var(--ink);
}

.choice-item.is-on {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--brand-deep);
  box-shadow: inset 0 0 0 1px var(--brand);
}
