/* BioStudio AI — Ink.
   E-ink calm: two colours, monospace chrome, square 2px frames, no shadows,
   no glass, no motion. The focused window's title bar is inverted. The bar is
   a text status line — `apps` on the left, open windows as `1:Clarity*`,
   the tray as text on the right — and Start is a boxed A–Z command list.
   Built for long reading and analysis sessions, low-power screens and
   high-contrast needs. */

/* --- Palette ---------------------------------------------------------------- */
html:not(.shell-mobile) #os.theme-ink[data-color-theme],
html:not(.shell-mobile) body.theme-ink[data-color-theme] {
  --ct-desktop: #eeebe3;
  --ct-bg: #f4f1ea;
  --ct-surface: #f8f6f0;
  --ct-surface-2: #ebe7de;
  --ct-surface-3: #e3ded3;
  --ct-titlebar: #ebe7de;
  --ct-flyout: #f8f6f0;
  --ct-input: #fbfaf6;
  --ct-text: #111111;
  --ct-muted: #444444;
  --ct-faint: #7a7a7a;
  --ct-line: rgba(0, 0, 0, 0.22);
  --ct-line-strong: #111111;
  --ct-hover: rgba(0, 0, 0, 0.07);
  --ct-taskbar: #111111;
  --ct-shadow: none;
  --nv-paper: #f4f1ea;
  --nv-ink-solid: #111111;
}

html:not(.shell-mobile) #os.theme-ink:is([data-color-theme="black"], [data-color-theme="ocean"], [data-color-theme="orchid"]),
html:not(.shell-mobile) body.theme-ink:is([data-color-theme="black"], [data-color-theme="ocean"], [data-color-theme="orchid"]) {
  --ct-desktop: #0c0c0c;
  --ct-bg: #101010;
  --ct-surface: #141414;
  --ct-surface-2: #1b1b1b;
  --ct-surface-3: #222222;
  --ct-titlebar: #1b1b1b;
  --ct-flyout: #141414;
  --ct-input: #0e0e0e;
  --ct-text: #ece8de;
  --ct-muted: #bdb8ad;
  --ct-faint: #85817a;
  --ct-line: rgba(236, 232, 222, 0.24);
  --ct-line-strong: #ece8de;
  --ct-hover: rgba(236, 232, 222, 0.08);
  --ct-taskbar: #ece8de;
  --nv-paper: #101010;
  --nv-ink-solid: #ece8de;
}

html:not(.shell-mobile) #os.theme-ink,
html:not(.shell-mobile) body.theme-ink {
  --nv-font: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --nv-font-title: var(--nv-font);
  --nv-font-mono: var(--nv-font);
  --nv-ink: var(--ct-text);
  --nv-ink-2: var(--ct-muted);
  --nv-ink-3: var(--ct-faint);
  --nv-line: var(--ct-line);
  --nv-surface: var(--ct-surface);
  --nv-surface-3: var(--ct-surface-3);
  --nv-accent: var(--nv-ink-solid);
  --nv-on-accent: var(--nv-paper);
  --nv-radius: 0px;
  --nv-radius-menu: 0px;
  --nv-radius-item: 0px;
  --nv-win-border: 1.5px solid var(--ct-faint);
  --nv-win-border-focus: 2px solid var(--nv-ink-solid);
  --nv-shadow: none;
  --nv-shadow-idle: none;
  --nv-titlebar: var(--ct-surface-2);
  --nv-titlebar-rule: 1.5px solid var(--nv-ink-solid);
  --nv-titlebar-h: 26px;
  --nv-title-size: 12px;
  --nv-title-weight: 700;
  --nv-ctl-w: 30px;
  --nv-ctl-h: 26px;
  --nv-ctl-radius: 0px;
  --nv-ctl-glyph: 12px;
  --nv-hover: var(--ct-hover);
  --nv-close-hover: var(--nv-ink-solid);
  --nv-close-ink: var(--nv-paper);
  --nv-menu: var(--ct-surface);
  --nv-menu-border: 2px solid var(--nv-ink-solid);
  --nv-menu-shadow: none;
  --nv-menu-pad: 4px;
  --nv-menu-hover: var(--nv-ink-solid);
  --nv-menu-hover-ink: var(--nv-paper);
  --nv-item-h: 26px;
  --nv-item-size: 12.5px;
  --nv-scrim: transparent;
  --nv-desk-ink: var(--ct-text);
  --nv-desk-shadow: none;
  --nv-desk-hover: var(--ct-hover);
  --nv-desk-selected: transparent;
  --nv-scroll: color-mix(in srgb, var(--ct-text) 55%, transparent);
  --nv-scroll-radius: 0px;
  --taskbar-h: 26px;
  --taskbar-clearance: 26px;
  --accent: var(--nv-ink-solid);
}

/* A faint dither, like a sheet under an e-ink front light. */
html:not(.shell-mobile) #os.theme-ink.wp-ink[data-os-theme] {
  background:
    conic-gradient(from 90deg at 1px 1px, transparent 25%, color-mix(in srgb, var(--ct-text) 6%, transparent) 0) 0 0 / 3px 3px,
    var(--ct-desktop);
}

.tk-ink {
  background: repeating-linear-gradient(45deg, #111 0 2px, #f4f1ea 2px 5px);
}

html:not(.shell-mobile) #os.theme-ink .wallpaper-logo-layer,
html:not(.shell-mobile) #os.theme-ink .wallpaper-wordmark {
  display: none !important;
}

/* No motion anywhere in the chrome. */
html:not(.shell-mobile) #os.theme-ink .window,
html:not(.shell-mobile) #os.theme-ink .window.closing,
html:not(.shell-mobile) body.theme-ink :is(.ctx-menu, .flyout, .start-menu, .toast, .platform-dialog, .tv-inner) {
  animation: none !important;
  transition: none !important;
}

/* --- Windows ------------------------------------------------------------------ */
/* The shared title-bar rule paints var(--nv-win-titlebar); the focused
   window inverts by redefining it. */
html:not(.shell-mobile) #os.theme-ink .window.focused,
html:not(.shell-mobile) #os.theme-ink .window[data-app-color-theme].focused {
  --nv-win-titlebar: var(--nv-ink-solid);
  --nv-win-ink: var(--nv-paper);
}

html:not(.shell-mobile) #os.theme-ink .window.focused .window-title-text,
html:not(.shell-mobile) #os.theme-ink .window[data-app-color-theme].focused .window-title-text,
html:not(.shell-mobile) #os.theme-ink .window.focused .win-btn,
html:not(.shell-mobile) #os.theme-ink .window[data-app-color-theme].focused .win-btn {
  color: var(--nv-paper) !important;
}

html:not(.shell-mobile) #os.theme-ink .window .window-title-text::before {
  content: "■ ";
}

html:not(.shell-mobile) #os.theme-ink .window .window-title-icon {
  display: none;
}

html:not(.shell-mobile) #os.theme-ink .window.focused .win-btn:hover:not(.close) {
  background: color-mix(in srgb, var(--nv-paper) 20%, transparent) !important;
}

html:not(.shell-mobile) #os.theme-ink .window.focused .win-btn.close:hover {
  background: var(--nv-paper) !important;
  color: var(--nv-ink-solid) !important;
}

/* --- Status line ------------------------------------------------------------- */
html:not(.shell-mobile) #os.theme-ink .taskbar {
  left: 0;
  right: 0;
  bottom: 0;
  height: 26px;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--nv-ink-solid);
  color: var(--nv-paper);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none !important;
  font-family: var(--nv-font);
  font-size: 12px;
  counter-reset: inkwin;
}

html:not(.shell-mobile) #os.theme-ink .taskbar-left {
  display: none;
}

html:not(.shell-mobile) #os.theme-ink .taskbar-center {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
}

html:not(.shell-mobile) #os.theme-ink .taskbar-center > :is(.taskbar-apps-launcher, .tb-desktop-pill, .dock-divider, .dock-stack),
html:not(.shell-mobile) #os.theme-ink .taskbar-center > .tb-icon-btn[title^="Task"] {
  display: none !important;
}

html:not(.shell-mobile) #os.theme-ink :is(.tb-icon-btn, .task-btn) {
  width: auto;
  min-width: 0;
  height: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--nv-paper);
  font-family: var(--nv-font);
  font-size: 12px;
  transform: none !important;
}

html:not(.shell-mobile) #os.theme-ink :is(.tb-icon-btn, .task-btn):hover {
  background: color-mix(in srgb, var(--nv-paper) 16%, transparent);
}

html:not(.shell-mobile) #os.theme-ink :is(.tb-icon-btn, .task-btn) > .icon,
html:not(.shell-mobile) #os.theme-ink .task-btn-icon,
html:not(.shell-mobile) #os.theme-ink .task-btn-indicator {
  display: none;
}

/* The session block on the left: [ apps ]. */
html:not(.shell-mobile) #os.theme-ink .taskbar-start {
  order: 0;
  padding: 0 12px;
  background: var(--nv-paper);
  color: var(--nv-ink-solid);
  font-weight: 700;
}

html:not(.shell-mobile) #os.theme-ink .taskbar-start:hover {
  background: color-mix(in srgb, var(--nv-paper) 85%, var(--nv-ink-solid));
}

html:not(.shell-mobile) #os.theme-ink .taskbar-start .tb-start-label {
  display: inline;
}

html:not(.shell-mobile) #os.theme-ink .taskbar-start .tb-start-label::before {
  content: "▌";
}

html:not(.shell-mobile) #os.theme-ink .taskbar-center > .tb-search {
  order: 1;
}

html:not(.shell-mobile) #os.theme-ink .tb-search .tb-search-label {
  display: inline;
  min-width: 0;
  color: inherit;
  font-size: 12px;
  text-transform: lowercase;
}

html:not(.shell-mobile) #os.theme-ink .tb-search .tb-search-label::before {
  content: "/";
}

html:not(.shell-mobile) #os.theme-ink .taskbar-apps {
  order: 2;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}

/* Only open windows are listed, numbered like terminal panes. */
html:not(.shell-mobile) #os.theme-ink .task-btn:not(.running) {
  display: none;
}

html:not(.shell-mobile) #os.theme-ink .task-btn.running {
  counter-increment: inkwin;
}

html:not(.shell-mobile) #os.theme-ink .task-btn.running .task-btn-label {
  display: inline;
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html:not(.shell-mobile) #os.theme-ink .task-btn.running .task-btn-label::before {
  content: counter(inkwin) ":";
  opacity: 0.7;
}

html:not(.shell-mobile) #os.theme-ink .task-btn.active {
  background: var(--nv-paper);
  color: var(--nv-ink-solid);
  font-weight: 700;
}

html:not(.shell-mobile) #os.theme-ink .task-btn.active .task-btn-label::after {
  content: "*";
}

html:not(.shell-mobile) #os.theme-ink .task-btn.multi .task-btn-label::after {
  content: "+";
}

html:not(.shell-mobile) #os.theme-ink .task-btn-notif-badge {
  position: static;
  margin-left: 4px;
  height: 14px;
  min-width: 14px;
  border-radius: 0;
  background: var(--nv-paper);
  color: var(--nv-ink-solid);
  font-size: 10px;
  line-height: 14px;
}

/* Tray as text and small glyphs. */
html:not(.shell-mobile) #os.theme-ink .taskbar-right,
html:not(.shell-mobile) #os.theme-ink .taskbar-tray {
  height: 100%;
  gap: 0;
  padding: 0;
}

html:not(.shell-mobile) #os.theme-ink :is(.tray-chevron, .tray-cluster, .tray-clock, .tray-notif-btn, .tb-style-toggle) {
  height: 100%;
  padding: 0 8px;
  border-radius: 0;
  background: transparent;
  color: var(--nv-paper);
  font-family: var(--nv-font);
  font-size: 12px;
}

html:not(.shell-mobile) #os.theme-ink :is(.tray-chevron, .tray-cluster, .tray-clock, .tray-notif-btn, .tb-style-toggle):hover {
  background: color-mix(in srgb, var(--nv-paper) 16%, transparent);
}

html:not(.shell-mobile) #os.theme-ink :is(.tray-cluster, .tray-notif-btn, .tray-chevron) .icon {
  width: 13px;
  height: 13px;
}

html:not(.shell-mobile) #os.theme-ink .tray-clock {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

html:not(.shell-mobile) #os.theme-ink .tray-clock :is(.clock-time, .clock-date) {
  font-size: 12px;
}

html:not(.shell-mobile) #os.theme-ink .tray-clock .clock-date {
  order: -1;
  opacity: 0.7;
}

html:not(.shell-mobile) #os.theme-ink .tb-style-toggle {
  font-weight: 700;
  text-transform: lowercase;
}

html:not(.shell-mobile) #os.theme-ink .tb-show-desktop {
  display: none;
}

html:not(.shell-mobile) #os.theme-ink .tray-notif-badge {
  border-radius: 0;
  background: var(--nv-paper);
  color: var(--nv-ink-solid);
}

/* --- Start: a boxed A–Z command list over the status line ------------------- */
html:not(.shell-mobile) #os.theme-ink .start-menu {
  left: 0;
  bottom: 26px;
  width: min(460px, 100vw);
  height: min(560px, calc(100dvh - 60px));
  min-height: 0;
  padding: 0;
  border: 2px solid var(--nv-ink-solid);
  border-bottom: 0;
  border-radius: 0;
  background: var(--ct-surface);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: none;
  font-family: var(--nv-font);
}

html:not(.shell-mobile) #os.theme-ink .start-menu.visible {
  transform: none;
}

html:not(.shell-mobile) #os.theme-ink .start-menu::before,
html:not(.shell-mobile) #os.theme-ink .start-home > :is(.start-section:not(.start-inline-all-head), .start-grid, .start-recommended),
html:not(.shell-mobile) #os.theme-ink .start-inline-all-head .start-view-btn {
  display: none !important;
}

html:not(.shell-mobile) #os.theme-ink .start-searchbar {
  height: 34px;
  margin: 0;
  padding: 0 12px;
  gap: 8px;
  border: 0;
  border-bottom: 2px solid var(--nv-ink-solid);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html:not(.shell-mobile) #os.theme-ink .start-searchbar::before {
  content: "›";
  font-weight: 700;
}

html:not(.shell-mobile) #os.theme-ink .start-searchbar .icon {
  display: none;
}

html:not(.shell-mobile) #os.theme-ink .start-search {
  font-family: var(--nv-font);
  font-size: 13px;
}

html:not(.shell-mobile) #os.theme-ink :is(.start-home, .start-results) {
  gap: 0;
  padding: 6px 0;
}

html:not(.shell-mobile) #os.theme-ink .start-inline-all-head {
  display: none !important;
}

html:not(.shell-mobile) #os.theme-ink .start-letter-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: auto;
  height: 22px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-family: var(--nv-font);
  font-size: 11px;
  font-weight: 700;
  color: var(--ct-muted);
}

html:not(.shell-mobile) #os.theme-ink .start-letter-head::before { content: "── "; }
html:not(.shell-mobile) #os.theme-ink .start-letter-head::after { content: " ──"; }

html:not(.shell-mobile) #os.theme-ink :is(.start-all-row, .start-best) {
  min-height: 26px;
  padding: 0 12px;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  color: var(--ct-text);
  font-family: var(--nv-font);
}

html:not(.shell-mobile) #os.theme-ink :is(.start-all-row, .start-best):hover,
html:not(.shell-mobile) #os.theme-ink :is(.start-all-row, .start-best):focus-visible {
  background: var(--nv-ink-solid);
  color: var(--nv-paper);
  outline: none;
}

html:not(.shell-mobile) #os.theme-ink :is(.start-all-icon, .start-best-icon) {
  display: none;
}

html:not(.shell-mobile) #os.theme-ink .start-all-name,
html:not(.shell-mobile) #os.theme-ink .start-best-name {
  font-size: 12.5px;
  font-weight: 400;
}

html:not(.shell-mobile) #os.theme-ink :is(.start-all-row, .start-best):hover .start-all-name::before {
  content: "› ";
}

html:not(.shell-mobile) #os.theme-ink .start-results-label {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ct-muted);
}

html:not(.shell-mobile) #os.theme-ink :is(.start-best-sub, .start-best-open, .start-all-sub) {
  display: none;
}

html:not(.shell-mobile) #os.theme-ink .start-footer {
  height: 30px;
  padding: 0 4px 0 12px;
  border-top: 1.5px solid var(--nv-ink-solid);
  border-radius: 0;
  background: transparent;
}

html:not(.shell-mobile) #os.theme-ink :is(.start-user, .start-power) {
  height: 26px;
  border-radius: 0;
  font-family: var(--nv-font);
  font-size: 12px;
}

html:not(.shell-mobile) #os.theme-ink .start-user .user-avatar {
  width: 18px;
  height: 18px;
  border-radius: 0;
  font-size: 11px;
}

/* --- Desktop: grayscale glyphs, ink labels --------------------------------- */
html:not(.shell-mobile) #os.theme-ink .desktop-icon-glyph .icon {
  filter: grayscale(1) contrast(1.15);
}

html:not(.shell-mobile) #os.theme-ink .desktop-icon-label {
  padding: 0 3px;
  font-size: 11.5px;
  font-weight: 500;
}

html:not(.shell-mobile) #os.theme-ink .desktop-icon.selected .desktop-icon-label {
  background: var(--nv-ink-solid);
  color: var(--nv-paper);
}

/* Launcher glyphs everywhere in the chrome go grey too. */
html:not(.shell-mobile) #os.theme-ink :is(.launchpad-icon-glyph, .start-tile-icon, .tb-preview-head) .icon {
  filter: grayscale(1) contrast(1.15);
}

/* Flyouts and toasts are square, bordered sheets. */
html:not(.shell-mobile) #os.theme-ink :is(.flyout, .toast) {
  border-width: 2px;
}

html:not(.shell-mobile) #os.theme-ink .toast-layer {
  bottom: 34px;
}
