/* Later visual passes (icons, status pills, typography rhythm, glass
   depth, empty states, skeletons, login branding).

   These deliberately come after the sections they refine — several rules
   here override earlier ones at equal specificity, so this file must stay
   in this position in the link order.

   Part of the split style sheet — see index.html for the link order. */
/* ---------- Multiple summaries ---------- */
.summary-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.summary-header-row h3 { margin: 0; }
.summaries-list { display: flex; flex-direction: column; gap: 20px; }
.summaries-list .summary-card { max-width: none; }

/* ============================================================
   Part B — visual overhaul
   ============================================================ */

/* Elevation + glass highlight tokens (fixed rgba; not theme-recolored) */
:root {
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --shadow-modal: 0 18px 50px rgba(20, 30, 24, 0.18), 0 4px 14px rgba(20, 30, 24, 0.10);
}
html[data-theme="dark"] {
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* ---------- B1: icons ---------- */
.ic {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.14em;
  flex: none;
}
.icon-only {
  padding: 9px 11px;
  line-height: 0;
}
.icon-only .ic { width: 16px; height: 16px; vertical-align: middle; }
.link-chip .ic { width: 14px; height: 14px; }
.link-chip .link-chip-arrow { width: 13px; height: 13px; }

/* ---------- B2: status pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: calc(10.5px * var(--font-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}
.pill-assigned { background: var(--accent-soft); color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 26%, transparent); }
.pill-update { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 34%, transparent); }

.task-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.age-badge { display: inline-flex; align-items: center; gap: 6px; margin-left: 0; }
.age-badge .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: currentColor; }
.task-item.is-stale { border-left-color: var(--danger); }

/* ---------- B3: typography rhythm ---------- */
.type, .save-status, .history-title, .summary-row-picker input { font-variant-numeric: tabular-nums; }
.detail-header h3, .modal h2, .summary-card h3, .summary-header-row h3 { letter-spacing: -0.01em; }

/* ---------- B4: glass depth (inner top highlight + elevation) ---------- */
.sidebar,
.source-card,
.field-row,
.summary-card,
.summary-table-wrap,
.history-item,
.auth-card { box-shadow: var(--shadow-sm), var(--glass-highlight); }
.task-item { box-shadow: var(--shadow-sm), var(--glass-highlight); }
.task-item:hover { box-shadow: var(--shadow-hover), var(--glass-highlight); }
.task-item.active { box-shadow: var(--shadow-md), var(--glass-highlight); }
.detail-pane { box-shadow: var(--shadow-md), var(--glass-highlight); }
.modal { box-shadow: var(--shadow-modal), var(--glass-highlight); }
.field-readonly { box-shadow: var(--glass-highlight); }

/* ---------- B5: detail pane as a document ---------- */
.detail-section { margin-top: 24px; }
.detail-section:first-of-type { margin-top: 8px; }
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.compose-card {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-sm), var(--glass-highlight);
}
.compose-card .field-block:first-of-type,
.detail-section .field-block:first-of-type { margin-top: 0; }

/* §5.5 Sticky Save/Submit: the action row + status hug the bottom of the
   viewport while a long compose form scrolls, then settle at the card's
   bottom edge. Negative margins bleed the bar to the padded card edges. No
   animation, so reduced-motion users are unaffected. */
.compose-actions {
  position: sticky;
  bottom: 0;
  margin: 18px -18px -18px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--glass-border);
  border-bottom-left-radius: var(--radius-card);
  border-bottom-right-radius: var(--radius-card);
  z-index: 4;
}
@supports (backdrop-filter: blur(6px)) {
  .compose-actions { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(8px); }
}
.compose-card .save-row { margin-top: 0; }
.compose-actions .save-status { margin-bottom: 0; }

/* ---------- B6: empty states ---------- */
.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 56px 24px;
  grid-column: 1 / -1;
}
.empty-ic {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: var(--glass-highlight);
}
.empty-ic .ic { width: 28px; height: 28px; }
.empty-state-card h3 { margin: 2px 0 0; font-size: 20px; font-weight: 750; letter-spacing: -0.01em; }
.empty-state-card p { margin: 0; max-width: 42ch; color: var(--ink-soft); font-size: 13.5px; }
.empty-cta { margin-top: 4px; }
.empty-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 13px;
  padding: 16px 4px;
}
.empty-inline .ic { width: 16px; height: 16px; opacity: 0.7; }

/* ---------- B8: loading skeletons + transitions ---------- */
.skeleton-card {
  border-radius: var(--radius-card);
  padding: 14px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm), var(--glass-highlight);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}
.sk-line, .sk-btn, .sk-block {
  border-radius: 6px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--ink) 6%, transparent) 25%,
    color-mix(in srgb, var(--ink) 13%, transparent) 37%,
    color-mix(in srgb, var(--ink) 6%, transparent) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.sk-line { height: 11px; }
.sk-line.sk-tall { height: 20px; margin-bottom: 16px; }
.sk-w-30 { width: 30%; } .sk-w-45 { width: 45%; } .sk-w-60 { width: 60%; }
.sk-w-80 { width: 80%; } .sk-w-85 { width: 85%; }
.sk-btn { height: 34px; flex: 1; border-radius: var(--radius-sm); }
.sk-block { height: 90px; margin-bottom: 14px; }
.sk-block.sk-tall2 { height: 140px; }
.skeleton-card.sk-big { height: 120px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.task-list.animate-in .task-item {
  animation: taskIn 0.35s ease backwards;
  animation-delay: calc(min(var(--i, 0), 12) * 28ms);
}
@keyframes taskIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.btn-primary.submit-done {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  animation: submitPop 0.4s ease;
}
@keyframes submitPop { 0% { transform: scale(1); } 45% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* View + detail entrance motion (shipped with the new themes + credit) */
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.anim-view { animation: viewIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-view.anim-view-slow { animation-delay: 0.06s; }
@keyframes detailSwap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.detail-enter { animation: detailSwap 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .anim-view, .anim-view.anim-view-slow, .detail-enter,
  .task-list.animate-in .task-item, .btn-primary.submit-done { animation: none !important; }
}

/* "Made by" credit */
.sidebar-credit { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--glass-border); text-align: center; font-size: 11px; color: var(--ink-muted); }
.sidebar-credit b { color: var(--ink-soft); font-weight: 600; }
.auth-credit { margin-top: 20px; text-align: center; font-size: 11.5px; color: var(--ink-muted); }
.auth-credit b { color: var(--ink-soft); font-weight: 600; }

/* ---------- B9: login branding ---------- */
.auth-screen {
  background:
    radial-gradient(ellipse at 22% 8%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 46%),
    radial-gradient(ellipse at 82% 96%, color-mix(in srgb, var(--gold) 18%, transparent) 0%, transparent 48%),
    linear-gradient(155deg, color-mix(in srgb, var(--accent-strong) 20%, var(--paper)), var(--paper));
}
.auth-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000, transparent 75%);
}
.auth-card { position: relative; z-index: 1; }
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-mark { width: 54px; height: 54px; border-radius: 13px; }
.auth-title { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.auth-tagline { margin: 0; font-size: 12.5px; color: var(--ink-soft); max-width: 30ch; line-height: 1.5; }
