:root{
  --shell-window-pad: 18px;
  --shell-window-radius: 24px;
  --shell-window-radius-mobile: 16px;

  --shell-window-border: rgba(126,173,255,0.22);
  --shell-window-line: rgba(255,255,255,0.06);
  --shell-window-line-soft: rgba(255,255,255,0.03);

  --shell-window-bg:
    linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.01)),
    rgba(10,20,39,0.94);

  --shell-window-shadow: 0 24px 70px rgba(0,0,0,0.42);

  --shell-window-title: #edf4ff;
  --shell-window-text: #edf4ff;
  --shell-window-muted: #9eb2ce;

  --shell-window-transition: 180ms ease;
}

/* =========================================================
   MOBILE TRIGGER BAND
   ========================================================= */

.shell-mobile-band{
  display: none;
}

.shell-mobile-band__track{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.shell-mobile-trigger{
  width: 100%;
  min-width: 0;
}

.shell-mobile-trigger .btn__face{
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 9px;
  white-space: nowrap;
  font-size: 9px;
  letter-spacing: .03em;
}

/* =========================================================
   SHELL WINDOWS
   Shared window base for nav / modules / credits / site-nav / controls
   ========================================================= */

.shell-window{
  position: absolute;
  padding: var(--shell-window-pad);
  border: 1px solid var(--shell-window-border);
  border-radius: var(--shell-window-radius);
  background: var(--shell-window-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shell-window-shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--shell-window-transition),
    transform var(--shell-window-transition),
    visibility var(--shell-window-transition);
  z-index: 30;
}

.shell-window::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 24%);
}

.shell-window::after{
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: calc(var(--shell-window-radius) - 8px);
  border: 1px solid var(--shell-window-line-soft);
  pointer-events: none;
}

.shell-window.is-open{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* =========================================================
   DESKTOP WINDOW POSITIONS
   ========================================================= */

.shell-window--nav{
  top: 96px;
  bottom: 18px;
  left: 16px;
  width: min(430px, calc(100% - 32px));
  transform: translateX(-16px);
}

.shell-window--modules{
  top: 96px;
  bottom: 18px;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%) translateY(10px);
}

.shell-window--credits{
  top: 96px;
  right: 16px;
  bottom: 74px;
  width: min(360px, calc(100% - 32px));
  transform: translateX(16px);
}

/* desktop trigger windows if you keep them invoked there too */
.shell-window--site-nav{
  top: auto;
  left: 16px;
  right: auto;
  bottom: 18px;
  width: min(430px, calc(100% - 32px));
  max-height: min(42dvh, 340px);
  transform: translateY(10px);
}

.shell-window--controls{
  top: auto;
  right: 16px;
  left: auto;
  bottom: 18px;
  width: min(360px, calc(100% - 32px));
  max-height: min(38dvh, 300px);
  transform: translateY(10px);
}

.shell-window--nav.is-open,
.shell-window--credits.is-open{
  transform: translateX(0);
}

.shell-window--modules.is-open{
  transform: translateX(-50%) translateY(0);
}

.shell-window--site-nav.is-open,
.shell-window--controls.is-open{
  transform: translateY(0);
}

/* =========================================================
   WINDOW HEADER
   ========================================================= */

.shell-window-head{
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.shell-window-title{
  margin: 0;
  color: var(--shell-window-title);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.15;
}

.shell-window-subtitle{
  margin: 4px 0 0;
  color: var(--shell-window-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* =========================================================
   WINDOW BODY
   ========================================================= */

.shell-window-body{
  position: relative;
  z-index: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.shell-window-body::-webkit-scrollbar{
  width: 10px;
}

.shell-window-body::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}

/* =========================================================
   WINDOW INTERIOR
   ========================================================= */

.shell-section{
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.shell-section:first-child{
  margin-top: 0;
}

.shell-section-label{
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--shell-window-muted);
}

.shell-link-list{
  display: grid;
  gap: 10px;
}

.shell-link{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--shell-window-line);
  background: rgba(255,255,255,0.024);
  color: var(--shell-window-text);
  transition:
    background var(--shell-window-transition),
    border-color var(--shell-window-transition),
    transform var(--shell-window-transition);
}

.shell-link--button{
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  text-align: left;
  border-width: 1px;
  cursor: pointer;
  font: inherit;
}

.shell-link:hover,
.shell-link:focus-visible{
  background: rgba(255,255,255,0.05);
  border-color: var(--shell-window-border);
  outline: none;
}

.shell-link:active{
  transform: translateY(1px);
}

.shell-link.is-active{
  background: rgba(93,169,255,0.10);
  border-color: rgba(93,169,255,0.28);
}

.shell-link-copy{
  min-width: 0;
}

.shell-link-title{
  display: block;
  font-weight: 600;
}

.shell-link-meta{
  display: block;
  margin-top: 3px;
  color: var(--shell-window-muted);
  font-size: 0.84rem;
}

.shell-card{
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--shell-window-line);
  background: rgba(255,255,255,0.024);
}

.shell-card-title{
  margin: 0 0 8px;
  font-size: 0.96rem;
  font-weight: 700;
}

.shell-card-text{
  margin: 0;
  color: var(--shell-window-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.shell-inline-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.shell-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(215,174,73,0.14);
  border: 1px solid rgba(215,174,73,0.24);
  color: #f4dfad;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* =========================================================
   MOBILE
   Mobile trigger buttons become primary.
   Persistent command band is hidden.
   All shell windows become bottom drawers.
   ========================================================= */

@media (max-width: 820px){
  .shell-mobile-band{
    display: block;
    margin-top: 8px;
  }

  .shell-command-band{
    display: none;
  }

  .shell-window{
    top: auto;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px;
    width: auto;
    max-height: min(34dvh, 240px);
    padding: 9px;
    border-radius: var(--shell-window-radius-mobile);
    transform: translateY(10px);
  }

  .shell-window::after{
    inset: 6px;
    border-radius: calc(var(--shell-window-radius-mobile) - 6px);
  }

  .shell-window--nav,
  .shell-window--modules,
  .shell-window--credits,
  .shell-window--site-nav,
  .shell-window--controls{
    left: 8px !important;
    right: 8px !important;
    bottom: 8px;
    width: auto;
    max-height: min(34dvh, 240px);
  }

  .shell-window--nav.is-open,
  .shell-window--modules.is-open,
  .shell-window--credits.is-open,
  .shell-window--site-nav.is-open,
  .shell-window--controls.is-open{
    transform: translateY(0);
  }

  .shell-window-head{
    gap: 6px;
    margin-bottom: 7px;
  }

  .shell-window-title{
    font-size: 0.84rem;
  }

  .shell-window-subtitle{
    margin-top: 2px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .shell-window-body{
    padding-right: 2px;
  }

  .shell-section{
    gap: 5px;
    margin-top: 8px;
  }

  .shell-section-label{
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .shell-link-list{
    gap: 4px;
  }

  .shell-link{
    min-height: 32px;
    padding: 7px 9px;
    gap: 6px;
    border-radius: 10px;
  }

  .shell-link-title{
    font-size: 0.76rem;
    line-height: 1.05;
  }

  .shell-link-meta{
    margin-top: 1px;
    font-size: 0.68rem;
    line-height: 1.15;
  }

  .shell-card{
    padding: 9px;
    border-radius: 12px;
  }

  .shell-card-title{
    font-size: 0.82rem;
    margin-bottom: 5px;
  }

  .shell-card-text{
    font-size: 0.76rem;
    line-height: 1.35;
  }
}

@media (max-width: 480px){
  .shell-mobile-band__track{
    gap: 6px;
  }

  .shell-mobile-trigger .btn__face{
    min-height: 27px;
    padding: 0 7px;
    font-size: 8.5px;
  }

  .shell-window{
    max-height: min(30dvh, 210px);
    padding: 8px;
  }

  .shell-link{
    min-height: 30px;
    padding: 6px 8px;
  }
}

@media (prefers-reduced-motion: reduce){
  .shell-window,
  .shell-link{
    transition: none !important;
  }
}