/* Yogert app styles. Monochrome radical minimalism: every colour is one of the
   17 tokens in rentals.css :root. No icons, charts, gradients, or webfonts. */

/* --- Accessibility & motion --- */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.stage-banner {
  background: var(--ink); color: var(--button-text);
  text-align: center; padding: 6px 12px; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase;
}

/* --- App chrome --- */
.app-top {
  position: sticky; top: 0; z-index: 30;
  background: var(--page); border-bottom: 1px solid var(--line);
}
.app-top-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.app-nav {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.app-nav a {
  min-height: 38px; display: inline-flex; align-items: center;
  border-radius: 6px; background: transparent; color: var(--muted);
  padding: 0 13px; font-weight: 650; font-size: 0.94rem; text-decoration: none;
}
.app-nav a.active { background: var(--ink); color: var(--button-text); }
.app-nav a:hover:not(.active) { background: var(--surface-subtle); color: var(--ink); }

.account-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.86rem; color: var(--muted);
}
.account-chip a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }

/* --- Mobile bottom tab bar (<640px) --- */
.bottom-bar { display: none; }
@media (max-width: 640px) {
  .app-nav { display: none; }
  .bottom-bar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-bar a {
    min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--muted); text-decoration: none; font-size: 0.7rem; font-weight: 650;
  }
  .bottom-bar a.active { color: var(--ink); }
  .bottom-bar a .tab-mark { width: 18px; height: 2px; background: transparent; border-radius: 2px; }
  .bottom-bar a.active .tab-mark { background: var(--ink); }
  .app { padding-bottom: 84px; }
}

/* --- Section heading --- */
.screen-head { margin-bottom: 18px; }
.screen-head h1 {
  margin: 0; color: var(--ink); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.04;
}
.screen-head p { margin: 8px 0 0; color: var(--muted); }

/* --- Today: coming up + log columns --- */
.coming-up { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.coming-up li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font-size: 0.9rem;
}
.coming-up li b { color: var(--ink); font-weight: 650; }
.coming-up li time { color: var(--muted); font-family: var(--font-mono); font-size: 0.8rem; white-space: nowrap; }

.artifact-link {
  color: var(--muted); font-size: 0.8rem; text-decoration: none;
  border-bottom: 1px dotted var(--line-strong);
}
.artifact-link:hover { color: var(--ink); }

/* --- Countdown chip + derivation --- */
.countdown-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-subtle);
  color: var(--ink); padding: 4px 11px; font-size: 0.78rem; font-weight: 700;
  cursor: pointer;
}
.derivation {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-subtle); padding: 12px 14px;
}
.derivation ol { margin: 0; padding-left: 18px; }
.derivation li { color: var(--text); font-size: 0.86rem; margin-bottom: 4px; }
.derivation summary { cursor: pointer; color: var(--muted); font-size: 0.82rem; font-weight: 650; }

/* --- Trust microcopy under legal buttons --- */
.trust-note {
  margin-top: 10px; padding: 11px 13px;
  border: 1px solid var(--line); border-left: 3px solid var(--ink); border-radius: 6px;
  background: var(--surface-subtle); color: var(--text); font-size: 0.84rem; line-height: 1.45;
}

/* --- Forms --- */
.form-card {
  max-width: 520px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  padding: 28px; box-shadow: var(--shadow);
}
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 7px; color: var(--muted);
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
}
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 1rem;
}
.field textarea { min-height: 90px; padding: 12px 14px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(17,17,17,0.06);
}
.form-error { color: var(--danger); font-size: 0.9rem; min-height: 20px; margin-top: 6px; }
.btn {
  min-height: 48px; border-radius: 6px; background: var(--button); color: var(--button-text);
  padding: 0 20px; font-weight: 700; font-size: 0.96rem; display: inline-flex; align-items: center; justify-content: center;
}
.btn-ghost {
  min-height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  color: var(--text); padding: 0 16px; font-weight: 650; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-block { width: 100%; }

/* --- Toasts (aria-live, 10s undo) --- */
.toast-tray {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 60;
  display: grid; gap: 8px; width: min(560px, calc(100vw - 32px));
}
@media (max-width: 640px) { .toast-tray { bottom: 92px; } }
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--ink); color: var(--button-text);
  padding: 12px 14px; box-shadow: var(--shadow); font-size: 0.9rem;
}
.toast button {
  min-height: 36px; border: 1px solid var(--button-text); border-radius: 6px;
  background: transparent; color: var(--button-text); padding: 0 12px; font-weight: 700;
}

/* --- Bottom-anchored approve bar (mobile legal actions >=48px) --- */
.approve-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.approve-bar .btn, .approve-bar .btn-ghost { min-height: 48px; }
@media (max-width: 640px) {
  .approve-bar {
    position: sticky; bottom: 84px; padding: 10px; margin: 12px -4px 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  }
  .approve-bar .btn { flex: 1; }
}

/* --- Tables that stack into cards on mobile --- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; color: var(--muted); font-size: 0.72rem; font-weight: 720; text-transform: uppercase;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-subtle);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 0.92rem; color: var(--text); }
.data-table tr:last-child td { border-bottom: 0; }
.table-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

@media (max-width: 640px) {
  .stacks thead { display: none; }
  .stacks tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 4px; }
  .stacks td { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--surface-muted); }
  .stacks td:last-child { border-bottom: 0; }
  .stacks td::before { content: attr(data-label); color: var(--muted); font-size: 0.78rem; font-weight: 700; }
}

/* --- Empty states --- */
.empty-state {
  border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface);
  padding: 32px; text-align: center; color: var(--muted);
}
.empty-state h3 { color: var(--ink); margin: 0 0 8px; }

/* --- Filters / search row --- */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-row input[type="search"] {
  min-height: 40px; min-width: 220px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}
.chip-toggle {
  min-height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); padding: 0 13px; font-weight: 650; font-size: 0.84rem;
}
.chip-toggle.on { background: var(--ink); color: var(--button-text); }

.group-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 18px 0 8px; color: var(--ink);
}
.group-head span { color: var(--muted); font-size: 0.84rem; }
