/* Forms, buttons and messages. */
label {
  display: block;
  margin: 1rem 0 0.25rem;
  font-weight: 600;
}

input:not([type="checkbox"]):not([type="hidden"]),
select {
  display: block;
  width: 100%;
  max-width: 28rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-line);
  border-radius: 0.4rem;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 400;
}

.check input {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--accent);
}

fieldset {
  margin: 1.5rem 0 0;
  padding: 0.25rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

legend { font-weight: 700; }

button, .button {
  display: inline-block;
  min-height: 2.75rem;
  margin: 1rem 0.5rem 0 0;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 0.4rem;
  text-decoration: none;
  cursor: pointer;
}

button.primary, .button.primary {
  color: var(--accent-ink);
  background: var(--accent);
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

details {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

summary {
  padding: 0.75rem 0;
  font-weight: 600;
  cursor: pointer;
}

.alert {
  padding: 0.7rem 1rem;
  border: 1px solid var(--danger);
  border-left-width: 0.3rem;
  border-radius: 0.4rem;
  background: var(--surface);
  color: var(--danger);
  font-weight: 600;
}

/* An empty live region stays in the page, so that text put into it is announced, but takes no room. */
.alert:empty {
  margin: 0;
  padding: 0;
  border: 0;
}

.alert.ok {
  border-color: var(--accent);
  color: var(--ink);
}

.tag {
  display: inline-block;
  margin: 0 0.4rem;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 1rem;
  background: var(--accent-soft);
  color: var(--ink);
}

/* Passphrases and codes: large, spaced and selectable in one go. */
.secret {
  display: block;
  padding: 0.8rem 1rem;
  font: 600 1.15rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface);
  border: 1px dashed var(--field-line);
  border-radius: 0.5rem;
  user-select: all;
}

.fingerprint-words {
    display: block;
    margin-top: 0.5rem;
    font-family: ui-monospace, monospace;
}

/* A QR code stays black on white in both themes: scanners expect it. */
.qr {
    display: block;
    width: min(100%, 18rem);
    height: auto;
    margin: 1rem 0;
}

.choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Wide tables scroll inside their own box, so the page never does. */
.scroll {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    font-size: 0.875rem;
    overflow-wrap: normal;
    font-variant-numeric: tabular-nums;
}

th, td {
    padding: 0.4rem 0.75rem 0.4rem 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

/* Dates and values stay whole; headings wrap at spaces and only stored content wraps anywhere. */
td {
    white-space: nowrap;
}

td code {
    display: block;
    min-width: 12rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.chart {
    margin: 1rem 0;
}

.chart svg {
    display: block;
    width: 100%;
    height: auto;
    background: var(--surface);
}

.chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
}

.chart-points {
    fill: none;
    stroke: var(--accent);
    stroke-width: 6;
    stroke-linecap: round;
}
