/* IBM Plex Sans 1.1.0 and IBM Plex Mono 2.5.0, SIL OFL.
   Files: public/assets/fonts/, from the IBM/plex GitHub releases.
   The page CSP must allow font-src 'self' or the browser will not load these files. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
}

:root {
  --paper-canvas: #F3F0EA;
  --paper-surface: #FFFCF8;
  --paper-surface-alt: #F7F4EE;
  --paper-ink: #1C1917;
  --paper-muted: #5E574E;
  --paper-faint: #6F675E;
  --paper-line: #E6E0D6;
  --paper-accent: #0E6B66;
  --paper-accent-text: #F7FFFD;
  --paper-accent-hover: #0C5E5A;
  --paper-selection: #E5F3F1;
  --paper-field: #FFFCF8;
  --paper-danger: #8A2E2A;
  --paper-hover: #E9E4DB;
  --paper-boundary: #8A8178;
  --paper-frame: #FFFCF8;
  --paper-scrim: rgb(28 25 23 / 0.36);

  --ink-canvas: #141413;
  --ink-surface: #1E1E1C;
  --ink-surface-alt: #191917;
  --ink-text: #F6F3EE;
  --ink-muted: #C8C0B6;
  --ink-faint: #8A847C;
  --ink-line: #2E2E2A;
  --ink-accent: #8ED9D2;
  --ink-accent-text: #10211F;
  --ink-accent-hover: #A9E3DD;
  --ink-selection: #1C3331;
  --ink-field: #232321;
  --ink-danger: #F0B4AE;
  --ink-hover: #2A2A27;
  --ink-boundary: #A39C94;
  --ink-frame: #FFFCF8;
  --ink-scrim: rgb(8 8 7 / 0.62);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --type-12: 12px;
  --type-13: 13px;
  --type-14: 14px;
  --type-16: 16px;
  --type-20: 20px;

  --radius-control: 8px;
  --radius-card: 12px;
  --radius-menu: 12px;
  --radius-nested: 4px;

  --shadow-raised: 0 1px 2px rgb(28 25 23 / 0.04), 0 8px 24px rgb(28 25 23 / 0.06);
  --shadow-floating: 0 1px 2px rgb(28 25 23 / 0.06), 0 16px 40px rgb(28 25 23 / 0.12);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --sidebar-width: 240px;
  --row-height: 40px;
  --field-height: 36px;
  --mark-size: 28px;
  --icon-size: 20px;
  --tile-icon-size: 32px;
  --footer-height: 32px;
  --tile-min: 148px;
  --tile-row: 132px;
  --touch: 44px;
  --dense: 32px;

  font-family: "IBM Plex Sans", sans-serif;
  font-size: var(--type-14);
  font-weight: 400;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

body[data-mode="organize"] {
  --canvas: var(--paper-canvas);
  --surface: var(--paper-surface);
  --surface-alt: var(--paper-surface-alt);
  --ink: var(--paper-ink);
  --muted: var(--paper-muted);
  --faint: var(--paper-faint);
  --line: var(--paper-line);
  --accent: var(--paper-accent);
  --accent-text: var(--paper-accent-text);
  --accent-hover: var(--paper-accent-hover);
  --selection: var(--paper-selection);
  --field: var(--paper-field);
  --danger: var(--paper-danger);
  --hover: var(--paper-hover);
  --boundary: var(--paper-boundary);
  --frame: var(--paper-frame);
  --scrim: var(--paper-scrim);
  --shadow-sheet: var(--shadow-raised);
  --shadow-menu: var(--shadow-floating);
  color-scheme: light;
}

body[data-mode="live"] {
  --canvas: var(--ink-canvas);
  --surface: var(--ink-surface);
  --surface-alt: var(--ink-surface-alt);
  --ink: var(--ink-text);
  --muted: var(--ink-muted);
  --faint: var(--ink-faint);
  --line: var(--ink-line);
  --accent: var(--ink-accent);
  --accent-text: var(--ink-accent-text);
  --accent-hover: var(--ink-accent-hover);
  --selection: var(--ink-selection);
  --field: var(--ink-field);
  --danger: var(--ink-danger);
  --hover: var(--ink-hover);
  --boundary: var(--ink-boundary);
  --frame: var(--ink-frame);
  --scrim: var(--ink-scrim);
  --shadow-sheet: none;
  --shadow-menu: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}
button, select, input, summary { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 0;
  background: transparent;
  border-radius: var(--radius-control);
  transition: transform 140ms var(--ease-out);
}
button:active:not(:disabled) { transform: scale(0.97); }
button:disabled { color: var(--muted); cursor: not-allowed; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  display: block;
}
.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 40;
  transform: translateY(-150%);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.skip-link:focus {
  transform: none;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.layout {
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  overflow: hidden;
  background: var(--canvas);
}
#sidebar {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  border-right: 1px solid var(--line);
  color: var(--ink);
}
.sidebar-top { padding: var(--space-4); position: relative; }
#close-sidebar { display: none; }
.workspace-line {
  position: relative;
  height: 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--field-height);
  grid-template-areas:
    "brand brand"
    "picker tools";
  column-gap: var(--space-2);
  row-gap: var(--space-2);
  align-items: center;
}
.identity {
  grid-area: brand;
  min-width: 0;
  height: var(--field-height);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.identity-mark {
  width: var(--mark-size);
  height: var(--mark-size);
  flex: none;
  color: var(--accent);
  display: block;
}
.identity-mark svg { display: block; width: 100%; height: 100%; }
.identity strong {
  font-size: var(--type-14);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}
.workspace-picker { grid-area: picker; min-width: 0; position: relative; display: block; }
.workspace-picker select {
  width: 100%;
  min-width: 0;
  height: var(--field-height);
  padding: 0 var(--space-6) 0 var(--space-2);
  background: var(--field);
  color: var(--ink);
  border: 1px solid var(--boundary);
  border-radius: var(--radius-control);
  appearance: none;
}
.workspace-picker::after {
  content: "";
  position: absolute;
  right: var(--space-3);
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.workspace-tools { grid-area: tools; }
.workspace-tools summary {
  cursor: pointer;
  list-style: none;
  width: var(--field-height);
  height: var(--field-height);
  border-radius: var(--radius-control);
  color: var(--muted);
  display: grid;
  place-items: center;
}
.workspace-tools summary::-webkit-details-marker { display: none; }
.workspace-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--boundary);
  border-radius: var(--radius-menu);
  padding: var(--space-1);
  box-shadow: var(--shadow-menu);
  transform-origin: top right;
}
.workspace-tools[open] .workspace-menu {
  animation: menu-in 200ms var(--ease-out);
}
@keyframes menu-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.workspace-menu button,
.workspace-menu .import-button {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-size: var(--type-14);
  line-height: 1.45;
  border-radius: var(--radius-control);
  color: var(--ink);
}
.workspace-menu .destructive { color: var(--danger); }
.sidebar-nav {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  padding: 0 var(--space-2) var(--space-4);
  scrollbar-color: var(--boundary) transparent;
}
.side-home {
  position: relative;
  width: 100%;
  min-height: var(--dense);
  text-align: left;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2);
  color: var(--ink);
  font-size: var(--type-14);
}
.side-home.current,
.tree-row.current {
  background: var(--selection);
  font-weight: 600;
}
.side-home.current::before,
.tree-row.current::before {
  content: "";
  position: absolute;
  left: 0;
  top: var(--space-2);
  bottom: var(--space-2);
  width: 2px;
  background: var(--accent);
}
.side-home.current .icon,
.tree-row.current .tree-icon { color: var(--accent); }
.section-label {
  margin: var(--space-4) var(--space-2) var(--space-2);
  color: var(--muted);
  font-size: var(--type-12);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.45;
}
.tree-row {
  position: relative;
  min-height: var(--dense);
  display: flex;
  align-items: center;
  border-radius: var(--radius-control);
  white-space: nowrap;
}
.tree-toggle {
  width: 24px;
  height: var(--dense);
  min-width: 24px;
  min-height: 24px;
  flex: none;
  color: var(--faint);
  padding: 0;
  display: grid;
  place-items: center;
}
.tree-toggle.placeholder { visibility: hidden; }
.tree-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  margin: 0 var(--space-2) 0 var(--space-1);
  color: var(--muted);
  display: grid;
  place-items: center;
}
.tree-name {
  flex: 1;
  min-width: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: var(--space-1) var(--space-1);
  font-size: var(--type-14);
  color: var(--ink);
}
.tree-actions { display: flex; opacity: 0; }
.tree-row:focus-within .tree-actions { opacity: 1; }
.tree-actions button {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.sidebar-bottom {
  padding: var(--space-4);
  border-top: 1px solid var(--line);
}
.mode-switch {
  height: var(--row-height);
  display: flex;
  align-items: stretch;
  gap: var(--space-1);
  padding: var(--space-1);
  border: 1px solid var(--boundary);
  border-radius: var(--radius-control);
  background: var(--surface-alt);
}
.mode-switch button {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-nested);
  font-size: var(--type-14);
  font-weight: 500;
  color: var(--muted);
  transition: transform 140ms var(--ease-out);
}
.mode-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-text);
}
.mode-switch button:active { transform: none; }

main { min-width: 0; min-height: 0; }
#organize-view,
#live-view {
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
#organize-view[hidden],
#live-view[hidden] { display: none; }
.address-row {
  height: var(--row-height);
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}
.icon-button {
  width: var(--dense);
  height: var(--dense);
  min-width: 24px;
  min-height: 24px;
  flex: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}
.address-bar {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  height: var(--row-height);
  background: var(--field);
  border: 1px solid var(--boundary);
  border-radius: var(--radius-control);
  padding: 0 var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  color: var(--ink);
}
.address-bar button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  white-space: nowrap;
  color: var(--ink);
  font-size: var(--type-14);
}
.address-bar .icon { color: var(--faint); }
.address-bar .crumb-separator { color: var(--muted); flex: none; }
.command-bar {
  min-height: var(--row-height);
  height: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex: none;
  overflow: visible;
}
.command-bar button {
  min-height: var(--dense);
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  color: var(--ink);
  font-size: var(--type-14);
  border: 1px solid var(--boundary);
  background: var(--surface);
}
.command-bar button:disabled {
  color: var(--muted);
  background: var(--surface-alt);
  border-color: var(--boundary);
}
.command-bar .icon { pointer-events: none; }
#new-item {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
#new-item:disabled { color: var(--accent-text); }
.command-separator {
  width: 1px;
  height: var(--space-4);
  background: var(--line);
  flex: none;
}
.content-card {
  min-height: 0;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
}
.item-grid {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  align-content: start;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr));
  grid-auto-rows: var(--tile-row);
  padding: var(--space-4);
  gap: var(--space-2);
  scrollbar-color: var(--boundary) transparent;
}
.item-grid:has(.folder-empty) {
  align-content: center;
  grid-auto-rows: auto;
}
.tile {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--space-4) var(--space-2) var(--space-2);
  border: 2px solid transparent;
  border-radius: var(--radius-control);
  text-align: center;
  gap: var(--space-2);
  color: var(--ink);
}
.tile.selected {
  background: var(--selection);
  border-color: var(--accent);
}
.tile.selected .tile-icon { color: var(--accent); }
.tile-icon {
  width: var(--tile-icon-size);
  height: var(--tile-icon-size);
  color: var(--ink);
}
.tile-label {
  font-size: var(--type-13);
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.count-footer {
  height: var(--footer-height);
  border-top: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 0 var(--space-4);
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-size: var(--type-12);
  line-height: var(--footer-height);
  text-align: left;
  flex: none;
}
.folder-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  text-align: center;
  color: var(--muted);
  padding: var(--space-6) var(--space-4);
  max-width: 280px;
  margin: 0;
}
.folder-empty strong {
  display: block;
  color: var(--ink);
  font-size: var(--type-16);
  font-weight: 600;
  line-height: 1.45;
  text-wrap: balance;
  margin-bottom: var(--space-2);
}
.live-tabs {
  height: var(--row-height);
  flex: none;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.live-tabs #tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  flex: 1;
  height: var(--row-height);
  scrollbar-width: thin;
  scrollbar-color: var(--boundary) transparent;
}
.tab {
  flex: 0 1 208px;
  min-width: 0;
  height: var(--dense);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-2) 0 var(--space-3);
  border-radius: var(--radius-control);
  color: var(--muted);
}
.tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.tab-icon { color: var(--faint); }
.tab.active .tab-icon { color: var(--accent); }
.tab .tab-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  padding: var(--space-1) 0;
  font-size: var(--type-14);
  color: inherit;
}
.tab .close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--muted);
}
.live-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  min-height: 0;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}
.toolbar {
  min-height: var(--row-height);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.toolbar strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28%;
  font-size: var(--type-14);
  font-weight: 600;
}
.toolbar .address {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-size: var(--type-12);
}
.toolbar a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-control);
  font-size: var(--type-14);
}
.notice {
  font-size: var(--type-12);
  line-height: 1.45;
  color: var(--muted);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line);
}
iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  background: var(--frame);
}
.live-empty {
  margin: auto;
  text-align: center;
  padding: var(--space-5);
  color: var(--muted);
  max-width: 360px;
}
.live-empty h1 {
  font-size: var(--type-20);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.45;
  text-wrap: balance;
  margin: 0 0 var(--space-2);
}
.live-empty p { line-height: 1.45; margin: 0; font-size: var(--type-14); }
.live-empty button {
  margin-top: var(--space-4);
  min-height: var(--row-height);
  padding: 0 var(--space-4);
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 500;
}
#message {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 30;
  max-width: 340px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--danger);
  box-shadow: var(--shadow-menu);
  font-size: var(--type-14);
  line-height: 1.45;
  display: none;
}
#message.visible { display: block; }
.layout.sidebar-closed { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 15;
  border: 0;
  padding: 0;
  background: var(--scrim);
}
.sidebar-scrim:not([hidden]) { display: block; }
.sidebar-closed #sidebar { visibility: hidden; overflow: hidden; }

@media (hover: hover) and (pointer: fine) {
  .side-home:hover,
  .tree-row:hover,
  .tree-name:hover,
  .address-bar button:hover,
  .command-bar button:hover:not(:disabled):not(#new-item),
  .workspace-tools summary:hover,
  .workspace-menu button:hover,
  .workspace-menu .import-button:hover,
  .tab:hover:not(.active),
  .icon-button:hover,
  .tab .close:hover,
  .tree-actions button:hover,
  .tile:not(.selected):hover {
    background: var(--hover);
    transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out);
  }
  .tree-row:hover .tree-actions { opacity: 1; }
  #new-item:hover,
  .live-empty button:hover { background: var(--accent-hover); }
  .toolbar a:hover { text-decoration: underline; }
}
@media (hover: none) {
  .tree-actions { opacity: 1; }
}

@media (max-width: 700px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  #sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(240px, 86vw);
    border-right: 1px solid var(--line);
    transform: translateX(0);
    visibility: visible;
    transition: transform 200ms var(--ease-out), visibility 0s linear 0s;
  }
  .layout.sidebar-closed {
    grid-template-columns: minmax(0, 1fr);
  }
  .layout.sidebar-closed #sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    transition: transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }
  .sidebar-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--touch);
    gap: var(--space-2);
    align-items: start;
  }
  .workspace-line { grid-template-columns: minmax(0, 1fr) var(--touch); }
  #close-sidebar {
    display: grid;
    place-items: center;
    width: var(--touch);
    height: var(--touch);
    min-width: var(--touch);
    min-height: var(--touch);
    color: var(--ink);
    position: static;
  }
  .icon-button,
  .command-bar button,
  .tree-actions button,
  .tab .close,
  .workspace-tools summary {
    min-width: var(--touch);
    min-height: var(--touch);
  }
  .icon-button { width: var(--touch); height: var(--touch); }
  .address-row { height: auto; min-height: var(--touch); }
  .command-bar {
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .command-separator { display: none; }
  .command-bar button {
    min-height: var(--touch);
    justify-content: center;
    border: 1px solid var(--boundary);
    background: var(--surface);
  }
  #new-item {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-text);
  }
  .command-bar button:disabled {
    background: var(--surface-alt);
    color: var(--muted);
  }
  .tree-actions { opacity: 1; }
  .tree-actions button { width: var(--touch); height: var(--touch); }
  .tab { flex-basis: auto; height: auto; min-height: var(--touch); }
  .tab .close { width: var(--touch); height: var(--touch); }
  .toolbar { flex-wrap: wrap; }
  .toolbar strong { max-width: 55%; }
  .toolbar .address { order: 3; flex-basis: 100%; }
  .side-home,
  .tree-name { min-height: var(--touch); }
}

@media (prefers-reduced-motion: reduce) {
  button:active:not(:disabled) { transform: none; }
  .workspace-tools[open] .workspace-menu {
    animation: menu-fade 120ms linear;
  }
  @keyframes menu-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}
@media (max-width: 700px) and (prefers-reduced-motion: reduce) {
  #sidebar,
  .layout.sidebar-closed #sidebar {
    transform: none;
    transition: opacity 120ms linear, visibility 0s linear 120ms;
  }
  .layout.sidebar-closed #sidebar { opacity: 0; }
  #sidebar { opacity: 1; }
}
