/* ==========================================================================
   Three Wooden Crosses — Client Management System
   Brand system drawn from threewoodencrossesconstruction.com and the official
   badge logo: badge black + bronze-gold timber linework, walnut and stone
   neutrals, DM Serif Display headings over Poppins (assets/fonts.css).
   ========================================================================== */

:root {
    color-scheme: light;

    --ink: #121114;          /* logo badge */
    --ink-2: #1b1917;
    --ink-3: #2a2622;
    --walnut: #5e564d;       /* website nav + buttons */
    --walnut-2: #4a433c;
    --stone: #d6cfc7;        /* website section background */
    --stone-2: #e8e2da;
    --sand: #a89f91;         /* website footer */
    --parchment: #f5f1ea;
    --paper: #fffdf9;
    --line: #e7e0d6;
    --line-strong: #d6cfc7;

    --text: #2b2723;
    --text-2: #4d463f;
    --muted: #71685e;

    --gold: #b49060;         /* logo truss */
    --gold-hi: #d8b484;
    --gold-pale: #ecd9b0;
    --gold-lo: #86663b;      /* gold that passes AA as text on light surfaces */
    --gold-grad: linear-gradient(135deg, #8f6f42 0%, #c9a46e 28%, #f1deb3 50%, #c9a46e 72%, #8f6f42 100%);
    --gold-rule: linear-gradient(90deg, transparent, #b49060 18%, #ecd9b0 50%, #b49060 82%, transparent);

    --red: #94372b;    --red-bg: #f7e5e0;
    --amber: #84560f;  --amber-bg: #f7ebd3;
    --green: #3d6837;  --green-bg: #e2eddb;
    --slate: #3c5163;  --slate-bg: #e2e8ed;

    --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --r-lg: 20px;
    --r: 14px;
    --r-sm: 10px;
    --r-xs: 7px;
    --shadow-sm: 0 1px 2px rgba(33, 26, 18, .06), 0 1px 1px rgba(33, 26, 18, .04);
    --shadow: 0 1px 2px rgba(33, 26, 18, .05), 0 8px 22px -10px rgba(33, 26, 18, .2);
    --shadow-lg: 0 28px 56px -22px rgba(33, 26, 18, .45), 0 4px 14px rgba(33, 26, 18, .08);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --wrap: 1240px;
}

/* ---- Base ----------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--parchment);
    color: var(--text);
    font: 400 15px/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
main { flex: 1 0 auto; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0; color: var(--ink-2); letter-spacing: .005em; }
p { margin: 0; }
a { color: var(--gold-lo); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--walnut-2); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--gold-pale); color: var(--ink); }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.emblem { width: 40px; height: 40px; flex: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--gold-pale); border-radius: var(--r-sm); transition: top .2s; }
.skip-link:focus { top: 12px; color: var(--gold-pale); }

.eyebrow {
    font: 600 .72rem/1.2 var(--sans);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold-lo);
}
.eyebrow--gold { color: var(--gold-hi); }

.gold-text {
    background: var(--gold-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Gold hairline with a small cross at its centre — the section divider. */
.rule {
    position: relative;
    height: 14px;
    margin: 18px 0;
    background: var(--gold-rule) center / 100% 1px no-repeat;
}
.rule::after {
    content: '';
    position: absolute;
    left: 50%; top: 0;
    width: 10px; height: 14px;
    transform: translateX(-50%);
    background:
        linear-gradient(var(--gold), var(--gold)) center / 2px 100% no-repeat,
        linear-gradient(var(--gold), var(--gold)) center 32% / 100% 2px no-repeat;
    box-shadow: 0 0 0 5px var(--paper);
    background-color: var(--paper);
}

/* ---- Buttons --------------------------------------------------------------- */

.btn {
    --bg: var(--walnut);
    --fg: #fff;
    --bd: transparent;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55em;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--bd);
    border-radius: var(--r-sm);
    background: var(--bg);
    color: var(--fg);
    font: 600 .9rem/1 var(--sans);
    letter-spacing: .01em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, color .2s, border-color .2s;
}
.btn:hover { color: var(--fg); transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(18, 17, 20, .55); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled], .btn.is-busy { cursor: progress; opacity: .85; transform: none; }

.btn--primary { --bg: var(--ink-2); --fg: var(--gold-pale); --bd: rgba(216, 180, 132, .35); }
.btn--primary:hover { --bg: #000; }
.btn--walnut { --bg: var(--walnut); --fg: #fff; }
.btn--walnut:hover { --bg: var(--walnut-2); }

.btn--gold { --fg: var(--ink); background: var(--gold-grad); background-size: 220% 100%; background-position: 0 0; border-color: rgba(143, 111, 66, .5); transition: background-position .6s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.btn--gold:hover { background-position: 100% 0; box-shadow: 0 10px 24px -10px rgba(143, 111, 66, .8); }

.btn--ghost { --bg: transparent; --fg: var(--text-2); --bd: var(--line-strong); }
.btn--ghost:hover { --bg: var(--paper); --bd: var(--gold); --fg: var(--ink-2); }
.btn--ghost-light { --bg: rgba(255, 255, 255, .04); --fg: var(--gold-pale); --bd: rgba(216, 180, 132, .35); }
.btn--ghost-light:hover { --bg: rgba(216, 180, 132, .14); --bd: var(--gold-hi); --fg: #fff; }

.btn--sm { min-height: 34px; padding: 0 12px; font-size: .8rem; border-radius: 9px; }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.btn--block { width: 100%; }

/* Light sweep across gold/primary buttons on hover. */
.btn--gold::after, .btn--primary::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .7s var(--ease);
}
.btn--primary::after { background: linear-gradient(110deg, transparent 30%, rgba(216, 180, 132, .22) 50%, transparent 70%); }
.btn--gold:hover::after, .btn--primary:hover::after { transform: translateX(120%); }

.btn .spinner { display: none; }
.btn.is-busy .spinner { display: inline-block; }
.btn.is-busy .btn__icon { display: none; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 34px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: var(--paper);
    color: var(--text-2);
    cursor: pointer;
    transition: border-color .2s, color .2s, background-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { border-color: var(--gold); color: var(--ink); transform: translateY(-1px); }
.icon-btn.is-done { color: var(--green); border-color: var(--green); }

/* ---- Chips ----------------------------------------------------------------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--paper);
    color: var(--text-2);
    font: 500 .72rem/1.5 var(--sans);
    letter-spacing: .02em;
    white-space: nowrap;
}
.chip .i { width: 1em; height: 1em; }
.chip--code { font: 600 .74rem/1.5 var(--mono); letter-spacing: .06em; color: var(--ink-2); background: var(--stone-2); border-color: transparent; }
.chip--gold { background: rgba(216, 180, 132, .16); border-color: rgba(180, 144, 96, .45); color: var(--gold-lo); }
.chip--internal { background: var(--red-bg); border-color: transparent; color: var(--red); font-weight: 600; }
.chip--warn { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.chip--draft { background: var(--slate-bg); border-color: transparent; color: var(--slate); }
.chip--ok { background: var(--green-bg); border-color: transparent; color: var(--green); }
.chip--neutral { background: var(--stone-2); border-color: transparent; }
.chip--dark { background: rgba(255, 255, 255, .06); border-color: rgba(216, 180, 132, .3); color: var(--gold-pale); }

/* ---- Top bar ---------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(18, 17, 20, .94);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    color: var(--gold-pale);
}
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold-rule); opacity: .7; }
.topbar__inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-right: auto; }
.brand:hover { color: inherit; }
.brand__mark { width: 42px; height: 42px; transition: transform .5s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-4deg) scale(1.06); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font: 400 1.25rem/1.1 var(--serif); color: #f3e6c8; letter-spacing: .01em; }
.brand__sub { font: 500 .66rem/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-top: 3px; }

.topnav { display: flex; gap: 4px; }
.topnav__link {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-radius: 9px;
    color: rgba(236, 217, 176, .72);
    font-size: .86rem; font-weight: 500;
    text-decoration: none;
    position: relative;
    transition: color .2s, background-color .2s;
}
.topnav__link:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.topnav__link.is-active { color: var(--gold-pale); }
.topnav__link.is-active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -14px; height: 2px; border-radius: 2px; background: var(--gold-grad); }

.topbar__tools { display: flex; align-items: center; gap: 12px; }
.idle {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(216, 180, 132, .22);
    color: rgba(236, 217, 176, .75);
    font-size: .76rem;
    transition: color .3s, border-color .3s, background-color .3s;
}
.idle__time { font-family: var(--mono); font-weight: 600; color: var(--gold-pale); min-width: 3.4em; }
.idle.is-warn { border-color: #e2a35b; background: rgba(226, 163, 91, .12); color: #f6c98f; }
.idle.is-warn .idle__time { color: #ffd9a8; }

/* ---- Hero bands --------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    color: #efe6d6;
    background:
        radial-gradient(900px 420px at 85% -10%, rgba(216, 180, 132, .22), transparent 60%),
        radial-gradient(700px 400px at -10% 120%, rgba(94, 86, 77, .55), transparent 60%),
        linear-gradient(160deg, var(--ink) 0%, #1f1b17 55%, #2b251f 100%);
    padding: 44px 0 96px;
}
.hero::before {   /* faint grain so large dark fields don't band */
    content: '';
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}
.hero__art { position: absolute; right: -40px; bottom: -36px; width: min(560px, 60vw); opacity: .5; pointer-events: none; }
.hero__inner { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero__title { font-size: clamp(2rem, 4vw, 3rem); color: #f6ecd8; margin-top: 8px; }
.hero__sub { margin-top: 10px; color: rgba(239, 230, 214, .72); max-width: 640px; }
.hero__sub em { font-family: var(--serif); font-style: italic; color: var(--gold-hi); font-size: 1.05em; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Timber-frame line art; strokes draw themselves in on load. */
.truss path { stroke: var(--gold-hi); stroke-linecap: round; stroke-linejoin: round; }
.truss__crosses path { stroke-width: 7; stroke: #8a6a44; }
.truss__frame path { stroke-width: 3; }
.truss__studs path { stroke-width: 1.4; opacity: .55; }
.truss__ground { stroke-width: 2.2; opacity: .8; }
.js .truss path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s var(--ease) forwards; animation-delay: calc(var(--i) * 55ms + 150ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---- Stat tiles ------------------------------------------------------------------ */

.stats {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: -60px;
}
.stat {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 20px;
    border-radius: var(--r);
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.stat::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--gold-grad); opacity: .85; }
.stat__icon {
    display: grid; place-items: center;
    width: 44px; height: 44px; flex: none;
    border-radius: 12px;
    background: linear-gradient(150deg, var(--ink-2), var(--ink-3));
    color: var(--gold-hi);
    font-size: 1.15rem;
    box-shadow: inset 0 0 0 1px rgba(216, 180, 132, .25);
}
.stat__value { font: 400 2rem/1 var(--serif); color: var(--ink-2); }
.stat__value--sm { font-size: 1.25rem; line-height: 1.2; }
.stat__label { margin-top: 4px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.stat__foot { margin-top: 2px; font-size: .74rem; color: var(--muted); }

/* ---- Panels & cards -------------------------------------------------------------- */

.panel {
    margin-top: 28px;
    padding: clamp(18px, 2.4vw, 28px);
    border-radius: var(--r-lg);
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.panel__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.panel__title { font-size: 1.6rem; }
.panel__title small { font: 500 .8rem var(--sans); color: var(--muted); margin-left: 8px; letter-spacing: 0; }

.card {
    padding: 22px;
    border-radius: var(--r);
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card__title { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin-bottom: 4px; }
.card__title .i { color: var(--gold-lo); }
.card--ink {
    background: linear-gradient(160deg, var(--ink-2), #2b251f);
    border-color: rgba(216, 180, 132, .25);
    color: rgba(239, 230, 214, .78);
}
.card--ink .card__title { color: var(--gold-pale); }
.card--ink .card__title .i { color: var(--gold-hi); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: min(360px, 100%);
}
.search .i { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search input {
    width: 100%;
    height: 42px;
    padding: 0 40px 0 40px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--parchment);
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.search input:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(180, 144, 96, .18); }
.search kbd {
    position: absolute; right: 10px;
    padding: 1px 7px;
    border-radius: 5px;
    border: 1px solid var(--line-strong);
    background: var(--paper);
    font: 600 .7rem/1.5 var(--mono);
    color: var(--muted);
    pointer-events: none;
}
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }

.select select {
    height: 42px;
    padding: 0 38px 0 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: var(--parchment) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371685e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat;
    appearance: none;
    cursor: pointer;
}
.select select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(180, 144, 96, .18); }

/* ---- Avatars ------------------------------------------------------------------------ */

.avatar {
    --size: 52px;
    position: relative;
    display: grid;
    place-items: center;
    width: var(--size); height: var(--size); flex: none;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--ink-2), #3a3129);
    color: var(--gold-pale);
    font: 400 calc(var(--size) * .4)/1 var(--serif);
    letter-spacing: .02em;
}
.avatar::before {   /* gold ring */
    content: '';
    position: absolute; inset: -3px;
    border-radius: 50%;
    padding: 2px;
    background: var(--gold-grad);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.avatar--xl { --size: 92px; }

/* ---- Client cards (dashboard) ------------------------------------------------------- */

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

.client-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px;
    border-radius: var(--r);
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.client-card::before { content: ''; position: absolute; left: 22px; right: 22px; top: -1px; height: 2px; border-radius: 2px; background: var(--gold-grad); transform: scaleX(0); transition: transform .45s var(--ease); }
.client-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(180, 144, 96, .45); }
.client-card:hover::before { transform: scaleX(1); }
.client-card.is-new { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(180, 144, 96, .2), var(--shadow); }

.client-card__head { display: flex; gap: 14px; align-items: center; }
.client-card__name { font-size: 1.35rem; line-height: 1.2; }
.client-card__name a { color: var(--ink-2); text-decoration: none; }
.client-card__name a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }   /* whole card is the link */
.client-card__name a:focus-visible { outline: none; }
.client-card:has(.client-card__name a:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.client-card__since { margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .76rem; color: var(--muted); }

.contact { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: .86rem; }
.contact__row { display: flex; gap: 10px; align-items: flex-start; min-width: 0; color: var(--text-2); }
.contact__row .i { color: var(--gold-lo); margin-top: .2em; }
.contact__row a { position: relative; z-index: 2; color: var(--text-2); text-decoration: none; overflow-wrap: anywhere; }
.contact__row a:hover { color: var(--gold-lo); text-decoration: underline; }
.contact__row.is-empty { color: #a39a8f; font-style: italic; }
.contact__row.is-empty .i { color: #c4bcb1; }

.client-card__badges { display: flex; gap: 6px; flex-wrap: wrap; }
.client-card__foot {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px dashed var(--line-strong);
}
.client-card__updated { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.client-card__actions { display: flex; gap: 8px; position: relative; z-index: 2; }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .emblem { width: 64px; height: 64px; margin: 0 auto 14px; opacity: .7; }
.empty h3 { font-size: 1.35rem; color: var(--text-2); margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

/* ---- Drawer (new client) ------------------------------------------------------------- */

.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(18, 17, 20, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .28s; }
.drawer__panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: min(520px, 100%);
    display: flex; flex-direction: column;
    background: var(--paper);
    box-shadow: -30px 0 60px -20px rgba(18, 17, 20, .5);
    transform: translateX(100%);
    transition: transform .34s var(--ease);
}
.drawer__form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head {
    position: relative;
    padding: 26px 28px 22px;
    background: linear-gradient(160deg, var(--ink), #2b251f);
    color: rgba(239, 230, 214, .75);
}
.drawer__head::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold-rule); }
.drawer__head h2 { color: #f6ecd8; font-size: 1.8rem; margin-top: 6px; }
.drawer__head p { margin-top: 6px; font-size: .86rem; }
.drawer__close { position: absolute; top: 18px; right: 18px; background: rgba(255, 255, 255, .06); border-color: rgba(216, 180, 132, .3); color: var(--gold-pale); }
.drawer__close:hover { color: #fff; border-color: var(--gold-hi); }
.drawer__body { flex: 1; overflow-y: auto; padding: 24px 28px; }
.drawer__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--parchment); }

.code-preview {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    margin-bottom: 22px;
    border-radius: var(--r-sm);
    background: var(--parchment);
    border: 1px dashed rgba(180, 144, 96, .6);
    font-size: .8rem;
    color: var(--muted);
}
.code-preview strong { display: block; font: 600 1.25rem/1.2 var(--mono); letter-spacing: .08em; color: var(--ink-2); }

/* ---- Forms -------------------------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

.field { display: block; }
.field__label { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.field__control { position: relative; display: flex; align-items: center; }
.field__control > .i { position: absolute; left: 14px; color: var(--muted); pointer-events: none; transition: color .2s; }
.field__control:focus-within > .i { color: var(--gold-lo); }
.input, .field select {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.field select { padding-left: 14px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371685e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px no-repeat; cursor: pointer; }
.input:hover, .field select:hover { border-color: var(--sand); }
.input:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(180, 144, 96, .2); }
.input::placeholder { color: #aaa197; }
.input--pw { padding-right: 50px; }
.input--plain { padding-left: 14px; }   /* no leading icon */
.pw-toggle { position: absolute; right: 7px; border: 0; background: transparent; }
.pw-toggle .i-off { display: none; }
.pw-toggle.is-on .i-on { display: none; }
.pw-toggle.is-on .i-off { display: inline; }
.field__hint { margin-top: 7px; font-size: .78rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.field__hint--warn { color: var(--amber); }

.notice {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: .85rem;
    line-height: 1.45;
}
.notice .i { margin-top: .1em; }
.notice--info { background: rgba(216, 180, 132, .16); color: var(--gold-lo); border: 1px solid rgba(180, 144, 96, .35); }
.notice--error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(148, 55, 43, .25); }
.js .notice--error { animation: shake .45s var(--ease) 1; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

/* ---- Login ---------------------------------------------------------------------------- */

.page-login { background: var(--ink); }
.login { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); min-height: 100vh; }

.login-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: clamp(32px, 5vw, 72px);
    color: rgba(239, 230, 214, .8);
    background:
        radial-gradient(800px 500px at 50% -10%, rgba(216, 180, 132, .2), transparent 65%),
        radial-gradient(700px 500px at 0% 110%, rgba(94, 86, 77, .6), transparent 60%),
        linear-gradient(165deg, #0d0c0e 0%, var(--ink) 40%, #241f1a 100%);
}
.login-brand::before { content: ''; position: absolute; inset: 0; background: inherit; opacity: 0; }
.login-brand__art { position: absolute; left: 50%; bottom: -4%; width: min(980px, 120%); transform: translateX(-50%); opacity: .2; pointer-events: none; }
.login-brand__inner { position: relative; width: 100%; max-width: 620px; margin: 0 auto; }

.login-logo-wrap { position: relative; width: min(300px, 70%); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .9), 0 0 0 1px rgba(216, 180, 132, .25); }
.login-logo-wrap::after {   /* slow gold sheen across the badge */
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 236, 196, .28) 50%, transparent 65%);
    transform: translateX(-100%);
    animation: sheen 7s ease-in-out 1.2s infinite;
}
@keyframes sheen { 0% { transform: translateX(-100%); } 22%, 100% { transform: translateX(100%); } }

.login-tagline { margin-top: 34px; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.1; color: #f6ecd8; }
.login-tagline em { display: block; font-style: italic; }

.quotes { position: relative; margin: 26px 0 0; min-height: 7.6em; }
.quote { position: absolute; inset: 0 0 auto 0; margin: 0; padding-left: 20px; border-left: 2px solid var(--gold); opacity: 0; transform: translateY(8px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.quote.is-active { opacity: 1; transform: none; position: relative; }
.quote p { font: italic 400 1.08rem/1.55 var(--serif); color: rgba(246, 236, 216, .92); }
.quote footer { margin-top: 8px; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.quote-dots { display: flex; gap: 8px; margin-top: 14px; }
.quote-dots button { width: 22px; height: 4px; padding: 0; border: 0; border-radius: 4px; background: rgba(216, 180, 132, .25); cursor: pointer; transition: background-color .3s, width .3s var(--ease); }
.quote-dots button[aria-current="true"] { width: 36px; background: var(--gold-hi); }

.values { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.values li {
    padding: 16px 14px;
    border-radius: var(--r);
    border: 1px solid rgba(216, 180, 132, .18);
    background: rgba(255, 255, 255, .025);
    transition: border-color .3s, background-color .3s, transform .3s var(--ease);
}
.values li:hover { border-color: rgba(216, 180, 132, .5); background: rgba(216, 180, 132, .07); transform: translateY(-3px); }
.values__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(216, 180, 132, .12); color: var(--gold-hi); margin-bottom: 12px; font-size: 1.05rem; }
.values strong { display: block; font: 400 1.15rem/1.2 var(--serif); color: #f6ecd8; }
.values span:last-child { display: block; margin-top: 4px; font-size: .74rem; line-height: 1.45; color: rgba(239, 230, 214, .6); }

.login-est { margin-top: 30px; display: flex; gap: 10px 22px; flex-wrap: wrap; font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(216, 180, 132, .75); }
.login-est span { display: inline-flex; align-items: center; gap: 8px; }

.login-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 4vw, 56px);
    background:
        radial-gradient(600px 400px at 100% 0%, rgba(216, 180, 132, .18), transparent 60%),
        var(--parchment);
}
.login-panel::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(transparent, var(--gold) 30%, var(--gold-pale) 50%, var(--gold) 70%, transparent); }
.login-card { width: 100%; max-width: 420px; margin: 0 auto; }
.login-card__mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--ink); box-shadow: var(--shadow), inset 0 0 0 1px rgba(216, 180, 132, .3); margin-bottom: 26px; }
.login-card__mark .emblem { width: 44px; height: 44px; }
.login-title { margin-top: 10px; font-size: 2.5rem; }
.login-card > .muted { margin-top: 8px; }
.login-form { display: grid; gap: 18px; margin-top: 28px; }
.login-card .notice { margin-top: 20px; }
.login-secure { margin-top: 26px; display: flex; gap: 10px; font-size: .78rem; line-height: 1.5; color: var(--muted); }
.login-secure .i { color: var(--green); margin-top: .15em; }
.login-foot { margin-top: 40px; text-align: center; font-size: .75rem; color: var(--muted); }
.login-foot a { color: var(--text-2); }

/* ---- Client record ------------------------------------------------------------------------ */

.crumbs { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: rgba(239, 230, 214, .55); margin-bottom: 22px; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-hi); text-decoration: none; }
.crumbs a:hover { color: #fff; }
.crumbs [aria-current] { color: rgba(239, 230, 214, .85); }

.profile { position: relative; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.profile__main { flex: 1; min-width: 240px; }
.profile__meta { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 12px; font-size: .84rem; color: rgba(239, 230, 214, .7); }
.profile__meta span { display: inline-flex; align-items: center; gap: 6px; }
.profile__meta .chip--code { background: rgba(255, 255, 255, .08); color: var(--gold-pale); }
.profile__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; margin-top: 28px; padding-bottom: 12px; }
.layout > .panel { margin-top: 0; }
.side { position: sticky; top: 92px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: transparent;
    font-size: .8rem; font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: all .2s;
}
.filter:hover { border-color: var(--gold); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink-2); border-color: var(--ink-2); color: var(--gold-pale); }
.filter__n { font-size: .7rem; padding: 0 7px; border-radius: 999px; background: rgba(180, 144, 96, .2); }
.filter[aria-pressed="true"] .filter__n { background: rgba(216, 180, 132, .25); }

.group { border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; }
.group + .group { margin-top: 14px; }
.group__head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    background: linear-gradient(180deg, #fff, #fcfaf6);
    user-select: none;
}
.group__head::-webkit-details-marker { display: none; }
.group__head:hover { background: #faf6ef; }
.group__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--ink-2); color: var(--gold-hi); flex: none; }
.group__title { flex: 1; font: 400 1.15rem/1.25 var(--serif); color: var(--ink-2); }
.group__count { font: 600 .74rem/1 var(--sans); padding: 5px 10px; border-radius: 999px; background: var(--stone-2); color: var(--text-2); }
.group__chev { color: var(--muted); transition: transform .3s var(--ease); }
.group[open] .group__chev { transform: rotate(180deg); }
.group[open] .group__head { border-bottom: 1px solid var(--line); }

.doc-list { list-style: none; margin: 0; padding: 0; }
.doc {
    display: grid;
    grid-template-columns: 22px 52px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    transition: background-color .2s;
}
.doc:last-child { border-bottom: 0; }
.doc:hover { background: #fdfaf4; }
.doc.is-internal { background: linear-gradient(90deg, rgba(148, 55, 43, .05), transparent 40%); box-shadow: inset 3px 0 0 var(--red); }

.doc__tile {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 52px; height: 60px;
    border-radius: 8px 14px 8px 8px;
    background: var(--stone-2);
    color: var(--walnut-2);
    font: 700 .62rem/1 var(--sans);
    letter-spacing: .08em;
}
.doc__tile .i { font-size: 1.3rem; margin-bottom: 5px; }
.doc__tile b { font: 400 1.35rem/1 var(--serif); letter-spacing: 0; margin-bottom: 4px; color: var(--ink-2); }
.doc__tile--pdf { background: #f3e2dc; color: #8c3b2c; }
.doc__tile--web { background: #e3e9ee; color: #3c5163; }
.doc__tile--image { background: #e5ecdf; color: #3d6837; }
.doc__tile--archive, .doc__tile--sheet { background: #ece4d4; color: #6b5226; }
.doc__tile--text, .doc__tile--doc { background: #e6e2ef; color: #4a3f6e; }

.doc__title { font-weight: 600; color: var(--ink-2); text-decoration: none; line-height: 1.4; }
.doc__title:hover { color: var(--gold-lo); text-decoration: underline; }
.doc__chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.doc__chips .chip { white-space: normal; }
.doc__desc { margin-top: 7px; font-size: .84rem; color: var(--text-2); line-height: 1.5; }
.doc__audience { margin-top: 6px; display: flex; gap: 7px; align-items: flex-start; font-size: .78rem; color: var(--gold-lo); }
.doc__audience .i { margin-top: .15em; }
.doc.is-internal .doc__audience { color: var(--red); font-weight: 500; }
.doc__meta { margin-top: 6px; font-size: .74rem; color: var(--muted); overflow-wrap: anywhere; }
.doc__actions { display: flex; gap: 8px; align-items: center; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 18px; }
.gallery:not(:first-child) { border-top: 1px solid var(--line); }
.shot { position: relative; margin: 0; border-radius: var(--r-sm); overflow: hidden; background: var(--paper); border: 1px solid var(--line); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.shot:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.shot__img { display: block; aspect-ratio: 4 / 3; background: var(--stone-2); overflow: hidden; }
.shot__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.shot:hover .shot__img img { transform: scale(1.06); }
.shot figcaption { display: flex; align-items: center; gap: 8px; padding: 9px 10px; font-size: .76rem; font-weight: 500; color: var(--text-2); }
.shot figcaption span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot .icon-btn { width: 28px; height: 28px; border-radius: 7px; }
.shot__by { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .68rem; font-weight: 400; color: var(--muted); }

/* Upload */
.dropzone {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    gap: 6px;
    min-height: 150px;
    padding: 20px;
    border-radius: var(--r);
    border: 1.5px dashed rgba(180, 144, 96, .65);
    background:
        radial-gradient(300px 120px at 50% 0%, rgba(216, 180, 132, .16), transparent 70%),
        var(--parchment);
    color: var(--text-2);
    transition: border-color .2s, background-color .2s, transform .2s var(--ease);
}
.dropzone .i { font-size: 1.9rem; color: var(--gold-lo); margin-bottom: 4px; transition: transform .3s var(--ease); }
.dropzone strong { font-size: .9rem; }
.dropzone span { font-size: .76rem; color: var(--muted); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--gold); }
.dropzone:focus-within { box-shadow: 0 0 0 4px rgba(180, 144, 96, .2); }
.dropzone.is-drag { border-color: var(--gold-lo); background-color: #f3e7cf; transform: scale(1.01); }
.dropzone.is-drag .i { transform: translateY(-4px); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--green-bg); }
.dropzone.has-file .i { color: var(--green); }
.upload-form { display: grid; gap: 16px; margin-top: 16px; }

/* Upload batch: one row per chosen file, each with its own type */
.batch { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.batch[hidden] { display: none; }
.batch__row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; }
.batch__thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #efe8dc; display: grid; place-items: center; font-size: .66rem; font-weight: 700; color: var(--muted); }
.batch__meta { display: grid; gap: 4px; min-width: 0; }
.batch__name { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch__size { font-size: .72rem; color: var(--muted); }
.batch__type {
    width: 100%; min-height: 44px; padding: 0 36px 0 12px; font: inherit; font-size: 16px;   /* 16px: no zoom-on-focus */
    border-radius: var(--r-sm); border: 1px solid var(--line-strong); color: var(--text);
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371685e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat;
}
.batch__type:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(180, 144, 96, .2); }
.batch__rm { width: 40px; height: 40px; font-size: 1.4rem; line-height: 1; }
.field[hidden] { display: none; }
.field select { font-size: 16px; }

/* Client uploads awaiting review */
.review-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin: 0 14px 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--amber-bg); color: var(--amber); font-size: .82rem; }
.review-bar p { display: flex; gap: 8px; align-items: flex-start; margin: 0; flex: 1 1 260px; }
.review { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 8px; }
.review__decline > summary { list-style: none; }
.review__decline > summary::-webkit-details-marker { display: none; }
.review__decline[open] > summary { opacity: .7; }
.review__why { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; width: 100%; }
.review__why .input { height: 40px; flex: 1 1 200px; font-size: 16px; }
.review__decline[open] { flex-basis: 100%; }
.shot__review { padding: 0 10px 10px; display: grid; gap: 6px; }
#review, #upload { scroll-margin-top: 84px; }   /* clear the sticky top bar */
.shot__note { margin: 0; font-size: .74rem; color: var(--text-2); overflow-wrap: anywhere; }
.file-info { display: flex; gap: 10px; align-items: center; font-size: .8rem; color: var(--text-2); }
.file-info.is-bad { color: var(--red); }
.file-info span { min-width: 0; overflow-wrap: anywhere; }
.dropzone .dz-touch { display: none; font-size: inherit; color: inherit; }
@media (hover: none) and (pointer: coarse) {
    .dropzone .dz-desk { display: none; }
    .dropzone .dz-touch { display: inline; }
}

.details { margin: 14px 0 0; display: grid; gap: 0; }
.details__row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line-strong); font-size: .86rem; }
.details__row:last-child { border-bottom: 0; }
.details dt { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.details dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.details dd.is-empty { color: #a39a8f; font-style: italic; }
.details dd a { color: var(--ink-2); }
.details .icon-btn { width: 30px; height: 30px; }

/* ---- Batch download: buttons, tick boxes, selection bar ------------------------------------- */

.dl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn__meta { font-weight: 500; font-size: .72rem; opacity: .72; padding-left: 8px; margin-left: 2px; border-left: 1px solid currentColor; }
.docs-toolbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 18px; }
.docs-toolbar .search { flex: 1; }
.pick-all { display: inline-flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 500; color: var(--text-2); }

.pick { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; margin-top: 1px; }
.pick input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.pick__box {
    display: grid; place-items: center;
    width: 20px; height: 20px;
    border-radius: 6px;
    border: 1.5px solid #b9afa2;
    background: #fff;
    color: transparent;
    transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease);
}
.pick__box .i { width: 13px; height: 13px; }
.pick:hover .pick__box { border-color: var(--gold); }
.pick input:checked + .pick__box { background: var(--ink-2); border-color: var(--ink-2); color: var(--gold-hi); transform: scale(1.05); }
.pick input:indeterminate + .pick__box { background: var(--ink-2); border-color: var(--ink-2); }
.pick input:indeterminate + .pick__box .i { display: none; }
.pick input:indeterminate + .pick__box::after { content: ''; width: 10px; height: 2px; border-radius: 2px; background: var(--gold-hi); }
.pick input:focus-visible + .pick__box { outline: 2px solid var(--gold); outline-offset: 2px; }
.pick input:disabled { cursor: not-allowed; }
.pick input:disabled + .pick__box { opacity: .35; }
.pick--overlay { position: absolute; top: 8px; left: 8px; z-index: 2; }
.pick--overlay .pick__box { box-shadow: 0 1px 5px rgba(0, 0, 0, .35); }

.doc.is-selected { background: #fbf3e3; }
.doc.is-internal.is-selected { background: linear-gradient(90deg, rgba(148, 55, 43, .08), #fbf3e3 40%); }
.shot.is-selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }

.group__dl { width: 30px; height: 30px; }
.group__dl .spinner { width: 14px; height: 14px; display: none; }
.group__dl.is-busy .spinner { display: inline-block; }
.group__dl.is-busy .btn__icon { display: none; }

.dl-fallback { margin-top: 18px; }
.js .dl-fallback { display: none; }

.selbar {
    position: fixed;
    left: 50%; bottom: 20px;
    z-index: 70;
    display: flex; align-items: center; gap: 10px;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 10px 10px 10px 20px;
    border-radius: 16px;
    background: rgba(27, 25, 23, .97);
    border: 1px solid rgba(216, 180, 132, .35);
    color: rgba(239, 230, 214, .8);
    box-shadow: var(--shadow-lg);
    transform: translate(-50%, 160%);
    visibility: hidden;
    transition: transform .35s var(--ease), visibility 0s linear .35s;
}
.selbar.is-on { transform: translate(-50%, 0); visibility: visible; transition: transform .35s var(--ease); }
.selbar__info { font-size: .84rem; margin-right: 6px; }
.selbar__info strong { font: 400 1.25rem/1 var(--serif); color: var(--gold-pale); }
.selbar__warn { color: #f0b7a6; }
.js .has-selection main { padding-bottom: 90px; }

/* ---- E-signatures: status strips, "to sign" call-outs, dashboard notice ---------------------- */

.anchor { display: block; position: relative; top: -96px; visibility: hidden; }
.chip small { font-size: .9em; opacity: .8; }
.chip--sign { background: var(--ink-2); border-color: transparent; color: var(--gold-pale); font-weight: 600; }

.doc__sigs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.doc__sigs .chip { display: inline-block; white-space: normal; text-align: left; }
.doc__sigs .chip .i { margin-right: .35em; vertical-align: -.15em; }
.doc__sigs-label { font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }

.sign-callout { margin: 22px 0 4px; border-color: rgba(180, 144, 96, .6); background: linear-gradient(180deg, #fffaf0, #fff); box-shadow: 0 0 0 4px rgba(216, 180, 132, .14), var(--shadow-sm); }
.sign-callout__list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.sign-callout__list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); }
.sign-callout__list li > div { flex: 1 1 240px; min-width: 0; }

.sign-notice { margin-top: 28px; border-color: rgba(180, 144, 96, .55); background: linear-gradient(170deg, #fffaf0 0%, var(--paper) 55%); box-shadow: 0 0 0 4px rgba(216, 180, 132, .14), var(--shadow); }
.sign-notice__head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.sign-notice__icon {
    position: relative; display: grid; place-items: center; flex: none;
    width: 54px; height: 54px; border-radius: 16px;
    background: linear-gradient(150deg, var(--ink-2), var(--ink-3)); color: var(--gold-hi); font-size: 1.4rem;
    box-shadow: inset 0 0 0 1px rgba(216, 180, 132, .3);
}
.sign-notice__count {
    position: absolute; top: -7px; right: -7px; min-width: 24px; height: 24px; padding: 0 7px;
    display: grid; place-items: center; border-radius: 999px;
    background: var(--gold-grad); color: var(--ink); font: 700 .74rem/1 var(--sans);
    box-shadow: 0 0 0 3px var(--paper);
}
.js .sign-notice__count { animation: pulse-ring 2.4s var(--ease) infinite; }
@keyframes pulse-ring { 0%, 70%, 100% { box-shadow: 0 0 0 3px var(--paper); } 35% { box-shadow: 0 0 0 3px var(--paper), 0 0 0 9px rgba(216, 180, 132, .35); } }
.sign-notice__client { border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; }
.sign-notice__client + .sign-notice__client { margin-top: 14px; }
.sign-notice__who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fcfaf6; }
.sign-notice__who > div { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sign-notice__who strong { font: 400 1.2rem/1.2 var(--serif); color: var(--ink-2); }
.sign-notice__who .avatar { --size: 40px; }
.sign-notice__docs { list-style: none; margin: 0; padding: 0; }
.sign-notice__docs li + li { border-top: 1px solid var(--line); }
.sign-notice__doc { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; color: inherit; text-decoration: none; transition: background-color .2s; }
.sign-notice__doc:hover { background: #fdf6e8; color: inherit; }
.sign-notice__doc:hover .btn--gold { background-position: 100% 0; }
.sign-notice__no { display: grid; place-items: center; width: 40px; height: 44px; border-radius: 8px 12px 8px 8px; background: #f3e2dc; color: var(--ink-2); font: 400 1.2rem/1 var(--serif); }
.sign-notice__text b { display: block; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.sign-notice__text .doc__sigs { margin-top: 6px; }

.sign-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--gold-grad); color: var(--ink); text-decoration: none;
    font-size: .78rem; font-weight: 600;
    box-shadow: 0 0 0 1px rgba(143, 111, 66, .5);
}
.sign-pill:hover { color: var(--ink); filter: brightness(1.06); }
.sign-pill__n { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: var(--gold-pale); font-size: .72rem; }

@media (max-width: 600px) {
    .sign-notice__head { gap: 12px; }
    .sign-notice__icon { width: 44px; height: 44px; border-radius: 12px; }
    .sign-notice__doc { grid-template-columns: 34px minmax(0, 1fr); padding: 12px; }
    .sign-notice__doc .btn { grid-column: 2; justify-self: start; }
    .sign-notice__no { width: 34px; height: 40px; font-size: 1.05rem; }
    .sign-pill__label { display: none; }
    .sign-pill { padding: 5px 8px; gap: 5px; }
    .sign-callout__list li .btn { width: 100%; }
}

/* Small phones: keep the top bar on one line when the "to sign" badge shows. */
.brand { min-width: 0; }
.brand__text { min-width: 0; }
.brand__name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
    .topbar__inner { gap: 10px; }
    .topbar__tools { gap: 6px; }
    .brand { gap: 8px; }
    .brand__mark { width: 30px; height: 30px; }
    .brand__name { font-size: .95rem; }
    .brand__sub { display: none; }
    .idle { padding: 5px 8px; gap: 4px; }
    .idle > .i { display: none; }
    .topbar .btn--sm { padding: 0 8px; min-height: 32px; }
}

/* ---- Toasts ----------------------------------------------------------------------------------- */

.toast {
    position: fixed;
    right: 20px; bottom: 20px;
    z-index: 80;
    display: flex; align-items: center; gap: 12px;
    max-width: min(440px, calc(100vw - 40px));
    padding: 14px 14px 14px 18px;
    border-radius: var(--r);
    background: var(--ink-2);
    color: #f1e6d0;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(216, 180, 132, .3);
    font-size: .86rem;
    animation: toast-in .5s var(--ease) both;
}
.toast > .i { font-size: 1.3rem; }
.toast--success > .i { color: #9fd18f; }
.toast--error > .i { color: #f2a08f; }
.toast p { flex: 1; }
.toast__close { border: 0; background: transparent; color: rgba(241, 230, 208, .6); cursor: pointer; padding: 4px; border-radius: 6px; }
.toast__close:hover { color: #fff; }
.toast.is-leaving { animation: toast-out .35s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

/* ---- Footer ------------------------------------------------------------------------------------ */

.site-foot { margin-top: 56px; background: var(--ink); color: rgba(239, 230, 214, .6); position: relative; }
.site-foot::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--gold-rule); opacity: .6; }
.site-foot__inner { display: flex; align-items: center; justify-content: space-between; gap: 18px 32px; flex-wrap: wrap; padding-top: 28px; padding-bottom: 20px; }
.site-foot__brand { display: flex; align-items: center; gap: 12px; }
.site-foot__brand strong { display: block; font: 400 1.05rem/1.2 var(--serif); color: #f3e6c8; }
.site-foot__brand span { font-size: .74rem; }
.site-foot__meta { font-size: .78rem; }
.site-foot__meta a { color: var(--gold-hi); text-decoration: none; }
.site-foot__mission { padding: 14px 16px 18px; text-align: center; font: italic 400 .98rem/1.4 var(--serif); color: var(--gold); border-top: 1px solid rgba(216, 180, 132, .1); }

.values-line { list-style: none; display: flex; align-items: center; gap: 14px; margin: 0; padding: 0; font: 600 .7rem/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: var(--gold-hi); }
.values-line li { display: inline-flex; align-items: center; gap: 14px; }
.values-line li + li::before {
    content: '';
    width: 8px; height: 11px;
    background:
        linear-gradient(var(--gold), var(--gold)) center / 1.5px 100% no-repeat,
        linear-gradient(var(--gold), var(--gold)) center 30% / 100% 1.5px no-repeat;
}

/* ---- Reveal-on-load motion ---------------------------------------------------------------------- */

/* Plain on-load animation (not scroll-triggered), so nothing can be left
   invisible — e.g. below the fold when a page is printed. */
.js [data-reveal] { animation: rise .7s var(--ease) both; animation-delay: calc(var(--d, 0) * 70ms + 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
    .js .truss path { stroke-dashoffset: 0; }
}

/* ---- Report (print-ready letterhead) --------------------------------------------------------------- */

.page-report { background: var(--stone-2); }
.report-bar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(18, 17, 20, .94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--gold-pale);
}
.report-bar__inner { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.report-bar__title { margin-right: auto; display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.report-bar__title .emblem { width: 32px; height: 32px; }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: .8rem; color: rgba(236, 217, 176, .85); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: rgba(255, 255, 255, .15); position: relative; cursor: pointer; transition: background-color .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { transform: translateX(16px); }

.sheet {
    width: min(900px, calc(100% - 32px));
    margin: 32px auto 48px;
    padding: clamp(24px, 5vw, 56px);
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 30px 60px -30px rgba(33, 26, 18, .45), 0 2px 8px rgba(33, 26, 18, .08);
}
.letterhead { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.letterhead__logo { width: 190px; border-radius: 14px; }
.letterhead__co { text-align: right; font-size: .82rem; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; min-width: 0; }
.letterhead__co strong { display: block; font: 400 1.25rem/1.2 var(--serif); color: var(--ink-2); }
.report-title { margin-top: 6px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.report-title h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.report-title p { font-size: .82rem; color: var(--muted); }
.report-client { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; margin-top: 24px; padding: 20px 22px; border-radius: 10px; background: var(--parchment); border: 1px solid var(--line); }
.report-client dt { font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.report-client dd { margin: 3px 0 0; font-size: .92rem; color: var(--ink-2); overflow-wrap: anywhere; }
.report-summary { margin-top: 18px; font-size: .86rem; color: var(--text-2); }
.report-section { margin-top: 30px; }
.report-section h2 { break-after: avoid; display: flex; align-items: center; gap: 10px; font-size: 1.3rem; padding-bottom: 8px; border-bottom: 2px solid var(--ink-2); }
.report-section h2 .count { font: 600 .72rem var(--sans); color: var(--muted); }
.report-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.report-table th { text-align: left; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line-strong); }
.report-table tr { break-inside: avoid; }
.report-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.report-table td:first-child { width: 44px; font-family: var(--serif); font-size: 1.05rem; color: var(--gold-lo); }
.report-table .t { font-weight: 600; color: var(--ink-2); }
.report-table .d { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.report-table .links { white-space: nowrap; text-align: right; }
.report-table .links a { margin-left: 10px; }
.report-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.report-photos figure { margin: 0; break-inside: avoid; }
.report-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.report-photos figcaption { margin-top: 6px; font-size: .76rem; color: var(--text-2); }
.report-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line-strong); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); }
.report-foot em { font-family: var(--serif); color: var(--gold-lo); font-size: .95rem; }
body.hide-internal .is-internal { display: none !important; }

/* ---- Responsive --------------------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout { grid-template-columns: minmax(0, 1fr); }
    .side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
    .side .card + .card { margin-top: 0; }
    .login { grid-template-columns: 1fr 1fr; }
    .values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .topnav { display: none; }
    .idle__label { display: none; }
    .login { grid-template-columns: 1fr; }
    .login-brand { padding: 32px 20px 36px; }
    .login-logo-wrap { width: 210px; margin: 0 auto; }
    .login-brand__inner { text-align: center; }
    .login-tagline { margin-top: 22px; font-size: 1.75rem; }
    .quotes, .quote-dots, .login-est { display: none; }
    .values { margin-top: 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .values li { padding: 10px 6px; text-align: center; }
    .values__icon { margin: 0 auto 6px; }
    .values span:last-child { display: none; }
    .values strong { font-size: .95rem; }
    .login-panel { padding: 32px 20px 28px; }
    .login-panel::before { display: none; }
    .login-title { font-size: 2.1rem; }
    .report-client { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    body { font-size: 14.5px; }
    .topbar__inner { min-height: 60px; gap: 12px; }
    .brand__mark { width: 36px; height: 36px; }
    .brand__name { font-size: 1rem; white-space: nowrap; }
    .brand__sub { letter-spacing: .16em; }
    .topbar .btn span { display: none; }
    .topbar .btn { padding: 0 10px; }
    .idle { padding: 6px 9px; }
    .hero { padding: 30px 0 84px; }
    .hero__actions, .hero__actions .btn { width: 100%; }
    .stats { gap: 10px; margin-top: -56px; }
    .stat { padding: 14px; gap: 10px; flex-direction: column; }
    .stat__icon { width: 36px; height: 36px; border-radius: 10px; }
    .stat__value { font-size: 1.6rem; }
    .stat__value--sm { font-size: 1.05rem; }
    .client-grid { grid-template-columns: 1fr; }
    .search { min-width: 100%; }
    .toolbar, .select, .select select { width: 100%; }
    .panel__head { align-items: stretch; }
    .form-grid { grid-template-columns: 1fr; }
    .doc { grid-template-columns: 22px 40px minmax(0, 1fr); padding: 14px 12px; gap: 10px; }
    .doc__tile { width: 40px; height: 50px; }
    .doc__actions { grid-column: 3; }
    .dl-actions, .dl-actions .btn { width: 100%; }
    .docs-toolbar .search { order: 3; }
    .selbar { left: 10px; right: 10px; bottom: 10px; transform: translateY(160%); flex-wrap: wrap; justify-content: flex-end; }
    .selbar.is-on { transform: none; }
    .selbar__info { flex: 1 1 100%; }
    .profile { gap: 16px; }
    .avatar--xl { --size: 68px; }
    .profile__actions, .profile__actions .btn { width: 100%; }
    .side { grid-template-columns: minmax(0, 1fr); }
    .drawer__head, .drawer__body, .drawer__foot { padding-left: 20px; padding-right: 20px; }
    .site-foot__inner { flex-direction: column; text-align: center; }
    .values-line { flex-wrap: wrap; justify-content: center; }
    .report-client { grid-template-columns: 1fr; }
    .letterhead__co { text-align: left; }
    .report-table .links { white-space: normal; }
    .report-table td:first-child { width: 30px; }
    .report-table th:nth-child(3), .report-table td:nth-child(3) { display: none; }
    .letterhead__logo { width: 150px; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; gap: 10px; }
}

@media print {
    @page { margin: 14mm; }
    body, .page-report { background: #fff; font-size: 11pt; }
    .no-print, .report-bar, .toast, .skip-link, .selbar, .pick, .dl-actions, .docs-toolbar { display: none !important; }
    .sheet { width: auto; margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
    .report-table .links { display: none; }
    a { color: inherit; text-decoration: none; }
    .report-client { background: #faf8f4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .letterhead__logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
