/* The one look shared by the base and every pillar.
   Black and white: a rail of pillar icons on the left in the frame colour (black unless the person picks
   another in My account), a light bar on top of every page with its name, tabs and profile,
   white cards on a light grey page, black actions. Colour is kept only for meaning
   (red for errors and money going down, green for money going up).
   Pillars load this file (/theme.css) and /shell.js; the base loads it before /style.css. */

:root {
  --bg: #f2f2f2;
  --card: #ffffff;
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e2e2e2;
  --line-soft: rgba(0, 0, 0, .07);
  --hover: #f4f4f4;
  --fill: #f4f4f4;
  --accent: #0a0a0a;         /* actions are black */
  --focus: #0a0a0a;
  --on-accent: #ffffff;
  --accent-soft: rgba(0, 0, 0, .06);
  --error: #c8102e;
  --error-soft: rgba(200, 16, 46, .07);
  --up: #13703a;
  --up-soft: rgba(19, 112, 58, .08);
  --chrome: rgba(255, 255, 255, .92);
  --band-bg: #000000;
  --band-text: #ffffff;
  --band-muted: #9b9b9b;
  --band-hover: rgba(255, 255, 255, .1);
  --band-line: #1f1f1f;
  --band-on: rgba(255, 255, 255, .16);
  --radius-card: 10px;
  --radius-field: 7px;
  --pill: 9999px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --fs: 12px;                /* body text */
  --fs-small: 11px;
  --band: 44px;
  --rail: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #121212; --text: #f2f2f2; --muted: #9a9a9a; --line: #2a2a2a;
    --line-soft: rgba(255, 255, 255, .09); --hover: #1c1c1c; --fill: #1c1c1c;
    --accent: #f2f2f2; --focus: #f2f2f2; --on-accent: #000000; --accent-soft: rgba(255, 255, 255, .08);
    --error: #ff6b6b; --error-soft: rgba(255, 107, 107, .12); --up: #4cc77a; --up-soft: rgba(76, 199, 122, .12);
    --chrome: rgba(18, 18, 18, .92); --band-line: #262626;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #121212; --text: #f2f2f2; --muted: #9a9a9a; --line: #2a2a2a;
  --line-soft: rgba(255, 255, 255, .09); --hover: #1c1c1c; --fill: #1c1c1c;
  --accent: #f2f2f2; --focus: #f2f2f2; --on-accent: #000000; --accent-soft: rgba(255, 255, 255, .08);
  --error: #ff6b6b; --error-soft: rgba(255, 107, 107, .12); --up: #4cc77a; --up-soft: rgba(76, 199, 122, .12);
  --chrome: rgba(18, 18, 18, .92); --band-line: #262626;
  color-scheme: dark;
}

/* ---- the frame -------------------------------------------------------------------- */
html.gs body { padding-top: var(--band); padding-left: var(--rail); }
.lu { width: 18px; height: 18px; flex: none; display: block; }

/* the light bar on top of every page */
.gs-top {
  position: fixed; top: 0; left: var(--rail); right: 0; height: var(--band); z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px;
  background: var(--card); color: var(--text); border-bottom: 1px solid var(--line);
  font: 400 var(--fs)/1.3 var(--font); letter-spacing: 0;
}
.gs-top a, .gs-top button { color: inherit; text-decoration: none; }
.gs-title { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; max-width: 32%; }
.gs-title b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-title-ic { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex: none;
  background: var(--band-bg); color: var(--band-text); }
.gs-title-ic .lu { width: 14px; height: 14px; }
.gs-tabs { display: flex; align-items: stretch; gap: 2px; height: 100%; min-width: 0; flex: 1 1 auto;
  overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.gs-tabs::-webkit-scrollbar { display: none; }
.gs-tabs[hidden] { display: none; }
.gs-tabs > a, .gs-tabs > button {
  display: flex; align-items: center; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; min-height: 0; font: 600 var(--fs)/1 var(--font); color: var(--muted); cursor: pointer; flex: none;
}
.gs-tabs > a:hover, .gs-tabs > button:hover { color: var(--text); background: none; }
.gs-tabs > .on { color: var(--text); border-bottom-color: var(--text); }
.gs-acts { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; white-space: nowrap; }
.gs-acts:empty { display: none; }
.gs-tabs[hidden] + .gs-acts { margin-left: auto; }
.gs-prof { flex: none; }
.gs-acts:empty + .gs-prof, .gs-tabs[hidden] ~ .gs-prof { margin-left: auto; }
.gs-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--pill);
  background: transparent; color: var(--text); font: 600 var(--fs-small)/1 var(--font); cursor: pointer; white-space: nowrap; min-height: 0;
}
.gs-btn:hover { background: var(--hover); }
.gs-btn .lu { width: 15px; height: 15px; }
.gs-logo { width: 28px; height: 28px; display: block; }
.gs-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--band-on); color: var(--band-text); font-size: 11px; font-weight: 700;
}
.gs-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.gs-menu { position: relative; }
.gs-list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; padding: 4px; z-index: 70;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); text-align: left;
}
.gs-list[hidden] { display: none; }
.gs-list > a, .gs-list > button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: 6px; min-height: 0;
  background: none; color: var(--text); font: 400 var(--fs)/1.3 var(--font); text-align: left; cursor: pointer; text-decoration: none;
}
.gs-list > a:hover, .gs-list > button:hover { background: var(--hover); }
.gs-more[hidden] { display: none; }
.gs-more .gs-list { min-width: 0; padding: 8px; }
.gs-more .gs-list > * { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.gs-list .on { font-weight: 600; }
.gs-list .on::after { content: "✓"; margin-left: auto; }
.gs-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.gs-list .gs-who { display: block; padding: 7px 9px; color: var(--muted); font-size: var(--fs-small); }
.gs-list .gs-who b { display: block; color: var(--text); font-size: var(--fs); }
.gs-list .gs-sub { color: var(--muted); }
.gs-apps { display: grid; grid-template-columns: repeat(3, 92px); gap: 4px; padding: 8px; min-width: 0; }
.gs-list.gs-apps a { flex-direction: column; gap: 3px; padding: 10px 4px; text-align: center; font-size: var(--fs-small); }
.gs-list.gs-apps .lu { width: 22px; height: 22px; }
.gs-list.gs-apps span { color: var(--muted); font-size: 10px; }

/* the rail: logo, pages and pillars, then the tools at the bottom */
.gs-rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail); z-index: 62;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 0 8px;
  background: var(--band-bg); color: var(--band-text); overflow-y: auto; scrollbar-width: none;
  font-family: var(--font);
}
.gs-rail::-webkit-scrollbar { display: none; }
.gs-rail .gs-brand { height: var(--band); width: 100%; flex: none; display: grid; place-items: center; color: var(--band-text); margin-bottom: 4px; }
.gs-rail > a:not(.gs-brand) {
  width: 54px; padding: 7px 2px 5px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--band-muted); font-size: 9.5px; font-weight: 600; line-height: 1.1; text-align: center; text-decoration: none;
  overflow-wrap: anywhere;
}
.gs-rail > a:not(.gs-brand):hover { color: var(--band-text); background: var(--band-hover); }
.gs-rail > a.on { color: var(--band-text); background: var(--band-on); }
.gs-rail .lu { width: 20px; height: 20px; }
.gs-rail .gs-gap { height: 1px; width: 32px; background: var(--band-line); margin: 6px 0; flex: none; }
.gs-end { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gs-tool { width: 40px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; min-height: 0;
  background: none; color: var(--band-muted); cursor: pointer; }
.gs-tool:hover { background: var(--band-hover); color: var(--band-text); }
.gs-tool.on { background: var(--band-on); color: var(--band-text); }
.gs-tool .lu { width: 19px; height: 19px; }
.gs-helper.live { color: var(--band-text); }
.gs-helper { position: relative; }
.gs-helper.live::after { content: ""; position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.gs-helper-list { min-width: 300px; max-width: 360px; }
.gs-helper-row { display: flex; align-items: center; gap: 6px; padding: 6px 9px; font-size: var(--fs); flex-wrap: wrap; }
.gs-helper-row select { min-height: 28px; padding: 2px 6px; font: inherit; }
.gs-helper-out { padding: 0 9px 6px; font-size: var(--fs-small); }
.gs-helper-out code { display: block; padding: 6px; margin: 4px 0; background: var(--fill); border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
.gs-danger { color: var(--error); border-color: var(--error); }
/* menus open beside the rail, from the bottom (fixed, so the rail's scrolling never cuts them off) */
.gs-rail .gs-list { position: fixed; left: calc(var(--rail) + 6px); right: auto; top: auto; bottom: 10px; }

/* quick notes, docked bottom right */
.gs-dock { position: fixed; right: 16px; bottom: 0; width: 320px; z-index: 65; font: 400 var(--fs)/1.4 var(--font);
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 10px 10px 0 0; box-shadow: 0 -2px 18px rgba(0, 0, 0, .14); }
.gs-dock.closed { display: none; }
.gs-dock-h { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; cursor: pointer;
  background: var(--band-bg); color: var(--band-text); border-radius: 10px 10px 0 0; }
.gs-dock-h .lu { width: 16px; height: 16px; }
.gs-count { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--band-text); color: var(--band-bg); font-size: 10px; font-weight: 700; text-align: center; line-height: 16px; }
.gs-count:empty { display: none; }
.gs-dock-tools { margin-left: auto; display: flex; }
.gs-dock-tools button { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; padding: 0; min-height: 0; }
.gs-dock-tools button:hover { background: var(--band-hover); }
.gs-dock.min .gs-dock-b, .gs-dock.min [data-dock="toggle"] .lu-minus { display: none; }
.gs-dock.min { width: 220px; }
.gs-dock-b { display: grid; gap: 6px; padding: 8px 10px 10px; }
.gs-notes { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; display: grid; gap: 6px; }
.gs-notes li { justify-self: end; max-width: 88%; padding: 6px 10px; border-radius: 14px 14px 4px 14px; background: var(--fill);
  white-space: pre-wrap; overflow-wrap: anywhere; }
.gs-notes li span { display: block; margin-top: 2px; font-size: 9.5px; color: var(--muted); text-align: right; }
.gs-notes li.gs-empty { justify-self: stretch; max-width: none; background: none; color: var(--muted); text-align: center; }
.gs-dock-f { display: flex; gap: 6px; align-items: flex-end; margin: 0; }
.gs-dock-f textarea { flex: 1; min-height: 36px; max-height: 120px; resize: none; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--card); color: var(--text); font: inherit; }
.gs-dock-f button { width: 34px; height: 34px; flex: none; display: grid; place-items: center; padding: 0; min-height: 0;
  border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); cursor: pointer; }
.gs-dock-f button .lu { width: 16px; height: 16px; }
.gs-dock-f .gs-bell { background: var(--fill); color: var(--text); }
.gs-dock-f .gs-bell.on { background: var(--accent); color: var(--on-accent); }
.gs-remind { display: flex; align-items: center; gap: 6px; font-size: var(--fs-small); color: var(--muted); }
.gs-remind[hidden] { display: none; }
.gs-remind input { flex: 1; min-height: 28px; padding: 3px 8px; border: 1px solid var(--line); border-radius: var(--radius-field); background: var(--card); color: var(--text); font: inherit; }
.gs-notes li span .lu { display: inline; width: 10px; height: 10px; vertical-align: -1px; }
.gs-dock-err { margin: 0; color: var(--error); font-size: var(--fs-small); }
.gs-dock-all { font-size: var(--fs-small); color: var(--muted); }

@media (max-width: 700px) {
  .gs-dock { right: 8px; left: 8px; width: auto; bottom: calc(56px + env(safe-area-inset-bottom)); border-radius: 10px; border-bottom: 1px solid var(--line); }
  .gs-dock .gs-dock-h { border-radius: 10px; }
  .gs-dock.open .gs-dock-h { border-radius: 10px 10px 0 0; }
  .gs-dock.min { left: auto; width: auto; }
  .gs-dock.min .gs-dock-h b { display: none; }
  .gs-dock.min .gs-dock-tools { display: none; }
  html.gs body { padding-left: 0; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .gs-top { left: 0; padding: 0 8px 0 10px; gap: 6px; }
  .gs-tabs:not([hidden]) ~ * .gs-btn { padding: 0 8px; }
  .gs-tabs:not([hidden]) ~ .gs-prof .gs-sub { display: none; }
  .gs-title { max-width: none; }
  .gs-tabs:not([hidden]) ~ .gs-prof .gs-btn .lu { display: none; }
  .gs-title:has(+ .gs-tabs:not([hidden])) b { display: none; }
  .gs-rail {
    top: auto; bottom: 0; right: 0; width: 100%; height: calc(56px + env(safe-area-inset-bottom));
    flex-direction: row; justify-content: flex-start; padding: 4px 6px env(safe-area-inset-bottom); gap: 0;
    overflow-x: auto; overflow-y: hidden; border-top: 1px solid var(--band-line);
  }
  .gs-rail .gs-brand, .gs-end .gs-tool:not([data-open="me"]), .gs-end .gs-tool-m { display: none; }
  .gs-rail > a:not(.gs-brand) { flex: 1 0 58px; width: auto; }
  .gs-rail .gs-gap { width: 1px; height: 28px; margin: 0 4px; }
  .gs-end { margin: 0 0 0 auto; padding: 0 4px; flex-direction: row; }
  .gs-rail .gs-list { left: auto; right: 8px; bottom: calc(62px + env(safe-area-inset-bottom)); }
}
/* a narrow window: everything gets a little smaller instead of wrapping onto more rows */
@media (min-width: 701px) and (max-width: 1199px) { html.gs #app, html.gs .gs-top { zoom: .92; } }
@media (min-width: 701px) and (max-width: 999px) { html.gs #app, html.gs .gs-top { zoom: .84; } }
@media (min-width: 701px) and (max-width: 849px) { html.gs #app, html.gs .gs-top { zoom: .78; } }
@media print { .gs-top, .gs-rail, .gs-dock { display: none !important; } html.gs body { padding: 0; } }
