/* Personal Assistant — local pages of the desktop client (threads in flight, work map, recent activity).
   Same tokens and components as the web app (PAM www/css/app.css): header bar, h_select rows, tiles. */
@font-face { font-family: "Helvetica Neue"; src: url("/fonts/HelveticaNeue-Light.otf") format("opentype"); font-weight: 300; }
@font-face { font-family: "Helvetica Neue"; src: url("/fonts/HelveticaNeue-Roman.otf") format("opentype"); font-weight: 400; }
@font-face { font-family: "Helvetica Neue"; src: url("/fonts/HelveticaNeue-Medium.otf") format("opentype"); font-weight: 500; }
@font-face { font-family: "Helvetica Neue"; src: url("/fonts/HelveticaNeue-Bold.otf") format("opentype"); font-weight: 700; }
:root {
  --accent_color: #f32851; --primary_blue: #b3c4de; --primary_green: #b9f3ac; --light_blue: #c8d6ed;
  --very_light_blue: #d7e0ee; --light_pink: #e29898; --header_bg: #f6cfd7; --beige: #f3eed9; --grey: #798897;
  --light_accent: #fadce2; --title: #444d58;
  --bg: #ffffff; --text: #2c3e50; --panel: #ffffff; --panel-2: #f3f3f3; --line: var(--primary_blue); --line-soft: #e6ecf5;
  --muted: var(--grey); --shadow: 0 2px 6px rgba(68, 77, 88, 0.08); --tile-ink: #5f6f80; --tree: #c9d4e3;
  --select_bg: #ffffff; --select_active: var(--beige); --select_ink: #2c3e50;
  font-family: "Helvetica Neue", "Noto Sans JP", Helvetica, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #3c4e60; --text: #ecf0f1; --panel: rgba(255,255,255,0.06); --panel-2: rgba(255,255,255,0.10); --line: rgba(179,196,222,0.35);
  --line-soft: rgba(255,255,255,0.12); --muted: #b8c4d2; --title: #ecf0f1; --shadow: none; --tree: rgba(255,255,255,0.25);
  --select_bg: rgba(255,255,255,0.06); --select_active: rgba(243,238,217,0.22); --select_ink: #ecf0f1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #3c4e60; --text: #ecf0f1; --panel: rgba(255,255,255,0.06); --panel-2: rgba(255,255,255,0.10); --line: rgba(179,196,222,0.35);
    --line-soft: rgba(255,255,255,0.12); --muted: #b8c4d2; --title: #ecf0f1; --shadow: none; --tree: rgba(255,255,255,0.25);
    --select_bg: rgba(255,255,255,0.06); --select_active: rgba(243,238,217,0.22); --select_ink: #ecf0f1;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { padding: 0 0 48px; font-size: 14px; line-height: 1.4; font-weight: 400; }
[hidden] { display: none !important; }

/* header bar, as the web app's */
.header_bar { padding: 10px 20px; border-bottom: 1px solid var(--primary_blue); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.header_bar img.logo { height: 36px; }
.header_bar h1 { font-size: 22px; font-weight: 700; color: var(--title); margin: 0; }
.header_bar .sub { color: var(--muted); font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; margin-right: 6px; }
.status-dot.on { background: #4caf50; }
.spacer { flex: 1; }
.page { padding: 14px 20px 0; }

/* the switch rows (web app: .h_select_div / .h_select_option) */
.h_select_div { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0; padding: 1px; }
.h_select_option { padding: 5px 12px; margin: 0; font-size: 12.5px; flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--primary_blue); background: var(--select_bg); color: var(--select_ink); border-radius: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: background-color .2s ease; font-family: inherit; font-weight: 500; }
.h_select_option + .h_select_option { margin-left: -1px; }
.h_select_option:first-child { border-bottom-left-radius: 8px; border-top-left-radius: 8px; }
.h_select_option:last-child { border-bottom-right-radius: 8px; border-top-right-radius: 8px; }
.h_select_option:hover { background: var(--light_accent); border-color: var(--accent_color); color: #2c3e50; position: relative; }
.h_select_option.active_filter { background: var(--select_active); border-color: var(--grey); position: relative; }
.h_select_option.active_filter:hover { background: var(--light_accent); border-color: var(--accent_color); }
.h_select_option .ico { font-size: 13px; line-height: 1; }
.h_select_option .n { background: rgba(44,62,80,.12); border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 600; }
.h_select_option.needs .n { background: var(--accent_color); color: #fff; }
.h_select_div.compact .h_select_option { flex: 0 0 auto; padding: 3px 10px; font-size: 12px; }
.views_row { margin-bottom: 14px; max-width: 760px; }
.controls_row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.controls_row label { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }

/* buttons and fields */
.btn, button.btn { padding: 5px 15px; font-size: 13px; font-weight: 600; border: 1px solid transparent; border-radius: 4px; background: var(--light_blue); color: #2c3e50; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--light_accent); border-color: var(--accent_color); }
.btn.primary { background: var(--primary_blue); }
.btn.active { background: var(--light_accent); border-color: var(--accent_color); }
.btn.small { padding: 2px 9px; font-size: 12px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--grey); }
select, input[type=text], input[type=number] { padding: 4px 8px; font-size: 12.5px; border: 1px solid var(--primary_blue); border-radius: 4px; background: var(--bg); color: var(--text); font-family: inherit; }
select:focus, input:focus { outline: none; border-color: var(--accent_color); }
.offline { background: var(--header_bg); color: #a4113a; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; display: none; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { border-radius: 8px; padding: 12px 14px; text-align: center; color: #2c3e50; background: var(--very_light_blue); box-shadow: var(--shadow); }
.tile .label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--tile-ink); }
.tile .value { font-size: 26px; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.tile .value small { font-size: 14px; color: var(--tile-ink); font-weight: 400; }
.tile .hint { font-size: 11.5px; color: var(--tile-ink); margin-top: 2px; }
.tile.needs { background: var(--header_bg); }
.tile.needs .value { color: var(--accent_color); }
.tile.running { background: var(--light_blue); }
.tile.waiting { background: var(--beige); }
.tile.you { background: var(--primary_green); }
.tile.ai { background: var(--very_light_blue); }
.tile.switches, .tile.others, .tile.goals { background: #ffffff; border: 1px solid var(--line-soft); }
.tile.unsorted { background: #ffffff; border: 1px dashed var(--line); }
:root[data-theme="dark"] .tile.switches, :root[data-theme="dark"] .tile.others, :root[data-theme="dark"] .tile.goals, :root[data-theme="dark"] .tile.unsorted { background: var(--panel-2); color: var(--text); border: 0; }
:root[data-theme="dark"] .tile.switches .label, :root[data-theme="dark"] .tile.switches .hint, :root[data-theme="dark"] .tile.others .label, :root[data-theme="dark"] .tile.others .hint, :root[data-theme="dark"] .tile.goals .label, :root[data-theme="dark"] .tile.goals .hint, :root[data-theme="dark"] .tile.unsorted .label, :root[data-theme="dark"] .tile.unsorted .hint { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tile.switches, :root:not([data-theme="light"]) .tile.others, :root:not([data-theme="light"]) .tile.goals, :root:not([data-theme="light"]) .tile.unsorted { background: var(--panel-2); color: var(--text); border: 0; }
  :root:not([data-theme="light"]) .tile.switches .label, :root:not([data-theme="light"]) .tile.switches .hint, :root:not([data-theme="light"]) .tile.others .label, :root:not([data-theme="light"]) .tile.others .hint, :root:not([data-theme="light"]) .tile.goals .label, :root:not([data-theme="light"]) .tile.goals .hint, :root:not([data-theme="light"]) .tile.unsorted .label, :root:not([data-theme="light"]) .tile.unsorted .hint { color: var(--muted); }
}

/* ---------- recent activity (timeline) ---------- */
#view-recent .tl_head { display: grid; grid-template-columns: 56px 1fr; gap: 0 12px; align-items: end; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
#view-recent .axis { position: relative; height: 18px; border-bottom: 1px solid var(--line); }
#view-recent .axis span { position: absolute; bottom: 2px; transform: translateX(-50%); white-space: nowrap; }
#view-recent .axis span::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 1px; height: 4px; background: var(--line); }
#view-recent .tl { display: grid; grid-template-columns: 56px 1fr; gap: 0 12px; }
#view-recent .tl_row { display: contents; }
#view-recent .tl_time { font-size: 11.5px; color: var(--muted); padding: 7px 0 0; text-align: right; font-variant-numeric: tabular-nums; }
#view-recent .tl_cell { position: relative; border-left: 2px solid var(--tree); padding: 5px 0 5px 14px; min-height: 30px; }
#view-recent .tl_row:last-child .tl_cell { padding-bottom: 14px; }
#view-recent .tl_cell::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--grey); border: 2px solid var(--bg); }
#view-recent .tl_row.window .tl_cell::before { background: var(--primary_blue); }
#view-recent .tl_row.action .tl_cell::before { background: var(--primary_blue); }
#view-recent .tl_row.thread .tl_cell::before { background: #8fa6c8; }
#view-recent .tl_row.unmonitored .tl_cell::before { background: transparent; border: 2px solid var(--grey); }
#view-recent .tl_row.ai .tl_cell::before { background: #6f8fb8; border-radius: 2px; transform: rotate(45deg); }
#view-recent .tl_row.clue .tl_cell::before { background: #b8a760; }
#view-recent .tl_row.waits .tl_cell::before { background: var(--accent_color); }
#view-recent .tl_row.live .tl_cell::before { box-shadow: 0 0 0 3px rgba(243,40,81,.18); background: var(--accent_color); }
#view-recent .bar_track { position: relative; height: 8px; border-radius: 4px; background: var(--panel-2); margin: 3px 0 5px; }
#view-recent .bar { position: absolute; top: 0; height: 8px; border-radius: 4px; background: var(--primary_blue); min-width: 3px; }
#view-recent .tl_row.unmonitored .bar { background: repeating-linear-gradient(90deg, var(--grey) 0 3px, transparent 3px 6px); opacity: .6; }
#view-recent .tl_row.ai .bar { background: #8fb0d8; }
#view-recent .tl_row.clue .bar { background: #d9c982; }
#view-recent .tl_row.thread .bar { background: #c1cfe3; }
#view-recent .tl_row.live .bar { background: linear-gradient(90deg, var(--primary_blue), var(--accent_color)); }
#view-recent .dot { position: absolute; top: -1px; width: 10px; height: 10px; border-radius: 50%; background: #b8a760; transform: translateX(-50%); }
#view-recent .tl_row.waits .dot { background: var(--accent_color); }
#view-recent .dot.before { background: #b8a760; }
#view-recent .before_link { position: absolute; top: 3px; height: 2px; background: repeating-linear-gradient(90deg, #b8a760 0 4px, transparent 4px 7px); }
#view-recent .tl_main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#view-recent .tl_title { font-weight: 500; color: var(--title); max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-recent .tl_row.unmonitored .tl_title { color: var(--muted); font-weight: 400; font-style: italic; }
#view-recent .tl_meta { color: var(--muted); font-size: 12px; }
#view-recent .tl_msg { color: var(--muted); font-size: 12px; font-style: italic; max-width: 90ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-recent .chip { display: inline-block; border-radius: 4px; padding: 0 6px; font-size: 11px; line-height: 17px; background: var(--very_light_blue); color: #2c3e50; white-space: nowrap; }
#view-recent .chip.src { background: var(--beige); }
#view-recent .chip.ai { background: #cfe0f5; }
#view-recent .chip.clue { background: #f1e9c9; }
#view-recent .chip.wait { background: var(--header_bg); color: #a4113a; }
#view-recent .chip.others { background: var(--very_light_blue); }
#view-recent .chip.proj { background: transparent; border: 1px solid var(--line-soft); color: var(--muted); }
#view-recent .chip.dur { background: transparent; color: var(--muted); border: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
#view-recent .empty { color: var(--muted); font-size: 13px; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; }
#view-recent .legend { color: var(--muted); font-size: 12px; margin: 10px 0 0; display: flex; gap: 14px; flex-wrap: wrap; }
#view-recent .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
@media (max-width: 760px) { .page { padding: 12px 14px 0; } .header_bar { padding: 10px 14px; } #view-recent .tl_title { max-width: 100%; white-space: normal; } }

/* feature set missing (app.js applyFunctions) */
.no_set { margin: 24px auto; max-width: 640px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.no_set h2 { margin: 0 0 8px; font-size: 18px; }
.no_set p { margin: 8px 0; line-height: 1.45; }
.no_set .hint { color: var(--muted); font-size: 12px; margin-left: 8px; }
.no_set.slim { max-width: none; margin: 12px 0 16px; padding: 12px 16px; }
.no_set.slim h2 { font-size: 15px; }
.no_set.slim p { margin: 4px 0; font-size: 13px; }

/* "monitored apps" links on the map and the timeline */
.apps_link { font-weight: 400; font-size: 12px; vertical-align: middle; margin-left: 6px; }

/* Focus & notifications (focus.js) */
#view-focus .fc_grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { #view-focus .fc_grid { grid-template-columns: 1fr; } }
#view-focus .fc_panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; box-shadow: var(--shadow); padding: 12px 14px; }
#view-focus .fc_panel h2 { font-size: 13px; font-weight: 700; color: #2c3e50; margin: 0 0 10px; padding: 6px 12px; background: var(--header_bg); border-radius: 4px; display: flex; align-items: center; gap: 10px; }
#view-focus .fc_panel h2 .hint { font-weight: 400; color: #2c3e50; opacity: .7; font-size: 12px; margin: 0; }
#view-focus .fc_panel h2 + .fc_bars { margin-bottom: 18px; }
#view-focus .fc_panel h3 { font-size: 12.5px; color: var(--muted); margin: 12px 0 4px; font-weight: 600; }
#view-focus .fc_bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 0 4px; }
#view-focus .fc_bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; cursor: help; }
#view-focus .fc_bar .col { width: 100%; height: 78px; display: flex; align-items: flex-end; background: var(--panel-2); border-radius: 3px; }
#view-focus .fc_bar .fill { width: 100%; background: var(--accent_color); border-radius: 3px 3px 0 0; min-height: 0; opacity: .85; }
#view-focus .fc_bar .v { font-size: 10px; color: var(--text); margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-focus .fc_bar .l { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#view-focus .fc_list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
#view-focus .fc_item { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
#view-focus .fc_item .t { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; font-size: 12px; }
#view-focus .fc_item .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view-focus .fc_item .vs, #view-focus .fc_item .st { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
#view-focus .fc_item .p { font-weight: 700; min-width: 28px; color: var(--text); }
#view-focus .fc_item .p.hot { color: var(--accent_color); }
#view-focus .fc_item.needs_you .st { color: var(--accent_color); }
#view-focus .fc_item.quiet { opacity: .6; }
#view-focus .fc_item .chip { font-size: 11px; color: #2c3e50; background: var(--light_blue); border-radius: 4px; padding: 1px 7px; white-space: nowrap; }
#view-focus .fc_form { display: flex; flex-direction: column; gap: 6px; }
#view-focus .fc_row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 4px 6px; border-radius: 4px; }
#view-focus .fc_row:hover { background: var(--panel-2); }
#view-focus .fc_row .lbl { min-width: 240px; }
#view-focus .fc_row .sub { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-left: 24px; }
#view-focus .fc_row .num input[type=number] { width: 70px; padding: 2px 6px; font-size: 12px; }
#view-focus .fc_row input[type=time] { padding: 2px 6px; font-size: 12px; border: 1px solid var(--primary_blue); border-radius: 4px; background: var(--bg); color: var(--text); font-family: inherit; }
#view-focus .fc_row label.inline { display: inline-flex; align-items: center; gap: 4px; }
#view-focus .empty { color: var(--muted); font-size: 13px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; }
#view-focus .tile.lowprio { background: var(--beige); }
#view-focus .tile.lowprio .value { color: var(--accent_color); }

/* the "start again" zone of the Focus page */
.fc_panel.danger_zone {border: 1px solid #e3b4b4; }
.fc_panel.danger_zone h2 {color: #a33; }
.fc_panel.danger_zone .warn {margin: 8px 0 2px; padding: 8px 10px; background: #fdecec; color: #7a1f1f; border-radius: 6px; font-size: 12.5px; }
.fc_panel.danger_zone #rs_form label {display: block; margin: 3px 0; }
.btn.danger {background: #c0392b; color: #fff; border-color: #c0392b; }
.btn.danger:disabled {opacity: .45; cursor: not-allowed; }
.fc_panel.danger_zone #rs_form label.sub {margin-left: 22px; color: var(--muted); }

/* header: the view switch sits at the level of the logo; the status is a dot (its tooltip says connected · day) */
.header_bar { flex-wrap: nowrap; row-gap: 8px; }
.header_bar .views_row { margin: 0; max-width: none; flex: 0 0 auto; flex-wrap: nowrap; }
.header_bar .views_row .h_select_option { flex: 0 0 auto; padding: 6px 14px; font-size: 13.5px; }
.header_bar .status { display: inline-flex; align-items: center; }
.header_bar .status .status-dot { margin-right: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .header_bar { flex-wrap: wrap; } .header_bar .views_row { order: 5; width: 100%; } .header_bar .views_row .h_select_option { flex: 1; } }
/* what only the desktop client has (the local reset of what this computer learnt) */
body[data-host="pam"] [data-host-only="omni"] { display: none !important; }
body[data-host="omni"] [data-host-only="pam"] { display: none !important; }
