/* Project styles. Howdy UI's own classes and the theme's colours come from
   ui.css; the themes themselves are in src/thecustardfactory/platform/brand.gleam. */

/* Fonts: Plus Jakarta Sans for headings and interface text, Geist Mono for
   logs, commands and technical values. Both are variable fonts. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Colours the Howdy UI theme has no slot for. Each is set for light, for
   dark, and for dark when the system asks for it and nothing was chosen. */

:root {
  --link: #806313;
  --ok: #0f7a54;
  --busy: #806313;
  --outline: #24231f;
  --shadow: 0 1px 2px rgba(36, 35, 31, 0.04), 0 4px 16px rgba(36, 35, 31, 0.05);
  --shadow-raised: 0 2px 4px rgba(36, 35, 31, 0.05),
    0 12px 28px rgba(36, 35, 31, 0.1);
}

[data-theme="dark"] {
  --link: #f5d85a;
  --ok: #59cfa4;
  --busy: #f5d85a;
  --shadow: none;
  --shadow-raised: 0 12px 28px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --link: #f5d85a;
    --ok: #59cfa4;
    --busy: #f5d85a;
    --shadow: none;
    --shadow-raised: 0 12px 28px rgba(0, 0, 0, 0.35);
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--howdy-primary);
  color: var(--howdy-on-primary);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The header and footer every layout in src/thecustardfactory/layouts/ has. */

.site-header {
  border-bottom: 1px solid var(--howdy-border);
  background: var(--howdy-surface);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
}

.site-logo {
  display: block;
  border-radius: var(--howdy-radius-small);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.site-logo img {
  display: block;
  height: 3.5rem;
  width: auto;
}

.site-logo:hover {
  transform: rotate(-3deg) scale(1.05);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  color: var(--howdy-text);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.15s;
}

.site-nav-link:hover,
.site-nav-link[aria-current] {
  background: var(--howdy-muted);
}

/* The theme toggle: a round button showing the theme in use. Only the
   nav's own buttons: the notification bell's panel has buttons of its own. */

.site-nav > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: 0.5rem;
  padding: 0;
  border-radius: 999px;
}

/* The notification bell (`platform/notifier.gleam`), beside it. */

.site-nav [data-howdy-bell] {
  margin-left: 0.5rem;
}

.site-nav [data-howdy-bell-button] {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
}

.theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
  display: none;
}

[data-theme="dark"] .theme-icon-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-icon-light {
    display: none;
  }

  :root:not([data-theme]) .theme-icon-dark {
    display: block;
  }
}

.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* A live section (`components/live_section.gleam`) lays its content out
   as the page does. It is drawn in a shadow root, which rules naming
   `.site-main` do not reach, so those that it needs name it too. */
lustre-server-component {
  display: block;
}

.live-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.site-footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--howdy-border);
  color: var(--howdy-text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

/* Text. Howdy UI's classes are a single class each, so these win by also
   naming the element. */

:is(.site-main, .live-section) h1 {
  margin: 0;
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

:is(.site-main, .live-section) h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

:is(.site-main, .live-section) h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
}

/* A section title standing on the page rather than in a card. */
:is(.site-main, .live-section, .env-main) > h2 {
  margin: 1rem 0 -0.5rem;
}

:is(.site-main, .live-section) p:last-child {
  margin-bottom: 0;
}

:is(.site-main, .live-section) a:where(:not(.page-button-link, .tile)) {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s;
}

:is(.site-main, .live-section) a:where(:not(.page-button-link, .tile)):hover {
  text-decoration-color: currentColor;
}

.mono {
  font-family: var(--howdy-font-mono);
  font-size: 0.875em;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* Buttons: a little heavier and roomier than Howdy UI's, and they squish
   when pressed. */

:is(.site-main, .live-section) button,
:is(.site-main, .live-section) .page-button-link {
  padding: 0.6rem 1.15rem;
  font-weight: 600;
  transition:
    transform 0.12s,
    background-color 0.15s,
    border-color 0.15s;
}

:is(.site-main, .live-section) button:not(:disabled):active,
:is(.site-main, .live-section) .page-button-link:active {
  transform: scale(0.96);
}

.page-button-link,
.page-button-link:hover {
  text-decoration: none;
}

.page-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.page-action {
  display: inline;
  margin: 0;
}

/* Cards. */

:is(.site-main, .live-section, .env-main) > div[class^="css-"],
.account > div[class^="css-"],
.sign-in > div[class^="css-"] {
  box-shadow: var(--shadow);
}

.danger-zone {
  border-color: color-mix(in srgb, var(--howdy-danger) 45%, var(--howdy-border));
}

/* An environment's own domains (`domains/pages/domains_page`). */

.domain-list {
  display: grid;
  gap: 1rem;
}

.domain-card {
  display: grid;
  gap: 0.75rem;
}

.domain-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.domain-name {
  margin: 0;
  font-size: 1.05rem;
}

.domain-detail,
.domain-message {
  margin: 0;
}

.domain-records {
  display: grid;
  gap: 0.5rem;
}

.domain-records .mono {
  overflow-wrap: anywhere;
}

/* The top of a page: breadcrumb, title and actions (`pages.heading`). */

.page-heading {
  display: grid;
  gap: 0.6rem;
}

.page-heading nav a {
  color: var(--howdy-text-muted);
  font-weight: 500;
}

.page-heading nav a:hover {
  color: var(--howdy-text);
}

/* The title's own page comes after the last link. */
.page-heading nav li:last-child::after {
  content: "›";
}

.page-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.page-intro {
  max-width: 44rem;
  margin: -0.75rem 0 0;
  color: var(--howdy-text-muted);
  font-size: 1.05rem;
}

/* Tiles: the organizations and projects (`pages.tiles`). */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--howdy-border);
  border-radius: var(--howdy-radius-large);
  background: var(--howdy-surface);
  box-shadow: var(--shadow);
  color: var(--howdy-text);
  text-decoration: none;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.2s,
    border-color 0.2s;
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--howdy-primary-hover);
  box-shadow: var(--shadow-raised);
}

.tile:focus-visible {
  outline: 2px solid var(--howdy-focus);
  outline-offset: 2px;
}

/* A blob of custard with the logo's dark outline. */
.tile-badge,
.feature-icon,
.empty-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--outline);
  border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  background: var(--howdy-primary);
  color: var(--howdy-on-primary);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}

.tile:hover .tile-badge {
  animation: wobble 0.5s ease-in-out;
}

.tile-text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.tile-title {
  font-weight: 700;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.tile-detail {
  color: var(--howdy-text-muted);
  font-size: 0.875rem;
}

@keyframes wobble {
  30% {
    transform: rotate(-8deg) scale(1.08);
  }
  65% {
    transform: rotate(6deg) scale(1.04);
  }
}

/* What a list shows with nothing in it (`pages.empty`). */

.empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 3.5rem 1.5rem;
  border: 1.5px dashed var(--howdy-border);
  border-radius: var(--howdy-radius-large);
  text-align: center;
}

.empty-icon {
  width: 4rem;
  height: 4rem;
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
}

.empty-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

:is(.site-main, .live-section) .empty-description {
  max-width: 30rem;
  margin: 0;
  color: var(--howdy-text-muted);
}

.empty .page-buttons {
  margin-top: 1rem;
}

/* Status of an environment or service (`status_badge_component`). */

.status {
  --tone: var(--howdy-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.7rem 0.2rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  color: var(--tone);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-ok {
  --tone: var(--ok);
}

.status-busy {
  --tone: var(--busy);
}

.status-failed {
  --tone: var(--howdy-danger);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.status-busy .status-dot {
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}

/* Tables, details and forms. */

.page-table {
  width: 100%;
  border-collapse: collapse;
}

.page-table th,
.page-table td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--howdy-border);
}

.page-table th:first-child,
.page-table td:first-child {
  padding-left: 0;
}

.page-table th:last-child,
.page-table td:last-child {
  padding-right: 0;
}

.page-table th {
  padding-top: 0.5rem;
  padding-bottom: 0.6rem;
  color: var(--howdy-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.page-table tbody tr:last-child td {
  border-bottom: 0;
}

.page-table td.page-actions {
  text-align: right;
  white-space: nowrap;
}

/* A card holding only a table. */
.table-card {
  padding-top: 0.75rem;
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.page-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.9rem 2rem;
  margin: 0;
}

.page-details dt {
  color: var(--howdy-text-muted);
  font-weight: 500;
}

.page-details dd {
  margin: 0;
  min-width: 0;
}

.page-form {
  display: grid;
  gap: 1.25rem;
}

/* `display: grid` would otherwise win over the `hidden` attribute. */
.page-form[hidden],
.page-field[hidden] {
  display: none;
}

.page-form + .page-form,
.page-table + .page-form,
.account-list + .page-form {
  margin-top: 1.5rem;
}

.page-field {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.925rem;
}

.page-checkbox {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.page-error {
  margin: 0;
  color: var(--howdy-danger);
  font-size: 0.9em;
  font-weight: 500;
}

/* Environment variables (`features/variables`). */

.variable-value {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

/* A reference to what another service offers: its name, then the key. */
.variable-reference {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0.6rem 0.15rem 0.2rem;
  border: 1px solid color-mix(in srgb, var(--link) 35%, var(--howdy-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--link) 8%, transparent);
  font-family: var(--howdy-font-mono);
  font-size: 0.8rem;
  white-space: nowrap;
}

.variable-reference-service {
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--howdy-primary);
  color: var(--howdy-on-primary);
  font-weight: 600;
}

/* A value that may be a secret: hidden until its dots are clicked. */
.variable-secret summary {
  cursor: pointer;
  list-style: none;
  color: var(--howdy-text-muted);
  letter-spacing: 0.1em;
}

.variable-secret summary::-webkit-details-marker {
  display: none;
}

/* The dots while hidden, the value alone once shown. */
.variable-secret:not([open]) .variable-secret-shown,
.variable-secret[open] .variable-secret-hidden {
  display: none;
}

.variable-secret[open] summary {
  color: inherit;
  letter-spacing: normal;
}

.variable-platform td {
  color: var(--howdy-text-muted);
}

/* Deployments and logs (`features/services`). */

.log-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* A terminal, the same in either theme. Laid out in reverse, the box
   starts scrolled to its end, where the newest lines are. */
.log {
  display: flex;
  flex-direction: column-reverse;
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--outline);
  border-radius: var(--howdy-radius-medium);
  background: #1b1a17;
  color: #ece7d9;
}

.log:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.log-text {
  margin: 0;
  padding: 1rem 1.25rem;
  font-family: var(--howdy-font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-empty {
  color: var(--howdy-text-muted);
}

.alert-actions {
  margin-top: 0.75rem;
}

/* The data browser (`features/databases`). */

.sql-input {
  font-family: var(--howdy-font-mono);
  font-size: 0.85rem;
}

.data-table th,
.data-table td {
  font-family: var(--howdy-font-mono);
  font-size: 0.8rem;
  max-width: 28rem;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-null {
  color: var(--howdy-text-muted);
  font-style: italic;
}

.data-note {
  color: var(--howdy-text-muted);
  font-size: 0.875rem;
}

.data-when {
  white-space: nowrap;
}

/* The Database section's tables and the table editor
   (`databases/components/table_editor_component.gleam`): a grid of rows
   like a spreadsheet's, and beside it, once a row is open, its fields. */

.tables-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.5rem;
}

.tables-heading h2 {
  margin: 0;
}

.table-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-editor-toolbar .data-note {
  margin: 0;
}

.table-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.table-editor-open {
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
}

.data-grid-card {
  padding: 0;
  overflow: hidden;
}

.data-grid-scroll {
  max-height: 70vh;
  overflow: auto;
}

.data-grid {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--howdy-font-mono);
  font-size: 0.8rem;
}

.data-grid th,
.data-grid td {
  max-width: 22rem;
  padding: 0.5rem 0.75rem;
  border-right: 1px solid var(--howdy-border);
  border-bottom: 1px solid var(--howdy-border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-grid th:last-child,
.data-grid td:last-child {
  border-right: 0;
}

/* The column names stay in sight while the rows scroll. */
.data-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--howdy-muted);
  font-family: var(--howdy-font-body);
}

.data-grid-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--howdy-text);
  font-weight: 700;
}

.data-grid-type {
  display: block;
  margin-top: 0.1rem;
  color: var(--howdy-text-muted);
  font-family: var(--howdy-font-mono);
  font-size: 0.72rem;
  font-weight: 400;
}

.data-grid-key {
  font-size: 0.65rem;
}

.data-grid tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--howdy-muted) 40%, transparent);
}

.data-grid-clickable {
  cursor: pointer;
}

.data-grid-clickable:hover td {
  background: color-mix(in srgb, var(--link) 10%, var(--howdy-surface)) !important;
}

.data-grid-open td {
  background: color-mix(in srgb, var(--link) 18%, var(--howdy-surface)) !important;
}

.data-grid-card .data-note {
  padding: 1rem;
  margin: 0;
}

/* A row's fields, beside the grid. */
.row-editor {
  position: sticky;
  top: 1.5rem;
}

.row-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.row-editor-head h3 {
  margin: 0;
  font-family: var(--howdy-font-mono);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.row-editor-fields {
  display: grid;
  gap: 1rem;
  max-height: 55vh;
  margin: 1rem 0;
  overflow: auto;
}

.row-editor-field {
  display: grid;
  gap: 0.35rem;
}

.row-editor-field label {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-weight: 600;
}

.row-editor-field label .data-grid-type {
  display: inline;
}

.row-editor-field :is(input, textarea) {
  font-family: var(--howdy-font-mono);
  font-size: 0.85rem;
}

.row-editor-toggles {
  display: flex;
  gap: 1rem;
}

.row-editor .row-editor-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--howdy-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.row-editor-delete {
  margin-left: auto;
}

.row-editor-confirm {
  flex-basis: 100%;
  margin: 0;
  color: var(--howdy-danger);
  font-weight: 600;
}

@media (max-width: 64rem) {
  .table-editor-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .row-editor {
    position: static;
  }
}

/* The home page. */

.hero {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  padding: 1.5rem 0 2rem;
  text-align: center;
}

.hero-logo {
  width: min(26rem, 80%);
  height: auto;
  animation: settle 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(-1.5rem) scale(0.92) rotate(-3deg);
  }
}

.site-main .hero-title {
  margin-top: 0.5rem;
  font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero-lead {
  max-width: 36rem;
  margin: 0;
  color: var(--howdy-text-muted);
  font-size: 1.15rem;
}

.hero-buttons {
  justify-content: center;
  margin-top: 0.5rem;
}

.hero-log {
  margin: 2rem 0 0;
  padding: 1.1rem 1.5rem;
  border: 1px solid var(--howdy-border);
  border-radius: var(--howdy-radius-large);
  background: var(--howdy-surface);
  box-shadow: var(--shadow);
  font-family: var(--howdy-font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  text-align: left;
  max-width: 100%;
  overflow-x: auto;
}

.hero-log-muted {
  color: var(--howdy-text-muted);
}

.hero-log-done {
  color: var(--ok);
  font-weight: 500;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.feature {
  padding: 1.5rem;
  border: 1px solid var(--howdy-border);
  border-radius: var(--howdy-radius-large);
  background: var(--howdy-surface);
  box-shadow: var(--shadow);
}

.feature-icon {
  margin-bottom: 1rem;
}

.feature:nth-child(2) .feature-icon {
  border-radius: 56% 44% 45% 55% / 46% 56% 44% 54%;
}

.feature:nth-child(3) .feature-icon {
  border-radius: 44% 56% 52% 48% / 58% 46% 54% 42%;
}

.site-main .feature-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.feature-body {
  margin: 0;
  color: var(--howdy-text-muted);
}

/* The sign-in and registration pages, and an invitation. */

.sign-in,
.invitation {
  width: 100%;
  max-width: 27rem;
  margin: 1rem auto 0;
}

.sign-in {
  display: grid;
  gap: 1rem;
}

.sign-in > h1,
.sign-in > p {
  margin: 0;
  text-align: center;
}

.sign-in h2 {
  margin-top: 1rem;
}

.sign-in button {
  width: 100%;
  justify-content: center;
}

.sign-in-status {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--howdy-radius-medium);
  background: var(--howdy-muted);
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--howdy-text-muted);
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--howdy-border);
}

/* "Continue with GitHub", with its mark. */
.provider-button {
  gap: 0.6rem;
  font-weight: 600;
}

.provider-logo {
  flex: none;
}

/* The code step: whom the code went to, with a way back. */
.sign-in-sent {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin: 0;
  color: var(--howdy-text-muted);
  font-size: 0.9375rem;
}

/* Buttons that read as links: Change, Send a new code. */
.sign-in button.sign-in-link-button {
  width: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--howdy-text);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.sign-in button.sign-in-link-button:hover {
  color: var(--howdy-focus);
}

/* The six boxes sit in the middle of the card. */
#code-field > span {
  align-self: center;
  margin-top: 0.35rem;
}

.invitation {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 2.5rem 2rem;
  text-align: center;
}

.invitation > * {
  margin: 0;
}

/* The account page. Its lists are filled in by Howdy Auth's script, which
   makes plain items and buttons, so they are styled here. */

.account {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 42rem;
}

.account-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.account-list:empty {
  display: none;
}

.account-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--howdy-border);
}

.site-main .account-list button,
.account-list input {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--howdy-radius-medium);
  border: 1px solid var(--howdy-border);
  background: var(--howdy-surface);
  color: var(--howdy-text);
}

.account-list button {
  cursor: pointer;
}

.account-list button:hover {
  border-color: var(--howdy-primary-hover);
}

.account-list button:disabled {
  opacity: 0.5;
  cursor: default;
}

.account-status {
  position: sticky;
  bottom: 1rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--howdy-radius-medium);
  background: var(--howdy-muted);
  border: 1px solid var(--howdy-border);
  box-shadow: var(--shadow-raised);
}

.account-status:empty {
  display: none;
}

/* Small screens. */

@media (max-width: 36rem) {
  .site-header-inner {
    padding: 0.6rem 1rem;
  }

  .site-logo img {
    height: 2.75rem;
  }

  .site-nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.875rem;
  }

  .site-main {
    padding: 2rem 1rem 3.5rem;
  }

  .page-details {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .page-details dd {
    margin-bottom: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* A button under an alert's message, such as Retry. */
[role="alert"] .page-action {
  display: block;
  margin-top: 0.75rem;
}

/* Billing: the plans to choose from, the usage bar and invoice lines. */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.plan {
  padding: 1rem;
  border: 1px solid var(--howdy-border, rgba(127, 127, 127, 0.3));
  border-radius: var(--howdy-radius-medium, 0.5rem);
}

.plan p {
  margin: 0 0 0.5rem;
}

.plan-current {
  border-color: var(--howdy-primary, currentColor);
  box-shadow: 0 0 0 1px var(--howdy-primary, currentColor);
}

.plan-name {
  font-weight: 600;
}

.plan-price {
  font-size: 1.5rem;
  font-weight: 600;
}

.usage-bar {
  height: 0.5rem;
  margin: 0.5rem 0 1rem;
  border-radius: 999px;
  background: var(--howdy-muted, rgba(127, 127, 127, 0.2));
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: var(--howdy-primary, currentColor);
}

.billing-lines .numeric,
.billing-lines th.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.billing-lines tfoot th {
  border-top: 2px solid var(--howdy-border, rgba(127, 127, 127, 0.4));
}

/* Telemetry (`features/telemetry`). */

/* An environment's pages: its menu down the left
   (`environments/components/environment_menu.gleam`), the page beside it.
   They take a wider page, header included, to make room. */
body:has(.env-shell) :is(.site-main, .site-header-inner) {
  max-width: 78rem;
}

.env-shell {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.env-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.env-menu {
  position: sticky;
  top: 1.5rem;
}

.env-menu ul {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.env-menu .env-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-radius: var(--howdy-radius-small);
  color: var(--howdy-text-muted);
  font-weight: 500;
  text-decoration: none;
  transition:
    background-color 0.15s,
    color 0.15s;
}

.env-menu .env-menu-link:hover {
  background: var(--howdy-muted);
  color: var(--howdy-text);
}

.env-menu .env-menu-link[aria-current="page"] {
  background: var(--howdy-muted);
  box-shadow: inset 2px 0 0 var(--link);
  color: var(--howdy-text);
  font-weight: 600;
}

/* A group, such as Auth: a chevron that turns as it opens. */
.env-menu-group::after {
  content: "›";
  font-size: 1.1em;
  line-height: 1;
  transition: transform 0.15s;
}

.env-menu-group.open {
  color: var(--howdy-text);
}

.env-menu-group.open::after {
  transform: rotate(90deg);
}

.env-menu .env-menu-children {
  margin: 0.125rem 0 0.375rem 0.75rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--howdy-border);
}

@media (max-width: 48rem) {
  .env-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .env-menu {
    position: static;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--howdy-border);
  }

  .env-menu > ul {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .env-menu .env-menu-children {
    flex-direction: row;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .env-menu li:has(> .env-menu-children) {
    flex-basis: 100%;
  }
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.billing-lines tfoot th {
  border-top: 2px solid var(--howdy-border, rgba(127, 127, 127, 0.4));
}

/* Telemetry (`features/telemetry`). */

.telemetry-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--howdy-border);
}

.telemetry-tab {
  padding: 0.5rem 0.85rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--howdy-text-muted);
  text-decoration: none;
  font-weight: 500;
}

.telemetry-tab:hover {
  color: var(--howdy-text);
}

.telemetry-tab[aria-current="page"] {
  color: var(--howdy-text);
  border-bottom-color: var(--link);
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Logs: a terminal, newest line at the top. */
.telemetry-log {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--outline);
  border-radius: var(--howdy-radius-medium);
  background: #1b1a17;
  color: #ece7d9;
}

.telemetry-log:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.telemetry-log-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--howdy-font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

.telemetry-log-table td {
  padding: 0.15rem 0.75rem;
  vertical-align: top;
}

.log-when {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.telemetry-log .log-when,
.telemetry-log .log-service {
  color: #a8a291;
  white-space: nowrap;
}

.log-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: 100%;
}

.log-error .log-body {
  color: #ff9b8f;
}

.log-warning .log-body {
  color: #f5d85a;
}

.log-trace {
  margin-left: 0.75rem;
  color: #f5d85a;
}

/* A trace: a row a span, its bar placed in time on a lane. */
.trace {
  display: grid;
  gap: 0.15rem;
}

.trace-row {
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) 3fr 5rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3rem 0;
  cursor: pointer;
  list-style: none;
}

.trace-row::-webkit-details-marker {
  display: none;
}

.trace-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
}

.trace-service {
  color: var(--howdy-text-muted);
}

.trace-lane {
  position: relative;
  height: 0.75rem;
  border-radius: 4px;
  background: var(--howdy-muted);
}

.trace-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  background: var(--series-1);
}

.trace-bar-failed {
  background: var(--series-8);
}

.trace-took {
  font-size: 0.8rem;
  color: var(--howdy-text-muted);
}

.trace-attributes {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.8rem;
}

/* Charts. Series colours are the validated reference palette, in a fixed
   order, stepped for each theme (see features/telemetry/components). */
:root {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #4a3aa7;
  --series-8: #e34948;
}

[data-theme="dark"] {
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
  }
}

.charts {
  display: grid;
  gap: 1.25rem;
}

.chart {
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--howdy-border);
  border-radius: var(--howdy-radius-large);
  background: var(--howdy-surface);
}

.chart-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--howdy-text-muted);
}

.chart-legend li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chart-key {
  width: 0.75rem;
  height: 2px;
  border-radius: 1px;
}

.chart-plot {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--howdy-border);
  stroke-width: 1;
}

.chart-axis,
.chart-end-label {
  fill: var(--howdy-text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-end-label {
  fill: var(--howdy-text);
}

.chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-end {
  stroke: var(--howdy-surface);
  stroke-width: 2;
}

.chart-hit {
  fill: transparent;
}

.chart-point:hover .chart-hit {
  fill: var(--howdy-text-muted);
  fill-opacity: 0.15;
}

.chart-table {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.chart-table summary {
  cursor: pointer;
  color: var(--howdy-text-muted);
}

/* Visits (`telemetry/pages/visits_page`): a tile for each total. */

.visit-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
}

.visit-stat {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--howdy-border);
  border-radius: var(--howdy-radius-large);
  background: var(--howdy-surface);
}

.visit-stat-label {
  color: var(--howdy-text-muted);
  font-size: 0.85rem;
}

.visit-stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
}

.visit-pages-title {
  caption-side: top;
  padding: 0.75rem 1rem 0.25rem;
  text-align: left;
  font-weight: 600;
}

/* Issues (`features/issues`): the list and one issue's stack. */

.issue-cell a {
  font-weight: 500;
}

.issue-marks {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.issue-culprit {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--howdy-text-muted);
}

.issue-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.issue-section {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.issue-frames {
  margin: 0;
  padding-left: 1.75rem;
  display: grid;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--howdy-text-muted);
}

.issue-frame-app {
  color: var(--howdy-text);
  font-weight: 600;
}

.issue-frame-file {
  overflow-wrap: anywhere;
}

.issue-raw,
.issue-attributes {
  margin-top: 0.75rem;
}

.issue-raw summary,
.issue-attributes summary {
  cursor: pointer;
  color: var(--howdy-text-muted);
}

.issue-raw .log-text {
  margin-top: 0.5rem;
  max-height: 24rem;
  overflow: auto;
  border-radius: var(--howdy-radius-medium);
  background: var(--howdy-muted);
}

.issue-attributes .page-details {
  margin-top: 0.75rem;
}

/* The back office (`features/admin`, `layouts/admin_layout.gleam`): a
   sidebar beside the page (Howdy UI's `sidebar`), opened from a bar across
   the top on a narrow screen, both marked so staff always know where they
   are. */

.admin-shell > main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-shell .site-main {
  max-width: 72rem;
}

.admin-sidebar,
.admin-top-bar {
  border-top: 4px solid var(--howdy-primary);
}

.admin-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-sidebar-footer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
}

.admin-top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--howdy-border);
  background: var(--howdy-surface);
}

@media (min-width: 48rem) {
  .admin-top-bar {
    display: none;
  }
}

.admin-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--howdy-text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.admin-badge {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--howdy-primary);
  color: var(--howdy-primary-foreground);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-leave {
  color: var(--howdy-text-muted);
  font-weight: 500;
  text-decoration: none;
}

.admin-leave:hover {
  color: var(--howdy-text);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat {
  display: grid;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--howdy-border);
  border-radius: var(--howdy-radius);
  background: var(--howdy-surface);
  color: var(--howdy-text);
  text-decoration: none;
}

.admin-stat:hover {
  border-color: var(--howdy-primary);
}

.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.admin-stat-label {
  color: var(--howdy-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* A bucket's quota on the back office's Storage page, in GB. */
.quota-input {
  width: 6rem;
  padding: 0.25rem 0.5rem;
  font: inherit;
}

.admin-muted {
  margin: 0;
  color: var(--howdy-text-muted);
  font-size: 0.85rem;
}

.admin-inline-badge {
  margin-left: 0.5rem;
}

.admin-search {
  display: flex;
  gap: 0.5rem;
  max-width: 30rem;
  margin-bottom: 1.5rem;
}

.admin-search input {
  flex: 1;
}

/* Staff acting as a customer (`platform/impersonation.gleam`). */

.acting-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.6rem 1.5rem;
  background: var(--howdy-danger);
  color: var(--howdy-danger-foreground, #fff);
  font-weight: 600;
  font-size: 0.9rem;
}

.acting-banner form {
  margin: 0;
}

.acting-banner button {
  padding: 0.35rem 0.9rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* An environment's email (`email/pages`): messages the sign-in service
   would have sent, outside live, and the SMTP form in live. */
.outbox-message {
  margin-bottom: 1rem;
}

.outbox-message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.outbox-message-meta {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9rem;
}

.outbox-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  margin: 0 0 0.75rem;
}

.smtp-starts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.smtp-starts a[aria-current="true"] {
  font-weight: 700;
  text-decoration: none;
}

.invitation-link {
  overflow-wrap: anywhere;
}

/* What a project's environments get (`projects/pages/project_form.gleam`). */
.capability-fields {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.capability-fields legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.capability-fields .page-checkbox {
  align-items: baseline;
}

/* Choosing a GitHub repository (`github/components/repository_picker.gleam`). */
.repository-picker {
  display: grid;
  gap: 0.4rem;
  font-weight: 400;
  font-size: 0.9rem;
}

.repository-picker-status,
.repository-picker-empty {
  margin: 0;
  color: var(--howdy-text-muted);
}

/* No padding above the groups: a sticky owner heading sits at the very
   top of the scroll box, so nothing scrolls past above it. */
.repository-picker-list {
  max-height: 18rem;
  overflow-y: auto;
  border: 1px solid var(--howdy-border);
  border-radius: var(--howdy-radius-medium);
  padding: 0 0 0.25rem;
  display: grid;
  align-content: start;
  background: var(--howdy-surface);
}

.repository-picker-empty {
  padding: 0.5rem;
}

.repository-picker-owner {
  display: grid;
  gap: 0.1rem;
  padding: 0 0.25rem 0.25rem;
}

.repository-picker-owner-name {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 -0.25rem 0.1rem;
  padding: 0.45rem 0.75rem 0.35rem;
  background: var(--howdy-surface);
  color: var(--howdy-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.repository-picker-option {
  display: flex;
  width: 100%;
  align-items: center;
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  border: 0;
  border-radius: var(--howdy-radius-small);
  background: none;
  color: var(--howdy-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.repository-picker-option:hover,
.repository-picker-option:focus-visible {
  background: var(--howdy-muted);
}

.repository-picker-option[aria-pressed="true"] {
  background: var(--howdy-primary);
  color: var(--howdy-on-primary);
}

.repository-picker-option[aria-pressed="true"]::after {
  content: "✓";
  margin-left: auto;
}

/* The back office's usage by app: each app's totals head its services. */
.page-table tr.usage-group th {
  background: var(--howdy-muted);
  font-weight: 600;
}

/* Notifications (`features/notifications`): the inbox, newest first, with
   unread ones marked by a dot and a bolder title. */

.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notification {
  display: grid;
  grid-template-columns: 0.75rem 1fr auto;
  gap: 0.25rem 0.75rem;
  align-items: start;
  padding: 1rem 1.25rem;
}

.notification + .notification {
  border-top: 1px solid var(--howdy-border);
}

.notification-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.45rem;
  border-radius: 999px;
  border: 1.5px solid var(--howdy-border);
}

.notification[data-unread] .notification-dot {
  border-color: var(--link);
  background: var(--link);
}

.notification-text {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.notification-title {
  color: var(--howdy-text);
  text-decoration: none;
}

a.notification-title:hover {
  text-decoration: underline;
}

.notification[data-unread] .notification-title {
  font-weight: 600;
}

.notification-body {
  color: var(--howdy-text-muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.notification-when {
  color: var(--howdy-text-muted);
  font-size: 0.8rem;
}

.notification-actions {
  display: flex;
  gap: 0.25rem;
}

.notification-actions form {
  margin: 0;
}

.notification-more {
  display: flex;
  justify-content: center;
}
