/* Auth + cabinet shell — paper archive product UI */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.auth-page .top { position: static; }
.auth-wrap {
  min-height: calc(100vh - 4rem);
  display: grid; place-items: center;
  padding: 2rem var(--pad) 3rem;
}
.auth-card {
  width: min(100%, 440px);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 1.75rem 1.5rem 1.5rem;
}
.auth-card h1 { font-size: clamp(1.6rem, 4vw, 2rem); }
.auth-lead { color: var(--ink-soft); margin: 0 0 1.25rem; }
.auth-card .btn-block { width: 100%; margin-top: 0.25rem; }
.auth-card .msg { min-height: 1.4em; margin: 0.85rem 0 0; text-align: center; color: var(--ok); }
.auth-card .msg.err { color: var(--danger); }
.auth-foot { margin: 1.1rem 0 0; font-size: 0.85rem; color: var(--ink-muted); }

/* Cabinet layout */
.cab-body { background: var(--paper); }
.cab {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.cab-side {
  position: sticky; top: 0; align-self: start; height: 100vh;
  padding: 1.1rem 0.9rem 1.25rem;
  border-right: 1px solid var(--line);
  background: var(--paper-2);
  display: flex; flex-direction: column; gap: 1.25rem;
}
.cab-brand { padding: 0.25rem 0.4rem; }
.cab-nav { display: grid; gap: 0.2rem; }
.cab-nav button, .cab-mobile-nav button {
  appearance: none; border: 0; background: transparent; text-align: left;
  font: 600 0.95rem/1.3 var(--font-ui); color: var(--ink-soft);
  padding: 0.6rem 0.7rem; border-radius: var(--r-sm); cursor: pointer;
  display: flex; align-items: center; gap: 0.55rem;
}
.cab-nav .tab-ico, .cab-mobile-nav .tab-ico {
  width: 22px; height: 22px; flex-shrink: 0;
}
.cab-nav button:hover, .cab-mobile-nav button:hover { background: color-mix(in srgb, var(--white) 70%, transparent); color: var(--ink); }
.cab-nav button.on, .cab-mobile-nav button.on {
  background: var(--white); color: var(--ink); border: 1px solid var(--line);
}
.cab-side-note {
  margin-top: auto; font-size: 0.78rem; color: var(--ink-muted);
  padding: 0.5rem 0.7rem; border-top: 1px solid var(--line);
}

.cab-main {
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 3rem;
  min-width: 0;
}
.cab-top {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: end;
  margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.cab-top h1 { margin: 0; font-size: clamp(1.45rem, 3vw, 1.9rem); }
.cab-top-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.member-select-wrap select {
  font: 600 0.95rem var(--font-ui); color: var(--ink);
  padding: 0.45rem 0.7rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--white);
}
.cab-view { min-height: 40vh; }
.cab-disclaimer {
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: 0.85rem; color: var(--ink-muted); max-width: 40rem;
}

.cab-mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 0.35rem 0.25rem calc(0.4rem + env(safe-area-inset-bottom));
  justify-content: space-around; gap: 0;
  box-shadow: 0 -6px 20px rgba(28, 25, 21, 0.04);
}
.cab-mobile-nav button {
  flex: 1;
  flex-direction: column !important;
  justify-content: center;
  align-items: center !important;
  gap: 0.2rem !important;
  text-align: center;
  font-size: 0.62rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  padding: 0.45rem 0.15rem !important;
  border: 0 !important;
  border-radius: 10px !important;
  min-height: 52px;
  color: var(--ink-muted) !important;
  background: transparent !important;
}
.cab-mobile-nav button .tab-ico { width: 24px; height: 24px; }
.cab-mobile-nav button span { line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cab-mobile-nav button.on {
  color: var(--accent) !important;
  background: var(--accent-wash) !important;
}
.cab-mobile-nav button.on .tab-ico { stroke-width: 2.1; }

@media (max-width: 860px) {
  .cab { grid-template-columns: 1fr; }
  .cab-side { display: none; }
  .cab-mobile-nav { display: flex; }
  .cab-main { padding-bottom: 5.75rem; }
}

/* Overview cards */
.ov-grid {
  display: grid; gap: 1rem;
  grid-template-columns: 1.2fr 1fr;
}
@media (max-width: 900px) { .ov-grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.1rem 1.15rem;
}
.panel h2 {
  font-size: 1.05rem; margin: 0 0 0.85rem;
  font-family: var(--font-display);
}
.hello {
  margin-bottom: 1.25rem;
}
.hello p { margin: 0.35rem 0 0; color: var(--ink-soft); max-width: 36rem; }

.list-clean { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.list-clean li {
  display: flex; justify-content: space-between; gap: 0.75rem; align-items: baseline;
  padding: 0.65rem 0; border-top: 1px solid var(--line); font-size: 0.95rem;
}
.list-clean li:first-child { border-top: 0; padding-top: 0; }
.list-clean .when { color: var(--ink-muted); font-size: 0.85rem; white-space: nowrap; }
.list-clean .overdue { color: var(--danger); font-weight: 600; }
.list-clean button.linkish {
  appearance: none; border: 0; background: 0; padding: 0; font: inherit;
  color: inherit; text-align: left; cursor: pointer;
}
.list-clean button.linkish:hover { color: var(--accent-deep); }

.spark-wrap { margin-top: 0.5rem; }
.spark-wrap strong { display: block; margin-bottom: 0.35rem; }
.spark-wrap svg { width: 100%; height: auto; display: block; background: var(--paper); border-radius: 6px; border: 1px solid var(--line); }
.spark-wrap svg .ln { fill: none; stroke: var(--accent); stroke-width: 2.25; }
.spark-wrap svg .dot { fill: var(--white); stroke: var(--accent); stroke-width: 2; }
.spark-wrap svg .band { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.spark-wrap svg .grid { stroke: var(--line); }
.spark-wrap svg text { font-family: var(--font-ui); font-size: 11px; fill: var(--ink-muted); }

/* Family */
.family-grid {
  display: grid; gap: 0.85rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.member-card {
  border: 1px solid var(--line); border-radius: var(--r); background: var(--white);
  padding: 1.15rem 1.1rem; text-align: left; cursor: pointer; font: inherit; color: inherit;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
.member-card:hover, .member-card.on {
  border-color: var(--accent); background: var(--accent-wash);
}
.member-card .role { color: var(--accent); font-size: 0.82rem; font-weight: 600; margin: 0 0 0.25rem; }
.member-card h3 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.member-card p { margin: 0; color: var(--ink-muted); font-size: 0.92rem; }

/* Docs */
.docs-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.docs-table { display: grid; gap: 0; }
.doc-row {
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem;
  width: 100%; text-align: left; font: inherit; color: inherit;
  padding: 0.9rem 0; border-top: 1px solid var(--line);
  background: transparent; border-left: 0; border-right: 0; border-bottom: 0; cursor: pointer;
}
.doc-row:hover { color: var(--accent-deep); }
.doc-row strong { display: block; font-size: 1rem; }
.doc-row small { color: var(--ink-muted); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.filter-pills button {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 0.3rem 0.7rem; font: 600 0.82rem var(--font-ui); color: var(--ink-soft); cursor: pointer;
}
.filter-pills button.on { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-wash); }

/* Reminders */
.rem-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.7rem; align-items: start;
  padding: 0.85rem 0; border-top: 1px solid var(--line);
}
.rem-item input { margin-top: 0.25rem; accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.rem-item.done .rem-title { text-decoration: line-through; color: var(--ink-muted); }
.rem-meta { font-size: 0.85rem; color: var(--ink-muted); }
.rem-meta.overdue { color: var(--danger); font-weight: 600; }

/* Profile */
.profile-dl {
  display: grid; gap: 0.85rem; max-width: 28rem;
}
.profile-dl div {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.5rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--line);
}
.profile-dl dt { color: var(--ink-muted); font-size: 0.88rem; }
.profile-dl dd { margin: 0; font-weight: 600; }

.visits li { align-items: flex-start; }
.visits .place { display: block; color: var(--ink-muted); font-size: 0.85rem; font-weight: 400; }

.empty { color: var(--ink-muted); padding: 0.5rem 0; }

@media (max-width: 480px) {
  .profile-dl div { grid-template-columns: 1fr; }
  .cab-top-actions { width: 100%; }
  .member-select-wrap { flex: 1; }
  .member-select-wrap select { width: 100%; }
}
