/* AiB Platform — page-level layout shapes: split (main + rail), two-column
   grids, tabs, the settings and integrations layouts, the tool-run canvas
   and the small spacing utilities. */

/* ---------- detail layout: main + rail ---------- */
/* Zero track minimums AND shrinkable cells: WebKit answers a wrapping flex
   row's min-content with its one-line sum (iOS file pickers are ~280px by
   themselves), and a bare 1fr / auto-min cell hands that phantom width to
   the page — content then wraps at a width the phone doesn't have. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: 20px;
  align-items: start;
}
.split > * { min-width: 0; }
@media (max-width: 1020px) { .split { grid-template-columns: minmax(0, 1fr); } }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2 > * { min-width: 0; }
@media (max-width: 1020px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- tabs ---------- */
/* The row scrolls in place on narrow screens instead of pushing the page
   wide; the rule stays put, the scrollbar stays out of sight. */
.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 2px 10px;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--grey);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 0.25s;
  white-space: nowrap;
  flex: 0 0 auto;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- workspace canvas (tool run surface) ---------- */
/* The widget grammar inside it (.tool-input, .tool-row, the answer shapes)
   lives in css/public/tools.css, loaded only by the tool pages. */
.canvas-frame { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: clamp(20px, 2.4vw, 32px); }
/* the free-tools canvas hint uses it */
.hint { color: var(--grey); font-size: 13.5px; margin: 0; }
.trust-line { margin: 12px 2px 0; color: var(--grey-dark); font-size: 10.5px; }

/* ---------- integrations ---------- */
/* min() keeps the tile track narrower than any phone screen */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 16px;
}
.integration { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; }
.integration-head { display: flex; align-items: center; gap: 14px; }
.int-logo {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}
.integration-head .name { font-family: var(--font-display); font-weight: 640; font-size: 17px; }
.integration-head .state { margin-left: auto; }
.integration p { margin: 0; color: var(--grey); font-size: 13.5px; }

/* ---------- settings (workspace config) ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.settings-nav a {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--grey);
  transition: color 0.25s, background 0.25s;
  white-space: nowrap;
}
.settings-nav a:hover { color: var(--ink); }
.settings-nav a.is-active { color: var(--ink); background: var(--paper); font-weight: 500; }
/* folded: the section nav becomes a scrollable pill row above the content */
@media (max-width: 860px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
}
.setting-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .label { font-weight: 500; font-size: 14px; }
.setting-row .help { display: block; color: var(--grey); font-size: 12.5px; margin-top: 3px; max-width: 52ch; font-weight: 300; }
.setting-row .value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink);
  white-space: nowrap;
}
/* the logo value shows the mark small, in the row's ink */
.setting-row .value .mark { font-size: 18px; }

/* ---------- spacing & voice utilities ---------- */
.stack-20 > * + * { margin-top: 20px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
/* the quiet mono aside (card heads, modal rails) */
.mono--dim { color: var(--grey); }
