* { box-sizing: border-box; }

:root {
  --bg: #12141c;
  --surface: #1c1f2b;
  --text: #e7e9f0;
  --muted: #9aa0b4;
  --border: #333748;
  --header-bg: #0b0d14;
  --accent: #3f5daa;
  --accent-text: #ffffff;
  --secondary: #545b6e;
  --danger: #c0392b;
  --input-bg: #14161f;
  --shadow: 0 1px 3px rgba(0,0,0,0.5);
  --link: #8ab4ff;
  --link-hover: #b3cdff;
  --accent2: #e8862e;
  --accent2-hover: #f4a15a;
  --accent2-text: #1a1206;
}

:root[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6c757d;
  --border: #e2e2e6;
  --header-bg: #16213e;
  --accent: #16213e;
  --accent-text: #ffffff;
  --secondary: #6c757d;
  --danger: #a4161a;
  --input-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --link: #1a56db;
  --link-hover: #123fa8;
  --accent2: #d9651b;
  --accent2-hover: #b8530f;
  --accent2-text: #ffffff;
}

body { font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:visited { color: var(--link); }
header { background: var(--header-bg); color: white; padding: 16px 120px 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
header a { color: white; text-decoration: none; }
header .header-left { display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; letter-spacing: 0.2px; }
.brand img { display: block; width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 700; font-size: 21px; letter-spacing: -0.01em; }
.brand-tagline { font-size: 11.5px; font-weight: 400; letter-spacing: 0.02em; color: rgba(255,255,255,0.72); }
.footer-brand .brand-tagline { color: var(--muted); }
main { max-width: 960px; margin: 24px auto; padding: 0 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent2);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
h1, h2, h3 { margin-top: 0; }
ol { padding-left: 22px; }
ol li::marker { color: var(--accent2); font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { border-bottom: 2px solid var(--accent2); }
form.inline { display: inline; }
label { display: block; margin-top: 10px; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; background: var(--input-bg); color: var(--text); }
button { background: var(--accent); color: var(--accent-text); border: none; padding: 10px 16px; border-radius: 4px; cursor: pointer; margin-top: 12px; font-size: 14px; }
button.secondary { background: var(--secondary); }
button.danger { background: var(--danger); }
/* Reserved for the one primary call-to-action per page (e.g. "Start my
   application") -- a second accent so it doesn't blend into every other
   blue button on the page. */
button.cta { background: var(--accent2); color: var(--accent2-text); font-weight: 600; }
button.cta:hover { background: var(--accent2-hover); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; color: white; background: #6c757d; }
.badge.error { background: #a4161a; }
.badge.task { background: var(--accent2); color: var(--accent2-text); }
.badge.info { background: #0f4c81; }
.badge.urgent { background: #7a1520; box-shadow: 0 0 0 1px #ff6b6b inset; }
.urgent-banner { background: #3a1414; border: 1px solid #ff6b6b; color: #ffd6d6; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.urgent-banner h3 { margin-top: 0; color: #ff8080; }
.urgent-banner a { color: #ffd6d6; font-weight: 600; }
:root[data-theme="light"] .urgent-banner { background: #fdeceb; border-color: #c0392b; color: #6b1414; }
:root[data-theme="light"] .urgent-banner h3 { color: #a4161a; }
:root[data-theme="light"] .urgent-banner a { color: #a4161a; }
.error-msg { color: #e0574a; margin-bottom: 12px; }
:root[data-theme="light"] .error-msg { color: #a4161a; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#sig-pad { border: 1px solid var(--border); touch-action: none; background: #fff; }

/* Help menu: native <details>/<summary> dropdown, no JS required to
   open/close (a small script only closes it on an outside click). */
.help-menu { position: fixed; top: 16px; right: 64px; z-index: 1000; }
.help-menu > summary {
  list-style: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-size: 16px;
  font-weight: 700;
  transition: border-color 0.15s ease;
}
.help-menu > summary:hover { border-color: var(--accent2); color: var(--accent2); }
.help-menu > summary::-webkit-details-marker { display: none; }
.help-menu .menu-panel {
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 230px;
  padding: 8px 0;
}
.help-menu .menu-section-label { padding: 10px 16px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.help-menu .menu-panel a { display: block; padding: 8px 16px; color: var(--text); text-decoration: none; font-size: 14px; }
.help-menu .menu-panel a:hover { background: var(--bg); color: var(--link); }
.help-menu .menu-panel hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* Footer */
.site-footer { max-width: 960px; margin: 40px auto 0; padding: 32px 16px 24px; border-top: 1px solid var(--border); }
.site-footer .footer-top { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; margin-bottom: 24px; }
.site-footer .footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.site-footer .footer-brand img { width: 28px; height: 28px; display: block; }
.site-footer .footer-tagline { color: var(--muted); font-size: 13px; margin-top: 10px; max-width: 260px; line-height: 1.5; }
.site-footer .footer-cols { display: flex; gap: 40px; flex-wrap: wrap; }
.site-footer .footer-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
.site-footer .footer-col a { display: block; font-size: 14px; color: var(--text); text-decoration: none; margin-bottom: 8px; }
.site-footer .footer-col a:hover { color: var(--link); }
.site-footer .footer-bottom { border-top: 1px solid var(--border); padding-top: 16px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item > summary { cursor: pointer; font-weight: 600; list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::before { content: "+"; display: inline-block; width: 16px; color: var(--accent2); font-weight: 700; }
.faq-item[open] > summary::before { content: "\2212"; }
.faq-item p { margin: 10px 0 0 24px; color: var(--muted); line-height: 1.6; }

#theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease;
}
#theme-toggle:hover { border-color: var(--accent2); }

/* ==========================================================================
   Workbench homepage (views/site/workbench.ejs) - scoped to body.workbench
   so nothing here touches any other page's layout. Deliberately breaks from
   the app's internal "card grid" pattern used everywhere else (that pattern
   is right for a staff tool; the public homepage needs to read as a real
   firm's front door).
   ========================================================================== */
body.workbench {
  font-family: "Source Sans 3", -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
body.workbench .display {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
}

.wb-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent2);
  color: var(--accent2-text);
  padding: 10px 16px;
  z-index: 2000;
  border-radius: 0 0 6px 0;
}
.wb-skip-link:focus { left: 0; }

.wb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px;
}
.wb-header .brand { color: var(--text); }
.wb-header .brand-tagline { color: var(--muted); }
.wb-header .brand-name { font-family: "Fraunces", Georgia, serif; font-size: 24px; font-weight: 600; }
.wb-header nav { display: flex; gap: 22px; align-items: center; font-size: 14px; }
.wb-header nav a { color: var(--text); text-decoration: none; font-weight: 600; opacity: 0.85; transition: opacity 0.15s ease; }
.wb-header nav a:hover { opacity: 1; color: var(--link); }

.wb-hero {
  position: relative;
  overflow: hidden;
  padding: 0 24px 64px;
  isolation: isolate;
}
.wb-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 620px;
  z-index: -2;
  background:
    radial-gradient(560px 360px at 18% 20%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(480px 420px at 82% 8%, color-mix(in srgb, var(--accent2) 22%, transparent), transparent 70%);
  filter: blur(4px);
}
/* Fixed, low-opacity SVG-noise overlay to keep the gradient from reading as
   a flat digital fade (redesign-skill: "flat design with zero texture"). */
.wb-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.wb-hero-inner { max-width: 1240px; margin: 0 auto; padding-top: 32px; }
.wb-eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 18px;
}
.wb-hero h1 {
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  max-width: 16ch;
  text-wrap: balance;
}
.wb-hero-lede {
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 8px;
}
.wb-hero-note {
  max-width: 58ch;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  border-left: 2px solid var(--accent2);
  padding-left: 14px;
  margin-top: 24px;
}

.wb-section { max-width: 1240px; margin: 0 auto; padding: 8px 24px 72px; }
.wb-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.wb-section-head h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.01em; margin: 0; }
.wb-section-head p { color: var(--muted); max-width: 46ch; margin: 6px 0 0; font-size: 14.5px; }

/* Asymmetric bento grid, not three equal columns. Debt Review is the
   established/most-complete pipeline, so it gets the larger tile. */
.wb-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-areas: "big top" "big bottom";
  gap: 18px;
}
.wb-tile {
  position: relative;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 180px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}
.wb-tile:hover, .wb-tile:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent2) 55%, var(--border));
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent2) 45%, transparent);
  outline: none;
}
.wb-tile:active { transform: translateY(-1px) scale(0.995); }
.wb-tile--big { grid-area: big; }
.wb-tile--top { grid-area: top; }
.wb-tile--bottom { grid-area: bottom; }
.wb-tile-index {
  position: absolute;
  top: 20px;
  right: 22px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 46px;
  font-weight: 500;
  color: var(--border);
  line-height: 1;
  user-select: none;
}
.wb-tile-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent2); }
.wb-tile h3 { font-family: "Fraunces", Georgia, serif; font-size: 25px; margin: 8px 0 10px; letter-spacing: -0.01em; }
.wb-tile p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0; max-width: 46ch; }
.wb-tile-cta { font-size: 13.5px; font-weight: 700; color: var(--link); display: inline-flex; align-items: center; gap: 6px; }
.wb-tile-cta .arrow { transition: transform 0.2s ease; }
.wb-tile:hover .wb-tile-cta .arrow { transform: translateX(4px); }

@media (max-width: 860px) {
  .wb-grid { grid-template-columns: 1fr; grid-template-areas: "big" "top" "bottom"; }
}

/* Modal: native <dialog>, styled - no JS framework/library needed. */
dialog.wb-modal {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
}
dialog.wb-modal::backdrop { background: rgba(6, 7, 12, 0.6); backdrop-filter: blur(3px); }
.wb-modal-scroll { overflow-y: auto; max-height: min(88vh, 760px); padding: 30px 30px 26px; }
.wb-modal-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent2); }
.wb-modal h2 { font-family: "Fraunces", Georgia, serif; font-size: 27px; margin: 8px 0 14px; }
.wb-modal p.lede { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 0 0 18px; }
.wb-modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin: 14px 14px 0 0;
  padding: 0;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.wb-modal-close:hover { border-color: var(--accent2); color: var(--accent2); }
.wb-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.wb-modal hr.wb-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0 18px; }
.wb-contact-status { font-size: 13.5px; margin-top: 10px; display: none; }
.wb-contact-status.is-visible { display: block; }
.wb-contact-status.ok { color: var(--link); }
.wb-contact-status.err { color: var(--danger); }

.wb-firm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.wb-firm-figure {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
}
.wb-firm-figure dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.wb-firm-figure dt { color: var(--muted); }
.wb-firm-figure dd { margin: 0; font-weight: 600; }
@media (max-width: 860px) { .wb-firm { grid-template-columns: 1fr; } }

.wb-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.wb-footer a { color: var(--muted); }
.wb-footer a:hover { color: var(--link); }
