
* {
  box-sizing: border-box;
}

:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #171717;
  background: #f6f7f9;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f6f7f9;
}

body {
  padding-bottom: 86px;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid #e7e7e7;
  padding: 16px;
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: #6d6d6d;
}

main {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.stack {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns:
    repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 18px;
  padding: 16px;
  box-shadow:
    0 8px 30px rgba(0,0,0,.04);
}

.card h2,
.card h3 {
  margin: 0 0 8px;
}

.card p {
  margin: 6px 0;
}

.muted {
  color: #6c6c6c;
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  background: #f0f0f0;
}

button,
.button,
a.button {
  appearance: none;
  border: 0;
  border-radius: 13px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: #111;
  color: #fff;
}

button.secondary,
.button.secondary {
  background: #ececec;
  color: #111;
}

button.danger,
.button.danger {
  background: #951b1b;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  background: #fff;
  color: #111;
  padding: 12px;
  font: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 11px;
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.empty {
  text-align: center;
  padding: 28px 16px;
  color: #777;
}

.error {
  border-color: #e9a5a5;
  background: #fff6f6;
}

.success {
  border-color: #a7d8b5;
  background: #f4fff7;
}

nav {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  background: #fff;
  border-top: 1px solid #ddd;
  padding:
    7px
    max(7px, env(safe-area-inset-right))
    max(7px, env(safe-area-inset-bottom))
    max(7px, env(safe-area-inset-left));
}

nav button {
  background: transparent;
  color: #555;
  padding: 10px 4px;
  font-size: 12px;
}

nav button.active {
  background: #111;
  color: #fff;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

@media (min-width: 760px) {
  main {
    padding: 24px;
  }

  nav {
    left: 50%;
    right: auto;
    width: min(720px, calc(100% - 32px));
    transform: translateX(-50%);
    border: 1px solid #ddd;
    border-radius: 18px 18px 0 0;
  }
}
