/* Grassroots ID (test): mobile first, readable at 360px, no external resources. */
:root {
  --ink: #1d231f;
  --muted: #55605a;
  --paper: #f6f4ee;
  --card: #ffffff;
  --green: #1f5130;
  --warn-bg: #fff4d6;
  --warn-ink: #5a4300;
  --error: #9b1c1c;
  --line: #d9d5ca;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

#app {
  max-width: 34rem;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
}

h1 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
}

h2 {
  font-size: 1.15rem;
  margin: 1.25rem 0 0.5rem;
}

h3 {
  font-size: 1rem;
  margin: 0.75rem 0 0.25rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  vertical-align: middle;
}

/* A real account's mark: never the yellow of a test account. */
.badge.real {
  background: var(--green);
  color: #ffffff;
}

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

.notice.warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

.message:empty {
  display: none;
}

.message {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
}

.message.error {
  color: var(--error);
  border-color: var(--error);
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.ok {
  color: var(--green);
  font-weight: 600;
}

.card,
.approval:not(:empty),
.pairing:not(:empty),
.session:not(:empty),
.connect {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.25rem 1rem 1rem;
  margin: 1rem 0;
}

.approval:not(:empty) {
  border: 2px solid var(--green);
  scroll-margin-top: 0.5rem;
}

.approval h2:focus {
  outline: none;
}

.question {
  font-weight: 600;
}

blockquote {
  margin: 0.25rem 0;
  padding: 0.5rem 0.75rem;
  background: var(--paper);
  border-left: 4px solid var(--line);
  white-space: pre-wrap;
  max-height: 12rem;
  overflow: auto;
}

.code {
  font: 1.15rem/1.9 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.08em;
  background: var(--card);
  border: 1px dashed var(--green);
  border-radius: 0.5rem;
  padding: 0.75rem;
  user-select: all;
}

.address {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--card);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  word-break: break-all;
  user-select: all;
}

.code span {
  display: inline-block;
  margin-right: 0.6em;
}

label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
}

.check label {
  display: inline;
  font-weight: 400;
  margin-left: 0.4rem;
}

input[type="text"],
textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--card);
}

input[type="text"] {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.actions.end {
  margin-top: 2rem;
}

.button {
  font: inherit;
  font-weight: 600;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-radius: 0.6rem;
  border: 1px solid var(--green);
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  color: #fff;
}

.button.secondary {
  background: var(--card);
  color: var(--green);
}

.button.danger {
  background: var(--card);
  color: var(--error);
  border-color: var(--error);
}

.button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #e0a800;
  outline-offset: 2px;
}

.requests ul {
  padding-left: 1.2rem;
}

.state-expired,
.state-denied,
.state-refused,
.state-unreadable,
.state-too-large,
.state-failed {
  color: var(--muted);
}

.account-id {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
