/* ============================================================
   Homestead HR — editorial / private-office visual system
   ink + ivory + brass. Serif display, hairline rules, generous air.
   ============================================================ */
:root {
  --ink: #3d2f28;          /* warm brown-black */
  --ink-2: #6b5a50;
  --ink-3: #9a8a7e;
  --line: #efe6d8;         /* hairlines */
  --line-2: #e2d5c2;
  --paper: #fbf5ec;        /* cream page */
  --paper-2: #f4ebdd;
  --card: #ffffff;
  --accent: #b8573a;       /* clay — buttons, primary */
  --accent-ink: #fff8ef;
  --accent-soft: #f7e6de;
  --brass: #d9a441;        /* honey — highlights, active nav, badges */
  --brass-soft: #fbefd3;
  --brass-ink: #8a6420;
  --sage: #8aa37b;
  --warn: #a8472c;
  --warn-soft: #f8e4dc;
  --ok: #5f7f55;
  --ok-soft: #e8efe3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(61, 47, 40, .05);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --side: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
button { font: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; font-variation-settings: "opsz" 72, "SOFT" 100, "WONK" 1; }
h2 { font-family: var(--font); font-weight: 700; font-size: 22px; } h3 { font-family: var(--font); font-weight: 700; font-size: 16px; }
p { margin: 0 0 .75em; }
.muted { color: var(--ink-3); } .small { font-size: 13px; } .hidden { display: none !important; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brass); }
.ok-text { color: var(--ok); }
kbd { font: 600 11px/1 var(--font); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 5px; background: #fff; }
::selection { background: var(--brass-soft); }

/* boot / auth */
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--ink-3); }
.boot-mark { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--ink); color: var(--accent-ink); font-family: var(--serif); font-size: 22px; display: grid; place-content: center; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 520px at 85% -10%, #fbefd3 0%, transparent 60%), var(--paper); }
.auth-card { width: 100%; max-width: 410px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 34px 32px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-brand .boot-mark { margin: 0; width: 44px; height: 44px; font-size: 17px; border-radius: 12px; }
.auth-brand small { display: block; color: var(--ink-3); font-size: 12px; letter-spacing: .02em; }
.auth-card h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin-bottom: 4px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }

/* forms */
label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ink-2); margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled { background: var(--paper-2); color: var(--ink-3); }
textarea { min-height: 96px; resize: vertical; }
input[type=file] { font-size: 13px; padding: 9px 0; }
.check { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-weight: 500; font-size: 14px; letter-spacing: 0; text-transform: none; }
.check input { width: 17px; height: 17px; accent-color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; letter-spacing: .01em; cursor: pointer; text-decoration: none; transition: transform .08s, background .15s, color .15s, border-color .15s; }
.btn:hover { background: #a54d32; border-color: #a54d32; } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: var(--brass-soft); color: var(--brass-ink); border-color: transparent; } .btn.ghost:hover { background: #f5e3b8; }
.btn.quiet { background: transparent; color: var(--ink-2); border-color: var(--line-2); } .btn.quiet:hover { border-color: var(--ink); color: var(--ink); background: #fff; }
.btn.danger { background: transparent; color: var(--warn); border-color: transparent; } .btn.danger:hover { background: var(--warn-soft); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 20px; }
.error { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-top: 12px; }
.notice { background: var(--brass-soft); color: var(--brass-ink); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-top: 12px; }

/* shell */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; background: var(--accent); color: var(--accent-ink); display: grid; place-content: center; font-family: var(--serif); font-size: 14px; }
.brand .logo.wide { width: auto; max-width: 170px; height: 38px; object-fit: contain; background: transparent; border-radius: 0; }
.brand .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.brand .sub { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.spacer { flex: 1; }
.searchbar { display: flex; align-items: center; gap: 10px; margin-left: 10px; padding: 8px 10px 8px 12px; min-width: 320px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--ink-3); cursor: text; text-align: left; }
.searchbar:hover { border-color: var(--ink-3); } .searchbar .ph { flex: 1; font-size: 13px; } .searchbar > span:first-child { font-size: 16px; color: var(--ink-2); }
.org-switch select { padding: 8px 10px; font-size: 13px; max-width: 220px; border-radius: 999px; }
.viewas { display: flex; align-items: center; gap: 8px; background: var(--brass-soft); border: 1px solid #efdcae; padding: 4px 6px 4px 12px; border-radius: 999px; }
.viewas .small { color: var(--brass-ink); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 10px; }
.viewas select { padding: 5px 8px; font-size: 13px; border-color: transparent; background: #fff; border-radius: 999px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-content: center; font-weight: 700; font-size: 12px; cursor: pointer; letter-spacing: .02em; }
.menu { position: absolute; right: 20px; top: 58px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 220px; padding: 6px; }
.menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; border-radius: 9px; cursor: pointer; }
.menu button:hover { background: var(--paper-2); }
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }

.layout { display: flex; flex: 1; }
.sidenav { width: var(--side); padding: 18px 12px 24px; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; transition: width .18s; flex-shrink: 0; }
.sidenav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; }
.sidenav a i { font-style: normal; width: 20px; text-align: center; color: var(--ink-3); flex-shrink: 0; }
.sidenav a.active { background: var(--brass-soft); color: var(--ink); box-shadow: none; border-radius: 10px; }
.sidenav a.active i { color: var(--accent); }
.sidenav a:hover:not(.active) { background: var(--paper-2); color: var(--ink); }
.sidenav .sect { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3); margin: 18px 12px 6px; font-weight: 700; }
.collapse { margin-top: auto; background: none; border: 1px solid var(--line); color: var(--ink-3); border-radius: 10px; padding: 8px 10px; cursor: pointer; text-align: left; font-size: 13px; }
.collapse:hover { color: var(--ink); border-color: var(--line-2); }
.shell.collapsed { --side: 72px; }
.shell.collapsed .lbl, .shell.collapsed .ws-name, .shell.collapsed .ws-sub, .shell.collapsed .ws-logo, .shell.collapsed .ws-back { display: none; }
.shell.collapsed .sidenav a { justify-content: center; padding: 11px 0; } .shell.collapsed .sidenav a i { width: auto; }
.shell.collapsed .ws-card { padding: 10px 0; text-align: center; } .shell.collapsed .ws-mono { margin: 0 auto; }
.shell.collapsed .collapse { text-align: center; }

.ws-card { margin: 0 2px 16px; padding: 14px 14px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.ws-card.hq { background: var(--paper); }
.ws-mono { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; display: grid; place-content: center; font-family: var(--serif); font-size: 15px; margin-bottom: 10px; }
.ws-card.hq .ws-mono { background: var(--accent); }
.ws-logo { background: #fff; border-radius: 10px; padding: 8px; margin-bottom: 10px; border: 1px solid var(--line); }
.ws-logo img { display: block; width: 100%; max-height: 72px; object-fit: contain; }
.ws-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.ws-sub { font-size: 12px; margin-top: 2px; }
.ws-back { display: inline-block; font-size: 12px; color: var(--ink-3) !important; text-decoration: none; margin-bottom: 10px; padding: 0 !important; background: none !important; box-shadow: none !important; }
.ws-back:hover { color: var(--ink) !important; }
.rolebadge { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--brass-soft); color: var(--brass-ink); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ws-card.hq .rolebadge { background: var(--accent-soft); color: var(--accent); }

.main { flex: 1; min-width: 0; padding: 30px 36px 48px; max-width: 1180px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); max-width: 60ch; }
.page-head .eyebrow { margin-bottom: 6px; }
.hero { padding: 6px 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 40px; margin: 6px 0 8px; }
.hero p { color: var(--ink-2); font-size: 16px; margin: 0; }
.tabbar { display: none; }

/* cards & lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; align-items: center; gap: 16px; transition: border-color .15s; }
.row:hover { border-color: var(--line-2); }
.row .grow { flex: 1; min-width: 0; } .row .title { font-weight: 700; }
.row .meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.row .actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon { width: 42px; height: 42px; border-radius: 12px; background: var(--brass-soft); color: var(--brass-ink); display: grid; place-content: center; font-weight: 800; font-size: 11px; letter-spacing: .04em; flex-shrink: 0; }
.icon.urgent { background: var(--warn-soft); color: var(--warn); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em; background: var(--paper-2); border: 1px solid transparent; color: var(--ink-2); }
.pill.on { background: var(--brass-soft); color: var(--brass-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.off { opacity: .45; text-decoration: line-through; }
.empty { text-align: center; padding: 56px 24px; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: var(--radius); background: #fff; }
.empty h3 { color: var(--ink-2); margin-bottom: 6px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.alert:not(.active) { border-color: var(--warn); color: var(--warn); }
.search { max-width: 340px; border-radius: 999px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--paper); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
h4.sec { margin: 22px 0 2px; font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--brass); border-bottom: 1px solid var(--line); padding-bottom: 7px; font-weight: 700; }
.fld { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.fld span { color: var(--ink-3); flex-shrink: 0; } .fld b { font-weight: 600; text-align: right; } .fld:last-child { border-bottom: 0; }
.sub-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.sub-row:last-child { border-bottom: 0; } .sub-row.link { cursor: pointer; } .sub-row.link:hover b { text-decoration: underline; text-decoration-color: var(--brass); text-underline-offset: 3px; }
.late { color: var(--warn); font-weight: 700; }
select.complete, select.na { color: var(--ok); } select.in_progress { color: var(--brass-ink); }

/* home */
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2px; transition: border-color .15s, transform .08s; }
.tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tile b { font-family: var(--serif); font-size: 32px; font-weight: 400; line-height: 1; }
.tile span { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.tile.warn b { color: var(--accent); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 20px; }
.quick .eyebrow { margin-right: 6px; }

/* roles explainer */
.roles { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.roles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.role { padding: 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.role.me { border-color: var(--brass); background: var(--brass-soft); }
.role b { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.role p { font-size: 13px; color: var(--ink-2); margin: 0; line-height: 1.5; }

/* modules */
.modgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.mod { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; margin: 0; text-transform: none; letter-spacing: 0; font-weight: 500; }
.mod input { margin-top: 3px; accent-color: var(--ink); } .mod b { display: block; font-size: 14px; } .mod small { color: var(--ink-3); font-size: 12px; }
.modpills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* kanban */
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--paper-2); border-radius: var(--radius); padding: 10px; min-height: 150px; }
.col h4 { margin: 4px 6px 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); display: flex; justify-content: space-between; }
.cand { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.cand:hover { border-color: var(--brass); } .cand .n { font-weight: 700; } .cand .s { font-size: 12px; color: var(--ink-3); }
.cand.drag { opacity: .5; } .col.over { outline: 2px dashed var(--brass); }

/* org chart */
.oc-wrap { overflow-x: auto; padding: 24px 20px 12px; }
.oc, .oc ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 18px; position: relative; }
.oc ul { padding-top: 28px; margin-top: 0; }
.oc li { position: relative; display: flex; flex-direction: column; align-items: center; }
.oc li > ul::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 28px; background: var(--line-2); }
.oc li > ul > li::before { content: ""; position: absolute; top: -28px; left: 50%; width: 1px; height: 28px; background: var(--line-2); }
.oc li > ul > li:not(:only-child)::after { content: ""; position: absolute; top: -28px; height: 1px; background: var(--line-2); left: 0; right: 0; }
.oc li > ul > li:first-child:not(:only-child)::after { left: 50%; } .oc li > ul > li:last-child:not(:only-child)::after { right: 50%; }
.oc-card { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 10px 10px; min-width: 210px; max-width: 260px; cursor: pointer; box-shadow: var(--shadow); }
.oc-card:hover { border-color: var(--brass); } .oc-card.me { border-color: var(--brass); background: var(--brass-soft); }
.oc-card b { display: block; font-size: 14px; } .oc-card a { font-size: 12px; color: var(--brass-ink); word-break: break-all; }
.oc-av { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.oc-card .pill { margin-left: auto; }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(21, 23, 28, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border-radius: 20px; width: 100%; max-width: 540px; max-height: 92vh; overflow: auto; padding: 26px 28px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
.modal.wide { max-width: 800px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-head h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; align-items: center; }
.x { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--ink-3); line-height: 1; } .x:hover { color: var(--ink); }

/* command palette */
.modal-bg.palette { align-items: start; padding-top: 10vh; }
.pal { width: 100%; max-width: 640px; background: var(--card); border-radius: 18px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.55); overflow: hidden; border: 1px solid var(--line); }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pal-in > span { font-size: 20px; color: var(--ink-3); }
.pal-in input { flex: 1; border: 0; padding: 6px 0; font-size: 17px; background: transparent; } .pal-in input:focus { box-shadow: none; }
.pal-r { max-height: 56vh; overflow: auto; padding: 8px; }
.pal-type { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--brass); font-weight: 700; padding: 12px 12px 4px; }
.pal-it { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pal-it.sel { background: var(--paper-2); }
.pal-hint { padding: 22px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* notes / activity */
.note { padding: 10px 0; border-bottom: 1px solid var(--line); } .note .by { font-size: 12px; color: var(--ink-3); }
.act { font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); } .act:last-child { border-bottom: 0; }
.act time { color: var(--ink-3); margin-right: 10px; font-variant-numeric: tabular-nums; }
.card.reply { background: var(--brass-soft); border-color: transparent; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; transition: .2s; pointer-events: none; z-index: 60; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } .toast.err { background: var(--warn); }

/* responsive */
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(3, 1fr); } .roles-grid { grid-template-columns: 1fr 1fr; } .searchbar { min-width: 200px; } }
@media (max-width: 760px) {
  .sidenav { display: none; }
  .main { padding: 18px 16px 96px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10; overflow-x: auto; }
  .tabbar a { flex: 1; min-width: 62px; text-align: center; font-size: 10px; font-weight: 700; color: var(--ink-3); text-decoration: none; padding: 6px 2px; border-radius: 10px; letter-spacing: .02em; }
  .tabbar a.active { color: var(--ink); } .tabbar a.active span { color: var(--brass); }
  .tabbar a span { display: block; font-size: 18px; }
  .searchbar { min-width: 0; width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; } .searchbar .ph, .searchbar kbd { display: none; }
  .org-switch select { max-width: 130px; } .brand .sub { display: none; } .brand .logo.wide { max-width: 120px; height: 32px; }
  .viewas .small { display: none; }
  .board, .two, .three, .modgrid, .roles-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .row { flex-wrap: wrap; } .row .actions { width: 100%; justify-content: flex-end; }
  h1 { font-size: 28px; } .hero h1 { font-size: 32px; }
  .modal { padding: 20px; border-radius: 16px; }
  .oc, .oc ul { flex-direction: column; align-items: stretch; gap: 8px; } .oc ul { padding-top: 0; padding-left: 22px; border-left: 1px solid var(--line-2); margin-top: 8px; }
  .oc li::before, .oc li::after, .oc li > ul::before { display: none !important; } .oc-card { max-width: none; }
}

.editlink { background: none; border: 0; padding: 2px 0; color: var(--brass-ink); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; border-bottom: 1px solid transparent; }
.editlink:hover { border-bottom-color: var(--brass); }

/* in a workspace the logo lives in the sidebar; the top bar shows it only on phones (where the sidebar is hidden) */
.shell.in-ws .brand .logo { display: none; }
@media (max-width: 760px) { .shell.in-ws .brand .logo { display: grid; } .shell.in-ws .brand .logo.wide { display: block; } }

/* signing */
.signbox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 10px 0 4px; }
.padwrap { position: relative; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: #fff; }
.padwrap canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; border-radius: var(--radius-sm); }
.padwrap .btn { position: absolute; right: 8px; top: 8px; }
table.tpl input[type=text], table.tpl select { padding: 7px 9px; font-size: 13px; }
table.tpl td { vertical-align: top; }

.navtoggle { background: none; border: 1px solid transparent; border-radius: 9px; width: 36px; height: 36px; font-size: 18px; color: var(--ink-2); cursor: pointer; margin-right: 2px; }
.navtoggle:hover { background: var(--paper-2); color: var(--ink); }
@media (max-width: 760px) { .navtoggle { display: none; } }

.inline-label { margin: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.status-select { width: auto; padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.status-select.active { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.status-select.onboarding { color: var(--brass-ink); border-color: #efdcae; background: var(--brass-soft); }
.status-select.terminated { color: var(--warn); background: var(--warn-soft); }

/* settings */
.settings { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 76px; }
.subnav a { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); border: 1px solid transparent; }
.subnav a b { font-size: 14px; color: var(--ink); } .subnav a span { font-size: 12px; color: var(--ink-3); }
.subnav a:hover { background: #fff; border-color: var(--line); }
.subnav a.active { background: #fff; border-color: var(--line); box-shadow: var(--shadow); } .subnav a.active b { color: var(--brass-ink); }
@media (max-width: 900px) { .settings { grid-template-columns: 1fr; } .subnav { position: static; flex-direction: row; overflow-x: auto; } .subnav a span { display: none; } }

/* workflow editor */
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { padding: 14px 16px; }
.step-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stepno { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.step-head .s-label { flex: 2; min-width: 200px; font-weight: 700; } .step-head .s-type { flex: 1; min-width: 170px; }
.step-tools { display: flex; gap: 4px; margin-left: auto; }
.step .s-desc { margin-top: 8px; }
.step-grid { display: grid; grid-template-columns: 2fr 1fr 2fr 1fr; gap: 12px; align-items: end; }
.step-grid label { margin-top: 10px; }
.dueline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .dueline select { width: auto; }
.s-form { margin-top: 8px; padding: 10px 12px; background: var(--paper); border-radius: 10px; border: 1px dashed var(--line-2); }
.frow { display: grid; grid-template-columns: 2fr 1fr 2fr auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.formbox { padding: 4px 14px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 10px 0; }
@media (max-width: 900px) { .step-grid, .frow { grid-template-columns: 1fr; } }

/* in-portal documents */
.toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line-2); border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--paper); }
.toolbar button { border: 1px solid transparent; background: #fff; border-radius: 6px; padding: 5px 9px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.toolbar button:hover { border-color: var(--line-2); color: var(--ink); }
.editor { min-height: 320px; max-height: 55vh; overflow: auto; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: #fff; line-height: 1.6; }
.editor:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor:empty::before { content: "Paste or type your document here…"; color: var(--ink-3); }
.paper { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 48px 56px; max-width: 820px; box-shadow: var(--shadow); }
.paper-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 26px; font-weight: 700; }
.prose { font-size: 15.5px; line-height: 1.7; color: var(--ink); }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--font); font-weight: 700; margin: 1.4em 0 .5em; letter-spacing: -.01em; }
.prose h1 { font-size: 24px; } .prose h2 { font-size: 20px; } .prose h3 { font-size: 17px; } .prose h4 { font-size: 15px; }
.prose p { margin: 0 0 .9em; } .prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 .9em; } .prose li { margin-bottom: .25em; }
.prose blockquote { border-left: 3px solid var(--line-2); margin: 0 0 .9em; padding: 2px 0 2px 14px; color: var(--ink-2); }
.prose table { border-collapse: collapse; margin: 0 0 1em; width: 100%; } .prose th, .prose td { border: 1px solid var(--line-2); padding: 7px 10px; font-size: 14px; } .prose th { background: var(--paper); }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.4em 0; }
.editor h1, .editor h2, .editor h3 { font-family: var(--font); font-weight: 700; } .editor h2 { font-size: 20px; } .editor h3 { font-size: 17px; }
.editor table { border-collapse: collapse; } .editor td, .editor th { border: 1px solid var(--line-2); padding: 5px 8px; }
@media print {
  .topbar, .sidenav, .tabbar, .no-print, #toast, #modal-root { display: none !important; }
  body { background: #fff; } .main { padding: 0; max-width: none; } .paper { border: 0; box-shadow: none; padding: 0; max-width: none; }
}
@media (max-width: 760px) { .paper { padding: 24px 20px; } }

/* wordmark (logo D) */
.wordmark { position: relative; display: inline-block; font-family: var(--serif); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; line-height: 1; letter-spacing: -.03em; font-weight: 500; white-space: nowrap; padding-bottom: .22em; }
.wordmark .wm-a { color: var(--accent); }
.wordmark .wm-b { color: var(--brass); font-style: italic; margin-left: .08em; }
.wordmark .wm-line { position: absolute; left: 2%; right: 4%; bottom: 0; width: 94%; height: .3em; color: var(--brass); }
.auth-brand small { margin-top: 8px; }

/* JHM view: the wordmark lives in the sidebar; the top bar shows it only on phones */
.brand.hq-brand { display: none; }
@media (max-width: 760px) { .brand.hq-brand { display: flex; } }

.ws-card.slim { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ws-card.slim .ws-back { margin: 0; } .ws-card.slim .ws-sub { margin: 0; }
.powered { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 14px 12px 2px; border-top: 1px solid var(--line); margin-top: 10px; }
.powered .small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.shell.collapsed .powered { display: none; }
