/* =====================================================================
   CEG · Boilerplate — productivity-tool styles
   ===================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--ink-50);
  font-family: var(--font-body);
  color: var(--fg-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#root { min-height: 100vh; display: flex; flex-direction: column; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--fg-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── App shell ─────────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.app-nav {
  height: 60px;
  display: flex; align-items: center;
  padding: 0 28px; gap: 24px;
  background: var(--ceg-navy);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky; top: 0; z-index: 50;
}
.app-nav.light {
  background: #fff;
  color: var(--fg-1);
  border-bottom: 1px solid var(--border-subtle);
}
.app-nav .brand { display: flex; align-items: center; gap: 12px; }
.app-nav .brand img { height: 32px; display: block; }
.app-nav .brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.app-nav .brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 13.5px;
  letter-spacing: -0.005em;
}
.app-nav .brand-sub {
  font-family: var(--font-body); font-weight: 500; font-size: 9.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-400);
  margin-top: 2px;
}
.app-nav.light .brand-sub { color: var(--cyan-600); }
.app-nav .product-tag {
  margin-left: 8px; padding: 4px 9px;
  background: rgba(0,201,255,0.14);
  color: var(--cyan-400);
  border: 1px solid rgba(0,201,255,0.32);
  border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.app-nav.light .product-tag {
  background: var(--cyan-50);
  color: var(--cyan-700);
  border: 1px solid var(--cyan-200);
}
.app-nav .nav-links { display: flex; gap: 22px; margin-left: 20px; }
.app-nav .nav-link {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  cursor: pointer; transition: color 120ms;
}
.app-nav .nav-link:hover, .app-nav .nav-link.active { color: #fff; }
.app-nav.light .nav-link { color: var(--ink-500); }
.app-nav.light .nav-link:hover, .app-nav.light .nav-link.active { color: var(--ceg-navy); }
.app-nav .nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.app-nav .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-400), var(--cyan-700));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; letter-spacing: 0.02em;
}
.app-nav .icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  transition: background 120ms, color 120ms;
}
.app-nav .icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.app-nav.light .icon-btn { color: var(--ink-500); }
.app-nav.light .icon-btn:hover { background: var(--ink-100); color: var(--ceg-navy); }

/* ─── Stepper ──────────────────────────────────────────────────────── */
.stepper-bar {
  background: #fff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px;
  display: flex; align-items: center; gap: 16px;
}
.stepper {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
}
.step {
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; transition: opacity 120ms;
}
.step .dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  color: var(--ink-500);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
  transition: all 160ms var(--ease-standard);
}
.step.done .dot { background: var(--cyan-600); color: #fff; border-color: var(--cyan-600); }
.step.active .dot {
  background: var(--ceg-navy); color: #fff; border-color: var(--ceg-navy);
  box-shadow: 0 0 0 4px rgba(0,0,48,0.10);
}
.step .label {
  font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-500);
}
.step.active .label { color: var(--ceg-navy); }
.step.done .label { color: var(--ink-700); }
.step .sep { width: 28px; height: 1.5px; background: var(--border-subtle); }
.step.done .sep { background: var(--cyan-600); }

/* ─── Main canvas ──────────────────────────────────────────────────── */
.app-main {
  flex: 1; display: flex; flex-direction: column;
  padding: 0;
}
.canvas-pad { padding: 32px 28px 80px; max-width: 1280px; margin: 0 auto; width: 100%; }
.canvas-wide { max-width: 1440px; }

/* ─── Cards ────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: 22px 24px; }

/* ─── Buttons ──────────────────────────────────────────────────────── */
.btn {
  font-family: var(--font-body);
  font-weight: 600; font-size: 13.5px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 160ms var(--ease-standard);
  white-space: nowrap;
  line-height: 1;
}
.btn .lucide { width: 15px; height: 15px; stroke-width: 2; }
.btn-primary {
  background: var(--ceg-navy); color: #fff;
}
.btn-primary:hover { background: var(--navy-700); }
.btn-primary:active { transform: translateY(1px); }
.btn-accent {
  background: var(--cyan-400); color: var(--ceg-navy);
  box-shadow: 0 6px 18px -6px rgba(0,201,255,0.55);
}
.btn-accent:hover { background: var(--cyan-300); }
.btn-ghost {
  background: transparent; color: var(--ink-700);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover { background: var(--ink-50); border-color: var(--border-strong); }
.btn-text {
  background: transparent; color: var(--ink-600); padding: 8px 10px;
}
.btn-text:hover { color: var(--ceg-navy); background: var(--ink-50); }
.btn-danger {
  background: transparent; color: var(--danger);
  border: 1px solid var(--border-subtle);
}
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 22px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ─── Eyebrow / chip ───────────────────────────────────────────────── */
.eyebrow-sm {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-700);
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--ink-100); color: var(--ink-700);
}
.chip.live { background: var(--success-bg); color: var(--success); }
.chip.beta { background: var(--warning-bg); color: #8a5a00; }
.chip.soon { background: var(--ink-100); color: var(--ink-500); }
.chip.draft { background: var(--ink-100); color: var(--ink-600); }
.chip.review { background: var(--cyan-50); color: var(--cyan-700); }
.chip.sent { background: var(--success-bg); color: var(--success); }
.chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.65;
}

/* ─── Form inputs (adapted from design system) ─────────────────────── */
.field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  color: var(--ceg-navy);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 7px;
}
.field-label .req { color: var(--danger); }
.field-label .opt { color: var(--ink-400); font-weight: 500; font-size: 10px; text-transform: none; letter-spacing: 0.04em; }
.field-label .locked-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-500);
  background: var(--ink-100);
  padding: 2px 7px; border-radius: 999px;
}
.field-label .locked-pill .lucide { width: 10px; height: 10px; stroke-width: 2.5; }

/* Image upload */
.image-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 22px 18px;
  background: var(--ink-50);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--ink-600); font-size: 13px;
  transition: border-color 120ms, background 120ms;
  text-align: center;
}
.image-drop:hover {
  border-color: var(--cyan-400);
  background: var(--cyan-50);
}
.image-drop .lucide {
  width: 26px; height: 26px;
  color: var(--ink-500); stroke-width: 1.5;
  margin-bottom: 2px;
}
.image-drop:hover .lucide { color: var(--cyan-700); }
.image-drop .ttl {
  font-weight: 600; color: var(--ceg-navy); font-size: 13px;
}
.image-drop .hint {
  font-size: 11.5px; color: var(--ink-500); line-height: 1.4;
  max-width: 42ch;
}
.image-preview {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}
.image-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.image-preview .remove-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,48,0.85); color: #fff;
  border: none; padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  display: inline-flex; align-items: center;
  transition: background 120ms;
}
.image-preview .remove-btn:hover { background: var(--ceg-navy); }
.field-row { display: flex; flex-direction: column; }
.field {
  width: 100%; box-sizing: border-box;
  height: 40px; padding: 0 14px;
  font-size: 14px; color: var(--ceg-navy);
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
.field::placeholder { color: var(--ink-400); }
.field:hover:not(:disabled) { border-color: var(--border-strong); }
.field:focus {
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 4px rgba(0,201,255,0.18);
}
.field.is-error { border-color: var(--danger); background: #FFF6F5; }
.field.is-error:focus { box-shadow: 0 0 0 4px rgba(217,45,32,0.18); }
.field:disabled, .field.is-locked {
  background: var(--ink-50);
  color: var(--ink-700);
  cursor: not-allowed;
  border-color: var(--border-subtle);
  -webkit-text-fill-color: var(--ink-700); /* Safari */
  opacity: 1;
}
.field.is-locked:focus { box-shadow: none; }
.field-shell:has(.field.is-locked) .suffix,
.field-shell:has(.field.is-locked) .prefix { color: var(--ink-500); }
textarea.field { height: auto; min-height: 84px; padding: 11px 14px; line-height: 1.55; resize: vertical; }
.field-mono { font-family: var(--font-mono); }
.field-help { font-size: 11.5px; color: var(--ink-500); margin-top: 5px; line-height: 1.45; }
.field-error { font-size: 11.5px; color: var(--danger); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.field-shell { position: relative; display: flex; align-items: center; }
.field-shell .field-icon {
  position: absolute; left: 13px;
  width: 16px; height: 16px;
  color: var(--ink-500); stroke-width: 1.75;
  pointer-events: none;
}
.field-shell.has-icon .field { padding-left: 38px; }
.field-shell .prefix {
  position: absolute; left: 14px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
  color: var(--ink-500); pointer-events: none;
}
.field-shell.has-prefix .field { padding-left: 28px; font-family: var(--font-mono); }
.field-shell .suffix {
  position: absolute; right: 6px;
  height: 28px; display: flex; align-items: center;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  color: var(--ink-500); background: var(--ink-50);
  padding: 0 9px; border-radius: 6px;
  pointer-events: none;
}
.field-shell.has-suffix .field { padding-right: 64px; font-family: var(--font-mono); }
select.field {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23637087' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* coaching box */
.coach {
  margin-top: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, var(--cyan-50), #fff);
  border: 1px solid var(--cyan-200);
  border-left: 3px solid var(--cyan-400);
  border-radius: var(--radius-md);
  font-size: 12px; line-height: 1.5;
  color: var(--ink-700);
  display: flex; gap: 8px;
}
.coach .lucide { width: 14px; height: 14px; color: var(--cyan-700); flex-shrink: 0; margin-top: 1px; stroke-width: 2; }
.coach b { color: var(--ceg-navy); font-weight: 600; }
.coach .example { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-500); }

/* Section card */
.section-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  overflow: hidden;
  transition: border-color 160ms;
}
.section-card.is-active { border-color: var(--cyan-300); box-shadow: 0 0 0 4px rgba(0,201,255,0.06); }
.section-head {
  padding: 16px 22px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, #fff, var(--ink-50));
  cursor: pointer;
}
.section-head .sec-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ink-100); color: var(--ink-600);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.section-head.complete .sec-num { background: var(--success); color: #fff; }
.section-head .sec-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 16px; color: var(--ceg-navy);
  flex: 1;
}
.section-head .sec-meta {
  font-size: 11.5px; color: var(--ink-500);
  display: flex; align-items: center; gap: 10px;
}
.section-body { padding: 24px; }

/* ─── Doc picker variants ──────────────────────────────────────────── */
.picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.picker-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  position: relative;
  transition: all 200ms var(--ease-standard);
  display: flex; flex-direction: column; gap: 12px;
}
.picker-card:hover {
  border-color: var(--cyan-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.picker-card.is-selected {
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 4px rgba(0,201,255,0.16), var(--shadow-md);
}
.picker-card.is-disabled {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
}
.picker-card .icon-wrap {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--ceg-navy), var(--navy-700));
  color: var(--cyan-400);
  display: flex; align-items: center; justify-content: center;
}
.picker-card .icon-wrap .lucide { width: 22px; height: 22px; stroke-width: 1.75; }
.picker-card h4 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 15.5px; line-height: 1.25;
  color: var(--ceg-navy); margin: 0;
}
.picker-card p {
  font-size: 12.5px; line-height: 1.5;
  color: var(--ink-500); margin: 0;
  flex: 1;
}
.picker-card .foot {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--ink-500);
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  margin-top: 2px;
}

/* Featured layout */
.picker-featured {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px;
}
.picker-featured .picker-card.featured {
  grid-row: span 2;
  background: linear-gradient(165deg, var(--ceg-navy), var(--navy-800));
  color: #fff;
  border-color: var(--navy-700);
}
.picker-featured .picker-card.featured h4 { color: #fff; font-size: 22px; }
.picker-featured .picker-card.featured p { color: rgba(255,255,255,0.72); font-size: 13.5px; }
.picker-featured .picker-card.featured .icon-wrap {
  background: rgba(0,201,255,0.16); color: var(--cyan-400);
  border: 1px solid rgba(0,201,255,0.32);
  width: 52px; height: 52px;
}
.picker-featured .picker-card.featured .icon-wrap .lucide { width: 26px; height: 26px; }
.picker-featured .picker-card.featured .foot { border-top-color: rgba(255,255,255,0.10); color: rgba(255,255,255,0.6); }

/* List layout */
.picker-list { display: flex; flex-direction: column; gap: 8px; }
.picker-list-item {
  display: grid;
  grid-template-columns: 44px 1.4fr 2fr 110px 100px 24px;
  gap: 18px; align-items: center;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 160ms var(--ease-standard);
}
.picker-list-item:hover {
  border-color: var(--cyan-300);
  box-shadow: var(--shadow-sm);
}
.picker-list-item.is-selected {
  border-color: var(--cyan-400);
  background: linear-gradient(90deg, rgba(0,201,255,0.04), #fff 40%);
  box-shadow: 0 0 0 3px rgba(0,201,255,0.14);
}
.picker-list-item .icon-wrap {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--ink-100); color: var(--ceg-navy);
  display: flex; align-items: center; justify-content: center;
}
.picker-list-item .icon-wrap .lucide { width: 18px; height: 18px; stroke-width: 1.75; }
.picker-list-item .ttl { font-weight: 600; font-size: 14px; color: var(--ceg-navy); }
.picker-list-item .desc { font-size: 12.5px; color: var(--ink-500); line-height: 1.45; }
.picker-list-item .meta { font-size: 11.5px; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.picker-list-item .meta .lucide { width: 13px; height: 13px; }
.picker-list-item .arrow { color: var(--ink-400); }

/* ─── Greeting page ────────────────────────────────────────────────── */
.hero-greet {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: stretch;
  margin-bottom: 28px;
}
.greet-panel {
  background: linear-gradient(165deg, var(--ceg-navy) 0%, var(--navy-800) 60%, var(--navy-700) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 36px 36px 32px;
  position: relative;
  overflow: hidden;
}
.greet-panel::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 110%, rgba(0,201,255,0.22), transparent 50%),
    radial-gradient(circle at 30% 0%, rgba(0,140,178,0.18), transparent 50%);
  pointer-events: none;
}
.greet-panel > * { position: relative; }
.greet-panel .eyebrow-sm { color: var(--cyan-400); }
.greet-panel h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 44px; line-height: 1.05; letter-spacing: -0.02em;
  margin: 12px 0 8px; color: #fff;
}
.greet-panel h1 .accent { color: var(--cyan-400); }
.greet-panel .lead {
  font-size: 16px; line-height: 1.6;
  color: rgba(255,255,255,0.78);
  max-width: 56ch; margin: 0 0 24px;
}
.greet-cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.greet-panel .pillars {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.greet-panel .pillar {
  font-size: 11px; color: rgba(255,255,255,0.6);
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
}
.greet-panel .pillar .num {
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  color: #fff; letter-spacing: -0.01em;
  display: block; margin-bottom: 4px;
  text-transform: none;
}

.recent-panel {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px 24px 18px;
  display: flex; flex-direction: column;
}
.recent-panel .head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.recent-panel .head h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 17px; color: var(--ceg-navy); margin: 0;
}
.recent-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.recent-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 120ms;
}
.recent-item:hover { background: var(--ink-50); }
.recent-item .doc-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--ink-100); color: var(--ceg-navy);
  display: flex; align-items: center; justify-content: center;
}
.recent-item .doc-icon .lucide { width: 14px; height: 14px; stroke-width: 2; }
.recent-item .title-wrap { min-width: 0; }
.recent-item .title { font-size: 13.5px; font-weight: 600; color: var(--ceg-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item .sub { font-size: 11.5px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item .right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.recent-item .meta { font-size: 11px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.recent-panel .foot {
  margin-top: 10px; padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; align-items: center;
}

/* ─── Page header ──────────────────────────────────────────────────── */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 22px;
}
.page-head h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 28px; line-height: 1.1; letter-spacing: -0.015em;
  color: var(--ceg-navy); margin: 0;
}
.page-head .lead {
  font-size: 14px; color: var(--ink-500);
  margin-top: 6px; max-width: 60ch; line-height: 1.55;
}
.page-head .right { display: flex; gap: 10px; align-items: center; }

/* ─── Form layout (step 3) ─────────────────────────────────────────── */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.form-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; }

/* Completeness meter */
.completeness {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.completeness .ttl {
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-600);
  display: flex; justify-content: space-between; align-items: baseline;
}
.completeness .pct {
  font-family: var(--font-mono); font-size: 28px; font-weight: 600;
  color: var(--ceg-navy); margin: 8px 0 10px;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.completeness .bar {
  height: 6px; background: var(--ink-100);
  border-radius: var(--radius-pill); overflow: hidden;
}
.completeness .bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-500), var(--cyan-400));
  transition: width 360ms var(--ease-standard);
}
.completeness ul { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.completeness li {
  font-size: 12px; color: var(--ink-600);
  display: flex; align-items: center; gap: 8px;
}
.completeness li .lucide { width: 14px; height: 14px; stroke-width: 2; }
.completeness li.done { color: var(--ink-500); text-decoration: line-through; text-decoration-color: var(--ink-300); }
.completeness li.done .lucide { color: var(--success); }
.completeness li.todo .lucide { color: var(--ink-400); }
.completeness li.warn .lucide { color: var(--warning); }

/* AI sidebar card */
.ai-side {
  background: linear-gradient(165deg, var(--ceg-navy), var(--navy-800));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative; overflow: hidden;
}
.ai-side::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(0,201,255,0.18), transparent 60%);
  pointer-events: none;
}
.ai-side > * { position: relative; }
.ai-side .ttl {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan-400);
  display: flex; align-items: center; gap: 6px;
}
.ai-side .ttl .lucide { width: 13px; height: 13px; stroke-width: 2; }
.ai-side h4 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 16px; margin: 8px 0 6px; line-height: 1.3;
  color: #fff;
}
.ai-side p {
  font-size: 12.5px; line-height: 1.55;
  color: rgba(255,255,255,0.72); margin: 0;
}

/* ─── Draft preview (step 4) ───────────────────────────────────────── */
.draft-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}
.draft-doc {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.draft-doc-head {
  padding: 22px 32px;
  background: linear-gradient(180deg, var(--ink-50), #fff);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 18px;
}
.draft-doc-head .ttl {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; color: var(--ceg-navy); margin: 0;
  letter-spacing: -0.01em; line-height: 1.15;
}
.draft-doc-head .sub {
  font-size: 12px; color: var(--ink-500);
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.draft-doc-head .right { display: flex; gap: 8px; }

.draft-body {
  padding: 4px 0 0;
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--ink-800);
  font-size: 14.5px; line-height: 1.7;
}
.draft-sec {
  position: relative;
  padding: 22px 32px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 160ms;
}
.draft-sec:hover { background: var(--ink-50); }
.draft-sec.is-selected {
  background: linear-gradient(90deg, var(--cyan-50), #fff 60%);
}
.draft-sec.is-selected::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--cyan-400);
}
.draft-sec .check {
  position: absolute; top: 22px; left: 8px;
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: all 120ms;
}
.draft-sec.is-selected .check {
  background: var(--cyan-400); border-color: var(--cyan-400);
}
.draft-sec.is-selected .check .lucide { color: var(--ceg-navy); width: 12px; height: 12px; stroke-width: 3; }
.draft-sec .check .lucide { color: transparent; width: 12px; height: 12px; }
.draft-sec h3 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; color: var(--ceg-navy);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin: 0 0 12px 0;
  display: flex; align-items: center; gap: 10px;
}
.draft-sec h3 .num {
  font-family: var(--font-mono); font-weight: 600;
  color: var(--ink-500); font-size: 12.5px;
  letter-spacing: 0;
}
.draft-sec p { margin: 0 0 12px; }
.draft-sec p:last-child { margin-bottom: 0; }
.draft-sec strong { color: var(--ink-900); font-weight: 700; }
.draft-sec .filled {
  background: var(--cyan-50);
  padding: 1px 5px; border-radius: 3px;
  font-style: normal; color: var(--ink-900);
  font-weight: 500;
  border-bottom: 1.5px dotted var(--cyan-500);
}
.draft-sec .ai-note {
  margin-top: 8px;
  display: flex; gap: 8px; align-items: flex-start;
  font-family: var(--font-body);
  font-size: 12px; color: var(--cyan-700);
  padding: 8px 12px;
  background: var(--cyan-50);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--cyan-400);
}
.draft-sec .ai-note .lucide { width: 13px; height: 13px; stroke-width: 2; flex-shrink: 0; margin-top: 2px; }

/* AI chat panel */
.ai-panel {
  position: sticky; top: 80px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 100px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.ai-panel-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #fff, var(--ink-50));
}
.ai-panel-head .ai-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ceg-navy), var(--navy-700));
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan-400);
  border: 1px solid var(--navy-700);
}
.ai-panel-head .ai-avatar .lucide { width: 16px; height: 16px; stroke-width: 2; }
.ai-panel-head .ttl { flex: 1; }
.ai-panel-head h4 { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ceg-navy); margin: 0; line-height: 1.1; }
.ai-panel-head .sub { font-size: 11px; color: var(--ink-500); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.ai-panel-head .sub::before { content:''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(34,160,107,0.18); }

.ai-context {
  padding: 12px 18px;
  background: var(--cyan-50);
  border-bottom: 1px solid var(--cyan-200);
  font-size: 11.5px; color: var(--cyan-700);
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
}
.ai-context .lucide { width: 13px; height: 13px; stroke-width: 2; }
.ai-context .count {
  font-family: var(--font-mono); font-weight: 700;
  background: var(--cyan-400); color: var(--ceg-navy);
  padding: 1px 6px; border-radius: 4px;
  font-size: 10.5px;
}

.ai-msgs {
  flex: 1; overflow-y: auto;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.ai-msg { display: flex; gap: 10px; align-items: flex-start; }
.ai-msg .bubble {
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px; line-height: 1.55;
  max-width: 90%;
}
.ai-msg.bot .av {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ceg-navy), var(--navy-700));
  color: var(--cyan-400);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--navy-700);
}
.ai-msg.bot .av .lucide { width: 13px; height: 13px; stroke-width: 2; }
.ai-msg.bot .bubble {
  background: var(--ink-50);
  color: var(--ink-800);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: 4px;
}
.ai-msg.user { flex-direction: row-reverse; }
.ai-msg.user .av {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--cyan-400);
  color: var(--ceg-navy);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.ai-msg.user .bubble {
  background: var(--ceg-navy);
  color: #fff;
  border-top-right-radius: 4px;
}
.ai-msg .bubble .src {
  margin-top: 7px; padding-top: 7px;
  border-top: 1px solid var(--border-subtle);
  font-size: 10.5px; color: var(--ink-500);
  display: flex; align-items: center; gap: 5px;
}
.ai-msg .bubble .src .lucide { width: 11px; height: 11px; stroke-width: 2; }
.ai-msg .bubble .escalate {
  margin-top: 7px;
  background: var(--warning-bg);
  border: 1px solid #f0d68a;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #6b4900;
  display: flex; align-items: flex-start; gap: 6px;
}
.ai-msg .bubble .escalate .lucide { width: 13px; height: 13px; stroke-width: 2; color: #b07700; flex-shrink: 0; margin-top: 1px; }

.ai-input {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 14px;
  background: #fff;
}
.ai-input .row {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--ink-50);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px 4px 4px 12px;
  transition: border-color 120ms, box-shadow 120ms;
}
.ai-input .row:focus-within {
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 4px rgba(0,201,255,0.16);
}
.ai-input textarea {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 13px; line-height: 1.5; padding: 8px 0;
  resize: none; min-height: 22px; max-height: 120px;
  color: var(--ceg-navy);
}
.ai-input .send-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none; cursor: pointer;
  background: var(--cyan-400); color: var(--ceg-navy);
  display: flex; align-items: center; justify-content: center;
  transition: all 120ms;
}
.ai-input .send-btn:hover { background: var(--cyan-300); }
.ai-input .send-btn:disabled { background: var(--ink-200); color: var(--ink-400); cursor: not-allowed; }
.ai-input .quick-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 8px;
}
.ai-input .quick {
  font-size: 11px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--ink-600);
  transition: all 120ms;
}
.ai-input .quick:hover { color: var(--ceg-navy); border-color: var(--cyan-400); background: var(--cyan-50); }

/* Footer action bar */
.action-bar {
  position: sticky; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--border-subtle);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  z-index: 30;
  box-shadow: 0 -4px 16px -8px rgba(0,0,48,0.06);
}
.action-bar .left, .action-bar .right { display: flex; align-items: center; gap: 10px; }
.action-bar .status {
  font-size: 12px; color: var(--ink-500);
  display: flex; align-items: center; gap: 6px;
}
.action-bar .status .lucide { width: 13px; height: 13px; }

/* ─── Delivery (step 5) ────────────────────────────────────────────── */
.delivery {
  display: grid; grid-template-columns: 1fr 320px;
  gap: 24px; align-items: start;
}
.delivery-doc {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.delivery-doc .preview-strip {
  padding: 8px 14px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid #c7e5d4;
}
.delivery-doc .preview-strip .lucide { width: 13px; height: 13px; stroke-width: 2.2; }
.delivery-options { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 80px; }
.deliv-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 160ms;
}
.deliv-card:hover { border-color: var(--cyan-300); box-shadow: var(--shadow-sm); }
.deliv-card.primary {
  background: linear-gradient(165deg, var(--ceg-navy), var(--navy-800));
  color: #fff;
  border-color: var(--navy-700);
}
.deliv-card.primary p { color: rgba(255,255,255,0.72); }
.deliv-card .row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.deliv-card .row .lucide { width: 18px; height: 18px; stroke-width: 1.75; }
.deliv-card .primary .row .lucide { color: var(--cyan-400); }
.deliv-card h5 { font-family: var(--font-display); font-weight: 600; font-size: 14.5px; margin: 0; }
.deliv-card p { font-size: 12px; line-height: 1.5; margin: 0; color: var(--ink-500); }
.deliv-card.primary h5 { color: #fff; }
.deliv-card .footrow {
  margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.deliv-card .approver {
  font-size: 11px; color: rgba(255,255,255,0.6);
  display: flex; align-items: center; gap: 6px;
}
.deliv-card .approver .av {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-400), var(--cyan-700));
  color: var(--ceg-navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700;
}

/* ─── Misc ─────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-subtle); margin: 16px 0; }
.subtle { color: var(--ink-500); }
.spacer { flex: 1; }
.flex { display: flex; }
.flex-row { display: flex; flex-direction: row; gap: 10px; align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: 10px; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px 22px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* density variants */
body.density-compact .section-body { padding: 16px 18px; }
body.density-compact .grid-2 { gap: 12px 16px; }
body.density-compact .grid-3 { gap: 12px 16px; }
body.density-compact .picker-grid { gap: 12px; }
body.density-comfy .section-body { padding: 32px 32px; }
body.density-comfy .grid-2 { gap: 22px 26px; }
body.density-comfy .grid-3 { gap: 22px 26px; }
body.density-comfy .picker-grid { gap: 20px; }

/* fade-in */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp 280ms var(--ease-standard) both; }
.fade-in-d2 { animation: fadeUp 280ms var(--ease-standard) 80ms both; }
.fade-in-d3 { animation: fadeUp 280ms var(--ease-standard) 160ms both; }

/* typing indicator */
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-400);
  animation: typing 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* spinner (busy state on action buttons) */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
