/* Base look (Attio-style tokens and components), carried over from the demo app. */
/* Layout: Attio-style app shell. Left sidebar (workspace, nav, favorites), sticky top bar, dense content panes. Phone: drawer sidebar + bottom tab bar. */
:root {
  --bg: #FFFFFF; --sidebar: #FBFBFB; --surface: #FFFFFF; --subtle: #F7F7F8; --hover: #F3F4F5; --active: #EDEEF0;
  --border: #E6E7EA; --border-soft: #EEEFF1; --text: #1C1D1F; --text-2: #5C6068; --text-3: #6B6F76; --scrim: rgba(17,18,20,0.32);
  --blue: #2B6AE6; --blue-press: #2259C9; --on-blue: #FFFFFF; --focus: rgba(43,106,230,0.28);
  --red-bg: #FDECEC; --red-fg: #B42328; --blue-bg: #EAF1FE; --blue-fg: #1F57C9; --green-bg: #E6F6EE; --green-fg: #137547;
  --violet-bg: #F1ECFE; --violet-fg: #5B3FC4; --amber-bg: #FDF3E1; --amber-fg: #7A4F00; --gray-bg: #F1F2F4; --gray-fg: #4A4E55;
  --c-blue: #2B6AE6; --c-cyan: #3FB3E0; --c-violet: #7B5CF0; --c-purple: #A06CF5; --c-yellow: #F2B53A; --c-red: #E5484D; --c-green: #22A06B;
  --pie-a1: #5CC6EC; --pie-a2: #2C94CC; --pie-b1: #9C7BF7; --pie-b2: #6A4BE6;
  --grid: #F1F2F4; --axis: #E3E5E8; --plan: #F5F6F7; --plan-line: #C9CCD1; --pill: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,0.02), 0 2px 4px -1px rgba(0,0,0,0.02), 0 4px 8px -2px rgba(0,0,0,0.03), 0 8px 16px -4px rgba(0,0,0,0.04);
  --shadow-pop: 0 0 0 1px rgba(0,0,0,0.06), 0 4px 8px -2px rgba(0,0,0,0.06), 0 16px 40px -8px rgba(0,0,0,0.18);
  --avatar-jh-bg: #FDF0E3; --avatar-jh-fg: #8A4B12; --avatar-pa-bg: #E9E3FB; --avatar-pa-fg: #5B3FC4; --online: #22A06B;
  --f-ui: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #111214; --sidebar: #151618; --surface: #18191C; --subtle: #1C1D20; --hover: #222327; --active: #27292D;
  --border: #2B2D31; --border-soft: #232529; --text: #ECEDEF; --text-2: #A3A7AE; --text-3: #959AA1; --scrim: rgba(0,0,0,0.55);
  --blue: #4C86F7; --blue-press: #3A74E6; --on-blue: #FFFFFF; --focus: rgba(76,134,247,0.35);
  --red-bg: #3A1D1F; --red-fg: #FF9EA1; --blue-bg: #1B2A47; --blue-fg: #A3C2FF; --green-bg: #15301F; --green-fg: #82D9A8;
  --violet-bg: #2A2145; --violet-fg: #C6B6FF; --amber-bg: #3A2C12; --amber-fg: #F2C66D; --gray-bg: #26282C; --gray-fg: #C3C6CC;
  --grid: #222428; --axis: #2E3034; --plan: #1D1F22; --plan-line: #44474D; --pill: #1F2023;
  --shadow: 0 1px 2px rgba(0,0,0,0.3); --shadow-pop: 0 0 0 1px rgba(255,255,255,0.06), 0 16px 40px -8px rgba(0,0,0,0.6);
  --avatar-jh-bg: #3B2A1A; --avatar-jh-fg: #F5C89A; --avatar-pa-bg: #2A2145; --avatar-pa-fg: #C6B6FF;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #111214; --sidebar: #151618; --surface: #18191C; --subtle: #1C1D20; --hover: #222327; --active: #27292D;
  --border: #2B2D31; --border-soft: #232529; --text: #ECEDEF; --text-2: #A3A7AE; --text-3: #959AA1; --scrim: rgba(0,0,0,0.55);
  --blue: #4C86F7; --blue-press: #3A74E6; --on-blue: #FFFFFF; --focus: rgba(76,134,247,0.35);
  --red-bg: #3A1D1F; --red-fg: #FF9EA1; --blue-bg: #1B2A47; --blue-fg: #A3C2FF; --green-bg: #15301F; --green-fg: #82D9A8;
  --violet-bg: #2A2145; --violet-fg: #C6B6FF; --amber-bg: #3A2C12; --amber-fg: #F2C66D; --gray-bg: #26282C; --gray-fg: #C3C6CC;
  --grid: #222428; --axis: #2E3034; --plan: #1D1F22; --plan-line: #44474D; --pill: #1F2023;
  --shadow: 0 1px 2px rgba(0,0,0,0.3); --shadow-pop: 0 0 0 1px rgba(255,255,255,0.06), 0 16px 40px -8px rgba(0,0,0,0.6);
  --avatar-jh-bg: #3B2A1A; --avatar-jh-fg: #F5C89A; --avatar-pa-bg: #2A2145; --avatar-pa-fg: #C6B6FF;
  color-scheme: dark; }

* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { color: var(--text); font-family: var(--f-ui); font-size: 14px; line-height: 20px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Shell */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--sidebar); border-right: 1px solid var(--border-soft); padding: 10px 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.ws { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 10px; }
.ws-btn { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; }
.ws-btn:hover { background: var(--hover); }
.ws-logo { width: 22px; height: 22px; border-radius: 6px; background: var(--text); color: var(--bg); display: grid; place-items: center; flex: none; }
.icon-btn { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; display: inline-grid; place-items: center; color: var(--text-2); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.qa { display: flex; gap: 6px; padding: 0 2px 10px; }
.qa-btn { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,0.03); color: var(--text); }
.qa-btn:hover { background: var(--hover); }
.kbd { margin-left: auto; font-size: 11px; color: var(--text-3); background: var(--gray-bg); border-radius: 4px; padding: 0 5px; line-height: 18px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a, .fav a { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 0 8px; border-radius: 8px; color: var(--text); font-weight: 500; text-decoration: none; }
.nav a:hover, .fav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--active); }
.nav svg { color: var(--text-2); flex: none; }
.nav a[aria-current="page"] svg { color: var(--text); }
.count { margin-left: auto; font-size: 11px; font-weight: 600; border-radius: 5px; padding: 0 6px; line-height: 18px; }
.count.red { color: var(--red-fg); background: var(--red-bg); }
.count.blue { color: var(--blue-fg); background: var(--blue-bg); font-weight: 500; }
.sec-label { margin-top: 18px; padding: 0 8px 4px; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.fav-dot { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; flex: none; color: #FFFFFF; }
.team { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.avatar { width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-size: 10px; font-weight: 600; flex: none; position: relative; }
.av-jh { background: var(--avatar-jh-bg); color: var(--avatar-jh-fg); }
.av-pa { background: var(--avatar-pa-bg); color: var(--avatar-pa-fg); }
.online { position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 999px; background: var(--online); border: 2px solid var(--sidebar); }
.side-foot { margin-top: auto; padding: 12px 8px 0; font-size: 11px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border-soft); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 48px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.crumbs { display: flex; align-items: center; gap: 8px; font-weight: 500; min-width: 0; }
.crumbs .root { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.crumbs .sep { color: var(--plan-line); }
.crumbs .here { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.avatars { display: inline-flex; margin-right: 4px; }
.avatars .avatar { border: 2px solid var(--bg); width: 26px; height: 26px; }
.avatars .avatar + .avatar { margin-left: -7px; }
.menu-btn { display: none; }
.content { padding-block: 16px 40px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 16px; max-width: 1360px; width: 100%; }
.demo-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.demo-note b { font-weight: 500; color: var(--text-2); }

/* Buttons and tags */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,0.03); white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: transparent; color: var(--on-blue); box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 2px rgba(16,24,40,0.14); }
.btn.primary:hover { background: var(--blue-press); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.lg { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; border-radius: 6px; padding: 0 6px; line-height: 20px; white-space: nowrap; }
.t-red { background: var(--red-bg); color: var(--red-fg); } .t-blue { background: var(--blue-bg); color: var(--blue-fg); }
.t-green { background: var(--green-bg); color: var(--green-fg); } .t-violet { background: var(--violet-bg); color: var(--violet-fg); }
.t-amber { background: var(--amber-bg); color: var(--amber-fg); } .t-gray { background: var(--gray-bg); color: var(--gray-fg); }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head h1 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.02em; }
.page-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--subtle); font-size: 12px; font-weight: 500; }
.seg button { min-height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; }
.card-head.ruled { border-bottom: 1px solid var(--border-soft); }
.card-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.card-title h2 { margin: 0; font-size: 13px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-3); }
.callout { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 14px; }
.callout img { width: 36px; height: 45px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); flex: none; }
.callout .txt { flex: 1 1 320px; min-width: 0; }
.callout h2 { margin: 0; font-size: 14px; font-weight: 600; }
.callout p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.callout .check { width: 32px; height: 32px; border-radius: 999px; background: var(--green-bg); color: var(--green-fg); display: grid; place-items: center; flex: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { padding: 12px 14px; }
.kpi .label { margin: 0; font-size: 12px; font-weight: 500; color: var(--text-2); }
.kpi .val { margin: 6px 0 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.kpi .num { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.02em; }
.kpi .of { font-size: 14px; font-weight: 500; color: var(--text-3); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px; }
.chart-wrap { position: relative; padding: 0 14px 10px; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.legend { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.lg-box { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-pop); padding: 8px 10px 8px 14px; font-size: 12px; min-width: 120px; opacity: 0; transform: translate(-50%, -100%); transition: opacity 0.12s; z-index: 5; }
.tip::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--tipc, var(--c-blue)); }
.tip.on { opacity: 1; }
.tip b { display: block; font-weight: 500; }
.tip span { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); margin-top: 2px; }
.tip code { font-family: var(--f-mono); font-size: 11px; color: var(--text); background: var(--gray-bg); border-radius: 4px; padding: 0 4px; }

/* SVG chart classes */
.ax { stroke: var(--axis); } .gl { stroke: var(--grid); }
.axl { fill: var(--text-3); font-family: var(--f-ui); font-size: 11px; }
.axl.strong { fill: var(--text); font-weight: 600; }
.vpill { fill: var(--pill); stroke: var(--border); }
.vtxt { fill: var(--text); font-family: var(--f-mono); font-size: 10px; }
.bar-plan { fill: var(--plan); stroke: var(--plan-line); stroke-dasharray: 3 3; }
.bar-need { fill: var(--red-bg); stroke: var(--c-red); stroke-dasharray: 3 3; }
.need-pill { fill: var(--red-bg); } .need-txt { fill: var(--red-fg); font-family: var(--f-ui); font-size: 10px; font-weight: 500; }
.hit { fill: transparent; cursor: default; }
.ln { fill: none; stroke: var(--c-blue); stroke-width: 2; stroke-linejoin: round; }
.dot { fill: var(--c-blue); stroke: var(--surface); stroke-width: 1.5; }
.pie-pill { fill: var(--pill); fill-opacity: 0.94; }
.pie-num { fill: var(--text); font-family: var(--f-mono); font-size: 10.5px; }
.pie-pct-a { fill: var(--blue-fg); font-family: var(--f-mono); font-size: 10px; }
.pie-pct-b { fill: var(--violet-fg); font-family: var(--f-mono); font-size: 10px; }

/* Lists and tables */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border-soft); }
.row:first-child { border-top: 0; }
.row .when { width: 56px; flex: none; font-size: 13px; color: var(--text-2); }
.row .what { flex: 1; min-width: 0; font-weight: 500; }
.row .what small { display: block; font-size: 13px; font-weight: 400; color: var(--text-2); }
.sq { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 640px; }
.tbl th { text-align: left; font-size: 13px; font-weight: 500; color: var(--text-2); padding: 8px 12px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.tbl th + th, .tbl td + td { border-left: 1px solid var(--border-soft); }
.tbl .chk { width: 14px; height: 14px; border: 1px solid var(--plan-line); border-radius: 4px; display: block; margin-top: 3px; }
.tbl td.c0, .tbl th.c0 { width: 36px; padding-left: 14px; padding-right: 0; border-left: 0; }
.tbl td.c0 + td, .tbl th.c0 + th { border-left: 0; }
.work-cell { display: flex; gap: 10px; align-items: flex-start; }
.work-cell b { display: block; font-weight: 500; }
.work-cell small { display: block; font-size: 13px; color: var(--text-2); }
.muted { color: var(--text-2); }
.foot-count { margin: 0; padding: 8px 14px; font-size: 13px; color: var(--text-2); }
.foot-count b { color: var(--text); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; font-size: 13px; font-weight: 500; }
.chips button { min-height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--text-2); }
.chips button[aria-pressed="true"] { border-color: var(--border); background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.search { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-width: 0; flex: 0 1 240px; }
.search input { border: 0; outline: 0; background: transparent; min-width: 0; width: 100%; font-size: 13px; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-2); font-size: 13px; }
.empty b { display: block; color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 2px; }

/* Approvals */
.ap-shell { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0; min-height: calc(100vh - 49px); }
.ap-list { min-width: 0; border-right: 1px solid var(--border-soft); }
.ap-list .toolbar { padding-left: max(20px, env(safe-area-inset-left, 0px)); }
.filter-chip { display: inline-flex; align-items: stretch; min-height: 30px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 13px; font-weight: 500; background: var(--surface); }
.filter-chip > span { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; }
.filter-chip > span + span { border-left: 1px solid var(--border-soft); }
.group-h { padding: 14px 20px 6px; font-size: 12px; font-weight: 500; color: var(--text-2); background: var(--sidebar); border-bottom: 1px solid var(--border-soft); }
.group-h span { color: var(--text-3); font-weight: 400; }
.ap-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px; align-items: center; border-bottom: 1px solid var(--border-soft); }
.ap-row > * { padding: 9px 12px; min-width: 0; }
.ap-row > * + * { border-left: 1px solid var(--border-soft); }
.ap-row > :first-child { padding-left: 20px; }
.ap-row.sel { background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }
.ap-row button.pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0; border: 0; background: none; text-align: left; }
.ap-row button.pick:hover b { text-decoration: underline; }
.ap-head { display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px; font-size: 13px; font-weight: 500; color: var(--text-2); border-bottom: 1px solid var(--border-soft); }
.ap-head > * { padding: 8px 12px; } .ap-head > :first-child { padding-left: 20px; } .ap-head > * + * { border-left: 1px solid var(--border-soft); }
.glyph { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #FFFFFF; font-size: 10px; font-weight: 600; flex: none; }
.ap-title { min-width: 0; flex: 1; overflow: hidden; }
.ap-row .pick { min-width: 0; }
.ap-title b { display: block; font-weight: 500; }
.ap-title small { display: block; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel { background: var(--surface); display: flex; flex-direction: column; min-width: 0; position: sticky; top: 49px; max-height: calc(100vh - 49px); overflow-y: auto; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 12px; }
.panel-head .glyph { width: 32px; height: 32px; border-radius: 8px; font-size: 13px; }
.panel-head h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; letter-spacing: -0.02em; }
.panel-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.panel-back { display: none; }
.attrs { margin: 0; padding: 8px 16px; display: grid; grid-template-columns: 124px minmax(0, 1fr); row-gap: 2px; font-size: 13px; border-top: 1px solid var(--border-soft); }
.attrs dt { display: flex; align-items: center; gap: 8px; min-height: 30px; color: var(--text-2); }
.attrs dd { margin: 0; display: flex; align-items: center; gap: 8px; min-height: 30px; min-width: 0; }
.pv-label { margin: 0 0 8px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.preview { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 20px; }
.preview p { margin: 0; } .preview p + p { margin-top: 6px; }
.preview .pt { font-weight: 600; } .preview .pb { color: var(--text-2); }
.preview .url { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); }
.preview.li { display: flex; gap: 12px; }
.preview.li img { width: 84px; height: 105px; object-fit: cover; border-radius: 6px; flex: none; }
.actions { padding: 4px 16px 14px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 8px; }
.actions .two { display: flex; gap: 8px; } .actions .two .btn { flex: 1; min-height: 34px; }
.note-box { display: flex; flex-direction: column; gap: 8px; }
.note-box label { font-size: 13px; font-weight: 500; }
.note-box textarea { font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); resize: vertical; min-height: 76px; }
.note-box .err { font-size: 12px; color: var(--red-fg); margin: 0; }
.note-box .two { justify-content: flex-end; } .note-box .two .btn { flex: 0 0 auto; }
.state { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.state.ok { background: var(--green-bg); color: var(--green-fg); }
.state.chg { background: var(--amber-bg); color: var(--amber-fg); display: block; }
.state.chg .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.state.chg p { margin: 2px 0 0; font-weight: 400; }
.linkish { min-height: 28px; padding: 0 4px; border: 0; background: none; color: inherit; font-weight: 600; text-decoration: underline; }
.activity { padding: 12px 16px 18px; }
.activity ol { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.activity li { display: flex; gap: 10px; padding: 6px 0; }
.activity li .avatar { width: 20px; height: 20px; font-size: 9px; }
.activity small { display: block; font-size: 12px; color: var(--text-3); }
.sys-dot { width: 20px; height: 20px; border-radius: 999px; background: var(--gray-bg); display: grid; place-items: center; flex: none; color: var(--text-2); }

/* Requests */
.req-form { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border-soft); background: var(--subtle); }
.req-form label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 4px; }
.req-form input, .req-form textarea { width: 100%; font-size: 13px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.req-form textarea { min-height: 64px; resize: vertical; }
.req-form .two { display: flex; justify-content: flex-end; gap: 8px; }
.req-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border-soft); }
.req-row:first-child { border-top: 0; }
.req-rank { width: 22px; font-size: 12px; color: var(--text-3); flex: none; text-align: center; }
.req-main { flex: 1; min-width: 0; }
.req-main b { display: block; font-weight: 500; }
.req-main small { display: block; font-size: 13px; color: var(--text-2); }
.req-main.done b { color: var(--text-3); text-decoration: line-through; }
.mv { display: flex; gap: 2px; }
.mv .icon-btn { width: 28px; height: 28px; }

/* Receipts */
.rc-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rc-big { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; }
.bars { display: flex; flex-direction: column; gap: 12px; padding: 4px 14px 14px; font-size: 13px; }
.bars .lab { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.bars .track { height: 8px; border-radius: 999px; background: var(--gray-bg); overflow: hidden; }
.bars .fill { height: 8px; border-radius: 999px; }
.tbl.rc td.num, .tbl.rc th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl.rc tfoot td { font-weight: 600; border-bottom: 0; }

/* Palette, toast, drawer, tab bar */
.overlay { position: fixed; inset: 0; background: var(--scrim); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.palette { width: min(560px, 100%); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-pop); overflow: hidden; }
.palette .pin { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); }
.palette input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 320px; overflow-y: auto; }
.palette li button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.palette li button[aria-selected="true"] { background: var(--active); }
.palette li .hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-pop); opacity: 0; transition: opacity 0.18s, transform 0.18s; z-index: 90; pointer-events: none; display: flex; align-items: center; gap: 8px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.scrim { display: none; }
.tabbar { display: none; }

@media (max-width: 1099px) {
  .ap-shell { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 899px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 284px; height: auto; z-index: 70; transform: translateX(-102%); transition: transform 0.2s ease; padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-top: calc(10px + env(safe-area-inset-top, 0px)); box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; }
  .scrim.on { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 65; }
  .menu-btn { display: inline-grid; margin-left: -6px; }
  .topbar-in { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .avatars, .hide-sm, .crumbs .root, .crumbs .sep { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 10px 12px; }
  .kpi .num { font-size: 19px; line-height: 24px; }
  .kpi .label { font-size: 11.5px; line-height: 16px; }
  .callout img { display: none; }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; font-size: 10.5px; font-weight: 500; color: var(--text-3); text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar .badge { position: absolute; top: 2px; left: 50%; margin-left: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--c-red); color: #FFFFFF; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; }
  .ap-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .ap-list { border-right: 0; }
  .ap-list .toolbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .ap-head, .filter-chip { display: none; }
  .ap-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ap-row > :nth-child(2) { display: none; }
  .ap-row > * + * { border-left: 0; }
  .ap-row > :first-child, .group-h { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .ap-row > :last-child { padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .panel { position: fixed; inset: 0; z-index: 75; max-height: none; top: 0; transform: translateX(102%); transition: transform 0.22s ease; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .panel.open { transform: none; }
  .panel-back { display: inline-flex; }
  .page-head .seg { width: 100%; } .page-head .seg button { flex: 1; }
  .req-row { flex-wrap: wrap; }
}
