/* The app's dock rail and phone tab bar for static pages (see appshell.js). Rules mirror
   src/styles/search-workspace.css (#dock …) and src/styles/mobile.css (.mtb, .msheet). The blog and
   developers stylesheets name a few tokens differently, hence the fallbacks. */
#dock, .mtb, .msheet { font-family: 'Geist', system-ui, -apple-system, sans-serif; }
#dock *, .mtb *, .msheet * { box-sizing: border-box; }
#dock svg, .mtb svg, .msheet svg { display: block; flex-shrink: 0; }

#dock {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
  width: 64px; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 2px;
}
.dock-logo { width: 36px; height: 36px; border-radius: 5px; background: var(--ink); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.dock-sep { width: 28px; height: 1px; background: var(--border); margin: 6px 0; }
.dock-nav { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.dock-icon {
  position: relative; width: 40px; height: 40px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink2); text-decoration: none; transition: background 160ms ease-out, color 160ms ease-out;
}
.dock-icon:hover { background: var(--canvas); color: var(--ink); }
.dock-icon.active { background: var(--accent); color: #fff; }
.dock-tip {
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  background: var(--ink); color: var(--panel); font-size: 11px; font-weight: 500; white-space: nowrap;
  padding: 4px 8px; border-radius: 4px; pointer-events: none; opacity: 0; transition: opacity 160ms ease-out; z-index: 100;
}
.dock-icon:hover .dock-tip, .avatar:hover .dock-tip, .dock-icon:focus-visible .dock-tip { opacity: 1; }
.dock-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 4px; }
.toggle-btn {
  width: 40px; height: 40px; border-radius: 5px; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink2);
}
.toggle-btn:hover { background: var(--canvas); color: var(--ink); }
.avatar {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  background: var(--canvas); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--ink2); text-decoration: none;
}
.avatar:hover { color: var(--ink); border-color: var(--ink3); }
#dock a:focus-visible, #dock button:focus-visible, .mtb-tab:focus-visible, .msheet a:focus-visible, .msheet button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the page shifts right of the rail */
body.has-dock { padding-left: 64px; }

.mtb { display: none; }
.msheet[hidden], .msheet-scrim[hidden] { display: none; }

@media (max-width: 1023px) {
  #dock { display: none; }
  body.has-dock { padding-left: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .mtb {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(64px + env(safe-area-inset-bottom, 0px)); padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: var(--panel); border-top: 1px solid var(--border);
  }
  .mtb-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 44px;
    font-family: inherit; font-size: 10.5px; font-weight: 500; color: var(--ink3); text-decoration: none;
    background: none; border: 0; padding: 0; cursor: pointer;
  }
  .mtb-tab.on { color: var(--accent); }
  .msheet-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .msheet {
    position: fixed; left: 0; right: 0; z-index: 40; bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    background: var(--panel); border-radius: 14px 14px 0 0; box-shadow: 0 12px 40px rgba(0, 0, 0, .16); padding: 8px 16px 16px;
  }
  .msheet-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--border2); margin: 4px auto 12px; }
  .msheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .msheet-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px;
    background: var(--panel-2, var(--panel-r, var(--canvas))); border: 1px solid var(--border); border-radius: 8px;
    font-size: 12.5px; font-weight: 600; color: var(--ink2); text-decoration: none;
  }
  .msheet-tile.on { border-color: var(--accent); color: var(--accent-ink, var(--accent-h)); background: var(--accent-soft, var(--accent-lo)); }
  .msheet-row {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 12px; padding: 0 4px;
    font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink2);
    background: none; border: 0; border-top: 1px solid var(--border); cursor: pointer;
  }
  .msheet-auth { margin-top: 8px; }
  .msheet-signin {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px;
    background: var(--accent); color: #fff; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none;
  }
}
