/* Hale & Mercer LLP — one stylesheet for public site, client portal and admin (Studio rule 8). */
:root {
  --navy: #14213d;
  --navy-deep: #0d1730;
  --parchment: #f5f1e8;
  --parchment-deep: #ebe4d6;
  --brass: #b08d57;
  --brass-deep: #8f7044;
  --ink: #1d1d1b;
  --ink-soft: #5a5a55;
  --line: #d9d2c3;
  --white: #fffdf9;
  --ok: #2f6b3a;
  --bad: #a23b2c;
  --warn: #9a6b12;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1180px;
  --gutter: 16px;
  --radius: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--parchment); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brass-deep); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0 0 .5em; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: 760px; }
.page { min-height: 60vh; }
.eyebrow { font-family: var(--sans); text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; color: var(--brass-deep); font-weight: 600; margin: 0 0 .6em; }
.muted { color: var(--ink-soft); }
.small { font-size: .9rem; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--parchment-deep); padding: .1em .35em; border-radius: 3px; }
code.small { font-size: .78em; }
pre.stack { background: var(--navy-deep); color: #e9e4d8; padding: 16px; border-radius: var(--radius); overflow: auto; font-size: .82rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* Buttons & forms */
.btn { display: inline-block; padding: 12px 22px; border: 1.5px solid var(--navy); border-radius: var(--radius); background: transparent; color: var(--navy); font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer; line-height: 1.2; transition: background .15s, color .15s; }
.btn:hover { background: var(--navy); color: var(--white); }
.btn.primary { background: var(--navy); color: var(--white); }
.btn.primary:hover { background: var(--navy-deep); }
.btn.brass { background: var(--brass); border-color: var(--brass); color: var(--white); }
.btn.brass:hover { background: var(--brass-deep); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad); color: var(--white); }
.btn.small { padding: 8px 14px; font-size: .85rem; }
.btn.block { display: block; width: 100%; text-align: center; }
button.link { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.link:hover { color: var(--brass-deep); }
form.inline { display: inline; }
.form { display: grid; gap: 18px; max-width: 560px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.form label small { font-weight: 400; }
.form input[type=text], .form input[type=email], .form input[type=tel], .form input[type=password], .form input[type=number], .form input[type=date], .form input[type=datetime-local], .form input[type=file], .form select, .form textarea,
.filters input, .filters select {
  font: inherit; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--ink); width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--brass); }
.form .row { display: grid; gap: 18px; grid-template-columns: 1fr; }
.form .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 0 0 20px; }
.filters label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; }
fieldset { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; }
legend { font-weight: 600; padding: 0 6px; }
.choice-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.choice { display: block; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--white); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass); }
.choice input { margin-right: 8px; }

/* Flash & badges */
.flashes { margin: 0 0 20px; }
.flash { background: #e6efe2; border-left: 4px solid var(--ok); padding: 12px 16px; border-radius: var(--radius); margin: 0 0 8px; }
.badge { display: inline-block; font: 600 .72rem var(--sans); text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: var(--parchment-deep); color: var(--ink-soft); vertical-align: middle; }
.badge.received, .badge.requested, .badge.intake, .badge.draft, .badge.scheduled, .badge.pending, .badge.awaiting_signature { background: #ece7da; color: #6a5a2e; }
.badge.under_review, .badge.open, .badge.in_progress, .badge.sent, .badge.uploaded, .badge.confirmed, .badge.active { background: #e0e7f3; color: var(--navy); }
.badge.approved, .badge.accepted, .badge.paid, .badge.signed, .badge.posted, .badge.completed, .badge.closed, .badge.verified { background: #e2eedd; color: var(--ok); }
.badge.needs_attention, .badge.rejected, .badge.declined, .badge.void, .badge.cancelled, .badge.failed, .badge.frozen, .badge.on_hold, .badge.unpaid { background: #f3e1dc; color: var(--bad); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); background: var(--parchment-deep); }
.table.compact th, .table.compact td { padding: 7px 10px; font-size: .88rem; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 20px; }
dl.kv dt { font-weight: 600; color: var(--ink-soft); }
dl.kv dd { margin: 0; }

/* Header */
.site-header { background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 20; }
.nav-row { display: flex; align-items: center; justify-content: space-between; min-height: 68px; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; }
.brand-mark { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; background: var(--brass); color: var(--navy-deep); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; letter-spacing: -.02em; }
.brand-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.brand-name small { font-size: .7em; letter-spacing: .1em; opacity: .8; }
.site-nav { display: none; flex-direction: column; gap: 4px; position: absolute; top: 68px; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); background: var(--navy-deep); padding: 16px var(--gutter) 24px; }
.site-nav a { color: var(--white); text-decoration: none; padding: 10px 0; font-weight: 500; border-bottom: 1px solid rgba(255,255,255,.08); }
.site-nav a.active { color: var(--brass); }
.site-nav .btn { border-color: var(--brass); color: var(--brass); margin-top: 10px; align-self: flex-start; }
.site-nav .btn:hover { background: var(--brass); color: var(--navy-deep); }
.site-nav button.link { color: var(--white); opacity: .85; margin-top: 10px; }
.nav-toggle { display: none; }
.nav-toggle:checked ~ .site-nav { display: flex; }
.nav-burger { width: 28px; height: 22px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.nav-burger span { height: 2px; background: var(--white); border-radius: 2px; }

/* Hero & sections */
.hero { background: var(--navy); color: var(--white); padding: 56px 0 64px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: url("/static/img/hero.jpg") center/cover no-repeat; opacity: .22; }
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--white); max-width: 14ch; }
.hero p.lede { font-size: 1.2rem; max-width: 46ch; color: #e4dfd3; }
.hero .eyebrow { color: var(--brass); }
.hero .btn { border-color: var(--white); color: var(--white); }
.hero .btn.brass { border-color: var(--brass); background: var(--brass); color: var(--navy-deep); }
section.band { padding: 56px 0; }
section.band.alt { background: var(--white); }
section.band.dark { background: var(--navy); color: var(--white); }
section.band.dark h2, section.band.dark h3 { color: var(--white); }
section.band.dark .eyebrow { color: var(--brass); }
.lede { font-size: 1.15rem; max-width: 60ch; }
.grid-2 { display: grid; gap: 24px; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 24px; grid-template-columns: 1fr; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 24px; }
.card h2 { font-size: 1.35rem; }
.card h3 { font-size: 1.1rem; }
.stat { font-family: var(--serif); font-size: 2.4rem; color: var(--navy); line-height: 1; }
.practice-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.practice-list li { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.practice-list h3 a { text-decoration: none; }
.check-list { padding-left: 1.2em; }
.quote { font-family: var(--serif); font-size: 1.35rem; font-style: italic; color: var(--navy); border-left: 3px solid var(--brass); padding-left: 18px; margin: 24px 0; }
.quote cite { display: block; font-style: normal; font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); margin-top: 8px; }

/* People */
.people-grid { display: grid; gap: 28px 20px; grid-template-columns: repeat(2, 1fr); }
.person-card { text-decoration: none; color: inherit; display: block; }
.person-card .portrait { aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--parchment-deep); margin-bottom: 12px; position: relative; }
.person-card .portrait img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.person-card:hover .portrait img { transform: scale(1.03); }
.person-card .hobby-line { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(20,33,61,.86); color: var(--white); padding: 8px 12px; font-size: .82rem; transform: translateY(100%); transition: transform .25s; }
.person-card:hover .hobby-line { transform: none; }
.person-card h3 { margin: 0; font-size: 1.15rem; }
.person-card .title { color: var(--brass-deep); font-size: .9rem; font-weight: 600; margin: 2px 0 4px; }
.person-card .short { font-size: .92rem; color: var(--ink-soft); margin: 0; }
.person-hero { display: grid; gap: 28px; grid-template-columns: 1fr; padding: 40px 0 24px; }
.person-hero .portrait { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--parchment-deep); max-width: 440px; }
.person-hero .portrait img { width: 100%; height: 100%; object-fit: cover; }
.person-hero h1 { margin-bottom: .2em; }
.person-hero .title { font-size: 1.15rem; color: var(--brass-deep); font-weight: 600; }
.person-meta { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; }
.story p { font-size: 1.08rem; max-width: 66ch; }
.story p:first-of-type::first-letter { font-family: var(--serif); font-size: 3.2em; float: left; line-height: .85; padding: 4px 8px 0 0; color: var(--brass-deep); }
.offduty { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
.offduty .photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; background: var(--parchment-deep); }
.offduty .photo img { width: 100%; height: 100%; object-fit: cover; }
.hobby { border-left: 3px solid var(--brass); padding-left: 14px; margin: 0 0 18px; }
.hobby h3 { margin: 0 0 .2em; font-size: 1.1rem; }
.hobby p { margin: 0; color: var(--ink-soft); }
.ask-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ask-list li { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; font-family: var(--serif); font-size: 1.05rem; }
.ask-list li::before { content: "“"; color: var(--brass); margin-right: 4px; }
.contact-card { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 24px; }
.contact-card a { color: var(--white); }
.contact-card .eyebrow { color: var(--brass); }
.contact-card .btn { border-color: var(--brass); color: var(--brass); margin: 4px 8px 4px 0; }
.contact-card .btn:hover { background: var(--brass); color: var(--navy-deep); }

/* Offices / map */
.map-embed { border: 0; width: 100%; height: 360px; border-radius: var(--radius); }
.hours { list-style: none; padding: 0; margin: 0; }
.hours li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 6px 0; }

/* Portal & admin shells */
.portal-shell, .admin-shell { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 56px; }
.portal-nav, .admin-nav { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.portal-nav nav, .admin-nav nav { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; }
.portal-nav a, .admin-nav a { text-decoration: none; padding: 6px 0; font-weight: 500; color: var(--ink); font-size: .95rem; }
.portal-nav a.active, .admin-nav a.active { color: var(--brass-deep); font-weight: 600; }
.portal-nav .count, .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--brass); color: var(--navy-deep); font-size: .72rem; font-weight: 700; text-align: center; margin-left: 4px; }
.portal-main h1, .admin-main h1 { font-size: 2rem; }
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); margin: 0 0 24px; }
.tile { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; }
.tile .n { font-family: var(--serif); font-size: 2rem; color: var(--navy); line-height: 1; }
.tile .l { font-size: .85rem; color: var(--ink-soft); }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 16px 18px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--brass); }
.timeline .when { font-size: .8rem; color: var(--ink-soft); }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; flex-wrap: wrap; }
.steps li { padding: 6px 12px; border-radius: 999px; background: var(--parchment-deep); font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.steps li.current { background: var(--navy); color: var(--white); }
.steps li.done { background: #e2eedd; color: var(--ok); }
.thread-post { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; }
.thread-post.mine { background: #eef1f7; }
.thread-post .who { font-weight: 600; font-size: .9rem; }
.thread-post .when { font-size: .8rem; color: var(--ink-soft); }
.doc-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.checks li .mark { display: inline-block; width: 22px; font-weight: 700; }
.checks li.ok .mark { color: var(--ok); }
.checks li.bad { color: var(--bad); }
.machine-wrap { overflow-x: auto; }
.machine { width: 100%; max-width: 900px; height: auto; color: var(--navy); }
.spark { width: 100%; max-width: 420px; height: 48px; color: var(--brass-deep); }
.message.unread { border-left: 4px solid var(--brass); }
.message header { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.recovery-codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.recovery-codes code { display: block; padding: 10px; text-align: center; font-size: 1rem; }
.twofa-setup { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
.twofa-setup .qr svg { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.auth-card { padding: 48px var(--gutter); }
.error-page { padding: 64px var(--gutter); }
.deferred-banner { background: #fff6dd; border: 1px solid #e8d49a; border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; }
.card-visual { background: linear-gradient(135deg, var(--navy), #2c3e6b); color: var(--white); border-radius: 14px; padding: 22px; max-width: 380px; aspect-ratio: 1.586; display: flex; flex-direction: column; justify-content: space-between; font-family: ui-monospace, monospace; }
.empty { padding: 32px; text-align: center; color: var(--ink-soft); background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Footer */
.site-footer { background: var(--navy-deep); color: #d9d3c6; padding: 48px 0 24px; margin-top: 56px; }
.site-footer a { color: #ece6d8; text-decoration: none; display: block; padding: 3px 0; }
.site-footer a:hover { color: var(--brass); }
.site-footer .brand-name { color: var(--white); margin-bottom: 8px; }
.site-footer .eyebrow { color: var(--brass); }
.site-footer .muted { color: #b8b1a3; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding-top: 16px; }

/* Larger screens */
@media (min-width: 720px) {
  .form .row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .people-grid { grid-template-columns: repeat(3, 1fr); }
  .person-hero { grid-template-columns: 2fr 3fr; align-items: start; }
  .offduty { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
  .twofa-setup { grid-template-columns: auto 1fr; }
  .hero { padding: 88px 0 96px; }
}
@media (min-width: 960px) {
  .nav-burger { display: none; }
  .site-nav { display: flex; position: static; flex-direction: row; align-items: center; gap: 26px; background: none; padding: 0; }
  .site-nav a { border: 0; padding: 0; }
  .site-nav .btn, .site-nav button.link { margin: 0; }
  .people-grid { grid-template-columns: repeat(4, 1fr); }
  .portal-shell, .admin-shell { grid-template-columns: 230px 1fr; }
  .portal-nav nav, .admin-nav nav { flex-direction: column; gap: 0; }
  .portal-nav a, .admin-nav a { padding: 7px 0; border-bottom: 1px solid var(--line); }
}
@media print { .site-header, .site-footer, .portal-nav, .admin-nav, .btn, button { display: none !important; } body { background: #fff; } }

.photo, .photo-strip img { display:block; width:100%; height:auto; border-radius:10px; object-fit:cover; margin: 0 0 20px; }
.photo-strip { display:grid; gap:16px; grid-template-columns:1fr 1fr; margin: 28px 0; }
