/*
  Layout around the Livingdocs Design System components (ds/). Only what the
  components don't provide: the Settings View shell, list rows, highlights.
  Tokens only, no new colours.
*/
html, body { margin: 0; height: 100%; }
body { background: var(--li-c-gray-9); }
#root { height: 100%; }

/* --- Settings View shell (templates/settings-view) --- */

.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-family: var(--li-font-sans);
  color: var(--li-c-text);
}

.shell-bars { flex-shrink: 0; z-index: 2; }

.shell-body {
  flex-grow: 1;
  min-height: 0;
  display: flex;
  width: 100%;
  max-width: 1870px;
  margin: 0 auto;
}

.shell-nav { flex-shrink: 0; overflow: auto; }

.shell-main {
  flex-grow: 1;
  min-width: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  /* The app's trick for centring the content despite the navigation. */
  padding-right: min(max(100vw - 1010px - 213px, 0px), 213px);
}

.shell-column {
  max-width: 962px;
  margin: 0 auto;
  padding: 36px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 1023px) {
  .shell-main { padding-right: 0; }
  .shell-column { padding: 24px 12px 48px; }
}

.stack { display: flex; flex-direction: column; gap: var(--li-space-half); }
.stack-tight { display: flex; flex-direction: column; gap: var(--li-space-quarter); }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--li-space-third); }
.grow { flex: 1; min-width: 0; }
.hinted { color: var(--li-c-text--slightly-hinted); }
.mono { font-family: var(--li-font-mono); font-size: 12px; }
.section-title { font-weight: 700; font-size: 15px; line-height: 23px; }

/* --- entry rows inside a MetadataCard --- */

.rows { display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: flex-start;
  gap: var(--li-space-half);
  padding: var(--li-space-half) 0;
  border-top: 1px solid var(--li-c-gray-6);
}

.row:first-child { border-top: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: var(--li-space-sixth); flex-shrink: 0; }

/* --- dialogue body (the Dialogue leaves the body to the caller) --- */

.dialogue-body {
  padding: var(--li-space-one);
  display: flex;
  flex-direction: column;
  gap: var(--li-space-three-quarters);
}

.list-row { display: flex; align-items: center; gap: var(--li-space-third); }

.suggestions { display: flex; flex-direction: column; border: 1px solid var(--li-c-gray-6); border-radius: var(--li-radius-s); }

.suggestion {
  all: unset;
  cursor: pointer;
  padding: var(--li-space-quarter) var(--li-space-third);
  border-top: 1px solid var(--li-c-gray-7);
}

.suggestion:first-child { border-top: 0; }
.suggestion:hover, .suggestion:focus-visible { background: var(--li-c-gray-8); }

/* --- Try it: the checked text with matches marked --- */

.checked-text { white-space: pre-wrap; line-height: 28px; }

mark.match {
  color: inherit;
  background: var(--li-c-yellow-4);
  border-bottom: 2px solid var(--li-c-yellow-1);
  border-radius: var(--li-radius-xs);
  padding: 0 1px;
}

mark.match.custom {
  background: var(--li-c-green-4);
  border-bottom-color: var(--li-c-green-1);
}

/* --- login --- */

.login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--li-space-one);
  padding: var(--li-space-one) 16px;
  box-sizing: border-box;
  font-family: var(--li-font-sans);
  color: var(--li-c-text);
}

.login-card { width: min(400px, 100%); }
.login-logo { height: 28px; }
.divider-label { text-align: center; }

/* --- pipeline pages (pipeline/scripts/ui), framed as they are; restyled later --- */

.shell-main-framed { display: flex; flex-direction: column; overflow: hidden; }
.shell-frame { flex-grow: 1; min-height: 0; display: flex; }
.shell-frame iframe { flex-grow: 1; width: 100%; border: 0; background: var(--li-c-white, #fff); }
.shell-frame-select { padding: var(--li-space-half); }

/* --- golden set guide --- */

.progress { height: 6px; border-radius: 3px; background: var(--li-c-gray-8); overflow: hidden; }
.progress-bar { height: 100%; background: var(--li-c-brand); transition: width .3s; }
.job-log { max-height: 220px; overflow: auto; margin: 0; padding: var(--li-space-half); background: var(--li-c-gray-9); font-size: 12px; white-space: pre-wrap; }
.quota { width: 88px; }
.guide-context mark { background: var(--li-c-yellow-3); padding: 0 2px; border-radius: 2px; }

/* A pipeline rule's XML, opened from the Rules tab */
.rule-xml { white-space: pre-wrap; overflow-x: auto; margin: 6px 0 0; padding: 8px; border-radius: 4px; background: var(--li-color-grey-1, rgba(0, 0, 0, .04)); }
