body.shell {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
}

.login,
.list {
  max-width: 640px;
  margin: 0 auto;
  padding-block: 32px;
}

.shell h1 {
  font-size: 1.5rem;
  color: var(--strong);
  margin: 0 0 24px;
}

.shell h2 {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 8px;
}

.login form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login label {
  color: var(--soft);
  font-size: 0.9rem;
}

.login input[type="password"] {
  min-height: 44px;
  padding: 0 12px;
  font-size: 1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
}

.login input[type="password"]:focus {
  outline: 3px solid var(--focus);
}

.login button {
  min-height: 44px;
  font-size: 1rem;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
}

.error {
  min-height: 1.2em;
  margin: 0;
  color: var(--accent-ink);
  font-size: 0.9rem;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.rows li {
  border-bottom: 1px solid var(--rule);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 12px 0;
  color: inherit;
  text-decoration: none;
}

.row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.row-title {
  color: var(--strong);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.row-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.pill {
  flex: none;
  min-width: 1.6em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

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

#chrome {
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg);
}

#header {
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

#back {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
}

#heading {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--strong);
  font-weight: 600;
}

#header button {
  min-height: 44px;
  padding: 0 14px;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
}

#header #pill {
  background: var(--accent-tint);
  border-color: transparent;
  color: var(--accent-ink);
  font-weight: 600;
}

#remove-confirm {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font-size: 0.85rem;
}

#remove-confirm[hidden] {
  display: none;
}

#remove-yes {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

#chrome #banner {
  position: static;
}

#bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--bg);
  border-top: 1px solid var(--rule);
  -webkit-user-select: none;
  user-select: none;
}

#bar-button {
  display: block;
  width: 100%;
  min-height: 44px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
}

@media (pointer: coarse) {
  #doc {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }
}
