:root {
  color-scheme: light;
  --paper: #f8f8f3;
  --surface: #fffefa;
  --ink: #233731;
  --muted: #52645b;
  --forest: #173f35;
  --deep: #11372e;
  --leaf: #285845;
  --wash: #e7efe5;
  --line: #d8dfd4;
  --line-strong: #bdcabc;
  --gold: #b29662;
  --amber: #754715;
  --amber-wash: #f5ead6;
  --red: #973e39;
  --serif: "Hedvig Letters Serif", "Baskerville", Georgia, serif;
  --sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 100%;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, dl, dd, ul, ol { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary, a[href] { cursor: pointer; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--leaf); text-underline-offset: .18em; }
a:hover { color: var(--deep); }
button:disabled, input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
:focus-visible { outline: 3px solid #427e61; outline-offset: 3px; }
.sidebar :focus-visible, .auth-story :focus-visible { outline-color: #e2c891; }
::selection { background: #d3e7d3; color: #153d2f; }
svg { display: inline-block; vertical-align: middle; flex-shrink: 0; }
img, iframe { max-width: 100%; }
button svg, .btn svg { width: 1.08rem; height: 1.08rem; }
h1 { font: 400 clamp(2.22rem, 3.65vw, 3.65rem)/1.06 var(--serif); color: var(--forest); letter-spacing: -.045em; }
h2 { font-size: 1.22rem; line-height: 1.27; font-weight: 620; letter-spacing: -.033em; }
h3 { font-size: 1.02rem; line-height: 1.35; font-weight: 620; letter-spacing: -.018em; }
h4 { font-size: .925rem; line-height: 1.35; }
small { font-size: .8125rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Firm workspace */
.app-shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  display: flex; flex-direction: column; align-self: start; position: sticky; top: 0;
  height: 100vh; height: 100dvh; overflow-y: auto; padding: 2.05rem 1rem 1.12rem;
  color: #ecf2e9; background: var(--forest); border-right: 1px solid #204b3e; z-index: 10;
}
.brand {
  display: inline-flex; align-items: center; gap: .65rem; width: fit-content; color: inherit;
  font: 500 1.86rem/1 var(--serif); letter-spacing: -.055em; text-decoration: none;
}
.sidebar .brand { margin: 0 .52rem 1.6rem; color: #f4f4e8; }
.brand-mark {
  display: inline-grid; place-items: center; flex: none; width: 2.22rem; height: 2.22rem;
  color: #243e2d; background: #dbd9b0; border-radius: .56rem; font: 600 1.13rem/1 var(--serif);
  letter-spacing: -.08em;
}
.brand-mark svg { width: 1.36rem; height: 1.36rem; }
.firm-name {
  margin: 0 .45rem 1.3rem; padding: .9rem 0 1.05rem; color: #d6e3d8;
  border-block: 1px solid #3a5e50; font-size: .875rem; font-weight: 550; overflow-wrap: anywhere;
}
.sidebar nav { display: grid; align-content: start; gap: .25rem; }
.sidebar nav + nav { margin-top: 1.15rem; }
.nav-item {
  border: 1px solid transparent; background: transparent; color: #d9e4da; width: 100%;
  min-height: 2.7rem; padding: .63rem .75rem; display: flex; align-items: center; gap: .73rem;
  text-align: left; border-radius: .48rem; font-size: .925rem; font-weight: 525; text-decoration: none;
}
.nav-item svg { width: 1.08rem; height: 1.08rem; opacity: .89; }
.nav-item:hover { color: #fff; background: #224c3f; }
.nav-item.active, .nav-item[aria-current="page"] { color: #f5f7ed; background: #305747; border-color: #446955; }
.sidebar-foot {
  margin-top: auto; padding: 1.05rem .45rem 0; border-top: 1px solid #3a5e50; color: #d7e5d9;
  font-size: .84rem; overflow-wrap: anywhere;
}
.sidebar-foot > * + * { margin-top: .4rem; }
.sidebar-foot a { color: inherit; }
.sidebar-foot .btn { color: #e5eee4; border-color: #577364; background: transparent; }
.sidebar-foot .btn:hover { background: #2b5142; }
.main { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .7rem 1rem;
  min-height: 4.5rem; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: .78rem clamp(1.2rem, 3.5vw, 3.5rem);
}
.topbar-left, .topbar-right { display: flex; align-items: center; flex-wrap: wrap; min-width: 0; gap: .72rem; }
.topbar-right { margin-left: auto; }
.context { color: var(--muted); font-size: .88rem; font-weight: 520; overflow-wrap: anywhere; }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 2.1rem; height: 2.1rem;
  border: 1px solid #c5d4c5; border-radius: 50%; background: #e8eee2; color: var(--forest);
  font-weight: 650; font-size: .78rem; text-transform: uppercase;
}
.page {
  width: min(100%, 88rem); margin-inline: auto; display: flex; flex-direction: column; align-items: stretch;
  gap: 1.5rem; padding: clamp(1.4rem, 3.5vw, 3rem) clamp(1.2rem, 3.5vw, 3.5rem) 3.5rem;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: .85rem 1.4rem; margin-bottom: .1rem;
}
.page-head > :first-child { min-width: 0; }
.eyebrow { color: var(--muted); font-size: .76rem; font-weight: 680; line-height: 1.5; letter-spacing: .105em; text-transform: uppercase; }
.eyebrow + h1, .eyebrow + h2 { margin-top: .42rem; }
.lead { color: var(--muted); margin-top: .65rem; max-width: 62ch; font-size: 1rem; }
.mono { font: .875em/1.5 "IBM Plex Mono", Consolas, monospace; overflow-wrap: anywhere; }

/* Controls and status */
.btn, .mobile-menu {
  display: inline-flex; align-items: center; justify-content: center; gap: .48rem;
  min-height: 2.65rem; border: 1px solid var(--line-strong); border-radius: .5rem;
  padding: .58rem .95rem; color: var(--forest); background: var(--surface);
  font-size: .9rem; line-height: 1.35; font-weight: 600; text-align: center;
  text-decoration: none; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.btn:not(:disabled):hover, .mobile-menu:hover { color: var(--forest); background: #edf2e9; border-color: #9eb39f; }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fffef7; }
.btn.primary:not(:disabled):hover { background: #235241; border-color: #235241; color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.small { min-height: 2.15rem; padding: .38rem .68rem; font-size: .82rem; }
.btn.danger, .danger.btn { color: var(--red); background: #fff9f7; border-color: #dcb8ae; }
.danger { color: var(--red); }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; width: fit-content;
  max-width: 100%; padding: .22rem .55rem; border-radius: 4rem; background: var(--wash);
  color: #28503c; font-size: .78rem; line-height: 1.4; font-weight: 600;
}
.pill.amber { color: var(--amber); background: var(--amber-wash); }
.pill.gray { color: #4c5a58; background: #edf0ec; }
.notice, .sample-banner {
  padding: .85rem 1.05rem; border: 1px solid #c8d9c9; border-radius: .58rem;
  background: #edf3e9; color: #344d3a; overflow-wrap: anywhere; font-size: .925rem;
}
.notice.danger { color: #7e352f; background: #fcf0ea; border-color: #e7c6b9; }
.sample-banner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .4rem 1rem; color: #654b23; background: #f4ecd9; border-color: #e6d7b6; }
.sample-banner a, .sample-banner button { color: inherit; }
.sample-banner strong, .notice strong { font-weight: 650; }
.empty { padding: 1.7rem 1.25rem; color: var(--muted); text-align: center; font-size: .94rem; }
.empty > * + * { margin-top: .6rem; }

/* Inventory, work queues and project records */
.metrics {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: .72rem; overflow: hidden;
}
.metric { flex: 1 1 10rem; min-width: 0; padding: 1.15rem 1.45rem; color: var(--muted); font-size: .88rem; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric-value { display: block; color: var(--forest); margin-block: .22rem; font: 400 clamp(1.95rem, 3.1vw, 2.75rem)/1.1 var(--serif); letter-spacing: -.045em; font-variant-numeric: lining-nums tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem; align-items: start; }
.panel, .form-card {
  min-width: 0; padding: clamp(1rem, 2.1vw, 1.5rem); background: var(--surface);
  border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 2px 5px rgba(39, 55, 42, .025);
}
.panel-head, .modal-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem .75rem; margin-bottom: 1rem;
}
.panel-head p, .panel-head small, .row-copy small, .row-copy p, .detail dt, .timeline small { color: var(--muted); }
.panel-head p { font-size: .9rem; margin-top: .24rem; }
.panel > p + p, .panel > h2 + p, .panel > h3 + p { margin-top: .5rem; }
.list { display: flex; flex-direction: column; min-width: 0; }
.row {
  display: flex; width: 100%; align-items: center; gap: .78rem; min-width: 0;
  padding: .9rem 0; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); text-align: left; text-decoration: none;
}
.row:last-child { border-bottom-color: transparent; }
button.row:hover, a.row:hover { background: #eef3eb; color: var(--ink); }
.row-icon {
  flex: none; display: grid; place-items: center; width: 2.55rem; height: 2.55rem;
  color: var(--forest); border: 1px solid #cfdbcc; border-radius: .56rem; background: #edf2e8;
}
.row-icon svg { width: 1.18rem; height: 1.18rem; }
.row-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.row-copy strong, .row-copy small { display: block; }
.row-copy strong { font-size: .96rem; font-weight: 600; }
.row-copy small, .row-copy p { margin-top: .13rem; font-size: .84rem; }
.toolbar, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .7rem; }
.toolbar > input, .toolbar > select { width: auto; max-width: 100%; }
.toolbar + .list, .toolbar + .table-wrap, .toolbar + table { margin-top: .9rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .34rem; border-bottom: 1px solid var(--line); }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: .6rem .77rem; font-size: .9rem; font-weight: 570; }
.tab.active, .tab[aria-selected=true] { color: var(--forest); border-bottom-color: var(--forest); }
.tab:hover { background: var(--wash); }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: .82rem .65rem; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
th { font-size: .82rem; font-weight: 600; color: var(--muted); background: #f3f5ef; }
tbody tr:last-child td { border-bottom: 0; }
.timeline { display: grid; gap: 0; padding: 0; list-style: none; }
.timeline > :is(li, div) { position: relative; padding: 0 0 1.24rem 1.65rem; }
.timeline > :is(li, div)::before { content: ""; position: absolute; left: .1rem; top: .4rem; width: .65rem; height: .65rem; border-radius: 50%; background: #477159; }
.timeline > :is(li, div):not(:last-child)::after { content: ""; position: absolute; top: 1.04rem; bottom: -.43rem; left: .39rem; width: 1px; background: var(--line-strong); }
.timeline > :last-child { padding-bottom: .2rem; }
.timeline p { margin-top: .15rem; color: var(--muted); font-size: .9rem; }
.detail { overflow-wrap: anywhere; }
dl.detail > div, .detail dl > div { display: flex; justify-content: space-between; gap: .75rem; padding: .56rem 0; border-bottom: 1px solid var(--line); }
.detail dd { text-align: right; }
.price { color: var(--forest); font: 400 2.4rem/1.12 var(--serif); letter-spacing: -.04em; }

/* Forms and overlays */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .95rem 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; color: var(--ink); font-size: .9rem; font-weight: 570; }
.field > small { color: var(--muted); font-weight: 400; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
  min-width: 0; width: 100%; min-height: 2.75rem; border: 1px solid #849585; border-radius: .45rem;
  padding: .61rem .72rem; background: #fffefa; color: var(--ink); font-size: 1rem; font-weight: 400; line-height: 1.42;
}
textarea { resize: vertical; min-height: 6rem; }
select { appearance: auto; }
input::placeholder, textarea::placeholder { color: #647268; opacity: 1; }
input[type=checkbox], input[type=radio] { width: 1.06rem; height: 1.06rem; flex: none; accent-color: var(--leaf); }
.check { display: flex; align-items: flex-start; gap: .62rem; font-size: .94rem; cursor: pointer; }
.check input { margin: .22rem 0 0; }
fieldset { min-width: 0; margin: 0; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .48rem; }
legend { padding: 0 .3rem; font-weight: 600; font-size: .91rem; }
form > .field + .field, form > .fields + :is(.field, .notice, .actions), form > .actions,
.form-card > form, form > .check + .actions { margin-top: 1rem; }
.shade {
  position: fixed; inset: 0; z-index: 40; display: grid; align-items: center; justify-items: center;
  overflow: auto; padding: 1.25rem; background: rgba(17, 37, 28, .46);
}
.modal, dialog {
  background: var(--surface); color: var(--ink); width: min(100%, 35rem); max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2.5rem); overflow: auto; padding: 1.4rem;
  border: 1px solid var(--line); border-radius: .85rem; box-shadow: 0 .9rem 3.2rem #14261c30;
}
dialog::backdrop { background: rgba(17, 37, 28, .46); }
.modal-head h2, dialog > h2 { font: 400 1.8rem/1.16 var(--serif); color: var(--forest); }
.modal-body > * + * { margin-top: .95rem; }
.modal-foot { margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .58rem; }
.toast {
  position: fixed; right: 1.25rem; bottom: max(1.25rem, env(safe-area-inset-bottom)); z-index: 60;
  max-width: min(28rem, calc(100% - 2.5rem)); padding: .86rem 1.1rem;
  background: var(--deep); border: 1px solid #517361; border-radius: .58rem; color: #fffef8;
  box-shadow: 0 .4rem 1.4rem #1d35252e; overflow-wrap: anywhere;
}
.toast:empty { display: none; }

/* Front door */
.auth-layout {
  display: grid; grid-template-columns: minmax(0, .96fr) minmax(0, 1.04fr);
  min-height: 100vh; min-height: 100dvh; background: var(--paper);
}
.auth-story {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start; gap: 1.25rem;
  padding: clamp(2.2rem, 6vw, 6.8rem); color: #f5f3e7; background-color: var(--forest);
  background-image: radial-gradient(ellipse at 78% 110%, #315e4b 0%, transparent 56%);
}
.auth-story::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none; opacity: .48;
  bottom: -13rem; right: -7rem; width: 29rem; height: 29rem;
  border-radius: 50%; border: 1px solid #90a484;
  box-shadow: 0 0 0 1rem #ffffff00, 0 0 0 calc(1rem + 1px) #839a78,
    0 0 0 2rem #173f35, 0 0 0 calc(2rem + 1px) #839a78,
    0 0 0 3rem #173f35, 0 0 0 calc(3rem + 1px) #839a78,
    0 0 0 4rem #173f35, 0 0 0 calc(4rem + 1px) #839a78;
}
.auth-story .brand { color: #fffcef; margin-bottom: clamp(.6rem, 4vw, 3rem); }
.auth-story .eyebrow { color: #d4dfc9; }
.auth-story h1, .auth-story h2 {
  max-width: 13ch; font: 400 clamp(2.8rem, 5.4vw, 5.2rem)/1.01 var(--serif);
  color: #fffdef; letter-spacing: -.058em; text-wrap: balance;
}
.auth-story p:not(.eyebrow) { max-width: 38ch; font-size: 1.02rem; color: #e2e9db; }
.auth-main { min-width: 0; padding: clamp(1.3rem, 5vw, 5rem); display: grid; align-content: center; justify-items: center; }
.auth-card { width: min(100%, 28rem); }
.auth-card h1, .auth-card h2 { font: 400 clamp(2rem, 3.4vw, 2.9rem)/1.1 var(--serif); color: var(--forest); letter-spacing: -.04em; }
.auth-card > * + * { margin-top: 1rem; }
.auth-card p { color: var(--muted); }
.auth-card form { display: grid; gap: .9rem; }
.auth-card form > .field + .field, .auth-card form > .actions { margin-top: 0; }
.auth-card form > .btn { width: 100%; }

.mobile-menu { display: none; }
@media (min-width: 1540px) {
  .app-shell { grid-template-columns: 16.5rem minmax(0, 1fr); }
}
@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 13.8rem minmax(0, 1fr); }
  .page { gap: 1.1rem; }
  .grid { gap: 1rem; }
  .metric { padding: 1rem 1.1rem; }
}
@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 32; width: min(17.5rem, calc(100% - 3.4rem));
    transform: translateX(-102%); visibility: hidden; transition: transform .18s ease, visibility .18s;
  }
  .app-shell.menu-open .sidebar { visibility: visible; transform: translateX(0); box-shadow: .8rem 0 2.5rem #12281f30; }
  .mobile-menu { display: inline-flex; height: 2.75rem; min-width: 2.75rem; padding: .46rem; }
  .topbar { min-height: 3.9rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 690px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-story { padding: 1.6rem 1.3rem 1.85rem; gap: .7rem; }
  .auth-story .brand { margin: 0 0 .45rem; font-size: 1.55rem; }
  .auth-story h1, .auth-story h2 { max-width: 19ch; font-size: 2.55rem; }
  .auth-story::after { width: 18rem; height: 18rem; bottom: -15rem; right: -8rem; }
  .auth-story p:not(.eyebrow) { font-size: .95rem; }
  .auth-main { padding: 1.85rem 1.15rem 2.5rem; align-content: start; }
  .auth-layout { grid-template-rows: auto 1fr; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .metric { flex: 1 1 6.7rem; padding: .85rem .75rem; }
  .topbar { padding-inline: 1rem; }
  .page { padding-inline: 1rem; }
  .row { flex-wrap: wrap; column-gap: .6rem; }
  .row-copy { min-width: min(8rem, 60%); }
  .row .actions { margin-left: auto; }
}
@media (max-width: 430px) {
  .page { padding-inline: .82rem; }
  .topbar { gap: .45rem; padding-inline: .8rem; }
  .topbar-left, .topbar-right { gap: .4rem; }
  .topbar-right { max-width: 100%; }
  .page-head { align-items: start; }
  .toolbar > input, .toolbar > select { width: 100%; }
  .metric { flex-basis: 6.4rem; }
  .metric + .metric { border-left: 0; }
  .shade { padding: .65rem; }
  .modal, dialog { padding: 1rem; }
  .btn, .tab, .nav-item, .btn.small, .check { min-height: 2.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .btn, .pill, .avatar, .brand-mark, .nav-item, .row-icon { border: 1px solid ButtonText; }
  .nav-item.active, .tab.active { outline: 2px solid Highlight; }
}
