/* Surface Pages shell — small additions on top of ai0-surface-theme.css */

/*
 * Base theme hides #utility-panel below 1100px — on ai0.us that removes the only
 * place to set Base URL. Keep the three-column shell usable on laptops.
 */
#app.pages-shell {
  grid-template-columns: minmax(200px, 260px) 1fr minmax(300px, 420px) !important;
}
#app.pages-shell #utility-panel {
  display: flex !important;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
#app.pages-shell .util-section {
  min-width: 0;
}
#app.pages-shell .surface-label {
  white-space: normal;
  word-break: break-word;
  display: block;
  margin-top: 4px;
}
#app.pages-shell .util-actions button {
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

@media (max-width: 1100px) {
  #app.pages-shell {
    grid-template-columns: minmax(180px, 220px) 1fr minmax(260px, 36vw) !important;
  }
  #app.pages-shell #utility-panel {
    display: flex !important;
  }
}

@media (max-width: 820px) {
  #app.pages-shell {
    grid-template-columns: 1fr !important;
    grid-template-rows: 44px auto minmax(200px, 45vh) 1fr !important;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }
  #app.pages-shell #topbar {
    grid-column: 1;
    grid-row: 1;
  }
  #app.pages-shell #utility-panel {
    grid-column: 1;
    grid-row: 3;
    border-left: none;
    border-bottom: 1px solid var(--border);
    max-height: 45vh;
  }
  #app.pages-shell #sidebar {
    grid-column: 1;
    grid-row: 2;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
    overflow: auto;
  }
  #app.pages-shell #chat-area {
    grid-column: 1;
    grid-row: 4;
    min-height: 50vh;
  }
}

.surface-field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 10px;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--fg-0);
  font-size: 12px;
  font-family: var(--mono);
}
.surface-field:focus {
  outline: none;
  border-color: var(--accent);
}
select.surface-field {
  cursor: pointer;
  min-height: 36px;
}
.surface-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-2);
}
.surface-hint {
  font-size: 10px;
  color: var(--fg-2);
  line-height: 1.45;
  margin: 6px 0 0;
}

.advanced-connection {
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--bg-2);
}
.advanced-connection > summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-1);
  list-style-position: outside;
}
.advanced-connection[open] > summary {
  margin-bottom: 8px;
}
.util-actions .secondary {
  margin-top: 6px;
  opacity: 0.9;
}
