:root {
  --ink: #12201c;
  --ink-soft: #3d4f48;
  --muted: #6b7c74;
  --line: #d5ddd8;
  --line-strong: #b7c4bc;
  --paper: #f3f6f4;
  --panel: #ffffff;
  --accent: #1f6b57;
  --accent-deep: #154c3e;
  --accent-soft: #e5f2ed;
  --danger: #a33b2d;
  --danger-soft: #f8ebe8;
  --warn: #9a6b12;
  --warn-soft: #f8f0dc;
  --ok: #1f6b57;
  --ok-soft: #e5f2ed;
  --info: #2f5f7a;
  --info-soft: #e8f0f5;
  --shadow: 0 1px 0 rgba(18, 32, 28, 0.04), 0 12px 32px rgba(18, 32, 28, 0.06);
  --shadow-lift: 0 2px 0 rgba(18, 32, 28, 0.03), 0 18px 40px rgba(18, 32, 28, 0.1);
  --radius: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 520ms;
}

* { box-sizing: border-box; }
html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,0.55), transparent 220px),
    radial-gradient(900px 420px at 100% -10%, #dceae3 0%, transparent 60%),
    radial-gradient(700px 380px at -5% 20%, #e7eee9 0%, transparent 55%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 47px,
      rgba(18, 32, 28, 0.015) 47px,
      rgba(18, 32, 28, 0.015) 48px
    );
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-deep);
  transition: color var(--dur-fast) ease;
}
a:hover { color: var(--accent); }

.wrap { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

/* Header */
.app-top {
  position: sticky;
  top: 0;
  z-index: 30;
  animation: slideDown 480ms var(--ease-out) both;
}
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  position: relative;
  z-index: 20;
  transition: box-shadow var(--dur) ease, background var(--dur) ease;
}
.is-scrolled .site-header {
  background: rgba(255,255,255,0.96);
  box-shadow: 0 8px 24px rgba(18, 32, 28, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  position: relative;
  flex-wrap: wrap;
  transition: padding var(--dur) ease;
}
.is-scrolled .header-inner { padding: 0.65rem 0; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  transition: transform var(--dur-fast) var(--ease-out);
}
.brand:hover { transform: translateY(-1px); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-mark {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 3px;
  flex: none;
  background:
    linear-gradient(135deg, var(--accent) 0 42%, transparent 42% 58%, var(--accent-deep) 58%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  transition: transform var(--dur) var(--ease-spring);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
}
.brand-legal {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle-bar {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}
.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.nav {
  display: flex;
  gap: 0.15rem 1rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-fast) ease, border-color var(--dur) ease, opacity var(--dur-fast) ease;
}
.nav a:hover,
.nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.nav-quiet { font-weight: 500; }
.nav-sep {
  width: 1px;
  height: 1rem;
  background: var(--line-strong);
  opacity: 0.7;
}
.user {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

.main-app {
  padding: 1.75rem 0 3rem;
}
.main-app > .page-head,
.main-app > .flash,
.main-app > .banner,
.main-app > .flow,
.main-app > .kpi-row,
.main-app > .panel,
.main-app > .actions,
.main-app > .grid-2,
.main-app > .grid-2-wide,
.main-app > .summary-grid,
.main-app > .section-label,
.main-app > .board-filters,
.main-app > .cal-bar,
.main-app > .cal-filters,
.main-app > .cal-grid,
.main-app > .mail-layout,
.main-app > .report-filters,
.main-app > .report-kpis,
.main-app > .report-main,
.main-app > .report-secondary,
.main-app > .report-chat,
.main-app > .report-hero {
  animation: rise var(--dur-slow) var(--ease-out) both;
}
.main-app > *:nth-child(1) { animation-delay: 0ms; }
.main-app > *:nth-child(2) { animation-delay: 45ms; }
.main-app > *:nth-child(3) { animation-delay: 90ms; }
.main-app > *:nth-child(4) { animation-delay: 135ms; }
.main-app > *:nth-child(5) { animation-delay: 180ms; }
.main-app > *:nth-child(6) { animation-delay: 225ms; }
.main-app > *:nth-child(7) { animation-delay: 270ms; }
.main-app > *:nth-child(8) { animation-delay: 315ms; }
.main-app > *:nth-child(n+9) { animation-delay: 360ms; }
.site-footer {
  padding: 0 0 2.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  animation: fade 600ms ease 200ms both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
@keyframes softScale {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes drawLine {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Type */
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  font-weight: 650;
  color: var(--ink);
}
h1 { font-size: clamp(1.8rem, 2.4vw, 2.35rem); margin: 0 0 0.4rem; line-height: 1.15; }
h2 { font-size: 1.2rem; margin: 0 0 0.85rem; }
.page-head { margin-bottom: 1.4rem; }
.page-head h1 {
  background: linear-gradient(105deg, var(--ink) 40%, var(--accent-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.lede {
  color: var(--muted);
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: 1rem;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.85rem;
  transition: color var(--dur-fast) ease, gap var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.back:hover {
  color: var(--accent-deep);
  gap: 0.5rem;
  transform: translateX(-2px);
}

/* Flash / banners */
.flash {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  font-weight: 500;
  animation: rise 380ms var(--ease-out) both;
  box-shadow: 0 4px 16px rgba(18, 32, 28, 0.04);
}
.flash-success { background: var(--ok-soft); border-color: #bfd9cf; color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: #e7c5be; color: var(--danger); }
.banner {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius);
  margin-bottom: 1.15rem;
  border: 1px solid #e2d2a8;
  background: var(--warn-soft);
  color: #6f4e0d;
}
.banner a { font-weight: 700; color: inherit; }
.banner-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #e7c66a;
  color: #5c4008;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex: none;
}

/* Surfaces */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow);
  transition:
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur) ease,
    border-color var(--dur) ease;
}
.panel:hover {
  box-shadow: var(--shadow-lift);
  border-color: #c8d4cd;
}
.panel.is-revealed {
  animation: rise var(--dur-slow) var(--ease-out) both;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.panel-head h2 { margin: 0; }
.panel-note { color: var(--muted); font-size: 0.88rem; }

/* KPI strip */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
  box-shadow: var(--shadow);
  animation: rise 520ms var(--ease-out) both;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--dur) ease,
    box-shadow var(--dur) ease,
    transform var(--dur) var(--ease-out);
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}
a.kpi:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
a.kpi:hover::after { transform: scaleX(1); }
a.kpi.is-active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent), var(--shadow);
}
a.kpi.is-active::after { transform: scaleX(1); }
.kpi:nth-child(2) { animation-delay: 50ms; }
.kpi:nth-child(3) { animation-delay: 100ms; }
.kpi:nth-child(4) { animation-delay: 150ms; }
.kpi .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}
.kpi .value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin-top: 0.2rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  transition: transform var(--dur) var(--ease-spring);
}
a.kpi:hover .value { transform: translateY(-1px); }
.kpi .hint { margin-top: 0.25rem; color: var(--muted); font-size: 0.82rem; }
.kpi.is-warn .value { color: var(--warn); }
.kpi.is-danger .value { color: var(--danger); }

.board-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.board-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.board-search input[type="search"] {
  flex: 1 1 16rem;
  min-width: 12rem;
  max-width: 28rem;
}
.board-clear {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.board-clear:hover { color: var(--ink); }
.board-client-filters { margin: 0; }
.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;
}
.panel-note a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.panel-note a:hover { text-decoration: underline; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
}
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td {
  padding: 0.8rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tbody tr {
  transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}
tbody tr:hover { background: #f7faf8; }
tbody tr.is-entering {
  animation: rise 420ms var(--ease-out) both;
}
.row-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-deep);
  transition: color var(--dur-fast) ease, gap var(--dur-fast) ease;
}
.row-link:hover {
  color: var(--accent);
  gap: 0.5rem;
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.cell-title { font-weight: 650; color: var(--ink); }
.cell-sub { color: var(--muted); font-size: 0.84rem; margin-top: 0.15rem; }

/* Badges — soft square, not pills */
.badge {
  display: inline-block;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-spring), filter var(--dur-fast) ease;
}
tbody tr:hover .badge { transform: translateY(-1px); }
.tone-warn { background: var(--warn-soft); color: var(--warn); border-color: #e5d4a4; }
.tone-danger { background: var(--danger-soft); color: var(--danger); border-color: #e5c0b8; }
.tone-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfd9cf; }
.tone-info { background: var(--info-soft); color: var(--info); border-color: #c4d6e2; }
.tone-neutral { background: #eef1ef; color: var(--ink-soft); border-color: var(--line); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #f4fbf8;
  border: 1px solid var(--accent-deep);
  border-radius: 8px;
  padding: 0.62rem 1rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--dur-fast) var(--ease-out),
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 4px 12px rgba(21, 76, 62, 0.18);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
}
.btn:hover {
  background: var(--accent-deep);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 8px 20px rgba(21, 76, 62, 0.28);
}
.btn:hover::before {
  opacity: 1;
  animation: shimmer 900ms ease;
}
.btn:active { transform: translateY(0); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn:disabled::before { display: none; }
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(18, 32, 28, 0.04);
}
.btn-secondary:hover {
  background: #f7faf8;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(18, 32, 28, 0.08);
}
.btn-secondary::before { display: none; }
.btn-danger { background: var(--danger); border-color: #822f24; color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1rem 0 1.25rem; }

/* Forms */
label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  font-weight: 600;
}
input[type=text],
input[type=email],
input[type=password],
input[type=file],
select {
  width: 100%;
  padding: 0.68rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  margin-bottom: 0.9rem;
  color: var(--ink);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, transform var(--dur-fast) ease;
}
input:focus, select:focus {
  outline: 2px solid rgba(31, 107, 87, 0.28);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 107, 87, 0.08);
}

/* Auth composition */
.main-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}
.main-auth::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 420px at 15% 20%, rgba(31,107,87,0.18), transparent 60%),
    radial-gradient(800px 500px at 85% 80%, rgba(18,32,28,0.12), transparent 55%),
    linear-gradient(160deg, #18362e 0%, #1f4a3d 42%, #0f241e 100%);
  z-index: 0;
  animation: fade 900ms ease both;
}
.main-auth::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 70% 30%, rgba(159, 213, 194, 0.12), transparent 28%),
    radial-gradient(circle at 20% 75%, rgba(255,255,255,0.06), transparent 22%);
  z-index: 0;
  animation: authDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes authDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-2%, 3%, 0) scale(1.05); }
}
.auth-shell {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(8, 20, 16, 0.35);
  animation: softScale 600ms var(--ease-out) both;
}
.auth-brand {
  padding: 2.4rem 2.2rem;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.08), transparent 40%),
    linear-gradient(180deg, #1b5646, #13362d);
  color: #eef7f3;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-brand .brand-text { color: #fff; font-size: 1.85rem; white-space: normal; max-width: 14ch; }
.auth-brand .brand { margin-bottom: 1.5rem; animation: rise 500ms var(--ease-out) both; }
.auth-brand .brand-mark {
  width: 1.35rem;
  height: 1.35rem;
  background: linear-gradient(135deg, #9fd5c2 0 42%, transparent 42% 58%, #fff 58%);
}
.auth-brand h1 {
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  max-width: 12ch;
  margin: 0 0 0.75rem;
  animation: rise 560ms var(--ease-out) 80ms both;
}
.auth-brand p {
  margin: 0;
  color: rgba(238, 247, 243, 0.78);
  max-width: 30ch;
  font-size: 1.02rem;
  animation: rise 560ms var(--ease-out) 140ms both;
}
.auth-points {
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.auth-points li {
  position: relative;
  padding-left: 1.15rem;
  color: rgba(238, 247, 243, 0.88);
  font-size: 0.92rem;
  font-weight: 500;
  animation: rise 480ms var(--ease-out) both;
}
.auth-points li:nth-child(1) { animation-delay: 200ms; }
.auth-points li:nth-child(2) { animation-delay: 260ms; }
.auth-points li:nth-child(3) { animation-delay: 320ms; }
.auth-points li:nth-child(4) { animation-delay: 380ms; }
.auth-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 2px;
  background: #9fd5c2;
  box-shadow: 0 0 0 0 rgba(159, 213, 194, 0.45);
  animation: pulse 2.4s ease infinite;
}
.auth-points li:nth-child(2)::before { animation-delay: 0.3s; }
.auth-points li:nth-child(3)::before { animation-delay: 0.6s; }
.auth-points li:nth-child(4)::before { animation-delay: 0.9s; }
.auth-brand .foot {
  font-size: 0.82rem;
  color: rgba(238, 247, 243, 0.55);
  margin-top: 2rem;
  animation: fade 700ms ease 450ms both;
}
.auth-form {
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: rise 560ms var(--ease-out) 120ms both;
}
.auth-form h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0 0 0.35rem;
}
.auth-form .lede { margin-bottom: 1.4rem; }
.auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Flow stepper */
.flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 1.35rem;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  position: relative;
}
.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 0.42rem;
  left: calc(50% + 0.55rem);
  right: calc(-50% + 0.55rem);
  height: 2px;
  background: var(--line);
  transform-origin: left;
}
.flow-step.is-done:not(:last-child)::after,
.flow-step.is-current:not(:last-child)::after {
  background: var(--accent);
  animation: drawLine 480ms var(--ease-out) both;
}
.flow-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 2px solid var(--line-strong);
  background: #fff;
  z-index: 1;
  transition: transform var(--dur) var(--ease-spring), background var(--dur) ease, border-color var(--dur) ease;
}
.flow-step.is-done .flow-dot {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}
.flow-step.is-current .flow-dot {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 107, 87, 0.18);
  animation: pulse 1.6s ease infinite;
  transform: scale(1.15);
}
.flow-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color var(--dur) ease;
}
.flow-step.is-done .flow-label,
.flow-step.is-current .flow-label { color: var(--ink); }
.flow-step {
  animation: rise 420ms var(--ease-out) both;
}
.flow-step:nth-child(1) { animation-delay: 0ms; }
.flow-step:nth-child(2) { animation-delay: 40ms; }
.flow-step:nth-child(3) { animation-delay: 80ms; }
.flow-step:nth-child(4) { animation-delay: 120ms; }
.flow-step:nth-child(5) { animation-delay: 160ms; }
.flow-step:nth-child(6) { animation-delay: 200ms; }
.flow-step:nth-child(7) { animation-delay: 240ms; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(31, 107, 87, 0.14); }
  50% { box-shadow: 0 0 0 6px rgba(31, 107, 87, 0.08); }
}

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.15rem;
  border-left: 2px solid var(--line);
  margin-left: 0.35rem;
  animation: rise 420ms var(--ease-out) both;
}
.timeline li:nth-child(1) { animation-delay: 0ms; }
.timeline li:nth-child(2) { animation-delay: 50ms; }
.timeline li:nth-child(3) { animation-delay: 100ms; }
.timeline li:nth-child(4) { animation-delay: 150ms; }
.timeline li:nth-child(5) { animation-delay: 200ms; }
.timeline li:nth-child(n+6) { animation-delay: 240ms; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) ease;
}
.timeline li:hover::before {
  transform: scale(1.35);
  box-shadow: 0 0 0 4px rgba(31, 107, 87, 0.16);
}
.timeline .when { color: var(--muted); font-size: 0.78rem; }
.timeline strong { font-weight: 650; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease, border-color var(--dur) ease;
  animation: rise 480ms var(--ease-out) both;
}
.stat:nth-child(2) { animation-delay: 50ms; }
.stat:nth-child(3) { animation-delay: 100ms; }
.stat:nth-child(4) { animation-delay: 150ms; }
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: #c8d4cd;
}
.stat .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 650;
}
.stat .value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
}

/* Upload drop zone */
.upload-zone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.4rem;
  background: #f8fbf9;
  text-align: center;
  transition:
    border-color var(--dur) ease,
    background var(--dur) ease,
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur) ease;
}
.upload-zone:hover,
.upload-zone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(31, 107, 87, 0.1);
}
.upload-zone strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}
.upload-zone p { color: var(--muted); margin: 0 0 1rem; }

.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  animation: fade 480ms ease both;
}

.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  margin: 1.5rem 0 0.65rem;
}

.classify-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.classify-form select {
  margin: 0;
  min-width: 8.5rem;
  padding: 0.4rem 0.5rem;
}
.classify-form .btn {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
}

/* Plan + template forms */
input[type=number],
textarea {
  width: 100%;
  padding: 0.68rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  margin-bottom: 0.9rem;
  color: var(--ink);
}
textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  resize: vertical;
}
textarea:focus, input[type=number]:focus {
  outline: 2px solid rgba(31, 107, 87, 0.28);
  border-color: var(--accent);
}
.panel-narrow { max-width: 620px; }
.page-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0 1rem;
}
.field-hint {
  margin: -0.6rem 0 1rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  opacity: 0.7;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  margin-bottom: 0.9rem;
}
.checks-stack { flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.check input { margin: 0; accent-color: var(--accent); }
.row-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}
.row-actions form { display: inline; }
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--danger);
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }
tbody tr.is-editing { background: var(--accent-soft); }
.grid-2-wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

.preview-subject {
  margin: 0;
  font-weight: 650;
  color: var(--ink);
}
.preview-frame {
  width: 100%;
  height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.placeholder-list { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.placeholder-list li {
  display: flex;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-bottom: 1px dotted var(--line);
}
.placeholder-list code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  color: var(--accent-deep);
  white-space: nowrap;
}
.placeholder-list span { color: var(--muted); }

/* Calendar */
.cal-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.cal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  min-width: 9rem;
  text-align: center;
}
.cal-legend { display: flex; gap: 0.35rem; margin-left: auto; flex-wrap: wrap; }
.cal-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.cal-filters-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}
.cal-filter {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  transition:
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out);
}
.cal-filter:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}
.cal-filter.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.cal-dow {
  background: #f7faf8;
  padding: 0.5rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
}
.cal-cell {
  background: var(--panel);
  min-height: 96px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.cal-cell:hover:not(.is-outside) {
  background: #f7faf8;
  z-index: 1;
}
.cal-cell.is-outside { background: #fafcfb; }
.cal-cell.is-outside .cal-day { color: var(--line-strong); }
.cal-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--accent);
  animation: softScale 480ms var(--ease-out) both;
}
.cal-day {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.cal-chip {
  display: block;
  padding: 0.2rem 0.35rem;
  border-radius: 5px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  text-decoration: none;
  line-height: 1.25;
  color: inherit;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) ease;
}
.cal-chip-title { display: block; font-weight: 700; }
.cal-chip-sub {
  display: block;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-chip:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}
.cal-group { position: relative; }
.cal-chip-group {
  cursor: pointer;
  list-style: none;
}
.cal-chip-group::-webkit-details-marker { display: none; }
.cal-chip-group::marker { content: ''; }
.cal-group[open] .cal-chip-group {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.cal-group-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-top: 0;
  border-radius: 0 0 5px 5px;
  overflow: hidden;
}
.cal-group-item {
  display: block;
  padding: 0.28rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: #f7faf8;
}
.cal-group-item:hover { background: #eef4f0; }

/* Email inbox + bank file examples */
.mail-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
  background: var(--panel);
}
.mail-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #f7faf8;
  max-height: 520px;
  overflow: auto;
}
.mail-row {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  transition: background var(--dur-fast) ease, border-color var(--dur) ease, transform var(--dur-fast) ease;
}
.mail-row:hover {
  background: #eef4f0;
  transform: translateX(2px);
}
.mail-row.is-active {
  background: #fff;
  border-left-color: var(--accent);
}
.mail-row-kind {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}
.mail-row-subject {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
}
.mail-row-when {
  font-size: 0.75rem;
  color: var(--muted);
}
.mail-read {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
}
.mail-chrome {
  display: grid;
  gap: 0.45rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}
.mail-chrome-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.9rem;
}
.mail-chrome-row > span:first-child {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mail-frame {
  width: 100%;
  flex: 1;
  min-height: 340px;
  border: 0;
  background: #f3f6f4;
}
.file-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fbfcfb;
}
.file-card + .file-card { margin-top: 0.85rem; }
.file-card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.file-name {
  font-weight: 700;
  color: var(--ink);
}
.file-meta {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.file-table-wrap {
  margin: 0;
  border: 0;
  border-radius: 0;
  max-height: 320px;
  overflow: auto;
  background: #fff;
}
.file-table {
  margin: 0;
  width: 100%;
}
.file-table th {
  position: sticky;
  top: 0;
  background: #eef4f0;
  z-index: 1;
}
@media (max-width: 860px) {
  .mail-layout { grid-template-columns: 1fr; }
  .mail-list {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .grid-2-wide { grid-template-columns: 1fr; }
  .cal-cell { min-height: 74px; }
  .cal-chip { font-size: 0.66rem; }
  .cal-chip-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Reports */
.report-filters { margin-bottom: 1.15rem; }
.report-head-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.report-kpis { margin-bottom: 1.15rem; }
.report-main,
.report-secondary { margin-bottom: 1.1rem; }
.report-panel { margin-bottom: 0; }
.report-empty { padding: 1.5rem 0.5rem; }

.pipe-chart { display: flex; flex-direction: column; gap: 0.7rem; }
.pipe-row {
  animation: rise 420ms ease both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.pipe-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.28rem;
  font-size: 0.88rem;
}
.pipe-label { font-weight: 600; color: var(--ink-soft); }
.pipe-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}
.pipe-track {
  height: 0.55rem;
  border-radius: 999px;
  background: #e8efeb;
  overflow: hidden;
}
.pipe-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  animation: pipeGrow 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(80ms + var(--i, 0) * 40ms);
}
.pipe-fill.tone-warn { background: linear-gradient(90deg, #d4a017, #9a6b12); }
.pipe-fill.tone-danger { background: linear-gradient(90deg, #c45a4a, #a33b2d); }
.pipe-fill.tone-ok { background: linear-gradient(90deg, #2f8f74, #1f6b57); }
.pipe-fill.tone-info { background: linear-gradient(90deg, #4a7f9a, #2f5f7a); }
.pipe-fill.tone-neutral { background: linear-gradient(90deg, #8a9a92, #6b7c74); }
@keyframes pipeGrow {
  from { width: 0; }
  to { width: var(--w, 0%); }
}

.attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition:
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) ease;
}
.attention-item:hover {
  background: #f7faf8;
  border-color: var(--line);
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(18, 32, 28, 0.05);
}
.attention-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
  gap: 0.75rem;
  align-items: end;
  min-height: 220px;
  padding-top: 0.35rem;
}
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  animation: rise 480ms ease both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.bar-value {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-deep);
  text-align: center;
  line-height: 1.2;
}
.bar-value.is-refund,
.rank-money.is-refund { color: var(--info); }
.bar-track {
  width: 100%;
  max-width: 2.4rem;
  height: 140px;
  border-radius: 8px 8px 4px 4px;
  background: #e8efeb;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bar-fill {
  width: 100%;
  height: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #3d9a7d, var(--accent-deep));
  animation: barRise 750ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(100ms + var(--i, 0) * 50ms);
}
.bar-fill.is-refund {
  background: linear-gradient(180deg, #6a9bb5, var(--info));
}
@keyframes barRise {
  from { height: 0; }
  to { height: var(--h, 0%); }
}
.bar-label {
  font-size: 0.72rem;
  font-weight: 650;
  text-align: center;
  color: var(--ink-soft);
}
.bar-sub {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}

.rank-chart {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.rank-row {
  display: block;
  text-decoration: none;
  color: inherit;
  animation: rise 420ms ease both;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.rank-row:hover .rank-name { color: var(--accent); }
.rank-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}
.rank-name { font-weight: 650; }
.rank-money {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent-deep);
  flex-shrink: 0;
}
.rank-track {
  height: 0.45rem;
  border-radius: 999px;
  background: #e8efeb;
  overflow: hidden;
}
.rank-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f8f74, var(--accent-deep));
  animation: pipeGrow 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(80ms + var(--i, 0) * 40ms);
}
.rank-sub {
  margin-top: 0.28rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.report-chat { margin-top: 0; }
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 520px;
  overflow: auto;
  padding-right: 0.25rem;
}
.chat-bubble {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: #f8fbf9;
  animation: rise 420ms ease both;
  animation-delay: calc(var(--i, 0) * 30ms);
  border-left: 3px solid var(--accent);
}
.chat-bubble.tone-warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}
.chat-bubble.tone-danger {
  background: var(--danger-soft);
  border-left-color: var(--danger);
}
.chat-bubble.tone-ok {
  background: #f8fbf9;
  border-left-color: var(--accent);
}
.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.chat-head time {
  color: var(--muted);
  font-size: 0.78rem;
  flex-shrink: 0;
}
.chat-period {
  margin-left: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}
.chat-subject {
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--ink);
}
.chat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  align-items: center;
  font-size: 0.82rem;
}
.chat-to { color: var(--muted); }
.chat-error {
  margin: 0.55rem 0 0;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 500;
}

input[type=text],
input[type=email],
input[type=password],
input[type=file],
input[type=search],
input[type=number],
select,
textarea {
  font-size: 1rem;
}

/* ========== Responsive: tablet & phone ========== */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .header-inner {
    flex-wrap: nowrap;
    gap: 0.75rem;
  }
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 0.85rem;
    background: rgba(255,255,255,0.97);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 28px rgba(18, 32, 28, 0.08);
    max-height: min(70vh, 28rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-open .nav {
    display: flex;
    animation: slideDown 280ms var(--ease-out) both;
  }
  .nav a,
  .nav .user,
  .nav .nav-quiet {
    padding: 0.7rem 0.15rem;
    border-bottom: 1px solid var(--line);
  }
  .nav a.is-active {
    border-bottom-color: var(--line);
    color: var(--accent-deep);
    box-shadow: inset 3px 0 0 var(--accent);
    padding-left: 0.55rem;
  }
  .nav-sep { display: none; }
  .nav .user {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.82rem;
    border-bottom: 0;
    padding-bottom: 0.2rem;
  }
  .nav .nav-quiet { border-bottom: 0; }
}

@media (max-width: 800px) {
  .wrap { width: min(1120px, calc(100% - 1.25rem)); }
  .main-app { padding: 1.25rem 0 2.25rem; }
  .panel {
    padding: 1rem;
    border-radius: 8px;
  }
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 1.4rem; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 0; padding: 1.6rem 1.4rem; }
  .auth-brand h1 { max-width: none; font-size: 1.65rem; }
  .auth-brand .brand-text { font-size: 1.45rem; }
  .auth-form { padding: 1.5rem 1.35rem 1.75rem; }
  .bar-chart { min-height: 180px; }
  .bar-track { height: 110px; }
  .chat-head { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .attention-item { flex-direction: column; align-items: flex-start; }
  .mail-chrome-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .file-card-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-head-row .actions { margin: 0; }
  .btn { min-height: 2.6rem; }
  .actions .btn { flex: 1 1 auto; }
}

@media (max-width: 720px) {
  .flow {
    gap: 0.2rem;
    margin-bottom: 1rem;
  }
  .flow-label { display: none; }
  .flow-step:not(:last-child)::after {
    top: 0.38rem;
    left: calc(50% + 0.4rem);
    right: calc(-50% + 0.4rem);
  }
  .cal-bar { justify-content: center; }
  .cal-legend { margin-left: 0; width: 100%; justify-content: flex-start; }
  .cal-title { flex: 1; min-width: 0; }
  .cal-dow { padding: 0.4rem 0.2rem; font-size: 0.62rem; text-align: center; }
  .cal-cell {
    min-height: 64px;
    padding: 0.28rem;
  }
  .cal-chip-sub { display: none; }
  .board-search input[type="search"] {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }
  .classify-form {
    flex-wrap: wrap;
    width: 100%;
  }
  .classify-form select {
    flex: 1 1 8rem;
    min-width: 0;
  }
  .row-actions {
    flex-wrap: wrap;
    white-space: normal;
  }
  th, td { padding: 0.65rem 0.4rem; }
  table { font-size: 0.86rem; }
}

@media (max-width: 560px) {
  .wrap { width: calc(100% - 1rem); }
  .brand-text { font-size: 0.92rem; white-space: normal; max-width: 12ch; }
  h1 { font-size: 1.55rem; }
  .kpi-row,
  .summary-grid { grid-template-columns: 1fr; }
  .kpi .value { font-size: 1.55rem; }
  .main-auth { padding: 1rem 0.75rem; }
  .auth-shell { border-radius: 14px; }
  .auth-card { padding: 1.35rem; }
  .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(2.6rem, 1fr));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cal-chip-title {
    font-size: 0.62rem;
  }
  .preview-frame,
  .mail-frame { min-height: 260px; height: 260px; }
  .bar-chart {
    grid-template-columns: repeat(auto-fit, minmax(3.4rem, 1fr));
    gap: 0.45rem;
  }
  .pipe-meta,
  .rank-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
  .placeholder-list li {
    flex-direction: column;
    gap: 0.15rem;
  }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 0.75rem); }
  .btn { width: 100%; }
  .actions { flex-direction: column; }
  .cal-legend .badge { font-size: 0.68rem; padding: 0.15rem 0.35rem; }
}

/* Prefer readable text when OS requests larger type */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal,
  .reveal-child {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Scroll / staggered reveals (driven by app.js) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.reveal-stagger > .reveal-child {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 420ms var(--ease-out),
    transform 420ms var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 45ms);
}
.reveal-stagger.is-in > .reveal-child {
  opacity: 1;
  transform: none;
}

/* ========== Showcase mode · screen stories ========== */
.present-guide {
  background:
    radial-gradient(720px 280px at 12% -20%, rgba(159, 213, 194, 0.22), transparent 55%),
    radial-gradient(640px 260px at 90% 0%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(118deg, #0f2a22 0%, #1a4a3b 46%, #14362c 100%);
  color: #eef7f3;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  animation: rise 380ms ease both;
  box-shadow: 0 12px 40px rgba(10, 28, 22, 0.28);
}
.present-guide[hidden] { display: none !important; }
.present-guide-inner {
  display: flex;
  gap: 1.35rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.2rem 0 1.3rem;
}
.present-guide-copy { min-width: 0; flex: 1; }
.present-guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.present-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(238, 247, 243, 0.62);
}
.present-step {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: rgba(159, 213, 194, 0.18);
  color: #c8eadc;
  border: 1px solid rgba(159, 213, 194, 0.28);
}
.present-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 0.45rem;
  line-height: 1.22;
  max-width: 38rem;
}
.present-body {
  margin: 0;
  color: rgba(238, 247, 243, 0.86);
  font-size: 0.98rem;
  max-width: 48rem;
  line-height: 1.5;
}
.present-why,
.present-say {
  margin: 0.7rem 0 0;
  font-size: 0.9rem;
  color: rgba(238, 247, 243, 0.7);
  max-width: 48rem;
  line-height: 1.45;
}
.present-why span,
.present-say span {
  display: inline-block;
  font-weight: 700;
  margin-right: 0.35rem;
  letter-spacing: 0.02em;
}
.present-why span { color: #9fd5c2; }
.present-say span { color: #f0d48a; }
.present-say {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(240, 212, 138, 0.22);
}

.present-tour {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.present-dot {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: rgba(238, 247, 243, 0.55);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  transition:
    background var(--dur-fast) ease,
    color var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-spring);
}
.present-dot:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}
.present-dot.is-current {
  color: #0f2a22;
  background: #9fd5c2;
  border-color: #9fd5c2;
  box-shadow: 0 0 0 3px rgba(159, 213, 194, 0.25);
}
.present-dot-label { white-space: nowrap; }

.present-guide-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding-top: 0.15rem;
  min-width: 11rem;
}
.present-stepper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.present-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 650;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  text-align: center;
}
a.present-nav-prev {
  color: rgba(238, 247, 243, 0.85);
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
}
a.present-nav-prev:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
a.present-nav-next.btn {
  background: #9fd5c2;
  color: #0f2a22;
  border: 0;
  box-shadow: none;
}
a.present-nav-next.btn:hover {
  background: #b6e4d2;
  color: #0a1f19;
}
.present-tour-end {
  font-size: 0.82rem;
  font-weight: 650;
  color: #9fd5c2;
  text-align: center;
  padding: 0.45rem;
}
.present-toggle {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.28);
  background: transparent;
  color: rgba(238, 247, 243, 0.78);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.present-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.present-nav-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.present-nav-toggle:hover,
.present-nav-toggle.is-active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
}
.present-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--accent-deep);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: rise 320ms ease both;
  transition:
    transform var(--dur) var(--ease-spring),
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    box-shadow var(--dur) ease;
}
.present-fab:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-lift);
}
.present-fab[hidden] { display: none !important; }

/* Spotlight the money shots while presenting */
body.is-presenting.has-spotlights .main-app > :not(.flash) {
  transition: opacity 280ms ease, filter 280ms ease;
}
body.is-presenting.has-spotlights .main-app > :not(.flash):not(.is-spotlit):not(:has(.is-spotlit)) {
  opacity: 0.42;
}
body.is-presenting .is-spotlit {
  position: relative;
  z-index: 2;
  opacity: 1 !important;
  outline: 2px solid rgba(31, 107, 87, 0.55);
  outline-offset: 4px;
  border-radius: calc(var(--radius) + 2px);
  box-shadow:
    0 0 0 6px rgba(31, 107, 87, 0.1),
    0 18px 48px rgba(18, 32, 28, 0.14);
  animation: spotPulse 900ms ease both;
  animation-delay: calc(var(--spot-i, 0) * 70ms);
}
@keyframes spotPulse {
  from { box-shadow: 0 0 0 0 rgba(31, 107, 87, 0.0), 0 8px 20px rgba(18, 32, 28, 0.06); }
  to {
    box-shadow:
      0 0 0 6px rgba(31, 107, 87, 0.1),
      0 18px 48px rgba(18, 32, 28, 0.14);
  }
}

/* Reports · showcase hero */
.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.2rem;
  padding: 1.35rem 1.4rem;
  border-radius: 14px;
  border: 1px solid #c5d9cf;
  background:
    radial-gradient(520px 220px at 100% 0%, rgba(31, 107, 87, 0.12), transparent 55%),
    linear-gradient(135deg, #f7fbf9 0%, #eef5f1 55%, #e7f0eb 100%);
  box-shadow: var(--shadow);
  animation: rise 480ms ease both;
}
.report-hero-copy h1 {
  margin-bottom: 0.35rem;
}
.report-hero-copy .lede {
  max-width: 34rem;
}
.report-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  align-content: center;
}
.report-hero-stat {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(31, 107, 87, 0.12);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) ease, background var(--dur) ease;
  animation: rise 480ms var(--ease-out) both;
}
.report-hero-stat:nth-child(1) { animation-delay: 80ms; }
.report-hero-stat:nth-child(2) { animation-delay: 130ms; }
.report-hero-stat:nth-child(3) { animation-delay: 180ms; }
.report-hero-stat:nth-child(4) { animation-delay: 230ms; }
.report-hero-stat:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 8px 22px rgba(18, 32, 28, 0.08);
}
.report-hero-stat .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
}
.report-hero-stat .value {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: -0.03em;
  margin-top: 0.15rem;
  line-height: 1.15;
  color: var(--accent-deep);
}
.report-hero-stat .hint {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.report-hero-stat.is-warn .value { color: var(--warn); }
.report-hero-stat.is-danger .value { color: var(--danger); }
.report-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.35rem 0 0.75rem;
}
.report-section-title h2 {
  margin: 0;
  font-size: 1.05rem;
}
.report-section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 800px) {
  .report-hero { grid-template-columns: 1fr; padding: 1.1rem; }
  .report-hero-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .present-guide-inner {
    flex-direction: column;
    gap: 0.95rem;
    padding: 1rem 0 1.1rem;
  }
  .present-guide-actions {
    width: 100%;
    min-width: 0;
  }
  .present-stepper { flex-direction: row; flex-wrap: wrap; }
  .present-nav-btn { flex: 1 1 auto; }
  .present-toggle { width: 100%; }
  .present-tour { gap: 0.3rem; }
  body.is-presenting.has-spotlights .main-app > :not(.flash):not(.is-spotlit):not(:has(.is-spotlit)) {
    opacity: 0.7;
  }
}

@media (max-width: 900px) {
  .nav .present-nav-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.7rem calc(1rem + 0.5vw);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav .present-nav-toggle.is-active {
    color: var(--ink);
    background: var(--accent-soft);
    border-bottom-color: var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-spotlit { animation: none !important; }
}

