/* Attio's neutral workspace foundation, with contextual record detail. */
:root {
  --paper: #ffffff;
  --paper-2: #f6f7f9;
  --paper-3: #edf0f4;
  --ink: #1c1d1f;
  --ink-2: #505967;
  --ink-3: #667180;
  --line: #e4e7ec;
  --line-2: #d3d8df;
  --rust: #a82e2d;
  --rust-soft: #fcf0ef;
  --amber: #805a08;
  --amber-soft: #fbf5e7;
  --moss: #075a39;
  --moss-soft: #edf7f1;
  --slate: #505967;
  --slate-soft: #edf1f6;
  --action: #356bd8;
  --action-soft: #edf3ff;
  --brand: "Fraunces", Georgia, serif;
  --display: var(--body);
  --radius: 8px;
  --shadow: none;
  --sidebar-width: 224px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17191c; --paper-2: #1e2125; --paper-3: #292d33;
    --ink: #f1f3f5; --ink-2: #c1c7d0; --ink-3: #9ca6b5;
    --line: #30353d; --line-2: #424954;
    --rust: #f48c85; --rust-soft: #392727;
    --amber: #e8c376; --amber-soft: #332d22;
    --moss: #91d6b1; --moss-soft: #23362b;
    --slate: #b6c2d3; --slate-soft: #29323c;
    --action: #9dbdff; --action-soft: #25334e;
    color-scheme: dark;
  }
}
body { background: var(--paper); }
body::before { display: none; }
button, input, select, textarea { font-family: var(--body); }
button, a, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:is(a,button,summary,input,select,textarea):focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.app-shell { margin-left: var(--sidebar-width); min-height: 100dvh; }
.app-content { min-width: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 35; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 24px 12px 10px; border-right: 1px solid var(--line); background: var(--paper-2); }
.sidebar .wordmark { padding: 0 14px; text-decoration: none; font-family: var(--brand); font-size: 25px; letter-spacing: -.6px; }
.wordmark .dot { width: 9px; height: 9px; background: #b3411f; box-shadow: none; }
.sidebar-org { font-size: 11px; color: var(--ink-3); margin: 6px 14px 24px; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.sidebar-label { margin: 0 12px 8px; color: var(--ink-3); font-size: 11px; font-weight: 500; letter-spacing: .02em; }
.sidebar-label:not(:first-child) { margin-top: 24px; }
.sidebar-link, .sidebar-group > summary { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 11px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-size: 13px; cursor: pointer; margin-bottom: 2px; }
.sidebar-link > span:first-of-type, .sidebar-group > summary > span:first-of-type { flex: 1; }
.sidebar-link:hover, .sidebar-group > summary:hover { background: var(--paper-3); color: var(--ink); }
.sidebar-link.active { background: var(--action-soft); color: var(--action); font-weight: 600; }
.nav-icon { width: 17px; height: 17px; flex: 0 0 17px; }
.sidebar .navn { font-size: 10px; font-variant-numeric: tabular-nums; border-radius: 4px; padding: 1px 5px; background: var(--rust-soft); color: var(--rust); margin-left: auto; }
.sidebar-group > summary, .sidebar-account > summary { list-style: none; }
.sidebar-group > summary::-webkit-details-marker, .sidebar-account > summary::-webkit-details-marker { display: none; }
.nav-chevron { width: 5px; height: 5px; flex: 0 0 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(-45deg); }
details[open] > summary .nav-chevron { transform: rotate(45deg); }
.sidebar-link.nested { margin-left: 27px; padding-left: 12px; min-height: 33px; font-size: 12.5px; }
.sidebar-footer { flex: 0 0 auto; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; max-height: 40dvh; overflow-y: auto; }
.sidebar-account { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.sidebar-account > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px; color: var(--ink-2); }
.account-avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px; background: var(--paper-3); color: var(--ink); font-size: 12px; font-weight: 600; }
.account-name { min-width: 0; flex: 1; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name small { display: block; color: var(--ink-3); font-size: 10px; text-transform: capitalize; }
.nav-signout { display: block; width: 100%; padding: 10px; text-align: left; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; }
.nav-signout:hover { background: var(--paper-3); }
.sidebar-toggle, .sidebar-scrim { display: none; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 28px; min-height: 64px; background: var(--paper); backdrop-filter: none; }
.workspace-context { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.workspace-context b { color: var(--ink); font-weight: 500; }
.context-divider { color: var(--line-2); }
.top .meta { font-size: 11px; gap: 10px; white-space: nowrap; flex-wrap: nowrap; }
.top .meta .live::before { width: 5px; height: 5px; animation: none; }
.gsearch { width: min(340px,36%); margin-left: auto; }
.gsearch input { padding: 8px 12px; border-radius: 7px; background: var(--paper-2); font-size: 12px; }
.gsearch input:focus { outline: 2px solid var(--action); }
.gresults { border-radius: 8px; box-shadow: 0 8px 24px #0002; }
.page, .page.wide { max-width: none; padding: 28px 32px 56px; }
.page h1 { font-family: var(--body); font-weight: 600; font-size: 27px; line-height: 1.25; letter-spacing: -.7px; margin: 0 0 10px; text-wrap: balance; }
.page .lede { font-family: var(--body); font-style: normal; color: var(--ink-3); font-size: 13px; line-height: 1.6; max-width: 960px; margin: 0 0 22px; }
.section { border-radius: 8px; background: var(--paper); box-shadow: none; animation: none; }
.section > header { background: var(--paper); padding: 15px 18px; }
.section > header h2, .servicehead h2, .page h2, .drawer h2 { font-family: var(--body); font-size: 17px; font-weight: 600; letter-spacing: -.3px; }
.summary { gap: 12px; padding: 26px 32px 8px; }
.tile, .qtiles > div { background: var(--paper); box-shadow: none; animation: none; }
.tile:hover { transform: none; background: var(--paper-2); }
.tile .n, .qtiles .n, .page .bignum { font-family: var(--body); font-variant-numeric: tabular-nums; font-size: 32px; font-weight: 500; }
.layout { gap: 20px; grid-template-columns: 210px minmax(0,1fr); padding: 20px 32px 56px; }
.rail { top: calc(var(--header-height,64px) + 16px); max-height: calc(100dvh - var(--header-height,64px) - 32px); }
.rail h4, .srchead { font-family: var(--body); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.servicegrid { columns: 2 320px; column-gap: 20px; }
.servicecard { box-shadow: none; }
.servicehead { background: var(--paper-2); }
.servicekind + .servicekind { border-top-style: solid; }
.btn, .chip { border-radius: 7px; font-size: 12px; font-weight: 500; box-shadow: none; }
.btn:hover { border-color: var(--line-2); background: var(--paper-2); }
.btn.primary, .chip.active { background: var(--ink); color: var(--paper); }
.toolbar { padding: 12px 16px; gap: 10px; }
.toolbar .search { background: var(--paper); font-size: 13px; width: min(300px,100%); }
table { font-variant-numeric: tabular-nums; }
table.f th, table.c th { font-family: var(--body); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-3); font-size: 12px; background: var(--paper-2); }
table.f td, table.c td { font-size: 13px; }
table.f.items { min-width: 800px; }
table.f.items td { padding: 11px 12px; }
table.f.items th { padding: 10px 12px; }
table.f.items .r:hover { background: var(--paper-2); }
.tablewrap.free { overflow: auto; max-height: calc(100dvh - var(--header-height,64px) - 240px); }
table.clients thead { top: 0; }
table.clients tbody td:first-child, table.clients thead tr:last-child th:first-child { position: sticky; left: 0; background: var(--paper); z-index: 2; }
table.clients thead tr:last-child th:first-child { background: var(--paper-2); z-index: 6; }
.view-help { margin: -8px 0 18px; color: var(--ink-3); font-size: 12px; }
.view-help > summary { cursor: pointer; }
.view-help .section-note { padding-left: 0; }
.pill { border-radius: 5px; font-size: 11px; font-family: var(--body); }
.section-note, .freshness { color: var(--ink-3); font-size: 12px; }
.settings-layout { padding: 28px 32px 56px; grid-template-columns: 170px minmax(0,1fr); }
.settings-menu a.active { box-shadow: none; background: var(--action-soft); color: var(--action); }
.loading-spinner { border-top-color: var(--action); }
.login-card .wordmark { font-family: var(--brand); }
.login-lede { font-family: var(--body); font-style: normal; }
.drawer-bg { background: #10182830; }
.drawer { width: min(620px,calc(100vw - 32px)); padding: 28px; background: var(--paper); border-left: 1px solid var(--line); box-shadow: -8px 0 32px #0001; }
.drawer h2 { font-size: 23px; line-height: 1.3; padding-right: 22px; margin: 12px 0 14px; }
.drawer-kicker { font-family: var(--body); font-size: 11px; text-transform: none; letter-spacing: 0; }
.drawer-close { width: 30px; height: 30px; top: 16px; right: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-size: 22px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-actions .btn { margin: 0; }
.drawer-actions details { margin-left: auto; }
.record-context { padding: 12px 14px; border: 1px solid var(--line); background: var(--paper-2); border-radius: 7px; font-size: 12px; color: var(--ink-3); line-height: 1.8; }
.record-context a { display: block; color: var(--action); font-weight: 500; }
.kvlist { grid-template-columns: minmax(110px,35%) minmax(0,1fr); font-size: 12px; }
.kvlist dt { font-family: var(--body); font-size: 12px; color: var(--ink-3); }
.kvlist dd { overflow-wrap: anywhere; }
.ticket-text { overflow-wrap: anywhere; }
.client-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.client-header .lede { margin-bottom: 8px; }
.client-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.client-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 24px 0; overflow-x: auto; }
.client-tabs a { text-decoration: none; padding: 12px 0; color: var(--ink-3); font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.client-tabs a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.client-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 8px; margin: 24px 0; }
.client-stats > div { padding: 18px; }
.client-stats > div + div { border-left: 1px solid var(--line); }
.client-stats span { display: block; font-size: 12px; color: var(--ink-3); }
.client-stats b { display: block; font-size: 27px; font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 6px; }
.client-record-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; padding-bottom: 18px; }
.client-record-picker label { font-size: 11px; color: var(--ink-3); }
.client-record-picker select { display: block; min-width: 280px; max-width: 100%; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--paper); color: var(--ink); font: 13px var(--body); margin-top: 6px; }
.client-records > .embedded { padding: 0; }
.source-read-summary { color: var(--ink-3); font-size: 11px; margin: 12px 0; }
.client-source-list { margin-top: 24px; }
.client-source-list > a { display: grid; grid-template-columns: minmax(0,1fr) 60px 150px; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 13px; }
.client-source-list > a:last-child { border-bottom: 0; }
.client-source-list > a:hover { background: var(--paper-2); }
.client-source-list b { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.client-source-list small { font-size: 11px; color: var(--ink-3); text-align: right; }
.client-pane > .page { padding: 0; }
.client-pane > .page h1 { font-size: 20px; }
.client-menu { position: relative; }
.client-menu > summary { cursor: pointer; }
.client-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-width: 85vw; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); z-index: 10; box-shadow: 0 8px 24px #0002; }
.client-menu-panel > .btn { display: block; width: 100%; text-align: left; margin: 0 0 8px; }
.doc-metadata { padding: 16px 0; border-block: 1px solid var(--line); margin: 18px 0; }
.relationship-picker { max-height: 260px; overflow-y: auto; margin: 12px 0; }
.relationship-picker label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 7px; border-bottom: 1px solid var(--line); }
.relationship-picker label input { width: auto; margin: 0; }
.relationship-picker small { display: block; width: 100%; margin-left: 26px; color: var(--ink-3); font-size: 10px; }
.template-manager { margin: 18px 0; font-size: 12px; }
.template-manager summary { cursor: pointer; }
.template-field { display: grid; grid-template-columns: 1fr 140px 100px auto; gap: 12px; align-items: center; margin: 12px 0; }
.template-field label { display: flex; align-items: center; gap: 6px; }
.template-field label input { width: auto; margin: 0; }
.structured-fields { padding: 16px; border: 1px solid var(--line); background: var(--paper-2); border-radius: 8px; margin: 20px 0; }
.document-body.markdown { white-space: normal; line-height: 1.7; }
.document-body.markdown h2 { margin-top: 24px; font-size: 20px; }
.document-body.markdown h3 { margin-top: 18px; }
.document-body.markdown pre { padding: 16px; background: var(--paper-2); white-space: pre-wrap; border: 1px solid var(--line); border-radius: 6px; }
.document-body.markdown a { color: var(--action); }
.document-related { margin: 20px 0; border-top: 1px solid var(--line); }
.document-related .linkbtn { display: block; margin: 8px 0; overflow-wrap: anywhere; }
@media (max-width: 1200px) {
  .top .meta .live { display: none; }
  .layout { grid-template-columns: 190px minmax(0,1fr); gap: 16px; padding-inline: 24px; }
  .page, .page.wide { padding-inline: 24px; }
  .servicegrid { columns: 1; }
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } .rail { position: static; } }
@media (max-width: 800px) {
  .app-shell { margin-left: 0; }
  .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .18s ease,visibility .18s; z-index: 45; }
  .sidebar.expanded { transform: translateX(0); visibility: visible; }
  .sidebar-toggle { display: grid; place-items: center; position: fixed; top: 14px; left: 12px; width: 34px; height: 34px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 6px; z-index: 40; cursor: pointer; }
  .sidebar-toggle svg { width: 18px; height: 18px; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 44; background: #10182860; border: 0; }
  .top { display: flex; padding: 14px 16px 14px 58px; gap: 12px; }
  .workspace-context > span { display: none; }
  .gsearch { grid-column: auto; width: min(300px,52%); }
  .top .meta { display: none; }
  .page, .page.wide { padding: 24px 18px 40px; }
  .summary { padding: 20px 18px 6px; }
  .layout { padding: 16px 18px 40px; }
  .client-header { flex-direction: column; gap: 12px; }
  .client-tabs { gap: 20px; }
  .client-stats > div { padding: 14px; }
  .client-stats b { font-size: 24px; }
  .client-source-list > a { grid-template-columns: minmax(0,1fr) 40px; gap: 8px; }
  .client-source-list small { grid-column: 1 / -1; text-align: left; }
  .drawer { width: 100%; padding: 24px 20px; }
  .settings-layout { padding: 24px 18px 40px; }
  .template-field { grid-template-columns: 1fr 1fr; }
}
.overview-scope { margin-bottom: 20px; }
.source-total { font-size: 22px; color: var(--ink-3); }
.overview-scope nav { display: flex; flex-wrap: wrap; gap: 8px; }
.overview-scope p, .kind-scope { color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.kind-scope { margin: 8px 0 4px; }
.ticket-state-counts { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0; font-size: 12px; }
.service-issues { display: block; padding: 14px 20px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.quiet-sources, .quiet-source-status, .source-context, details.resolved { margin: 16px 0; }
.quiet-sources > summary, .quiet-source-status > summary, .source-context > summary, details.resolved > summary { color: var(--ink-2); cursor: pointer; font-size: 13px; padding: 10px 0; }
.source-context { padding: 0 20px; }
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
@media print {
  .sidebar, .sidebar-toggle, .sidebar-scrim, .top, .client-tools, .client-tabs { display: none !important; }
  .app-shell { margin-left: 0; }
  .page, .page.wide { padding: 0; }
  .tablewrap.free { overflow: visible; max-height: none; }
  .client-pane { display: block !important; }
  .report h1, .report h2 { font-family: var(--brand); }
}
