/* The app's shell today: the app rail and the panel on the chrome, every pane an island (tools/shell.mjs).
   Values from the Hushbox Screens artboards MainIslands and Sidebar* and from tokens.json (chrome, island, island-card):
   the chrome is about 1.18:1 against the islands, lighter in dark themes and darker in light themes; 6 px gaps,
   radius-md, no shadow. A dark scene follows the page into light (data-flip), as tokens.css does. */
.isl[data-theme="dark"] {
  --chrome: oklch(0.2660 0.0060 285); --chrome-hover: oklch(0.3000 0.0060 285); --chrome-selected: oklch(0.3300 0.0060 285);
  --island: oklch(0.2175 0.0062 285); --island-card: oklch(0.2560 0.0058 285); --island-card-hover: oklch(0.2900 0.0055 285);
}
.isl[data-theme="light"], :root[data-scheme="light"] .isl[data-flip] {
  --chrome: oklch(0.9370 0.0050 285); --chrome-hover: oklch(0.9600 0.0040 285); --chrome-selected: oklch(1 0 0);
  --island: oklch(1 0 0); --island-card: oklch(1 0 0); --island-card-hover: oklch(0.9590 0.0040 285);
}
.isl[data-theme="system-dark"] {
  --chrome: oklch(0.2660 0.0125 160); --chrome-hover: oklch(0.3000 0.0125 160); --chrome-selected: oklch(0.3300 0.0125 160);
  --island: oklch(0.2175 0.0128 160); --island-card: oklch(0.2560 0.0118 160); --island-card-hover: oklch(0.2900 0.0113 160);
}
.isl[data-theme="system-light"] {
  --chrome: oklch(0.9370 0.0100 160); --chrome-hover: oklch(0.9600 0.0100 160); --chrome-selected: oklch(0.9954 0.0066 160);
  --island: oklch(0.9954 0.0066 160); --island-card: oklch(0.9954 0.0066 160); --island-card-hover: oklch(0.9605 0.0099 160);
}
.isl { --isl-gap: 6px; background: var(--chrome) !important; }
.isl .hb-window { background: var(--chrome); }
.isl-c {
  --surface-card: var(--island-card); --surface-card-hover: var(--island-card-hover);
  display: flex; flex: 1; min-width: 0; min-height: 0; padding: var(--isl-gap) var(--isl-gap) var(--isl-gap) 0; gap: var(--isl-gap);
}
.isl-c :is(.hb-listpane, .hb-reader, .hb-cal) { overflow: hidden; border-radius: var(--radius-md); border-right: 0; }
.isl-c .hb-listpane { --surface: var(--island); background: var(--island); }
.isl-c :is(.hb-reader, .hb-cal) { --canvas: var(--island); background: var(--island); }
.isl-c .hb-resizer { display: none; }
/* a crop that starts at the list: the list's island keeps its left gap */
.isl-bare .isl-c { padding-left: var(--isl-gap); }

/* ---------- the app rail: 52 px, 40 px buttons, the current app on a pill, a ring on the account choice ---------- */
.ar { width: 52px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; background: var(--chrome); }
.ar-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-md); color: var(--fg-subtle); }
.ar-btn.ar-on { background: var(--chrome-selected); color: var(--fg); }
.ar-dim { opacity: .55; }
.ar-count { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; display: grid; place-items: center;
  font: 600 10px/1 var(--font-sans); background: var(--fg); color: var(--chrome); }
.ar-sep { width: 24px; height: 1px; margin: 6px 0; background: var(--chrome-selected); }
.ar-disc { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 600 12px/1 var(--font-sans); color: var(--island); }
.ar-all { background: var(--chrome-selected); color: var(--fg); }
.ar-cur::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--fg); }
.ar-new { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 2px var(--chrome); }
.ar-gap { flex: 1; }
.ar-t1 { background: var(--acct-1); } .ar-t2 { background: var(--acct-2); } .ar-t3 { background: var(--acct-3); } .ar-t4 { background: var(--acct-4); }
.ar-t5 { background: var(--a5, var(--acct-1)); } .ar-t6 { background: var(--a6, var(--acct-2)); } .ar-t7 { background: var(--a7, var(--acct-3)); } .ar-t8 { background: var(--a8, var(--acct-4)); }

/* ---------- the panel: an island beside the rail ---------- */
.isl-p { width: 240px; flex: none; display: flex; padding: var(--isl-gap) var(--isl-gap) var(--isl-gap) 0; }
.ap { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 14px 8px; border-radius: var(--radius-md); background: var(--island); overflow: hidden; }
.ap-head { flex: none; display: flex; flex-direction: column; gap: 2px; padding: 2px 10px 12px; }
.ap-head b { font: 600 15px/20px var(--font-sans); color: var(--fg); }
.ap-head span { font: 400 12px/16px var(--font-sans); color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-compose { flex: none; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; margin-bottom: 8px; border-radius: var(--radius-md);
  background: var(--primary); color: var(--fg-on-primary); font: 500 13px/1 var(--font-sans); }
.ap-row { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; flex: none; border-radius: var(--radius-md); color: var(--fg-muted); font: 400 13px/16px var(--font-sans); }
.ap-row .hb-icon { flex: none; color: var(--fg-subtle); }
.ap-row.ap-on { background: var(--chrome-selected); color: var(--fg); }
:root[data-scheme="light"] .isl[data-flip] .ap-row.ap-on, .isl[data-theme="light"] .ap-row.ap-on, .isl[data-theme="system-light"] .ap-row.ap-on { background: var(--chrome); }
.ap-row.ap-bold { color: var(--fg); font-weight: 600; }
.ap-row.ap-d1 { padding-left: 34px; }
.ap-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-count { font: 500 12px/16px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--fg); }
.ap-label { flex: none; padding: 18px 10px 6px; font: 500 12px/16px var(--font-sans); color: var(--fg-subtle); }
.ap-group { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 10px 4px; font: 500 12px/16px var(--font-sans); color: var(--fg-muted); }
.ap-group i { width: 6px; height: 6px; border-radius: 50%; }
/* the narrow window's first page: the panel fills the window beside the rail */
.isl .hb-window > .isl-p:last-child { flex: 1; width: auto; }
