:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #243b46; background: #edf2f5; --line: #d6e0e6; --muted: #607681; --brand: #284f5d; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1280px; margin: auto; padding: 24px 28px 48px; }
button, input, select, summary { font: inherit; }
button, .quick-actions a { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--brand); cursor: pointer; }
button:hover, .quick-actions a:hover { background: #edf4f7; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 3px solid #5d92ad; outline-offset: 3px; }
a { color: var(--brand); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: 21px; margin: 2px 0; }
h2 { font-size: 27px; margin: 4px 0 16px; font-weight: 650; letter-spacing: -.02em; }
h3 { font-size: 17px; margin: 0 0 12px; font-weight: 650; }
.eyebrow, .muted, .sync-status { color: var(--muted); font-size: 13px; line-height: 1.5; }
.eyebrow { margin: 0; }
.sync-status { min-height: 20px; margin: 14px 0; }
.app-header, .brand, .page-heading, .calendar-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { justify-content: flex-start; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: white; background: var(--brand); font-weight: 750; }
.workspace-settings { position: relative; }
.workspace-settings > summary { padding: 12px; color: var(--brand); cursor: pointer; }
.header-actions { position: absolute; top: 100%; right: 0; width: min(300px, 85vw); display: grid; gap: 8px; background: white; border: 1px solid var(--line); padding: 16px; border-radius: 12px; box-shadow: 0 10px 30px #243b4614; z-index: 10; }
.header-actions p:empty { display: none; }
.primary-nav { display: flex; gap: 6px; margin-top: 24px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #e4ecf0; }
.primary-nav a { padding: 11px 22px; border-radius: 9px; text-decoration: none; font-weight: 650; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.primary-nav a[aria-current="page"] { background: white; box-shadow: 0 1px 4px #243b4610; }
.badge { min-width: 20px; padding: 2px 5px; border-radius: 12px; background: var(--brand); color: white; font-size: 11px; text-align: center; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
body.detail-open .layout { grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr); }
#workspace, #detail { min-width: 0; }
#inbox { display: grid; gap: 12px; }
.dashboard-section { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.record-list { display: grid; gap: 8px; }
.inbox-item { width: 100%; display: grid; gap: 5px; text-align: left; padding: 16px; color: #243b46; border-radius: 12px; }
.inbox-item.attention { border-left: 4px solid #668da0; }
.inbox-item.category-human_action { border-left-color: #b98543; }
.inbox-item.category-urgent { border-left-color: #b55e54; }
.inbox-item[aria-current="true"] { background: #edf5f9; border-color: #6b94a8; }
.record-title { font-size: 16px; font-weight: 650; }
.record-meta, .record-time { color: var(--muted); font-size: 12px; line-height: 1.5; }
.record-time { font-variant-numeric: tabular-nums; }
.category-label { color: #526e7b; font-size: 11px; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.category-human_action .category-label { color: #8e632e; }
.category-urgent .category-label, .safety { color: #9a443b; }
.empty { margin: 4px 0; padding: 12px 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
#view-controls { display: grid; gap: 12px; margin-bottom: 16px; }
#view-controls:empty { display: none; }
.search-input { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filters button { font-size: 13px; padding: 8px 12px; }
.filters button[aria-pressed="true"] { background: var(--brand); color: white; border-color: var(--brand); }
.calendar-navigation { flex-wrap: wrap; }
.calendar-navigation strong { flex: 1; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-grid .weekday { text-align: center; font-size: 12px; padding: 6px 0; color: var(--muted); }
.calendar-day { display: grid; align-content: start; gap: 6px; min-height: 72px; padding: 9px 5px; font-size: 13px; }
.calendar-day.outside { color: #8c9ca5; background: #e9eff2; }
.calendar-day.today { border: 2px solid #517c91; }
.calendar-day .day-count { width: 20px; height: 20px; line-height: 20px; margin: auto; border-radius: 50%; color: white; background: #54788a; font-size: 11px; }
#detail { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.back-button { margin-bottom: 20px; }
.field { margin: 0; padding: 11px 0; border-bottom: 1px solid #edf1f4; font-size: 14px; line-height: 1.5; }
.field strong { display: block; color: var(--muted); font-size: 12px; font-weight: 550; margin-bottom: 3px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 12px; }
.quick-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.client-history { display: grid; gap: 10px; }
.client-history h3 { margin: 20px 0 0; }
.impact-section > h3 { margin-bottom: 2px; }
.impact-section > p { margin: 0 0 12px; }
.impact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.impact-metric { display: grid; align-content: start; gap: 3px; font-size: 12px; color: var(--muted); }
.impact-metric strong { font-size: 24px; font-weight: 650; color: var(--brand); font-variant-numeric: tabular-nums; }
.impact-definitions > summary { min-height: 44px; padding: 12px 0; margin-top: 6px; color: var(--muted); font-size: 12px; cursor: pointer; }
.primary-button { background: var(--brand); color: white; }
.primary-button:hover { background: #386477; }
#conversation-history { margin-top: 24px; border-top: 1px solid var(--line); }
#conversation-history > summary { min-height: 48px; padding: 14px 0; cursor: pointer; font-weight: 650; }
.message { margin: 8px 0; padding: 12px; background: #f1f5f7; border-radius: 10px; white-space: pre-wrap; line-height: 1.5; font-size: 14px; }
.message.customer { background: #e6eff4; }
.message .record-meta { display: block; margin-bottom: 5px; }
.login-page { min-height: 100dvh; display: grid; place-items: center; }
.login-shell { width: min(100% - 32px, 420px); padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.login-form { display: grid; gap: 8px; }
.login-form input { min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 760px) {
  main { padding: max(14px, env(safe-area-inset-top)) 14px calc(88px + env(safe-area-inset-bottom)); }
  h1 { font-size: 18px; }
  h2 { font-size: 25px; }
  .primary-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; margin: 0; border-radius: 0; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: #e4ecf0; gap: 2px; }
  .primary-nav a { flex: 1; justify-content: center; padding: 12px 2px; font-size: 13px; }
  body.detail-open .layout { display: block; }
  body.detail-open #workspace, body.detail-open .app-header, body.detail-open > main > .sync-status { display: none; }
  #detail { padding: 18px; }
  .dashboard-section { padding: 16px; }
  .calendar-day { min-height: 65px; }
  .impact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) { button, a { transition: background-color .12s ease; } }
