/* The sync page's only stylesheet. System fonts, no images, nothing from another host. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1b1d21;
  --muted: #5a606b;
  --card: #f4f5f7;
  --border: #d4d7dd;
  --accent: #2456c9;
  --accent-fg: #ffffff;
  --danger: #b3261e;
  --danger-fg: #ffffff;
  --focus: #2456c9;
  --notice: #fff4d6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --fg: #e7e9ee;
    --muted: #a3a9b5;
    --card: #1d1f24;
    --border: #3a3e47;
    --accent: #8fb0ff;
    --accent-fg: #0c1430;
    --danger: #ff8a80;
    --danger-fg: #2b0705;
    --focus: #8fb0ff;
    --notice: #3a3014;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.masthead,
main,
#messages {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 16px;
}

.brand {
  font-weight: 700;
  margin: 16px 0 0;
}

h2 {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.75rem;
}

h3 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem;
  overflow-wrap: anywhere;
}

p {
  margin: 0 0 0.75rem;
}

h2:focus {
  outline: none;
}

h2:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.cards,
.addresses {
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 12px;
}

.addresses li,
code {
  overflow-wrap: anywhere;
}

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

.label {
  margin: 0;
  font-size: 0.9rem;
}

.actions,
.row,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.toolbar {
  justify-content: space-between;
  margin-top: 16px;
}

.badge {
  display: inline-block;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
}

.owed {
  padding-left: 1.25rem;
}

.owed li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.notice {
  background: var(--notice);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0;
  flex: 1 1 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

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

dialog button.danger {
  background: var(--danger);
  color: var(--danger-fg);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.inline {
  margin-top: 8px;
}

.inline label {
  display: block;
}

input[type="text"],
select,
textarea {
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  min-width: 0;
  max-width: 100%;
}

input[type="text"] {
  flex: 1 1 10rem;
}

textarea.secret {
  display: block;
  width: 100%;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  resize: vertical;
}

dialog {
  max-width: min(32rem, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  padding: 16px 20px;
}

dialog::backdrop {
  background: rgb(0 0 0 / 50%);
}

dialog h2 {
  margin-top: 0;
}

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.check input {
  margin-top: 0.3rem;
  width: 1.2rem;
  height: 1.2rem;
}

#messages p:empty {
  display: none;
}

#status {
  margin-top: 16px;
}

#alert {
  margin-top: 16px;
  color: var(--danger);
  font-weight: 600;
}

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

@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background-color 120ms ease;
  }
}
