/* v29 — full-screen two-pane shell, dense tool grid, local-trust bar */

.app.shell {
  max-width: none;
  width: 100%;
}

.shell {
  height: 100dvh;
  max-height: 100dvh;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 8px 12px 6px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
  overflow: hidden;
}

.shell-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  min-width: 0;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.shell-home {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  flex-shrink: 0;
}

.shell-home:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--ok) 35%, var(--hairline));
}

.shell-brand h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.local-trust-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--ok) 22%, var(--hairline));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--ok) 6%, var(--surface));
  box-shadow: var(--shadow-sm);
}

.local-trust-lead {
  margin: 0;
  flex: 1 1 280px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
}

.local-trust-lead strong {
  font-weight: 600;
  color: var(--ok);
}

.local-trust-chips {
  flex-shrink: 0;
}

.shell-body {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.files-pane,
.tools-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.files-pane {
  padding: 0;
}

.files-pane > .mode-tabs--main {
  margin: 8px 8px 0;
  flex-shrink: 0;
}

.hub-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tools-pane-head {
  flex-shrink: 0;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--hairline);
}

.tools-pane-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tools-pane-sub {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}

.tools-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 8px 10px 10px;
}

.tool-mosaic--rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  height: 100%;
  align-content: start;
  overflow: hidden;
}

.tool-mosaic--rail .tool-group {
  min-width: 0;
}

.tool-mosaic--rail .tool-group-label {
  font-size: 9px;
  margin-bottom: 5px;
  letter-spacing: 0.14em;
}

.tool-mosaic--rail .tool-group-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.tool-mosaic--rail .tool-pill {
  width: 100%;
  border-radius: var(--radius);
  padding: 8px 6px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tool-mosaic--rail .tool-pill-name {
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.tool-mosaic--rail .tool-pill-sum {
  display: none;
}

.dock-bottom {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border-radius: var(--radius-lg);
  transition:
    max-height 0.32s var(--ease-out),
    opacity 0.28s var(--ease-out);
}

.dock-bottom.is-open {
  opacity: 1;
  max-height: min(42vh, 400px);
}

.dock-bottom-inner {
  display: flex;
  flex-direction: column;
  max-height: min(42vh, 400px);
  min-height: 0;
}

.dock-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}

.dock-head .tool-spotlight {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  min-height: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.dock-head .tool-spotlight-name {
  font-size: 14px;
}

.dock-head .tool-spotlight-summary {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-head .tool-spotlight-meta {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.dock-head .toolkit-back {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  font-size: 18px;
}

.dock-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 10px 10px;
}

.dock-body #toolkitToolRoot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shell .footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  line-height: 1.2;
}

.footer-trust {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.shell .footer a {
  font-size: 10px;
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .shell-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.52fr) minmax(0, 0.48fr);
  }

  .tool-mosaic--rail {
    grid-template-columns: 1fr;
  }

  .tool-mosaic--rail .tool-group-items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 6px 8px 4px;
  }

  .local-trust-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .local-trust-chips {
    width: 100%;
  }

  .tool-mosaic--rail .tool-group-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tools-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

@media (max-width: 420px) {
  .tool-mosaic--rail .tool-group-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
