[data-shell] {
  width: 100%;
  max-width: none;
  margin: 24px auto;
  padding: 8px 16px;
  color: var(--app-ink);
  font-family: var(--app-font);
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

[data-shell],
[data-shell] * {
  box-sizing: border-box;
  min-width: 0;
}

[data-shell] [data-tracking-announcer] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[data-shell] h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  line-height: 1.25;
}

[data-shell] [data-shell-row] {
  /* Bound identity to a text measure plus feedback and gap, not the full-width frame. */
  max-width: calc(70ch + 16rem + 16px);
  display: grid;
  align-items: center;
  gap: 8px;
}

[data-shell] [data-shell-identity],
[data-shell] [data-persona-switcher] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

[data-shell] [data-persona-switcher] {
  width: 100%;
}

[data-shell] [data-shell-row][hidden],
[data-shell] [data-shell-identity][hidden],
[data-shell] [data-persona-switcher][hidden] {
  display: none;
}

[data-shell] p {
  max-width: 70ch;
  margin: 0;
  color: var(--app-muted);
  font-size: 0.875rem;
}

[data-shell] [data-persona-switcher] > span {
  color: var(--app-muted);
  font-size: 0.875rem;
}

[data-shell] button,
[data-shell] input {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 16px;
  border: 1px solid var(--app-edge);
  border-radius: 4px;
  background: var(--app-paper);
  color: var(--app-ink);
  font: inherit;
}

[data-shell] button {
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

[data-shell] [data-persona] {
  width: 100%;
  min-height: 44px;
  min-width: 44px;
  flex-shrink: 0;
}

[data-shell] button small {
  display: inline;
  color: var(--app-muted);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

[data-shell] button small[hidden] {
  display: none;
}

[data-shell] button[aria-pressed='true'] {
  border-color: var(--app-accent);
  background: var(--app-accent);
  color: var(--app-paper);
}

[data-shell] button[aria-pressed='true'] small {
  color: inherit;
}

[data-shell] button:hover:not(:disabled) {
  background: var(--app-field);
}

[data-shell] button[aria-pressed='true']:hover {
  background: var(--app-hover);
}

[data-shell] button:disabled {
  background: var(--app-field);
  color: var(--app-muted);
  cursor: wait;
}

[data-shell] :focus-visible {
  outline: 3px solid var(--app-accent);
  outline-offset: 3px;
}

[data-shell] ::selection {
  background: var(--app-accent);
  color: var(--app-paper);
}

[data-shell] input {
  width: 100%;
  padding-inline: 12px;
  caret-color: var(--app-accent);
}

[data-shell] [data-sign-in-form] {
  display: grid;
  max-width: 35ch;
  gap: 8px;
}

[data-shell] [data-sign-in-form][hidden] {
  display: none;
}

[data-shell] label {
  font-weight: 600;
}

@media (min-width: 960px) {
  [data-shell] [data-shell-row] {
    grid-template-columns: minmax(0, 1fr) minmax(0, 16rem);
    gap: 16px;
  }

  [data-shell] [data-shell-identity] {
    gap: 8px 12px;
  }

  [data-shell] [data-persona] {
    width: auto;
    padding: 4px 8px;
  }

  [data-shell] button small {
    display: block;
  }

  [data-shell] button small[hidden] {
    display: none;
  }

  [data-shell] [data-shell-notice] {
    flex-shrink: 0;
    max-width: 100%;
  }

  [data-shell] [data-persona-switcher] {
    width: auto;
    flex: 0 1 auto;
  }
}
