/* A single, labeled page menu; overflow remains reachable by touch and keyboard. */
.dock {
  width: max-content;
  max-width: calc(100vw - 28px);
  gap: 7px;
  padding: 8px 10px 10px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scroll-padding-inline: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgb(122 157 195 / 42%) transparent;
}

.dock-button {
  display: flex;
  flex: 0 0 80px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 80px;
  height: 72px;
  padding: 0 2px 8px;
  border-radius: 12px;
}

.dock .dock-icon,
.dock .dock-detail .dock-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  transition: width 320ms ease, height 320ms ease, flex-basis 320ms ease, border-radius 320ms ease;
}

.dock .dock-button .dock-icon {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  z-index: 1;
}
.dock .dock-home .dock-icon,
.dock .dgc-icon span { color: #47698f; }
.dock .dock-button::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgb(159 222 255 / 55%), rgb(177 225 255 / 24%) 42%, transparent 72%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.dock .dock-button.is-active::before {
  opacity: 1;
  animation: dock-active-glow 2.6s ease-in-out infinite;
}
.dock .dock-button.is-active .dock-icon {
  color: #3b80bc;
  filter: drop-shadow(0 0 5px rgb(105 196 250 / 55%));
}
@keyframes dock-active-glow {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.dock .dock-icon svg { width: 24px; height: 24px; }
.dock .dock-home .dock-icon {
  width: 64px;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.035em;
  white-space: nowrap;
  padding-bottom: 0;
}

.dock-label {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: #4e6b8f;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: .01em;
  white-space: nowrap;
  text-align: center;
  text-overflow: ellipsis;
}

.dock-divider {
  flex: 0 0 1px;
  height: 42px;
  margin: 0 2px 20px;
}

/* Compact Dock: scrolling a page hides the labels, a tap on the Dock brings them back. */
.dock { transition: padding 320ms ease, gap 320ms ease; }
.dock-button { transition: width 320ms ease, flex-basis 320ms ease, height 320ms ease, padding 320ms ease; }
.dock-label { height: 16px; transition: height 280ms ease, opacity 190ms ease, transform 280ms ease; }
.dock-divider { transition: height 320ms ease, margin 320ms ease; }
.dock.is-compact { padding: 5px 7px; gap: 3px; }
.dock.is-compact .dock-button { width: 44px; flex-basis: 44px; height: 40px; padding-bottom: 2px; }
.dock.is-compact .dock-label { height: 0; opacity: 0; transform: translateY(-6px); }
.dock.is-compact .dock-divider { height: 26px; margin: 0 2px 3px; }
.dock.is-compact .dock-guide { width: 42px; flex-basis: 42px; }
.dock.is-compact .dock-icon { flex-basis: 32px; width: 32px; height: 32px; border-radius: 10px; }
.dock.is-compact .dock-icon svg { width: 19px; height: 19px; }
.dock.is-compact .dock-guide-badge { width: 24px; height: 24px; border-radius: 8px; font-size: 9px; }
.dock.is-compact .dock-tabs-count { min-width: 22px; height: 22px; font-size: 10px; }

.dock .dock-indicator {
  bottom: 1px;
  width: 5px;
  height: 3px;
  background: #7697bc;
  box-shadow: none;
  transition: width .2s ease, background .2s ease;
}
.dock .is-active .dock-indicator {
  width: 22px;
  background: #5299d1;
  box-shadow: 0 0 8px rgb(93 179 237 / 55%);
}
.dock .is-minimized .dock-indicator { background: transparent; }
.dock-button.is-active .dock-label { color: #294e7d; }
.dock-button:focus-visible { outline: 2px solid #688ab3; outline-offset: -1px; }
.dock .dock-button:hover .dock-icon,
.dock .dock-button:focus-visible .dock-icon { transform: translateY(-2px); }
.dock::-webkit-scrollbar { display: block; height: 3px; }
.dock::-webkit-scrollbar-thumb { border-radius: 3px; background: rgb(122 157 195 / 42%); }

@media (max-width: 700px) {
  .dock {
    max-width: calc(100vw - 24px);
    bottom: calc(26px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    padding: 8px 8px 10px;
    scroll-padding-inline: 8px;
    border-radius: 20px;
  }
  .dock .dock-button { flex-basis: 76px; width: 76px; height: 72px; }
  .dock.is-compact .dock-button { width: 42px; flex-basis: 42px; height: 38px; }
  .dock.is-compact .dock-guide { width: 40px; flex-basis: 40px; }
  .dock.is-compact .dock-icon { flex-basis: 30px; width: 30px; height: 30px; }
  .dock-label { font-size: 9.5px; }
  .brand-wordmark { font-size: 22px; }
  .dock .dock-home .dock-icon { font-size: 13.5px; }
  .dock .dock-button:hover .dock-icon,
  .dock .dock-button:focus-visible .dock-icon { transform: none; }
  .has-open-windows .dock { bottom: calc(13px + env(safe-area-inset-bottom, 0px)); }
  .window-content {
    padding-bottom: 24px;
    scroll-padding-bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dock, .dock .dock-icon, .dock-button, .dock-label, .dock-divider, .dock .dock-icon svg { scroll-behavior: auto; transition: none; }
  .dock .dock-button::before, .dock .dock-button.is-active::before,
  .dock .dock-indicator { animation: none; transition: none; }
  .dock .dock-button:hover .dock-icon,
  .dock .dock-button:focus-visible .dock-icon { transform: none; }
}
html[data-reduced-motion="true"] .dock,
html[data-reduced-motion="true"] .dock .dock-icon,
html[data-reduced-motion="true"] .dock-button,
html[data-reduced-motion="true"] .dock-label,
html[data-reduced-motion="true"] .dock-divider { scroll-behavior: auto; transition: none; }
html[data-reduced-motion="true"] .dock .dock-button::before,
html[data-reduced-motion="true"] .dock .dock-button.is-active::before,
html[data-reduced-motion="true"] .dock .dock-indicator { animation: none; transition: none; }
html[data-reduced-motion="true"] .dock .dock-button:hover .dock-icon,
html[data-reduced-motion="true"] .dock .dock-button:focus-visible .dock-icon { transform: none; }

/* The tab counter is pinned; the page buttons scroll beside it. */
.dock, .dock.is-overflow { overflow: hidden; touch-action: auto; }
.dock-pinned { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; }
.dock-scroll {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  gap: 7px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  scrollbar-width: thin;
  scrollbar-color: rgb(122 157 195 / 42%) transparent;
}
.dock-scroll::-webkit-scrollbar { display: block; height: 3px; }
.dock-scroll::-webkit-scrollbar-thumb { border-radius: 3px; background: rgb(122 157 195 / 42%); }
.dock .dock-tabs { flex-basis: 62px; width: 62px; }
.dock .dock-tabs .dock-icon { display: grid; place-items: center; }
.dock-tabs-count {
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding: 0 5px;
  border: 1.7px solid #6b8cb1;
  border-radius: 8px;
  color: #47698f;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}
.dock-tabs.has-tabs .dock-tabs-count { border-color: #4b8fca; color: #2f6fa9; background: rgb(214 236 252 / 55%); box-shadow: 0 0 10px rgb(105 196 250 / 35%); }
.dock-tabs[aria-expanded="true"] .dock-tabs-count { background: #4b8fca; border-color: #4b8fca; color: #fff; }
.dock-tabs[aria-expanded="true"] .dock-label { color: #294e7d; }

.tab-switcher-scrim { position: fixed; inset: 0; z-index: 1080; background: rgb(38 66 104 / 16%); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: tab-switcher-fade .18s ease both; }
.tab-switcher {
  position: fixed;
  z-index: 1090;
  left: 50%;
  bottom: 148px;
  width: min(980px, calc(100vw - 36px));
  max-height: calc(100dvh - 240px);
  display: flex;
  flex-direction: column;
  padding: 16px 18px 18px;
  border: 1px solid #ffffffed;
  border-radius: 20px;
  background: linear-gradient(140deg, rgb(255 255 255 / 94%), rgb(240 248 255 / 90%));
  box-shadow: 0 30px 80px -28px rgb(40 77 125 / 42%), 0 8px 24px -12px rgb(55 119 188 / 24%), inset 0 0 0 1px rgb(160 204 238 / 20%);
  transform: translateX(-50%);
  animation: tab-switcher-rise .22s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes tab-switcher-fade { from { opacity: 0; } }
@keyframes tab-switcher-drop { from { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(.98); } }
@keyframes tab-switcher-rise { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.98); } }
.tab-switcher-header { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-bottom: 14px; }
.tab-switcher-header h2, .tab-switcher-clear { white-space: nowrap; }
.tab-switcher-header h2 { display: flex; align-items: center; gap: 9px; margin: 0 auto 0 2px; color: #35506f; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.tab-switcher-header h2 span { display: grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e3eef9; color: #3f6f9e; font-size: 11px; font-variant-numeric: tabular-nums; }
.tab-switcher-clear { padding: 7px 12px; border: 1px solid #d5e0eb; border-radius: 8px; background: #fff; color: #5d7590; font-size: 11px; cursor: pointer; }
.tab-switcher-clear:hover { border-color: #e2c4cc; color: #9a5666; background: #fbf3f5; }
.tab-switcher-desktop:hover { border-color: #a9c5de; color: #2f6fa9; background: #f1f7fc; }
.tab-switcher-close { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #7d8a9a; cursor: pointer; }
.tab-switcher-close:hover { border-color: rgb(132 181 218 / 30%); background: rgb(188 221 242 / 28%); color: #344f70; }
.tab-switcher-empty { margin: 18px 4px 12px; color: #7d8d9b; font-size: 12px; line-height: 1.9; text-align: center; }
.tab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; overflow-y: auto; overscroll-behavior: contain; padding: 3px; margin: -3px; scrollbar-width: thin; }
.tab-card { position: relative; min-width: 0; }
.tab-card-open { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 12px; }
.tab-preview { display: block; position: relative; overflow: hidden; width: 100%; height: 130px; border: 1px solid #d9e4ee; border-radius: 12px; background: #f6f9fc; box-shadow: 0 8px 20px -12px rgb(47 87 135 / 35%); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.tab-preview-screen { display: block; position: absolute; top: 0; left: 0; transform-origin: 0 0; pointer-events: none; user-select: none; }
.tab-preview-screen .window-content { display: block; overflow: hidden; padding-bottom: 0; background: #fff; }
.tab-preview-screen *, .tab-preview-screen *::before, .tab-preview-screen *::after { animation: none !important; transition: none !important; }
.tab-card-open:hover .tab-preview, .tab-card-open:focus-visible .tab-preview { transform: translateY(-2px); border-color: #9fbbd6; box-shadow: 0 14px 28px -14px rgb(47 87 135 / 45%); }
.tab-card-open:focus-visible { outline: 2px solid #688ab3; outline-offset: 3px; }
.tab-card.is-current .tab-preview { border-color: #4b8fca; box-shadow: 0 0 0 2px rgb(75 143 202 / 28%), 0 10px 24px -12px rgb(47 87 135 / 40%); }
.tab-card.is-minimized .tab-preview-screen { opacity: .85; }
.tab-card-caption { display: flex; align-items: center; gap: 7px; min-width: 0; margin-top: 9px; padding: 0 2px; color: #3f5874; font-size: 11.5px; }
.tab-card-icon { display: grid; place-items: center; flex-shrink: 0; color: #6f8fb0; }
.tab-card-caption strong { min-width: 0; overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.tab-card-caption small { flex-shrink: 0; color: #8fa1b3; font-size: 9.5px; }
.tab-card-close { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #ffffffd9; border-radius: 50%; background: rgb(255 255 255 / 92%); color: #66788c; box-shadow: 0 2px 8px rgb(47 87 135 / 22%); cursor: pointer; }
.tab-card-close:hover { background: #f6e9ed; color: #915b67; }
.tab-card-close:focus-visible, .tab-switcher-clear:focus-visible, .tab-switcher-close:focus-visible { outline: 2px solid #688ab3; outline-offset: 2px; }

@media (max-width: 700px) {
  .dock-pinned, .dock-scroll { gap: 4px; }
  .dock .dock-tabs { flex-basis: 56px; width: 56px; }
  .dock-scroll { scrollbar-width: none; }
  .dock-scroll::-webkit-scrollbar { display: none; }
  /* Phones: the overview hangs from the top bar so thumbs on the Dock never cover it. */
  .tab-switcher { top: 62px; bottom: auto; width: calc(100vw - 20px); max-height: calc(100dvh - 62px - 124px - env(safe-area-inset-bottom, 0px)); padding: 14px 12px; border-radius: 18px; animation-name: tab-switcher-drop; }
  .tab-switcher-header { gap: 6px; }
  .tab-switcher-header h2 { gap: 7px; font-size: 12px; letter-spacing: .02em; }
  .tab-switcher-clear { padding: 7px 8px; font-size: 10px; }
  .tab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .tab-card-caption { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) { .tab-switcher, .tab-switcher-scrim { animation: none; } .tab-preview { transition: none; } .tab-card-open:hover .tab-preview { transform: none; } }
html[data-reduced-motion="true"] .tab-switcher, html[data-reduced-motion="true"] .tab-switcher-scrim { animation: none; }
html[data-reduced-motion="true"] .tab-preview { transition: none; }
