/* Benchmark Practice Management — page styles */
:root {
  --navy: #0E1E45;
  --navy-deep: #08142F;
  --gold: #B98A3E;
  --gold-soft: #E9DCC4;
  --ink: #1B2433;
  --muted: #5B6577;
  --paper: #F4F6F9;
  --surface: #FFFFFF;
  --rule: #D6DBE4;
  --danger: #9B2C2C;
  --danger-bg: #FBEDED;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--navy); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2 { font-family: var(--serif); font-weight: 600; color: var(--navy); line-height: 1.2; }
h1 { font-size: 1.85rem; margin: 0 0 1.5rem; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }

/* ---- Masthead ---- */
.masthead { background: var(--navy); border-bottom: 3px solid var(--gold); }
.masthead-inner {
  max-width: 72rem; margin: 0 auto; padding: .85rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 2rem;
}
.wordmark { font-family: var(--serif); font-size: 1.15rem; color: #fff; text-decoration: none; letter-spacing: .01em; }
.mainnav { display: flex; gap: 1.25rem; flex: 1; }
.mainnav a { color: #C9D1E3; text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.mainnav a:hover { color: #fff; }
.mainnav a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.signout { display: flex; align-items: center; gap: .75rem; margin: 0; color: #C9D1E3; font-size: .9rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--gold-soft); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: #fff; }

/* ---- Page body ---- */
.page { max-width: 72rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.panel { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--navy); padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.empty { color: var(--muted); margin: 0; max-width: 60ch; }
.meta { color: var(--muted); font-size: .9rem; }

/* ---- Forms ---- */
label { display: block; font-weight: 600; font-size: .92rem; margin: 1rem 0 .3rem; }
input[type="text"], input[type="email"], input[type="password"], input:not([type]) {
  width: 100%; padding: .65rem .75rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #AEB6C4; border-radius: 3px;
}
input:focus { border-color: var(--navy); }
.button-primary {
  margin-top: 1.5rem; padding: .7rem 1.4rem; font: 600 1rem var(--sans);
  color: #fff; background: var(--navy); border: 0; border-radius: 3px; cursor: pointer;
}
.button-primary:hover { background: var(--navy-deep); }
.stack-form { max-width: 26rem; }
.error { background: var(--danger-bg); color: var(--danger); border-left: 4px solid var(--danger); padding: .6rem .85rem; margin: 0 0 1rem; }
.error p { margin: .2rem 0; }
.notice { background: #EEF2F8; border-left: 4px solid var(--navy); padding: .6rem .85rem; margin: 0 0 1rem; }

/* ---- Sign-in screen ---- */
.signin-body {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: var(--navy);
}
.signin { width: 100%; max-width: 24rem; }
.signin-mark {
  margin: 0 0 1.75rem; color: #fff; font-size: 2.6rem; font-weight: 500; line-height: 1.05; letter-spacing: -.01em;
  padding-bottom: 1rem; border-bottom: 1px solid var(--gold);
}
.signin-mark span { display: block; margin-top: .4rem; font-size: 1.05rem; color: var(--gold-soft); letter-spacing: .02em; }
.signin-form { background: var(--surface); padding: 1.5rem 1.5rem 1.75rem; border-radius: 3px; }
.signin-form label:first-of-type { margin-top: 0; }
.signin-form .button-primary { width: 100%; }

@media (max-width: 40rem) {
  .masthead-inner { gap: .4rem 1rem; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .signout .who { display: none; }
  h1 { font-size: 1.5rem; }
}

/* ---- Milestone 2: lists, details, forms ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.title-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1.25rem; }
.title-row h1, .title-row h2 { margin: 0; }
.back { margin: 0 0 .5rem; font-size: .92rem; }
.back a { color: var(--muted); }

.title-row .button-primary { margin-top: 0; text-decoration: none; display: inline-block; }
.button {
  display: inline-block; padding: .5rem 1rem; font: 600 .95rem var(--sans); color: var(--navy);
  background: #fff; border: 1px solid var(--navy); border-radius: 3px; text-decoration: none; cursor: pointer;
}
.button:hover { background: #EEF2F8; }
.button-danger { margin-top: .75rem; padding: .55rem 1.1rem; font: 600 .95rem var(--sans); color: #fff; background: var(--danger); border: 0; border-radius: 3px; cursor: pointer; }

.search { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: 1.25rem; }
.search input[type="search"] { flex: 1 1 18rem; }
.search select { flex: 0 1 10rem; }
input[type="search"], input[type="tel"], select, textarea {
  width: 100%; padding: .65rem .75rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #AEB6C4; border-radius: 3px;
}
textarea { resize: vertical; }
select:focus, textarea:focus { border-color: var(--navy); }
.hint { margin: .35rem 0 0; font-size: .85rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: 1rem 0 0; }
.check input { width: auto; margin: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.error ul { margin: .5rem 0 0; padding-left: 1.25rem; }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); }
.list th { text-align: left; font-size: .85rem; font-weight: 600; color: var(--muted); padding: .6rem .85rem; border-bottom: 2px solid var(--rule); }
.list td { padding: .65rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.list tbody tr:hover { background: #F8F9FC; }
.list .num { text-align: right; }
.list .sub { display: block; font-size: .85rem; color: var(--muted); }
.panel table.list { border: 0; }

.details { display: grid; grid-template-columns: 10rem 1fr; gap: .55rem 1.25rem; margin: 0 0 2rem; max-width: 48rem; }
.details dt { color: var(--muted); font-size: .92rem; }
.details dd { margin: 0; }
.pre { white-space: pre-line; }
.none { color: #8A93A3; }

.danger-zone { margin-top: 2rem; max-width: 26rem; color: var(--muted); font-size: .92rem; }
.danger-zone summary { cursor: pointer; }

@media (max-width: 40rem) {
  /* Tables become stacked rows on a phone */
  table.list, .list tbody, .list tr, .list td { display: block; width: 100%; }
  .list thead { display: none; }
  .list tr { padding: .6rem .85rem; border-bottom: 1px solid var(--rule); }
  .list td { padding: .1rem 0; border: 0; }
  .list td:first-child { font-weight: 600; }
  .list td:empty { display: none; }
  .list .num { text-align: left; }
  .details { grid-template-columns: 1fr; gap: .1rem; }
  .details dd { margin-bottom: .6rem; }
  .pair { grid-template-columns: 1fr; }
}

/* ---- Address-book index (contacts and firms) ---- */
.count { margin: 0 0 .6rem; font-size: .9rem; color: var(--muted); }
.index { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--navy); }
.index-group { display: grid; grid-template-columns: 4.5rem 1fr; }
.index-group + .index-group { border-top: 1px solid var(--rule); }
.index-letter {
  margin: 0; padding: .55rem 0 0; text-align: center; align-self: start;
  position: sticky; top: 0;
  font: 500 2rem/1.2 var(--serif); color: var(--gold);
}
.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem 2rem;
  padding: .85rem 1.5rem .85rem 0;
}
.entry + .entry { border-top: 1px solid #E9ECF1; }
.entry-main { display: block; text-decoration: none; color: var(--ink); min-width: 0; }
.entry-name { display: block; font: 600 1.12rem/1.3 var(--serif); color: var(--navy); }
.entry-main:hover .entry-name { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.entry-sub { display: block; margin-top: .1rem; font-size: .9rem; color: var(--muted); }
.entry-reach { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .2rem 1.5rem; font-size: .9rem; }
.reach { color: var(--muted); text-decoration: none; white-space: nowrap; }
.reach:hover { color: var(--navy); text-decoration: underline; }
.entries-plain { background: var(--surface); border: 1px solid var(--rule); padding-left: 1.5rem; }

/* ---- Contact and firm pages ---- */
.record-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem;
  padding-bottom: 1.1rem; border-bottom: 1px solid var(--gold);
}
.record-head h1 { margin: 0; font-size: 2.1rem; }
.record-sub { margin: .35rem 0 0; font-size: 1.05rem; color: var(--muted); }
.record-sub a { color: var(--muted); text-decoration-color: var(--gold); text-underline-offset: 3px; }
.record-sub a:hover { color: var(--navy); }
.record-body { margin: 1.5rem 0 2.5rem; }
.facts { display: flex; flex-wrap: wrap; gap: 1rem 3.5rem; margin: 0; }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: .15rem 0 0; font-size: 1.05rem; }
.facts dd a { text-underline-offset: 3px; }
.notes-block { margin-top: 1.5rem; max-width: 65ch; }
.notes-block h2, .people h2 { font: 600 1.05rem var(--sans); color: var(--ink); margin: 0; }
.notes-block p { margin: .35rem 0 0; }
.people { margin-bottom: 1.5rem; }
.people .title-row { margin-bottom: .75rem; }

@media (max-width: 40rem) {
  .index-group { grid-template-columns: 2.75rem 1fr; }
  .index-letter { font-size: 1.5rem; padding-top: .6rem; }
  .entry { grid-template-columns: 1fr; padding-right: 1rem; }
  .entry-reach { justify-content: flex-start; gap: .1rem 1.25rem; }
  .entries-plain { padding-left: 1rem; }
  .record-head h1 { font-size: 1.7rem; }
}

/* ---- Matters ---- */
.lede { margin: -.75rem 0 1.5rem; color: var(--muted); max-width: 65ch; }
.matters { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--navy); }
.matter {
  display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) auto; align-items: center; gap: .25rem 1.25rem;
  padding: .8rem 1.5rem .8rem 1rem;
}
.matter + .matter { border-top: 1px solid #E9ECF1; }

/* The calendar leaf: the session date at a glance */
.leaf {
  display: grid; justify-items: center; width: 3.6rem; padding: 0 0 .3rem;
  border: 1px solid var(--rule); border-radius: 3px; background: #fff; line-height: 1.1;
  overflow: hidden;
}
.leaf-month { width: 100%; padding: .15rem 0; text-align: center; background: var(--navy); color: #fff; font-size: .75rem; letter-spacing: .03em; }
.leaf-day { margin-top: .2rem; font: 600 1.45rem/1.1 var(--serif); color: var(--navy); }
.leaf-dow { font-size: .72rem; color: var(--muted); }
.leaf-empty { border-style: dashed; padding-top: .45rem; }
.leaf-empty .leaf-day { color: #A3ABB8; margin-top: 0; }

.chip { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font: 600 .8rem/1.4 var(--sans); white-space: nowrap; vertical-align: middle; }
.chip-request   { background: var(--gold-soft); color: #6E4F1C; }
.chip-scheduled { background: #E3E9F5; color: var(--navy); }
.chip-held      { background: var(--gold); color: #fff; }
.chip-closed    { background: #ECEEF2; color: var(--muted); }
.chip-cancelled { background: #fff; color: var(--muted); border: 1px solid var(--rule); text-decoration: line-through; }
.record-sub .chip { margin-left: .5rem; }

.search-matters { display: block; }
.search-line { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.search-line input[type="search"] { flex: 1 1 18rem; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 1rem; margin-top: .25rem; }
.filters label { font-size: .85rem; margin-top: .6rem; }
input[type="date"] { width: 100%; padding: .55rem .65rem; font: inherit; color: var(--ink); background: #fff; border: 1px solid #AEB6C4; border-radius: 3px; }

.matter-form { max-width: 40rem; }
.matter-form fieldset { margin: 0 0 1.5rem; padding: 0 0 1.5rem; border: 0; border-bottom: 1px solid var(--rule); }
.matter-form legend { padding: 0; font: 600 1.2rem var(--serif); color: var(--navy); }
.matter-form [hidden] { display: none; }
.type-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .75rem; }
.type-box { display: flex; flex-direction: column; gap: .2rem; margin: 0; padding: 1rem 1.1rem 1rem 2.6rem; position: relative; cursor: pointer;
            background: var(--surface); border: 2px solid var(--rule); border-radius: 4px; font-weight: 400; }
.type-box:hover { border-color: var(--navy); }
.type-box:has(input:checked) { border-color: var(--navy); background: #F3F5FA; box-shadow: inset 0 3px 0 var(--gold); }
.type-box input { position: absolute; left: 1rem; top: 1.2rem; width: auto; margin: 0; }
.type-name { font: 600 1.2rem var(--serif); color: var(--navy); }
.type-sub { font-size: .88rem; color: var(--muted); }
.add-row + .add-row { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--rule); }
.add-row .row-title { margin: 0; font: 600 .95rem var(--sans); color: var(--muted); }
.add-row-button { margin-top: 1rem; }
@media (max-width: 30rem) { .type-choices { grid-template-columns: 1fr; } }
.label-like { display: block; font-weight: 600; font-size: .92rem; margin: 1rem 0 .1rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.choices .check { margin-top: .4rem; }
.reveal[hidden] { display: none; }
.dd-sub { font-size: .9rem; color: var(--muted); }
.plain-list { margin: .35rem 0 0; padding-left: 1.1rem; }

.dash-section { margin-bottom: 2rem; }
.dash-section h2 { font: 600 1.05rem var(--sans); color: var(--ink); margin: 0 0 .6rem; }

.inline-add { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; max-width: 34rem; margin-bottom: 1.25rem; }
.inline-add input { flex: 1 1 14rem; width: auto; }
.type-list .inline-add { margin: 0; flex: 1; }
.type-list .entry-name { font-size: 1.02rem; }
.type-list .retired .entry-name { color: var(--muted); }
.inline-action { display: inline; margin: 0; }
.link-button.reach { color: var(--muted); text-decoration: none; font-size: .9rem; }
.link-button.reach:hover { color: var(--navy); text-decoration: underline; }

@media (max-width: 40rem) {
  .matter { grid-template-columns: 3.6rem minmax(0, 1fr); padding: .75rem 1rem .75rem .75rem; }
  .matter .chip { grid-column: 2; justify-self: start; }
}

/* ---- Milestone 4: matter page ---- */
.title-actions { display: flex; align-items: baseline; gap: 1.25rem; }
.chip-outcome { background: #fff; color: var(--navy); border: 1px solid var(--gold); }

.matter-layout { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 2.5rem; align-items: start; }
.matter-section { margin-bottom: 2.5rem; scroll-margin-top: 1rem; }
.matter-section > h2 { font: 600 1.3rem var(--serif); color: var(--navy); margin: 0 0 .9rem; }
.side-group { margin-bottom: 1.25rem; }
.side-group h3 { font: 600 .95rem var(--sans); color: var(--gold); margin: 0 0 .4rem; }

.participant { grid-template-columns: minmax(0, 1fr) auto; }
.participant-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-top: .35rem; }
.flag { padding: .15rem .6rem; font: .8rem var(--sans); color: var(--muted); background: #fff; border: 1px dashed #B7BFCC; border-radius: 999px; cursor: pointer; }
.flag:hover { color: var(--navy); border-color: var(--navy); }
.flag-on { color: var(--navy); background: #E3E9F5; border: 1px solid #E3E9F5; font-weight: 600; }
.participant-tools .remove { margin-left: auto; }

.add-person { margin-top: 1.25rem; padding: 1rem 1.25rem 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--gold); max-width: 40rem; }
.add-person h3 { font: 600 1rem var(--sans); margin: 0; }
.add-person > .button { margin-top: 1rem; }
.new-person { margin-top: 1rem; }
.new-person summary { cursor: pointer; color: var(--navy); font-size: .92rem; }

.note-form { display: grid; gap: .6rem; justify-items: start; max-width: 40rem; margin-bottom: 1.25rem; }
.notes { list-style: none; margin: 0; padding: 0; max-width: 40rem; }
.notes li { padding: .85rem 0; border-top: 1px solid var(--rule); }
.notes p { margin: 0; }
.note-meta { font-size: .82rem; color: var(--muted); }
.notes .note-meta { margin-bottom: .25rem; }
.note-delete { margin-top: .4rem; font-size: .82rem; color: var(--muted); }
.note-delete summary { cursor: pointer; }
.note-delete .button-danger { margin-top: .4rem; padding: .35rem .8rem; font-size: .85rem; }

.status-card { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--gold); padding: 1rem 1.25rem 1.25rem; }
.status-card h2, .side-block h2 { font: 600 1.05rem var(--sans); color: var(--ink); margin: 0; }
.status-card label:first-of-type { margin-top: .6rem; }
.status-card .button-primary { width: 100%; margin-top: 1rem; }
.side-block { margin-top: 1.5rem; }
.history summary { cursor: pointer; font-weight: 600; }
.activity { list-style: none; margin: .6rem 0 0; padding: 0; font-size: .9rem; }
.activity li { padding: .4rem 0; border-top: 1px solid #E9ECF1; }
.activity .note-meta { display: block; }

@media (max-width: 56rem) {
  .matter-layout { grid-template-columns: 1fr; gap: 0; }
  .matter-side { order: -1; margin-bottom: 2rem; }
}
@media (max-width: 40rem) {
  .participant { grid-template-columns: 1fr; }
  .title-actions { gap: .9rem; }
}

/* ---- Milestone 5: users ---- */
.user-list { margin-bottom: 2rem; max-width: 48rem; }
.user-list .entry-name .chip { font-family: var(--sans); margin-left: .4rem; }
.user-list .retired .entry-name { color: var(--muted); }
.pw-form { grid-column: 1 / -1; padding: .5rem 0 .75rem; }
.pw-form .button { margin-top: 1rem; }

/* ---- Notes stand out on the matter page ---- */
.notes-section {
  background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--gold);
  padding: 1.1rem 1.5rem 1.25rem; max-width: 44rem;
}
.notes-section > h2 { display: flex; align-items: center; gap: .6rem; }
.count-badge { font: 600 .8rem/1 var(--sans); color: #fff; background: var(--gold); border-radius: 999px; padding: .3rem .55rem; }
.notes-section .note-form { max-width: none; }
.notes-section textarea { background: #FFFDF8; border-color: #D9C9A8; }
.notes-section .notes { max-width: none; }
.notes-section .notes li { padding: .9rem 1rem; margin-top: .6rem; border: 1px solid #ECE3D2; border-radius: 3px; background: #FFFDF8; }
.notes-section .notes p.pre { font-size: 1.02rem; }
@media (max-width: 40rem) { .notes-section { padding: 1rem; } }
.user-delete { grid-column: 1 / -1; margin-top: .3rem; }

/* ---- Time and billing ---- */
input[type="number"], input[type="month"] {
  width: 100%; padding: .55rem .65rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #AEB6C4; border-radius: 3px;
}
input[type="number"]:focus, input[type="date"]:focus { border-color: var(--navy); }
.record-head .title-actions { flex-wrap: wrap; gap: .5rem; }
.cancel-link { margin-left: 1rem; color: var(--muted); }

.billing-setup { max-width: 40rem; margin: 1.5rem 0 2rem; padding: 1.1rem 1.5rem 1.4rem; background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--gold); }
.billing-setup h2 { font: 600 1.2rem var(--serif); margin: 0; }
.choices-big { gap: .25rem 2rem; }
.choices-big .check { font-size: 1.05rem; font-weight: 600; color: var(--navy); }
.money-input { display: flex; align-items: center; gap: .4rem; }
.money-input > span { font-weight: 600; color: var(--muted); }
.money-input-short { max-width: 12rem; }
.billing-line { margin: 1.25rem 0 1.75rem; color: var(--muted); }
.billing-line span { color: var(--ink); font-weight: 600; margin-right: .5rem; }

.time-layout { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.time-entry-card { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--navy); padding: 1rem 1.25rem 1.25rem; position: sticky; top: 1rem; }
.time-entry-card h2 { font: 600 1.15rem var(--serif); margin: 0; }
.time-entry-card .button-primary { margin-top: 1rem; }

.month-nav { display: flex; align-items: baseline; gap: 1.25rem; margin-bottom: .9rem; }
.month-nav h2 { margin: 0; font: 600 1.3rem var(--serif); color: var(--navy); }
.month-nav a { color: var(--muted); text-decoration: none; font-size: .92rem; white-space: nowrap; }
.month-nav a:hover { color: var(--navy); text-decoration: underline; }

.time-list td.pre { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.list tfoot td { padding: .65rem .85rem; font-weight: 600; border-top: 2px solid var(--navy); background: #F8F9FC; }
.list tr.editing { background: var(--gold-soft); }
.row-tools { white-space: nowrap; font-size: .9rem; }
.row-tools .note-delete { display: inline-block; margin: 0 0 0 .75rem; }
.row-tools .button-danger { display: block; }
.invoice-action { margin: 0; }
.invoice-action .button-primary { display: inline-block; text-decoration: none; }
.month-list a[aria-current="page"] { font-weight: 600; }
.pick-matter { max-width: 40rem; margin-bottom: 2rem; }
.pick-matter label { margin-top: 0; }
.pick-matter select { flex: 1 1 18rem; width: auto; }
.billing-list td:last-child { white-space: nowrap; }
.bulk-bar { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: .9rem; color: var(--muted); }
.bulk-bar .button { padding: .3rem .8rem; font-size: .9rem; }
.time-list th.pick, .time-list td.pick { width: 2.2rem; padding-right: 0; }
.time-list .pick input { width: auto; margin: .2rem 0 0; }
.time-list abbr { text-decoration: none; font-weight: 600; color: var(--navy); }
.time-list tr.no-charge td { color: var(--muted); }
.bnc-tag { display: inline-block; padding: 0 .35rem; font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--navy); background: var(--gold-soft); border-radius: 3px; }

@media (max-width: 56rem) {
  .time-layout { grid-template-columns: 1fr; gap: 2rem; }
  .time-entry-card { position: static; }
}
@media (max-width: 40rem) {
  .list tfoot { display: block; }
  .list tfoot td:empty { display: none; }
  .row-tools .note-delete { margin-left: 1rem; }
}

/* ---- Outlook sync ---- */
input[type="time"] { width: 100%; padding: .55rem .65rem; font: inherit; color: var(--ink); background: #fff; border: 1px solid #AEB6C4; border-radius: 3px; }
input[type="time"]:focus { border-color: var(--navy); }
.outlook-card { max-width: 40rem; margin-bottom: 2rem; }
.outlook-card p { margin: .6rem 0 0; }
.outlook-card a.button-primary { display: inline-block; text-decoration: none; }
.outlook-card .facts { margin: 1rem 0; }
.outlook-card form .button { margin-top: .25rem; }
.outlook-status { margin: .5rem 0 0; font-size: .9rem; color: var(--muted); }
.outlook-status.outlook-problem { color: var(--danger); }
.outlook-status form { display: inline; }

/* ---- Calendar page ---- */
:root {
  --cal-mediation: #1F4E9A; --cal-mediation-bg: #E6EDF8;
  --cal-mediation_outlook: #5B86C5; --cal-mediation_outlook-bg: #F0F4FA;
  --cal-law: #2E7D4F; --cal-law-bg: #E5F2EA;
  --cal-personal: #7A3E9D; --cal-personal-bg: #F1E8F6;
}
.cal-head { align-items: center; }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.cal-nav .button { padding: .4rem .8rem; }
.cal-views { margin-left: .75rem; display: inline-flex; border: 1px solid var(--navy); border-radius: 3px; overflow: hidden; }
.cal-views a { padding: .4rem .8rem; font: 600 .9rem var(--sans); color: var(--navy); text-decoration: none; background: #fff; }
.cal-views a[aria-current="page"] { background: var(--navy); color: #fff; }
.cal-legend { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; font-size: .92rem; }
.cal-key { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); text-decoration: none; }
.cal-key-off { color: #8A93A3; text-decoration: line-through; }
.cal-swatch { display: inline-block; width: .85rem; height: .85rem; border-radius: 2px; background: currentColor; vertical-align: -.1rem; }
.cal-key-mediation .cal-swatch, .cal-swatch-mediation { background: var(--cal-mediation); }
.cal-key-mediation_outlook .cal-swatch { background: var(--cal-mediation_outlook); }
.cal-key-law .cal-swatch, .cal-swatch-law { background: var(--cal-law); }
.cal-key-personal .cal-swatch, .cal-swatch-personal { background: var(--cal-personal); }
.cal-key-off .cal-swatch { background: #C9CED8 !important; }
.cal-tools { margin-left: auto; color: var(--muted); }
.cal-missing { margin: -.5rem 0 1rem; }

.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-ev { margin: 0 0 .3rem; padding: .3rem .5rem; border-left: 4px solid; border-radius: 2px; font-size: .92rem; line-height: 1.3; }
.cal-ev a { color: inherit; text-decoration: none; display: block; }
.cal-ev a:hover .cal-title { text-decoration: underline; }
.cal-mediation { border-color: var(--cal-mediation); background: var(--cal-mediation-bg); }
.cal-mediation_outlook { border-color: var(--cal-mediation_outlook); background: var(--cal-mediation_outlook-bg); }
.cal-law { border-color: var(--cal-law); background: var(--cal-law-bg); }
.cal-personal { border-color: var(--cal-personal); background: var(--cal-personal-bg); }
.cal-tentative { border-left-style: dashed; }
.cal-free { opacity: .65; }
.cal-time { font-weight: 600; white-space: nowrap; }
.cal-where { display: block; font-size: .85rem; color: var(--muted); }

.cal-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.cal-day { background: var(--surface); border: 1px solid var(--rule); padding: .5rem; min-height: 9rem; }
.cal-day-head { margin: 0 0 .5rem; font: 600 .95rem var(--sans); color: var(--ink); }
.cal-day-head span { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.cal-today { border-top: 3px solid var(--gold); }
.cal-none { margin: 0; font-size: .85rem; color: #8A93A3; }

.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.cal-dow { padding: .35rem .5rem; font-size: .8rem; font-weight: 600; color: var(--muted); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: #F5F7FA; }
.cal-cell { min-height: 7rem; padding: .3rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--surface); overflow: hidden; }
.cal-cell.cal-out { background: #F8F9FB; }
.cal-cell.cal-out .cal-date { color: #A3AAB7; }
.cal-date { display: inline-block; margin-bottom: .25rem; font-size: .85rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.cal-date-long { display: none; }
.cal-month .cal-ev { padding: .1rem .3rem; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left-width: 3px; }

@media (max-width: 56rem) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; }
  .cal-day-head span { display: inline; font-size: inherit; font-weight: 600; color: inherit; }
}
@media (max-width: 40rem) {
  .cal-views { margin-left: 0; }
  .cal-tools { margin-left: 0; }
  .cal-month { display: block; border: 0; }
  .cal-dow, .cal-cell.cal-empty { display: none; }
  .cal-cell { min-height: 0; border: 1px solid var(--rule); margin-bottom: .5rem; padding: .5rem; }
  .cal-date-long { display: inline; }
  .cal-month .cal-ev { white-space: normal; font-size: .9rem; }
}
/* QuickBooks */
.title-row .button { margin-top: 0; text-decoration: none; display: inline-block; }
.qbo-panel { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.qbo-panel h2 { font: 600 1.05rem var(--sans); color: var(--ink); margin: 0 0 .6rem; }
.qbo-list form { margin: 0; }
.qbo-list .button { margin-top: 0; white-space: nowrap; }
.qbo-list .chip { margin-left: .35rem; }
.qbo-actions { margin-top: .9rem; }
.qbo-actions .button-primary, .qbo-actions .button { margin-top: 0; }
.qbo-status dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .5rem 0 0; }
.qbo-status dt { color: var(--muted); }
.qbo-status dd { margin: 0; }
.problem { color: var(--danger); }
.qbo-recent { margin-top: 2rem; }

/* Invoice letterhead choice (Time page) */
.logo-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1.25rem; }
.logo-pick-label { font-size: .92rem; color: var(--muted); margin-right: .25rem; }
.logo-pick .flag { font-size: .9rem; padding: .3rem .9rem; }
.logo-pick + .invoice-action .button-primary { margin-top: .75rem; }

/* Documents (matter page) and letters to review (Dashboard) */
.doc-list .participant-tools { display: flex; align-items: center; gap: .5rem; }
#documents > .inline-action { margin-top: .75rem; }
.review-list { background: #FFF9EE; border-left: 4px solid var(--gold); padding: .75rem 1rem; }
.review-list .sub { color: var(--muted); font-size: .85rem; margin-left: .35rem; }
.doc-list .participant-tools .button { padding: .3rem .8rem; font-size: .88rem; }
.doc-icon { display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; text-decoration: none; color: var(--navy); font: 600 .75rem var(--sans); }
.doc-icon svg { display: block; transition: transform .12s ease; }
.doc-icon:hover svg, .doc-icon:focus-visible svg { transform: translateY(-2px); }
.doc-list .entry { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; }
.doc-list .entry .entry-main { flex: 1 1 16rem; }
.doc-list .participant-tools { flex: 0 1 auto; flex-wrap: wrap; margin: 0; }

/* Engagement letter: preview and edit (letter.php, letter-template.php) */
.letter-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.letter-actions .button { margin: 0; }
.letter-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem 0; background: var(--paper, #F4F5F8); }
.letter-toolbar .button, .letter-toolbar .button-primary { margin: 0; }
.letter-format { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.letter-format[hidden] { display: none; }
.fmt { width: 2.2rem; height: 2.2rem; border: 1px solid var(--rule); background: #fff; border-radius: 3px; cursor: pointer; font: 1rem var(--serif, Georgia, serif); color: var(--ink); }
.fmt:hover { border-color: var(--navy); }
.letter-hint { margin: 0 0 0 .25rem; }
.letter-page { background: #fff; max-width: 8.5in; margin: .5rem auto 1.5rem; padding: .6in .9in .5in; box-shadow: 0 1px 3px rgba(15,30,69,.12), 0 6px 24px rgba(15,30,69,.08);
  font-family: "Times New Roman", Times, serif; font-size: 1.02rem; line-height: 1.45; color: #111; }
.letter-wrap.editing .letter-page { outline: 2px solid var(--gold); outline-offset: 4px; }
.letter-body { outline: none; min-height: 4in; }
.letter-body[contenteditable="true"] { cursor: text; }
.letter-body p { margin: 0 0 .8em; text-align: justify; }
.letter-body p.field { margin: 0; text-align: left; }
.letter-body p.field strong { float: left; width: 6.4em; }
.letter-body p.field::after { content: ""; display: table; clear: both; }
.letter-body p.gap { margin-bottom: 1em; }
.letter-body p.date { text-align: center; margin-bottom: 1.2em; }
.letter-body table.counsel { width: 100%; border-collapse: collapse; margin-bottom: 1.2em; }
.letter-body table.counsel td { width: 50%; vertical-align: top; padding: 0 .75em .7em 0; }
.letter-body p.sign { margin: 0 0 0 50%; text-align: left; }
.letter-body p.signature { margin-top: 2.5em; }
.lh { width: 100%; border-collapse: collapse; border-bottom: 2px solid #B98A3A; margin-bottom: 1.5em; }
.lh td { vertical-align: middle; padding: 0 0 .6em; }
.lh-logo img { width: 2.6in; max-width: 100%; height: auto; display: block; }
.lh-who { width: 2.3in; padding-left: 1em; font-size: .8rem; line-height: 1.35; color: #4A4A4A; }
.lh-name { font-size: .95rem; font-weight: 700; color: #0F1E45; }
.lh-title { font-style: italic; color: #B98A3A; }
.lf { margin-top: 2em; border-top: 1px solid #0F1E45; padding-top: .4em; text-align: center; font-size: .85rem; color: #0F1E45; }
.letter-approve { max-width: 8.5in; margin: 0 auto 2rem; }
.letter-approve form { display: inline; }
@media (max-width: 700px) {
  .letter-page { padding: .35in .3in; font-size: .95rem; }
  .lh, .lh tbody, .lh tr, .lh td { display: block; width: auto; }
  .lh-who { padding: .5em 0 0; }
  .letter-body p.sign { margin-left: 0; }
}
.letter-toolbar [hidden] { display: none !important; }
.send-card { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--navy); padding: 1rem 1.25rem 1.25rem; margin-top: 1rem; }
.send-card h2 { font: 600 1.05rem var(--sans); margin: 0 0 .5rem; }
.send-card fieldset { border: 0; padding: 0; margin: 0 0 .5rem; }
.send-card legend { font-weight: 600; margin-bottom: .25rem; }
.wide-form { max-width: 46rem; }
.wide-form textarea { font: inherit; width: 100%; }
