/* An introduction: the repository field is the action, and the example shows
   the result it produces. Keep these styles independent of the picker and
   editor's viewport layout. */
.entry-welcome {
  flex: none;
  width: min(100%, 46rem);
  margin: var(--s6) auto var(--s7);
}

.entry-hero { text-align: center; margin-bottom: var(--s6); }
.entry-mark { width: 5rem; height: 5rem; color: var(--accent); }
.entry-hero h2 { margin-top: var(--s3); font-size: 4.5rem; line-height: 1.1; }
.entry-purpose { margin-top: var(--s2); font-size: 1.5rem; line-height: 1.4; color: var(--ink-secondary); }

/* The label, progress, and error share one line above the field, so a status
   or failure replaces the label instead of moving the controls below it.
   The label stays in the accessibility tree to keep naming the field. */
.entry-field-head { display: grid; margin-bottom: var(--s2); font-size: var(--t-md); font-weight: var(--weight-strong); }
.entry-field-head > * { grid-area: 1 / 1; }
.entry-field-head:has(#entry-error:not([hidden]), #entry-progress:not(:empty)) label { opacity: 0; }
#entry-progress { color: var(--ink-secondary); }
#entry-progress:empty { display: none; }

/* The repository field is the page's main interaction: one solid bar whose
   filled GitHub cell is the only accent fill until a repository is entered,
   with Create as the bar's own submit action. */
.entry-repo-row {
  display: flex;
  align-items: stretch;
  min-height: 3.5rem;
  border: 2px solid var(--accent);
  border-radius: var(--r-lg);
  background: var(--controls-surface);
  overflow: hidden;
}
/* The focus ring sits flush with the bar so the two read as one thicker edge. */
.entry-repo-row:focus-within { outline: 2px solid var(--focus-ring, var(--accent)); outline-offset: 0; }
.entry-repo-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 3.5rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.entry-repo-icon svg { width: 1.5rem; height: 1.5rem; fill: currentColor; }
#entry-url {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 0 var(--s4);
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: var(--t-md);
}
#entry-url:focus { outline: none; }
#entry-create { flex: none; margin: var(--s1); padding-inline: var(--s5); }
/* An unusable repository address recolours the whole bar, not just the line above it. */
.entry-repo-row:has(#entry-url[aria-invalid="true"]) { border-color: var(--error-line); outline-color: var(--error-line); }
.entry-repo-row:has(#entry-url[aria-invalid="true"]) .entry-repo-icon { background: var(--error-line); }

/* The button is centred on its own; "or" sits in the equal-width column to its left. */
.entry-alternatives {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: var(--s3);
  margin-top: var(--s4);
}
.entry-alternatives > span { justify-self: end; color: var(--ink-secondary); }
.entry-alternatives > button { white-space: normal; }
#entry-return-welcome { display: flex; margin: var(--s4) auto 0; }

/* The example card previews the bundled snapshot that its button opens. */
.entry-example {
  margin: var(--s7) 0 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--well);
  overflow: hidden;
}
.entry-example-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}
.entry-example-title { margin-right: auto; min-width: 0; }
.entry-example-title strong { display: block; font-size: var(--t-md); }
.entry-example-title span { color: var(--ink-secondary); font-family: var(--mono); }

/* The tree uses the editor/picker branch renderer and .indent geometry, set
   bold with accent branches and notes; line segments meet across adjacent rows. */
.sample-tree {
  margin: 0;
  padding: var(--s4) var(--s5);
  --tree-step: 4ch;
  --tree-guide-ink: var(--accent);
  --tree-guide-width: 2px;
  list-style: none;
  font-family: var(--mono);
  font-size: var(--t-base);
  font-weight: var(--weight-strong);
  line-height: 2;
  color: var(--ink);
}
.sample-row { display: flex; align-items: center; gap: var(--s1); min-height: 2em; white-space: nowrap; }
.sample-count { color: var(--ink-secondary); font-weight: var(--weight-body); }
/* Notes follow their name by the two-space delimiter generated treestamps use; the row gap counts toward it. */
.sample-note { margin-left: calc(2ch - var(--s1)); color: var(--accent); }

@media (max-width: 47.999rem) {
  .sample-count { display: none; }
}

@media (max-width: 39.999rem) {
  .entry-welcome { margin-top: var(--s3); }
  .entry-hero { margin-bottom: var(--s5); }
  .entry-mark { display: none; }
  .entry-hero h2 { margin-top: 0; font-size: 3.25rem; }
  .entry-purpose { font-size: 1.25rem; }
  /* The monospace placeholder does not fit narrow phones. */
  #entry-url { padding: 0 var(--s3); font-family: inherit; }
  .entry-repo-icon { width: 2.75rem; }
  #entry-create { padding-inline: var(--s3); }
  .entry-alternatives { margin-top: var(--s3); }
  .entry-example { margin-top: var(--s5); }
  .entry-example-head { padding: var(--s2) var(--s3); }
  .sample-tree { padding: var(--s3) var(--s4); }
  .sample-note { display: none; }
}

@media (max-width: 39.999rem) and (max-height: 40rem) {
  .entry-welcome { margin-top: 0; }
  .entry-hero { margin-bottom: var(--s3); }
  .entry-hero h2 { font-size: 2.75rem; }
  .entry-purpose { font-size: 1.125rem; }
  .entry-field-head { font-size: var(--t-base); }
  .entry-repo-row { min-height: 3rem; }
  #entry-url { padding: 0 var(--s2); }
  .entry-alternatives, #entry-return-welcome { margin-top: var(--s2); }
}
