:root {
  --navy: #071b61;
  --deep-navy: #061448;
  --gold: #bf9447;
  --logo-gold: #b78f4b;
  --soft-gold: #f0e4c9;
  --paper: #ffffff;
  --ink: #171923;
  --muted: #72747c;
  --line: #deded9;
  --white: #fff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body:not(.is-authenticated) > .site-header,
body:not(.is-authenticated) > main { display: none; }

.login-screen {
  align-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(191,148,71,.16), transparent 30%),
    linear-gradient(135deg, #061448 0%, #071b61 58%, #102d83 100%);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
}
.login-screen[hidden] { display: none; }
.login-card {
  background: var(--white);
  border-top: 4px solid var(--gold);
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
  max-width: 420px;
  padding: 42px 44px 46px;
  width: 100%;
}
.login-logo { display: block; height: 72px; margin: 0 auto 18px; object-fit: contain; width: 72px; }
.login-eyebrow { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .16em; margin: 0 0 12px; text-align: center; text-transform: uppercase; }
.login-card h1 { color: var(--deep-navy); font-size: 40px; line-height: 1; margin: 0 0 12px; text-align: center; }
.login-copy { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 28px; text-align: center; }
.login-form { display: grid; gap: 8px; }
.login-form label { color: var(--deep-navy); font-size: 12px; font-weight: 700; margin-top: 8px; }
.login-form input { border: 1px solid #aeb7c5; border-radius: 5px; color: var(--ink); padding: 11px 12px; width: 100%; }
.login-form input:focus { border-color: var(--gold); outline: 2px solid rgba(191,148,71,.2); }
.login-form button { background: var(--deep-navy); border: 1px solid var(--deep-navy); color: var(--white); cursor: pointer; font-size: 13px; font-weight: 700; margin-top: 18px; padding: 12px; }
.login-form button:hover { background: var(--navy); }
.login-error { color: #a33d3d; font-size: 12px; margin: 8px 0 0; }
.login-error[hidden] { display: none; }

main { padding-left: 230px; }
body:not(.matter-selected) main { padding-left: 0; }
body:not(.matter-selected) .hero > .hero-color-block { display: none; }

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

button { border-radius: 0; }

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0;
  max-width: none;
  padding: 15px 48px;
  position: relative;
  box-shadow: none;
  z-index: 3;
}
.site-header::after { background: var(--logo-gold); bottom: 4px; content: ""; height: 1px; left: 0; position: absolute; right: 0; }

.matter-sidebar {
  background: var(--white);
  border: 1px solid #e7e5df;
  border-radius: 9px;
  box-shadow: 0 18px 45px rgba(7,27,97,.08);
  left: 0;
  height: calc(100vh - 112px);
  min-height: calc(100vh - 112px);
  overflow: auto;
  position: absolute;
  top: 112px;
  width: 300px;
  z-index: 2;
}
.matter-sidebar[hidden] { display: none; }
.matter-sidebar-enter { animation: matter-sidebar-enter .55s cubic-bezier(.22,.8,.25,1); }
@keyframes matter-sidebar-enter {
  from { opacity: 0; transform: translateX(260px) scale(.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.matter-results-fly-in .matter-list-item { animation: matter-card-fly-in .65s cubic-bezier(.22,.8,.25,1) both; }
.matter-results-fly-in .matter-list-item:nth-child(1) { animation-delay: 0s; }
.matter-results-fly-in .matter-list-item:nth-child(2) { animation-delay: .08s; }
.matter-results-fly-in .matter-list-item:nth-child(3) { animation-delay: .16s; }
.matter-results-fly-in .matter-list-item:nth-child(4) { animation-delay: .24s; }
@keyframes matter-card-fly-in {
  from { opacity: 0; transform: translateX(700px) scale(.82); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.matter-sidebar::after { background: var(--gold); border-radius: 9px 0 0 9px; content: ""; height: 100%; left: 0; position: absolute; top: 0; width: 4px; }
.matter-sidebar-inner { color: var(--muted); display: flex; flex-direction: column; font-size: 12px; padding: 18px 20px 24px 16px; }
.matter-results { display: flex; flex-direction: column; }
.matter-sidebar-heading { align-items: flex-start; display: flex; justify-content: space-between; }
.matter-sidebar h2 { color: var(--muted); font-family: Newsreader, Georgia, serif; font-size: 18px; line-height: 1; margin: 0 0 13px; }
.matter-sidebar-actions { align-items: center; display: flex; gap: 6px; }
.matter-demo-button { align-items: center; background: transparent; border: 0; color: var(--muted); cursor: pointer; display: inline-flex; font-size: 13px; gap: 8px; padding: 0; }
.matter-demo-icon { align-items: center; background: var(--logo-gold); border: 1px solid var(--logo-gold); border-radius: 50%; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--logo-gold); color: var(--deep-navy); display: inline-flex; font-size: 17px; height: 24px; justify-content: center; line-height: 1; transition: box-shadow .2s ease, transform .2s ease; width: 24px; }
.matter-demo-button:hover { color: var(--deep-navy); }
.matter-demo-button:hover .matter-demo-icon { box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px rgba(183,143,75,.42); transform: scale(1.04); }
.matter-search { align-items: center; border: 1px solid #d9d7d1; border-radius: 6px; display: flex; gap: 6px; margin-bottom: 20px; margin-top: 24px; max-width: 88%; padding: 6px 8px; }
.matter-search:focus-within { border-color: var(--gold); outline: 2px solid rgba(191,148,71,.18); }
.matter-search svg { flex: 0 0 15px; height: 15px; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.7; width: 15px; }
.matter-search input { border: 0; color: var(--muted); font-size: 11px; min-width: 0; outline: 0; width: 100%; }
.matter-list { display: grid; gap: 7px; }
.matter-list-item { align-items: center; background: #fff; border: 1px solid #e7e5df; border-radius: 6px; color: var(--muted); cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; max-width: 88%; padding: 8px 9px; text-align: left; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.matter-list-item:hover { border-color: var(--gold); transform: none; }
.matter-list-item.selected { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(191,148,71,.18); }
.matter-list-details { display: grid; gap: 4px; min-width: 0; }
.matter-row-actions { align-items: center; display: flex; flex: 0 0 auto; gap: 2px; }
.matter-list-item .matter-create-form { background: #fff; flex: 1 0 100%; margin-top: 4px; max-width: 100%; }
.matter-list-item strong { color: #000; font-size: 14px; font-weight: 400; line-height: 1.3; }
.matter-list-item small { color: #000; font-size: 11px; text-transform: capitalize; }
.matter-edit-button { align-items: center; background: transparent; border: 0; border-radius: 4px; color: var(--muted); cursor: pointer; display: flex; flex: 0 0 22px; height: 22px; justify-content: center; padding: 3px; }
.matter-edit-button:hover { background: #f0efeb; color: var(--gold); }
.matter-row-save-button { color: var(--gold); }
.matter-edit-button svg { fill: none; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 15px; }
.matter-list-empty { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 8px 0; }
.matter-create-form { display: grid; gap: 6px; margin-top: 4px; }
.matter-create-form[hidden] { display: none; }
.matter-landing { margin: 0 auto; max-width: 1400px; padding: 10px 2vw 70px; }
.matter-landing[hidden] { display: none; }
.matter-landing-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 26px; }
.matter-landing-heading h1 { color: var(--deep-navy); font-size: 36px; margin: 0; }
.matter-landing-actions { align-items: center; display: flex; gap: 18px; margin-top: 10px; }
.matter-landing-edit, .matter-landing-add { align-items: center; background: transparent; border: 0; color: var(--muted); cursor: pointer; display: inline-flex; font-size: 13px; gap: 7px; padding: 0; }
.matter-landing-edit { font-size: 15px; }
.matter-landing-edit svg { background: var(--logo-gold); border: 1px solid var(--logo-gold); border-radius: 50%; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--logo-gold); fill: none; height: 28px; padding: 6px; stroke: var(--deep-navy); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; transition: box-shadow .2s ease, transform .2s ease; width: 28px; }
.matter-landing-edit:hover, .matter-landing-add:hover { color: var(--deep-navy); }
.matter-landing-edit.is-active { color: var(--deep-navy); }
.matter-landing-edit svg.is-check { padding: 7px; }
.matter-bulk-delete { align-items: center; background: transparent; border: 0; color: #b14d4d; cursor: pointer; display: inline-flex; font-size: 13px; gap: 7px; padding: 0; }
.matter-bulk-delete[hidden] { display: none; }
.matter-bulk-delete:hover { color: #8e3030; }
.matter-bulk-delete:disabled { cursor: not-allowed; opacity: .5; }
.matter-landing-add { gap: 9px; }
.matter-landing-add span { align-items: center; background: var(--logo-gold); border: 1px solid var(--logo-gold); border-radius: 50%; box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--logo-gold); color: var(--deep-navy); display: inline-flex; font-size: 17px; height: 28px; justify-content: center; transition: box-shadow .2s ease, transform .2s ease; width: 28px; }
.matter-landing-edit:hover svg,
.matter-landing-add:hover span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 5px rgba(183,143,75,.42); transform: scale(1.04); }
.matter-landing-results .matter-results { display: block; }
.matter-landing-results .matter-search { margin: 0 0 26px; max-width: 310px; }
.matter-landing-results .matter-list { gap: 32px 46px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.matter-landing-results .matter-list-item { border-color: #e7e5df; border-left: 3px solid var(--gold); border-radius: 4px; height: 104px; max-width: none; padding: 12px 14px; position: relative; width: 228px; }
.matter-landing-results .matter-list-item.is-editing { height: auto; min-height: 280px; padding: 12px 10px; }
.matter-landing-results .matter-list-item.bulk-editing { padding-left: 38px; }
.matter-bulk-checkbox { appearance: none; background: #fff; border: 1.5px solid var(--logo-gold); border-radius: 50%; cursor: pointer; height: 16px; left: 12px; margin: 0; position: absolute; top: 14px; width: 16px; }
.matter-bulk-checkbox:checked { background: var(--logo-gold); border-color: var(--logo-gold); box-shadow: inset 0 0 0 3px #fff; }
.matter-bulk-checkbox:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.matter-landing-results .matter-list-item strong { color: #000; font-size: 14px; }
.matter-landing-results .matter-list-item small { font-size: 11px; }
.matter-landing-results .matter-list-item .matter-create-form[hidden] { display: none; }
.matter-landing-results .matter-list-item.is-editing .matter-create-form { display: grid; gap: 6px; margin-top: 8px; max-width: 100%; }
.matter-landing-results .matter-list-item.is-editing .matter-create-form label { color: #000; font-size: 13px; font-weight: 400; }
.matter-landing-results .matter-list-item.is-editing .matter-create-form input,
.matter-landing-results .matter-list-item.is-editing .matter-create-form textarea,
.matter-landing-results .matter-list-item.is-editing .matter-create-form select { color: #000; font-size: 13px; max-width: 100%; }
.matter-landing-results .matter-row-actions { bottom: 9px; position: absolute; right: 11px; }
.matter-landing-results .matter-edit-button { height: 30px; width: 30px; }
.matter-landing-results .matter-edit-button svg { height: 18px; width: 18px; }
.matter-landing > .matter-create-form.is-new-matter { border: 0; margin: 0 0 28px; max-width: 240px; padding: 0; }
.matter-landing > .matter-create-form.is-new-matter input,
.matter-landing > .matter-create-form.is-new-matter textarea,
.matter-landing > .matter-create-form.is-new-matter select { max-width: 232px; }
.matter-landing > .matter-create-form.is-new-matter label { color: #000; font-size: 13px; font-weight: 400; }
.matter-landing > .matter-create-form.is-new-matter input,
.matter-landing > .matter-create-form.is-new-matter textarea,
.matter-landing > .matter-create-form.is-new-matter select { color: #000; font-size: 13px; }
.matter-create-form.is-new-matter { background: #fff; border: 1px solid #d9d7d1; border-radius: 6px; margin-top: 4px; max-width: 88%; padding: 12px 14px; }
.matter-create-form.is-new-matter input, .matter-create-form.is-new-matter textarea, .matter-create-form.is-new-matter select { max-width: 100%; }
.matter-create-form label { color: var(--deep-navy); font-size: 11px; font-weight: 700; }
.matter-create-form input, .matter-create-form textarea, .matter-create-form select { background: var(--white); border: 1px solid #aeb7c5; border-radius: 7px; color: var(--ink); font-size: 12px; max-width: 88%; padding: 7px 8px; resize: vertical; width: 100%; }
.matter-create-form input:focus, .matter-create-form textarea:focus, .matter-create-form select:focus { border-color: var(--gold); outline: 2px solid rgba(191,148,71,.18); }
.matter-save-button { background: var(--white); border: 1px solid #8f9baa; border-radius: 7px; color: var(--deep-navy); cursor: pointer; font-size: 10px; font-weight: 700; padding: 6px 12px; transition: background-color .15s ease, border-color .15s ease; }
.matter-header-save-button { padding: 4px 9px; }
.matter-save-button:hover { background: #eef4fa; border-color: var(--deep-navy); }
.matter-save-button:disabled { cursor: wait; opacity: .65; }
.matter-edit-actions { display: flex; gap: 6px; margin-top: 4px; }
.matter-inline-button { background: var(--white); border: 1px solid #8f9baa; border-radius: 6px; color: var(--deep-navy); cursor: pointer; font-size: 11px; font-weight: 700; padding: 5px 10px; }
.matter-inline-button:hover { background: #eef4fa; border-color: var(--deep-navy); }
.matter-delete-button { color: #9a5b5b; }
.matter-inline-button:disabled { cursor: wait; opacity: .65; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); }

.brand img { display: block; height: 72px; object-fit: contain; width: 72px; }

.dashboard-button { align-items: center; background: transparent; border: 0; color: var(--logo-gold); cursor: pointer; display: inline-flex; font-size: 13px; gap: 7px; margin-right: auto; padding: 0 0 0 82px; }
.dashboard-button[hidden] { display: none; }
.dashboard-icon { color: var(--logo-gold); display: inline-flex; font-size: 24px; line-height: 1; position: relative; top: -2px; }
.dashboard-button:hover { color: var(--logo-gold); }
.top-nav { align-items: center; display: flex; gap: 28px; }
.header-note { color: var(--logo-gold); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.build-version { border-left: 1px solid var(--logo-gold); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; padding-left: 28px; }

.hero { margin: 0 auto; max-width: 1500px; min-height: calc(100vh - 107px); padding: 0 1vw 125px; }
.selected-matter-header { background: var(--white); border: 1px solid #e7e5df; border-left: 4px solid var(--gold); border-radius: 6px; box-shadow: 0 8px 22px rgba(7,27,97,.05); margin: 4px auto 18px; max-width: none; padding: 14px 16px; }
.selected-matter-title { color: var(--gold); font-size: 13px; font-weight: 700; letter-spacing: .08em; margin-bottom: 8px; text-transform: uppercase; }
.selected-matter-grid { display: grid; gap: 10px 18px; grid-template-columns: minmax(180px, 1.2fr) minmax(220px, 2fr) minmax(90px, .7fr); }
.selected-matter-field { align-content: start; display: grid; gap: 3px; min-width: 0; }
.selected-matter-field > span { color: var(--muted); font-size: 13px; font-weight: 600; }
.selected-matter-field > strong { color: var(--muted); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.selected-matter-name-field > strong { color: var(--deep-navy); font-size: 16px; }
.hero-color-block { background: var(--white); border: 0; border-radius: 9px; min-height: 0; margin: 0 auto; max-width: none; overflow: hidden; padding: 14px 0; position: relative; top: 0; }
.hero-color-block::after { display: none; }
.eyebrow { align-items: center; color: var(--gold); display: flex; font-size: 11px; font-weight: 700; gap: 8px; justify-content: center; letter-spacing: .15em; text-transform: uppercase; }
.eyebrow-dot { background: var(--gold); border-radius: 50%; display: inline-block; height: 6px; width: 6px; }
h1, h2 { font-family: Newsreader, Georgia, serif; font-weight: 400; letter-spacing: -.045em; }
h1 { color: var(--white); font-size: clamp(66px, 9vw, 132px); line-height: .86; margin: 48px 0 25px; }
h1 em, h2 em { color: var(--gold); font-style: italic; }
.hero-copy { color: rgba(255, 255, 255, .72); font-size: 15px; line-height: 1.65; margin: 0; }
.workflow-selector { align-items: center; color: var(--deep-navy); display: flex; font-size: 11px; font-weight: 600; gap: 8px; justify-content: flex-start; letter-spacing: .08em; margin: 0 auto 4px; max-width: 1320px; text-transform: uppercase; }
.workflow-selector[hidden] { display: none; }
.workflow-dropdown { position: relative; }
.workflow-dropdown-trigger { align-items: center; background: transparent; border: 0; color: var(--deep-navy); cursor: pointer; display: flex; font: inherit; font-size: 13px; gap: 12px; letter-spacing: .02em; min-width: 110px; padding: 4px 0; text-align: left; text-transform: none; }
.workflow-dropdown-trigger:disabled { cursor: default; opacity: 1; }
.workflow-dropdown-trigger:hover,
.workflow-dropdown-trigger:focus-visible { color: var(--deep-navy); outline: 0; }
.workflow-dropdown-chevron { border-right: 2px solid currentColor; border-top: 2px solid currentColor; display: inline-block; height: 8px; margin-top: -4px; transform: rotate(135deg); width: 8px; }
.workflow-dropdown-trigger[aria-expanded="true"] .workflow-dropdown-chevron { transform: rotate(-45deg) translate(-2px, 2px); }
.workflow-dropdown-menu { background: var(--white); border: 1px solid #d9d7d1; box-shadow: 0 8px 20px rgba(7,27,97,.08); left: -8px; min-width: 126px; padding: 4px 0; position: absolute; top: calc(100% + 4px); z-index: 4; }
.workflow-dropdown-option { background: transparent; border: 0; color: var(--deep-navy); cursor: pointer; display: block; font: inherit; font-size: 13px; padding: 7px 8px; text-align: left; width: 100%; }
.workflow-dropdown-option:hover,
.workflow-dropdown-option[aria-selected="true"] { background: #f5f5f3; color: var(--deep-navy); }
.workflow-mode-native { display: none; }
.workflow-grid { display: grid; gap: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 auto; max-width: none; width: 100%; }
.workflow-tile[data-workflow="Matter Setup"], .workflow-subtitles[data-workflow="Matter Setup"] { display: none; }
.workflow-tile[data-block="2"] { grid-column: 1; grid-row: 1; }
.workflow-tile[data-block="3"] { grid-column: 3; grid-row: 1; }
.workflow-tile[data-block="4"] { grid-column: 2; grid-row: 1; }
.workflow-tile[data-block="5"] { grid-column: 4; grid-row: 1; }
.workflow-tile[data-block="6"] { grid-column: 5; grid-row: 1; }
.workflow-tile { align-items: flex-start; aspect-ratio: auto; background: var(--navy); border: 1px solid rgba(255,255,255,.42); border-radius: 6px; color: var(--white); cursor: pointer; display: flex; flex-direction: column; gap: 4px; justify-content: flex-start; min-height: 78px; padding: 8px; position: relative; text-align: left; transition: background .2s, border-color .2s, transform .2s; }
.workflow-tile:hover { background: var(--deep-navy); border-color: var(--gold); transform: translateY(-2px); }
.workflow-tile.selected { background: var(--deep-navy); border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(191,148,71,.45); }
.workflow-tile.active { background: var(--deep-navy); border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(191,148,71,.45); }
.workflow-icon { align-items: center; background: var(--gold); border: 1px solid var(--gold); border-radius: 50%; color: var(--deep-navy); display: flex; flex: 0 0 32px; height: 32px; justify-content: center; width: 32px; }
.workflow-icon svg { height: 18px; width: 18px; }
.workflow-label { font-size: 15px; font-weight: 600; line-height: 1.18; position: relative; top: 4px; }
.workflow-tile:first-child .workflow-label { font-size: 15px; }
.workflow-subtitles { background: transparent; border: 0; border-radius: 0; display: grid; gap: 10px; grid-template-columns: 1fr; margin-top: 0; padding: 0 4px; position: relative; }
.workflow-subtitles[data-block="2"] { grid-column: 1; grid-row: 2; }
.workflow-subtitles[data-block="3"] { grid-column: 3; grid-row: 2; }
.workflow-subtitles[data-block="4"] { grid-column: 2; grid-row: 2; }
.workflow-subtitles[data-block="5"] { grid-column: 4; grid-row: 2; }
.workflow-subtitles[data-block="6"] { grid-column: 5; grid-row: 2; }
.workflow-subtitles.selected { display: grid; }
.workflow-submenu-header { display: none; }
.workflow-submenu-chevron,
.workflow-item-chevron { border-right: 2px solid currentColor; border-top: 2px solid currentColor; display: inline-block; height: 8px; width: 8px; }
.workflow-submenu-chevron { transform: rotate(-45deg) translateY(2px); }
.workflow-submenu-item { align-items: center; background: var(--white); border: 1px solid #d9d7d1; border-radius: 7px; color: var(--deep-navy); cursor: pointer; display: flex; font: inherit; gap: 6px; height: 40px; padding: 4px 8px; text-align: left; transition: background .2s, border-color .2s, transform .2s; }
.workflow-submenu-item:hover,
.workflow-submenu-item.selected { background: #f5f5f3; border-color: var(--gold); transform: translateY(-1px); }
.workflow-submenu-icon { align-items: center; background: #fff; border: 1px solid #e7e5df; border-radius: 6px; color: var(--gold); display: flex; flex: 0 0 26px; height: 26px; justify-content: center; width: 26px; }
.workflow-submenu-icon svg { height: 17px; width: 17px; }
.workflow-submenu-copy { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.workflow-submenu-copy strong { color: #000; font-size: 13px; font-weight: 400; line-height: 1.2; }
.workflow-submenu-copy small { color: #000; font-size: 11px; line-height: 1.2; }
.workflow-item-chevron { border-width: 1.5px; color: var(--muted); flex: 0 0 8px; height: 8px; transform: rotate(45deg); width: 8px; }
.workflow-status-control { align-items: center; color: var(--muted); display: inline-flex; flex: 0 0 auto; gap: 4px; margin-left: auto; padding: 2px 4px; }
.workflow-status-control:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.workflow-status-check { color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1; }
.workflow-status-badge { background: #f0efeb; border-radius: 4px; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1; padding: 4px 5px; }
.workflow-status-control.is-done .workflow-status-check { color: #558b5f; }
.workflow-status-control.is-done .workflow-status-badge { background: #e8f2e9; color: #46734d; }
.workflow-status-control[data-status="in progress"] .workflow-status-badge,
.workflow-status-control[data-status="waiting"] .workflow-status-badge,
.workflow-status-control[data-status="draft"] .workflow-status-badge { background: #fff0df; color: #f58220; }
.workflow-status-control[data-status="list"] .workflow-status-badge { background: #e8edf2; color: #637083; }
.workflow-status-control[data-status="pending"] .workflow-status-badge { background: #fff0df; color: #f58220; }
.workflow-sync-button { background: var(--gold); border: 1px solid var(--gold); border-radius: 5px; bottom: 8px; color: var(--deep-navy); font-size: 10px; font-weight: 700; line-height: 1; padding: 4px 8px; position: absolute; right: 8px; text-decoration: none; }
.workflow-sync-button:hover { background: #d0a65b; border-color: #d0a65b; }
.workflow-arrow { color: var(--gold); font-size: 24px; margin-left: auto; }

.workflow-panel {
  background: var(--white);
  border: 1px solid #e7e5df;
  box-shadow: 0 20px 60px rgba(7, 27, 97, .08);
  display: block;
  margin: 22px 0 0;
  padding: 28px;
  position: relative;
  z-index: 1;
}
.workflow-panel[hidden] { display: none; }
.workflow-panel-heading { display: none; }
.workflow-panel-heading h2 { font-size: clamp(42px, 5vw, 70px); margin-top: 16px; }
.workflow-panel-heading p:last-child { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 330px; }
.workflow-panel-body { align-items: stretch; display: flex; flex-direction: column; min-width: 0; }
.workflow-panel .upload-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0;
  max-width: none;
  padding: 0;
  width: 100%;
  text-align: left;
}
.workflow-panel .upload-card[hidden] { display: none; }
.workflow-related-content { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.workflow-related-content[hidden] { display: none; }
.related-card { align-items: flex-start; background: #faf9f5; border: 1px solid #e7e5df; display: flex; flex-direction: column; gap: 12px; justify-content: flex-end; min-height: 210px; padding: 20px; }
.related-card span { color: var(--gold); font-size: 11px; font-weight: 700; }
.related-card strong { color: var(--deep-navy); font-size: 17px; }
.related-card small { color: var(--muted); font-size: 11px; }
.workflow-selection-card { background: transparent; border: 0; gap: 8px; justify-content: flex-start; min-height: 0; padding: 0; }
.error-message { color: #a54539; }
.upload-card.dragover { border-color: var(--gold); box-shadow: 0 20px 60px rgba(191, 148, 71, .14); }
.upload-card-top { align-items: flex-start; display: flex; justify-content: space-between; padding: 0 4px 21px; }
.upload-action-row { align-items: center; display: flex; gap: 10px; }
.upload-title { color: var(--deep-navy); font-size: 17px; font-weight: 600; margin: 0 0 5px; }
.upload-subtitle { color: #999aa0; font-size: 12px; margin: 0; }
.upload-mark { color: var(--gold); font-size: 26px; line-height: 1; }
.upload-area { align-items: center; background: #faf9f5; border: 1px dashed #d7d0c1; cursor: pointer; display: flex; flex-direction: column; min-height: 155px; justify-content: center; transition: background .2s, border-color .2s; }
.upload-area:hover, .upload-card.dragover .upload-area { background: #f7f0e2; border-color: var(--gold); }
.upload-icon { align-items: center; background: var(--soft-gold); border-radius: 50%; color: var(--navy); display: flex; height: 45px; justify-content: center; margin-bottom: 15px; width: 45px; }
.upload-icon svg { height: 24px; width: 24px; }
.upload-prompt { color: var(--deep-navy); font-size: 14px; }
.upload-prompt span { color: var(--gold); }
#file-input { display: none; }
.primary-button { background: var(--navy); border: 0; color: white; cursor: pointer; display: flex; font-size: 13px; font-weight: 600; justify-content: space-between; margin-top: 16px; padding: 17px 18px; transition: background .2s, transform .2s; width: 100%; }
.upload-trigger { align-items: center; background: #f1f1f3; border: 0; border-radius: 9px; color: #252631; display: inline-flex; font-size: 13px; gap: 8px; isolation: isolate; justify-content: flex-start; margin-top: 0; overflow: hidden; padding: 9px 11px; position: relative; width: auto; }
.upload-trigger::before { background: #dddddf; content: ""; inset: 0; position: absolute; transform: scaleY(0); transform-origin: bottom; transition: transform .22s ease; z-index: 0; }
.upload-trigger > * { position: relative; z-index: 1; }
.upload-trigger:hover:not(:disabled) { background: #e8e8eb; color: #252631; transform: none; }
.upload-trigger svg { height: 17px; width: 17px; }
.upload-button-label { color: inherit !important; font-size: 13px !important; margin: 0 !important; }
.upload-file-name { color: var(--deep-navy); display: inline-block; font-size: 15px; font-weight: 600; max-width: none; overflow-wrap: anywhere; white-space: normal; }
.upload-chevron { color: #252631 !important; font-size: 17px !important; line-height: 10px !important; margin-left: 1px !important; }
.primary-button:hover:not(:disabled) { background: var(--deep-navy); transform: translateY(-1px); }
.primary-button.upload-trigger:hover:not(:disabled) { background: #e8e8eb; color: #252631; transform: none; }
.primary-button.upload-trigger:hover:not(:disabled)::before { transform: scaleY(1); }
.primary-button:disabled { cursor: not-allowed; opacity: .38; }
.primary-button span { color: var(--gold); font-size: 18px; line-height: 12px; }
.status-message { color: var(--gold); font-size: 12px; margin: 12px 0 0; min-height: 14px; text-align: center; }
.error-message { color: #b33c32; }
.field-label { color: var(--deep-navy); display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; margin: 0 4px 7px; text-transform: uppercase; }
.text-input { border: 1px solid #d9d7d1; color: var(--ink); margin: 0 0 16px; padding: 13px; width: 100%; }
.text-input:focus, .review-field textarea:focus { border-color: var(--gold); outline: 2px solid rgba(191,148,71,.18); }
.review-shell { margin: 22px 0 0; max-width: none; padding: 0; width: 100%; }
.review-progress { align-items: center; background: #faf9f5; border: 1px solid #e7e5df; color: var(--deep-navy); display: flex; gap: 14px; margin-bottom: 18px; padding: 14px 16px; }
.review-progress[hidden] { display: none; }
.review-progress-track { background: #e7e5df; flex: 1; height: 5px; overflow: hidden; }
.review-progress-track span { animation: review-progress 1.4s ease-in-out infinite; background: var(--gold); display: block; height: 100%; transform: translateX(-100%); width: 35%; }
.review-progress-detail { color: var(--muted); font-size: 11px; min-width: 150px; text-align: right; }
@keyframes review-progress { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.review-heading { align-items: flex-end; display: flex; justify-content: space-between; margin-bottom: 28px; }
.eyebrow-dark { color: var(--gold); justify-content: flex-start; }
h2 { color: var(--deep-navy); font-size: clamp(46px, 6vw, 78px); line-height: .9; margin: 12px 0 0; }
.document-status { background: var(--soft-gold); color: var(--deep-navy); font-size: 11px; font-weight: 700; padding: 9px 12px; text-transform: capitalize; }
.review-grid { display: grid; gap: 22px; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); }
.review-summary { background: transparent; border: 0; margin-bottom: 22px; padding: 0; }
.review-summary-toolbar { align-items: center; color: var(--deep-navy); display: flex; justify-content: space-between; margin-bottom: 14px; }
.review-overall-status, .issue-modal-status { background: var(--soft-gold); color: var(--deep-navy); font-size: 11px; padding: 8px 10px; }
.review-overall-status.agreed, .issue-modal-status.agreed { background: #c8f0d2; color: #1d6338; }
.review-overall-status.amended, .issue-modal-status.amended { background: #f8dfa1; color: #87570e; }
.review-summary-heading { align-items: flex-start; display: flex; justify-content: space-between; gap: 20px; }
.review-summary h3 { color: var(--deep-navy); font-family: Newsreader, Georgia, serif; font-size: 42px; font-weight: 400; margin: 8px 0 0; }
.review-summary h3 em { color: var(--gold); font-style: italic; }
.review-summary > p { color: var(--deep-navy); line-height: 1.6; margin: 18px 0; max-width: 850px; }
.review-status { background: var(--soft-gold); color: var(--deep-navy); font-size: 11px; padding: 8px 10px; text-transform: capitalize; }
.review-findings { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.decision-sections { display: grid; gap: 18px; margin-top: 24px; }
.decision-section h4 { color: var(--deep-navy); font-size: 12px; letter-spacing: .12em; margin: 0 0 10px; text-transform: uppercase; }
.decision-findings { display: flex; flex-wrap: wrap; gap: 12px; }
.decision-section[hidden] { display: none; }
.finding-card { align-items: flex-start; background: #f4f7fb; border: 0; border-left: 4px solid var(--gold); color: var(--ink); cursor: pointer; display: inline-flex; justify-self: start; max-width: 100%; min-height: 0; padding: 6px 12px; text-align: left; width: fit-content; }
.finding-card:hover { background: #f4f7fb; }
.finding-card.issue-agreed { background: #28764a; border-left-color: #9be2ad; color: white; }
.finding-card.issue-amended { background: #a66b16; border-left-color: #f5d27c; color: white; }
.finding-card.active { background: var(--navy); color: var(--white); }
.finding-card.active .finding-label { color: var(--white); }
.finding-critical, .finding-high, .finding-medium, .finding-low { border-left-color: var(--gold); }
.finding-card h4 { color: var(--ink); font-size: 15px; margin: 9px 0; }
.finding-card p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 7px 0; }
.finding-meta { align-items: center; color: var(--gold); display: flex; font-size: 10px; font-weight: 700; justify-content: space-between; text-transform: uppercase; }
.finding-label { color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.4; }
.finding-suggestion { background: #f4f7fb; margin-top: 12px; padding: 10px; }
.finding-suggestion strong { color: var(--deep-navy); font-size: 11px; }
.finding-card small { color: #a54539; display: block; font-size: 10px; margin-top: 10px; }
.issue-modal { align-items: center; background: rgba(6, 20, 72, .72); display: flex; inset: 0; justify-content: center; padding: 24px; position: fixed; z-index: 20; }
.issue-modal[hidden] { display: none; }
.issue-modal-card { background: var(--white); box-shadow: 0 24px 80px rgba(0,0,0,.28); height: 96vh; max-height: 96vh; max-width: none; overflow: hidden; width: 96vw; }
.issue-modal-header { align-items: center; display: flex; justify-content: space-between; padding: 18px 22px; }
.issue-modal-header { border-bottom: 1px solid #e7e5df; }
.issue-modal-title-row { align-items: center; display: flex; gap: 18px; min-width: 0; }
.issue-modal-header h3 { color: var(--deep-navy); font-family: Newsreader, Georgia, serif; font-size: 34px; font-weight: 400; margin: 6px 0 0; }
.modal-close-button { background: transparent; border: 0; color: var(--deep-navy); cursor: pointer; font-size: 30px; line-height: 1; padding: 2px 8px; }
.agree-button, .amend-button { border: 1px solid rgba(7, 27, 97, .12); border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; padding: 9px 16px; }
.agree-button { background: #e8f3eb; color: #28764a; }
.amend-button { background: #fff4d8; color: #87570e; }
.issue-modal-content { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); min-height: 0; padding: 22px; }
.issue-modal-pdf { border: 1px solid #e7e5df; color: var(--muted); font-size: 11px; }
.issue-modal-pdf > span { display: block; padding: 10px 12px; }
.issue-page-preview { background: #f5f5f3; height: calc(96vh - 220px); min-height: 500px; max-height: 720px; overflow: auto; position: relative; width: 100%; }
.issue-page-preview canvas { display: block; margin: 0 auto; }
.issue-page-highlight { background: rgba(31, 56, 100, .12); border: 2px solid #1f3864; border-radius: 2px; box-sizing: border-box; pointer-events: none; position: absolute; }
.issue-page-empty { color: var(--muted); font-size: 13px; padding: 18px; }
.issue-modal-source { color: var(--deep-navy); font-size: 13px; line-height: 1.55; max-height: calc(96vh - 220px); min-height: 0; overflow: auto; padding-right: 8px; }
.issue-source-heading { align-items: center; display: flex; justify-content: space-between; gap: 12px; }
.issue-source-heading span { color: var(--muted); font-size: 11px; }
.issue-modal-source p { background: var(--white); border-left: 4px solid var(--gold); cursor: pointer; margin-top: 12px; padding: 14px; white-space: pre-wrap; }
.issue-modal-source p:hover { background: #fffdf5; }
.issue-modal-decision-actions { display: flex; gap: 8px; margin-top: 14px; }
.issue-modal-source label { display: block; font-size: 12px; font-weight: 700; margin: 18px 0 7px; }
.delete-confirm-modal { align-items: center; background: rgba(6,20,72,.58); display: flex; inset: 0; justify-content: center; padding: 24px; position: fixed; z-index: 30; }
.delete-confirm-modal[hidden] { display: none; }
.delete-confirm-card { background: var(--white); border-top: 4px solid #b14d4d; box-shadow: 0 24px 80px rgba(0,0,0,.28); max-width: 390px; padding: 30px 32px 28px; text-align: center; width: 100%; }
.delete-confirm-icon { align-items: center; background: #f8e7e7; border: 1px solid #d99a9a; border-radius: 50%; color: #a33d3d; display: flex; font-size: 20px; font-weight: 700; height: 42px; justify-content: center; margin: 0 auto 15px; width: 42px; }
.delete-confirm-card h2 { color: var(--deep-navy); font-size: 28px; margin: 0 0 10px; }
.delete-confirm-card p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }
.delete-confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; }
.delete-confirm-actions .secondary-button,
.delete-confirm-button { border-radius: 6px; font-size: 12px; font-weight: 700; padding: 9px 18px; }
.delete-confirm-button { background: #b14d4d; border: 1px solid #b14d4d; color: #fff; cursor: pointer; }
.delete-confirm-button:hover { background: #8e3030; border-color: #8e3030; }
#amend-comment { border: 1px solid #d9d7d1; padding: 10px; resize: vertical; width: 100%; }
#save-amendment { margin-top: 10px; }
.review-shell.local-only .review-grid { grid-template-columns: minmax(0, 820px); }
.advice-letter-panel { background: var(--white); border: 1px solid #e7e5df; box-shadow: 0 15px 40px rgba(7,27,97,.06); margin-bottom: 22px; }
.advice-letter-heading { align-items: center; border-bottom: 1px solid #e7e5df; display: flex; justify-content: space-between; padding: 15px 18px; }
.advice-letter-export { align-items: center; background: var(--white); border: 1px solid #d9d7d1; color: var(--deep-navy); cursor: pointer; display: inline-flex; gap: 6px; font-size: 11px; font-weight: 700; padding: 8px 10px; }
.advice-letter-export:hover { border-color: var(--gold); }
.advice-letter-export svg { height: 17px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; width: 17px; }
.advice-letter-panel article { color: #000; font-family: Calibri, Arial, sans-serif; font-size: 14px; line-height: 1.45; margin: 0; max-height: 620px; overflow: auto; padding: 22px; }
.advice-letter-panel article p { margin: 0 0 14px; }
.advice-letter-draft, .advice-letter-confidential { color: #c00000; font-size: 13px; font-weight: 700; }
.advice-letter-property-address { color: #6b7280; font-size: 13px; margin: 0; }
.advice-letter-title, .advice-letter-section-heading { background: #1f3864; border-left: 0; color: #fff; font-weight: 700; padding: 9px 12px; }
.advice-letter-title { font-size: 17px; line-height: 1.35; }
.advice-letter-section-heading { font-size: 16px; margin-top: 22px !important; }
.advice-letter-metadata { font-weight: 400; }
.advice-letter-subheading { color: #2f5496; font-weight: 700; margin-top: 18px !important; }
.advice-letter-table-heading { break-after: avoid; break-before: page; color: #2f5496; font-weight: 700; margin-top: 0 !important; page-break-after: avoid; page-break-before: always; }
.advice-letter-panel article ul { margin: 0 0 16px; padding-left: 24px; }
.advice-letter-panel article li { margin: 0 0 8px; padding-left: 4px; }
.advice-letter-table { border-collapse: collapse; font-size: 13px; margin: 24px 0; min-width: 100%; table-layout: fixed; }
.advice-letter-table th { background: #1f3864; color: #fff; font-weight: 700; text-align: left; }
.advice-letter-table th, .advice-letter-table td { border: 1px solid #b7c0ce; padding: 8px 9px; vertical-align: top; }
.advice-letter-table td { background: #eef4fa; }
.advice-letter-table th:first-child, .advice-letter-table td:first-child { width: 6%; }
.advice-letter-table th:nth-child(2), .advice-letter-table td:nth-child(2) { width: 24%; }
.advice-letter-table th:nth-child(3), .advice-letter-table td:nth-child(3) { width: 35%; }
.pdf-panel, .fields-panel { border: 1px solid #e7e5df; box-shadow: 0 15px 40px rgba(7,27,97,.06); }
.panel-toolbar, .fields-heading { align-items: center; border-bottom: 1px solid #e7e5df; display: flex; gap: 10px; justify-content: space-between; padding: 13px 15px; }
.panel-toolbar { color: var(--muted); font-size: 12px; }
.secondary-button { background: var(--white); border: 1px solid #d9d7d1; color: var(--deep-navy); cursor: pointer; font-size: 12px; padding: 9px 12px; }
.secondary-button:hover { border-color: var(--gold); }
.text-link, .source-link { background: none; border: 0; color: var(--gold); cursor: pointer; font-size: 11px; text-decoration: underline; }
#pdf-preview { background: #f5f5f3; border: 0; display: block; height: 680px; width: 100%; }

@media print {
  @page { margin: 0.55in; }
  header,
  .matter-sidebar,
  footer,
  main > .hero > .hero-color-block,
  #workflow-panel > .workflow-panel-heading,
  #workflow-panel > .workflow-panel-body > #workflow-related-content,
  #workflow-panel > .workflow-panel-body > #drop-zone { display: none !important; }
  main { margin: 0; padding: 0; }
  #workflow-panel,
  #workflow-panel > .workflow-panel-body { display: block !important; }
  #review-shell { display: block !important; margin: 0; padding: 0; }
  #review-shell > #review-progress,
  #review-shell > #review-summary,
  #review-shell > .review-grid { display: none !important; }
  #advice-letter-panel,
  #advice-letter-panel * { visibility: visible; }
  #advice-letter-panel { border: 0; box-shadow: none; left: auto; margin: 0; position: static; top: auto; width: 100%; }
  #advice-letter-panel .advice-letter-heading,
  #advice-letter-panel .advice-letter-property-address { display: none; }
  #advice-letter-panel article { max-height: none; overflow: visible; padding: 0; }
  #advice-letter-panel article h1,
  #advice-letter-panel article h2,
  #advice-letter-panel article h3,
  #advice-letter-panel article p.advice-letter-section-heading { break-after: avoid; page-break-after: avoid; }
  #advice-letter-panel article p.advice-letter-table-heading { break-after: avoid; break-before: page; page-break-after: avoid; page-break-before: always; }
  #advice-letter-panel article p.advice-letter-section-heading:has(+ table) { break-after: avoid; page-break-after: avoid; }
  #advice-letter-panel article table { break-inside: auto; page-break-inside: auto; }
  #advice-letter-panel article thead { display: table-header-group; }
  #advice-letter-panel article tr { break-inside: avoid; page-break-inside: avoid; }
  .advice-letter-export { display: none; }
}
.fields-panel { background: var(--white); max-height: 730px; overflow: auto; }
.fields-heading { position: sticky; top: 0; z-index: 1; background: var(--white); }
.review-field { border-bottom: 1px solid #eceae5; padding: 16px; }
.review-field.is-conflict { background: #fff8ef; border-left: 3px solid var(--gold); }
.review-field-heading { align-items: center; display: flex; justify-content: space-between; gap: 10px; }
.review-field label { color: var(--deep-navy); font-size: 12px; font-weight: 700; text-transform: capitalize; }
.review-field textarea { border: 1px solid #deded9; display: block; margin-top: 9px; min-height: 48px; padding: 9px; resize: vertical; width: 100%; }
.review-field small { color: var(--muted); display: block; font-size: 10px; margin-top: 6px; }
.review-field details { color: var(--muted); font-size: 11px; margin-top: 9px; }
.review-field details p { background: #faf9f5; line-height: 1.45; padding: 8px; }
.confirm-button { margin: 16px; width: calc(100% - 32px); }
.retry-button { background: #fff8ef; border: 1px solid var(--gold); color: var(--deep-navy); cursor: pointer; margin: 0 16px 16px; padding: 12px; width: calc(100% - 32px); }


@media (max-width: 650px) {
  main { padding-left: 0; }
  .site-header { padding: 22px 20px; }
  .brand img { height: 64px; width: 64px; }
  .dashboard-button { padding-left: 0; }
  .header-note { display: none; }
  .hero { min-height: 0; padding: 28px 0 80px; }
  .matter-sidebar { height: auto; min-height: 0; position: relative; top: auto; width: 100%; }
  .matter-sidebar::after { height: 100%; left: 0; right: auto; width: 4px; }
  .matter-sidebar-inner { padding: 20px; }
  .hero-color-block { min-height: 0; padding: 24px; top: auto; }
  .hero-color-block::after { width: 7px; }
  .workflow-selector { margin-bottom: 4px; }
  .workflow-dropdown-trigger { min-width: 105px; }
  .workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-tile[data-block],
  .workflow-subtitles[data-block] { grid-column: 1 / -1; grid-row: auto; }
  .workflow-tile { min-height: 0; padding: 13px; }
  .workflow-panel { grid-template-columns: 1fr; margin-top: 18px; padding: 18px; }
  .workflow-panel-heading { display: none; }
  .workflow-related-content { grid-template-columns: 1fr; }
  .workflow-subtitles { grid-template-columns: 1fr; padding: 12px; }
  .workflow-panel .upload-card { padding: 19px; }
  .review-shell { padding-left: 18px; padding-right: 18px; }
  .review-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .review-grid { grid-template-columns: 1fr; }
  .review-findings { grid-template-columns: 1fr; }
  .issue-modal-content { grid-template-columns: 1fr; }
  .review-summary-heading { flex-direction: column; }
  #pdf-preview { height: 500px; }
}
