/* J+H CRM: one stylesheet, no build step.
   Matches the J+H dashboards (pmdashboard.jandhlabs.com): navy, orange accent, frosted cards,
   small uppercase labels, Gothic A1 throughout.
   Light and dark share these tokens. The theme is set on <html data-theme> by the layout:
   the switch in the top bar, else the computer's setting. */

:root {
    color-scheme: light;
    --navy: #141831;
    --navy-2: #222840;
    --orange: #fa7f31;
    --green: #22c55e;
    --red: #ff4444;
    --yellow: #ffe01b;
    --purple: #8b5cf6;

    --bg: #f3f4f8;
    --surface: #ffffff;           /* cards */
    --panel: #ffffff;             /* menus and dropdowns: always opaque */
    --tint: rgba(20, 24, 49, .035); /* table headers, inputs, open accordion bodies */
    --hover: rgba(20, 24, 49, .04);
    --text: #141831;
    --muted: #5d6178;
    --faint: #8a8ea3;
    --line: #e2e4ec;
    --line-strong: #cdd0dc;
    --header: #141831;
    --header-line: transparent;
    --sidebar: #141831;
    --accent: #fa7f31;
    --accent-text: #b8500f;       /* orange text that stays readable on white */
    --accent-soft: rgba(250, 127, 49, .12);
    --accent-line: rgba(250, 127, 49, .35);
    --link: #b8500f;
    --danger: #c62828;
    --danger-soft: rgba(255, 68, 68, .1);
    --danger-line: rgba(255, 68, 68, .3);
    --ok: #15803d;
    --ok-soft: rgba(34, 197, 94, .13);
    --ok-line: rgba(34, 197, 94, .3);
    --warn: #8a6100;
    --warn-soft: rgba(255, 196, 27, .18);
    --warn-line: rgba(255, 196, 27, .45);
    --info: #6d3fd8;
    --info-soft: rgba(139, 92, 246, .12);
    --shadow: 0 10px 30px rgba(20, 24, 49, .14);
    --folder: #ffffff;            /* the client page's folder: opaque, so the open tab covers the line under it */
    --radius: 12px;
    --radius-sm: 8px;

    --font: "Gothic A1", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141831;
    --surface: rgba(255, 255, 255, .05);
    --panel: #222840;
    --tint: rgba(255, 255, 255, .04);
    --hover: rgba(255, 255, 255, .03);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, .6);
    --faint: rgba(255, 255, 255, .38);
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .15);
    --header: #141831;
    --header-line: rgba(255, 255, 255, .08);
    --sidebar: #1b2036;
    --accent-text: #fa7f31;
    --accent-soft: rgba(250, 127, 49, .12);
    --accent-line: rgba(250, 127, 49, .4);
    --link: #fa7f31;
    --danger: #ff4444;
    --danger-soft: rgba(255, 68, 68, .15);
    --danger-line: rgba(255, 68, 68, .3);
    --ok: #22c55e;
    --ok-soft: rgba(34, 197, 94, .15);
    --ok-line: rgba(34, 197, 94, .25);
    --warn: #ffe01b;
    --warn-soft: rgba(255, 224, 27, .12);
    --warn-line: rgba(255, 224, 27, .25);
    --info: #a78bfa;
    --info-soft: rgba(139, 92, 246, .15);
    --shadow: 0 8px 24px rgba(0, 0, 0, .4);
    --folder: #262b46;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0; min-height: 100vh;
    font: 15px/1.55 var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; transition: opacity .15s; }
a:hover { text-decoration: underline; }
/* Names that open a record: dark text, orange on hover. */
a.name-link { color: var(--text); }
a.name-link:hover { color: var(--link); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 900; letter-spacing: -.01em; line-height: 1.15; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }

/* ---------- Sidebar ----------
   The menu down the left, like the project manager's: logo, search, grouped links with icons,
   and the person, dark-mode switch and sign-out at the bottom. Navy in both themes. */
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column;
    background: var(--sidebar); color: #fff; border-right: 1px solid var(--header-line);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 1.4rem 1.25rem 1rem; }
.sidebar-brand { display: block; color: #fff; }
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand img { display: block; height: 26px; width: auto; }
.sidebar-brand span { display: block; margin: .4rem 0 0 1rem; font-size: .8rem; font-weight: 700; letter-spacing: .18em; color: rgba(255, 255, 255, .5); }
.sidebar-toggle { display: none; }
.sidebar-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.nav-label { margin: 1.1rem .6rem .45rem; font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .4); }
.nav-label:first-child { margin-top: .5rem; }
.sidebar-nav .nav-label:not(:first-child) { padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .08); margin-left: -.75rem; margin-right: -.75rem; padding-left: 1.35rem; }
.nav-link {
    display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem .7rem; margin-bottom: .15rem;
    border-radius: var(--radius-sm); color: rgba(255, 255, 255, .72); font-size: .92rem; font-weight: 500; text-align: left;
    transition: color .15s, background .15s;
}
.nav-link .icon { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; }
a.nav-link:hover, button.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav-link.active { color: var(--orange); background: rgba(250, 127, 49, .16); }
.nav-link .count { margin-left: auto; }

.sidebar-foot { padding: .75rem .75rem 1rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-foot form { margin: 0; }
.sidebar-foot button.nav-link { justify-content: flex-start; background: none; border: 0; font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; }
.sidebar-foot button.nav-link:hover { opacity: 1; }
.sidebar .who { cursor: default; color: #fff; }
.sidebar .who .role { margin-left: auto; font-size: .72rem; color: rgba(255, 255, 255, .45); }

/* Light / dark switch: sun, a sliding switch, moon. The lit icon shows the current mode. */
.theme-switch { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .6rem .7rem; padding: 0; background: none; border: 0; cursor: pointer; }
.theme-switch:hover { background: none; opacity: 1; }
.theme-switch svg { width: 1rem; height: 1rem; color: rgba(255, 255, 255, .4); transition: color .2s; }
.theme-switch .track {
    position: relative; width: 2.6rem; height: 1.4rem; border-radius: 999px;
    background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .25); transition: background .2s, border-color .2s;
}
.theme-switch .knob {
    position: absolute; top: 2px; left: 2px; width: calc(1.4rem - 6px); height: calc(1.4rem - 6px);
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s;
}
.theme-switch[aria-checked="false"] .sun { color: #ffc41b; }
.theme-switch[aria-checked="true"] .moon { color: #fff; }
.theme-switch[aria-checked="true"] .track { background: var(--orange); border-color: var(--orange); }
.theme-switch[aria-checked="true"] .knob { transform: translateX(1.2rem); }
.theme-switch:hover .track { border-color: rgba(255, 255, 255, .5); }
.theme-switch:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; border-radius: 999px; }

/* Search, under the logo. Results open over the page, wider than the sidebar. */
.sidebar .search { position: relative; margin: 0 1rem .5rem; }
.sidebar .search .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: .95rem; height: .95rem; color: rgba(255, 255, 255, .45); pointer-events: none; }
.sidebar .search input {
    width: 100%; padding: .5rem .9rem .5rem 2.2rem; border-radius: var(--radius-sm); border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06); color: #fff; font-size: .88rem; box-shadow: none;
}
.sidebar .search input::placeholder { color: rgba(255, 255, 255, .45); }
.sidebar .search input:focus { border-color: var(--orange); background: rgba(255, 255, 255, .1); box-shadow: none; }
.search-results {
    position: absolute; left: 0; top: calc(100% + .5rem); width: 28rem; max-width: calc(100vw - 2rem); max-height: 70vh; overflow-y: auto;
    background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); z-index: 40; padding: .4rem;
}
.search-results .group { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; padding: .6rem .7rem .25rem; }
.search-results a { display: block; padding: .45rem .7rem; border-radius: 5px; color: var(--text); font-weight: 400; background: none; }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); text-decoration: none; }
.search-results .title { display: flex; gap: .4rem; align-items: center; font-weight: 700; font-size: .88rem; }
.search-results .detail { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results a.all { color: var(--link); font-size: .82rem; font-weight: 700; border-top: 1px solid var(--line); border-radius: 0 0 5px 5px; margin-top: .3rem; padding-top: .6rem; }
.search-results .empty { margin: 0; padding: .6rem .7rem; color: var(--muted); font-size: .88rem; }
.count { background: var(--orange); color: #fff; border-radius: 999px; padding: .1rem .45rem 0; font-size: .68rem; font-weight: 700; margin-left: .3rem; line-height: 1.4; }

/* Phone and small tablet: a bar across the top, with the menu folding down from it. */
@media (max-width: 900px) {
    .shell { display: block; }
    .sidebar { height: auto; max-height: 100vh; border-right: 0; border-bottom: 1px solid var(--header-line); }
    .sidebar-head { padding: .75rem 1rem; }
    .sidebar-brand span { display: none; }
    .sidebar-toggle { display: inline-flex; padding: .4rem; background: none; border: 0; color: #fff; }
    .sidebar-toggle .icon { width: 1.4rem; height: 1.4rem; }
    .sidebar-body { display: none; overflow-y: auto; }
    .sidebar[data-open="true"] .sidebar-body { display: flex; }
    .sidebar .search { margin-top: .25rem; }
    .sidebar-nav { overflow: visible; }
}

/* ---------- Page ---------- */
main { max-width: 1440px; margin: 0 auto; padding: 2.25rem 2.5rem 4rem; }
@media (max-width: 700px) { main { padding: 1.5rem 1rem 3rem; } }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .15rem; }
.page-head p { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* Cards: frosted panels with a border that brightens on hover */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.25rem; margin-bottom: 1rem; transition: border-color .15s;
}
.card:hover { border-color: var(--line-strong); }
.card > h2 { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .85rem; }
.card > h2 a.small { font-size: .8rem; font-weight: 700; }
.card > h2 span.small { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-align: right; }
.card.placeholder { color: var(--muted); border-style: dashed; background: transparent; }
.card.placeholder > h2 { color: var(--muted); }

/* Text */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-line; }
/* "How to work with" note: a plain card with an orange edge */
.callout {
    background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm); padding: .85rem 1.1rem; margin-bottom: 1.25rem;
}
.callout strong { color: var(--accent-text); }
code { font-size: .8rem; background: var(--tint); border: 1px solid var(--line); border-radius: 4px; padding: .05rem .35rem; }

/* ---------- Tables and lists ---------- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead { background: var(--tint); }
th { padding: .7rem .9rem; text-align: left; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
td { padding: .75rem .9rem; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--hover); }
/* A table that fills its card runs edge to edge, like the dashboard's table-wrap. */
.card > table:first-child, .card > table:only-child { margin: -1.25rem; width: calc(100% + 2.5rem); }
.card > table:first-child thead th:first-child, .card > table:first-child td:first-child { padding-left: 1.25rem; }
.card > table:first-child thead th:last-child, .card > table:first-child td:last-child { padding-right: 1.25rem; }
.card:has(> table:first-child) { overflow: hidden; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.1rem; margin: 0; }
dl.facts dt { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding-top: .2rem; }
dl.facts dd { margin: 0; font-weight: 500; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain > li { padding: .7rem 0; border-bottom: 1px solid var(--line); }
ul.plain > li:last-child { border-bottom: 0; }
ul.tight { margin: .35rem 0; padding-left: 1.1rem; }
ul.tight li { margin: .2rem 0; }

/* Badges: tinted uppercase pills, like the dashboard's status labels */
.badge {
    display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.5;
    padding: .2rem .55rem .1rem; border-radius: 999px; background: var(--tint); color: var(--muted); white-space: nowrap; vertical-align: middle;
    border: 1px solid var(--line);
}
.badge.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
a.badge:hover { text-decoration: none; filter: brightness(1.1); }
.pills { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .35rem; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: .4rem; }
label.inline, .checks label { text-transform: none; letter-spacing: 0; font-size: .9rem; color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
    width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    font: inherit; font-size: .9rem; color: var(--text); background: var(--tint); transition: border-color .15s, box-shadow .15s;
}
:root[data-theme="dark"] :is(input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea) { background: rgba(255, 255, 255, .06); border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
/* Selects get the dashboard's small caret instead of the system arrow. */
select {
    appearance: none; -webkit-appearance: none; padding-right: 2rem; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
    background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
select option { background: var(--panel); color: var(--text); }
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .6; cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
textarea { min-height: 5rem; resize: vertical; }
.field { margin-bottom: 1rem; }
.field .hint { font-weight: 400; color: var(--faint); font-size: .78rem; text-transform: none; letter-spacing: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; background: var(--surface); }
legend { font-weight: 700; font-size: 1rem; padding: 0 .4rem; }
.checks { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; }
.checks label, label.inline { display: inline-flex; align-items: center; gap: .45rem; font-weight: 400; }
.inline-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; flex: 1; min-width: 140px; }

/* Buttons: orange primary, neutral secondary, red-tinted danger */
button, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .55rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--accent);
    background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: .85rem; line-height: 1.4;
    cursor: pointer; text-decoration: none; transition: opacity .15s, background .15s, border-color .15s, color .15s;
}
button:hover, .button:hover { opacity: .88; text-decoration: none; }
button.secondary, .button.secondary { background: var(--tint); border-color: var(--line-strong); color: var(--text); }
button.secondary:hover, .button.secondary:hover { background: var(--hover); border-color: var(--accent); color: var(--accent-text); opacity: 1; }
button.danger, .button.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
button.danger:hover { background: rgba(255, 68, 68, .25); opacity: 1; }
button.link { display: inline; background: none; border: 0; color: var(--link); padding: 0; font-weight: 600; font-size: inherit; }
button.link:hover { text-decoration: underline; opacity: 1; }
button.link.danger { color: var(--danger); background: none; }
.button.small, button.small, h2 .button { padding: .35rem .8rem; font-size: .78rem; }
button.link.small { padding: 0; font-size: .82rem; }
form.inline { display: inline; }

details > summary { cursor: pointer; color: var(--link); margin: .5rem 0; font-weight: 600; font-size: .9rem; }

/* ---------- Messages ---------- */
.flash { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: .9rem; border: 1px solid; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.flash ul { margin: 0; padding-left: 1.1rem; }

/* Sign-in */
.signin { max-width: 420px; margin: 10vh auto; }
.signin.card { padding: 2.5rem; }

/* ---------- Production work (Asana) and media runs ---------- */
.project { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.project:last-of-type { border-bottom: 0; }
.project table { margin: .5rem 0; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 .25rem; max-width: 22rem; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress.warn > span { background: #ffc41b; }
.progress.danger > span { background: var(--red); }

/* ---------- Client page and clients list ---------- */
ul.contacts > li > div { margin-top: .3rem; }
ul.contacts .small a { overflow-wrap: anywhere; }
form.filters { padding: 1rem 1.25rem; }
form.filters .field { min-width: 130px; }
form.filters .grow-0 { flex: 0 0 auto; min-width: 0; display: flex; gap: .75rem; align-items: center; }

/* Accordion: a stack of <details> in one bordered list, like the dashboard's media runs list.
   The open row gets an orange wash and its body sits on a darker tint. */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.accordion > details + details { border-top: 1px solid var(--line); }
.accordion > details > summary {
    list-style: none; display: flex; align-items: center; gap: .55rem; margin: 0; padding: .8rem 1rem;
    color: var(--text); font-weight: 700; font-size: .9rem; transition: background .15s;
}
.accordion > details > summary::-webkit-details-marker { display: none; }
.accordion > details > summary::after { content: ""; margin-left: auto; width: .42rem; height: .42rem; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.accordion > details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.accordion > details > summary:hover { background: var(--hover); }
.accordion > details[open] > summary { background: linear-gradient(135deg, rgba(250, 127, 49, .14), rgba(250, 127, 49, .04)); }
.accordion > details[open] { background: var(--tint); }
:root[data-theme="dark"] .accordion > details[open] { background: rgba(0, 0, 0, .15); }
.accordion > details > :not(summary) { margin: 0 1rem .85rem; }
.accordion > details > ul:first-of-type { margin-top: .25rem; }

/* ---------- Activity timeline ----------
   Days down a line. Each item shows who did what and the first two lines of the text. Clicking it
   opens the full text and a link to Basecamp in place, pushing the rest of the list down. */
ol.timeline, ol.timeline ol { list-style: none; margin: 0; padding: 0; }
.timeline-day { position: relative; padding-left: 1.4rem; padding-bottom: .5rem; }
.timeline-day::before { content: ""; position: absolute; left: .3rem; top: .55rem; bottom: 0; width: 2px; background: var(--line); }
.timeline-day:last-child::before { bottom: 1rem; }
.timeline-date { position: relative; display: block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: .35rem; }
.timeline-date::before { content: ""; position: absolute; left: -1.35rem; top: .2rem; width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timeline-item { margin: 0 -.6rem; border-radius: var(--radius-sm); transition: background .15s; }
.timeline-item:hover, .timeline-item:has(> details[open]) { background: var(--hover); }
.timeline-item > details > summary {
    list-style: none; display: flex; gap: .7rem; align-items: flex-start; margin: 0; padding: .5rem .6rem;
    color: inherit; font-weight: 400; font-size: inherit; border-radius: var(--radius-sm); outline: none;
}
.timeline-item > details > summary::-webkit-details-marker { display: none; }
.timeline-item > details > summary:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.avatar { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 700; letter-spacing: .02em; background: var(--accent-soft); color: var(--accent-text); padding-top: 2px; }
.timeline-body { display: block; min-width: 0; flex: 1; }
.timeline-line { display: block; font-size: .88rem; line-height: 1.4; }
.timeline-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-snippet {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
    margin: .15rem 0 .2rem; font-size: .84rem; line-height: 1.45; color: var(--muted);
}
.timeline-meta { display: block; }
/* Open: the snippet gives way to the full text below. */
.timeline-item > details[open] .timeline-snippet { display: none; }
.timeline-full { padding: 0 .6rem .7rem calc(.6rem + 1.9rem + .7rem); }
.timeline-full-text { margin: .4rem 0 0; font-size: .86rem; line-height: 1.55; padding: .6rem .75rem; border-radius: var(--radius-sm); background: var(--tint); border-left: 3px solid var(--accent-line); }
.timeline-full-link { display: inline-block; margin-top: .5rem; font-weight: 700; }
.timeline-note { margin: .75rem 0 0; }

/* ---------- Client page folder ----------
   The left column is a folder: tabs along the top, the open tab joined to the body below it.
   Sections inside sit flat on the folder, split by lines, instead of being cards in a card. */
.folder { min-width: 0; margin-bottom: 1rem; }
.folder-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .25rem; padding: 0 .75rem; position: relative; z-index: 1; }
.folder-tabs [role=tab] {
    position: relative; margin-bottom: -1px; padding: .5rem 1.1rem .45rem;
    border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--tint); color: var(--muted); font-weight: 700; font-size: .85rem; text-decoration: none;
    transition: background .15s, color .15s;
}
.folder-tabs [role=tab]:hover { color: var(--text); background: var(--hover); text-decoration: none; }
/* The open tab stands a little taller than the others, like a folder tab pulled up. */
.folder-tabs [role=tab][aria-selected=true] {
    padding-top: .75rem; background: var(--folder); color: var(--text); border-color: var(--line-strong); border-bottom-color: var(--folder);
}
.folder-tabs [role=tab]:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
/* Dark mode: the closed tabs are a middle tone, a little lighter than the page and darker than the open tab. */
:root[data-theme="dark"] .folder-tabs [role=tab] { background: #1c2039; border-color: rgba(255, 255, 255, .07); border-bottom-color: var(--line-strong); color: rgba(255, 255, 255, .6); }
:root[data-theme="dark"] .folder-tabs [role=tab]:hover { background: #21253f; color: #fff; }
:root[data-theme="dark"] .folder-tabs [role=tab][aria-selected=true] { background: var(--folder); border-color: var(--line-strong); border-bottom-color: var(--folder); color: #fff; }
.folder-body { background: var(--folder); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .25rem 1.25rem; }
.folder-body .card { background: none; border: 0; border-radius: 0; margin: 0; padding: 1.1rem 0; }
.folder-body .card + .card { border-top: 1px solid var(--line); }
.folder-body .card > table:first-child, .folder-body .card > table:only-child { margin: 0; width: 100%; }
@media (max-width: 600px) {
    .folder-tabs { padding: 0 .25rem; }
    .folder-tabs [role=tab] { padding: .45rem .7rem .4rem; font-size: .8rem; }
    .folder-tabs [role=tab][aria-selected=true] { padding-top: .65rem; }
    .folder-body { padding: .25rem 1rem; }
}

/* Overview: active jobs table and the latest threads */
.nowrap { white-space: nowrap; }
table.jobs .progress.mini { display: inline-block; width: 4.5rem; margin: 0 .4rem 0 0; vertical-align: middle; }
@media (max-width: 600px) {
    /* On a phone the table keeps to the screen: the % stays, the bar goes. */
    table.jobs .progress.mini { display: none; }
    table.jobs th, table.jobs td { padding-left: .4rem; padding-right: .4rem; }
}
ol.timeline.threads { margin: 0; }

/* Notes: pin, delete and edit under each one; pinned notes can be unpinned from Important information. */
.note-actions { display: flex; gap: 1rem; margin-top: .35rem; }
.note-edit > summary { font-size: .85rem; margin: .35rem 0 0; }
.note-edit[open] > form { margin-top: .75rem; padding: 1rem; border-radius: var(--radius-sm); background: var(--tint); }
.pinned-note { display: flex; gap: .75rem; align-items: flex-start; justify-content: space-between; }
.pinned-note form { flex: 0 0 auto; }

/* Sign-in pages */
/* The wordmark's lettering is white, so it sits on a navy band across the top of the card, like the sidebar. */
.signin.card { overflow: hidden; }
.signin-band { margin: -2.5rem -2.5rem 1.75rem; padding: 1.1rem 2.5rem; background: var(--sidebar); }
.signin-band img { display: block; height: 26px; width: auto; }
.signin-forgot { margin-left: 1rem; }

/* Activity log */
table.activity td { vertical-align: top; }
table.activity ul.tight { margin: .3rem 0 0; }

/* Import from Excel */
table.import-counts { max-width: 28rem; margin-bottom: 1rem; }
table.import-gaps { max-width: 24rem; margin: .25rem 0 1rem; }
.import-problems ul { margin: .5rem 0 0; }
input[type=file] { font: inherit; font-size: .88rem; }
