/* Contacts Mattyr — Organizations Mattyr's sheet with a purple accent in place of the green
   (projects/orgs-mattyr/orgs-mattyr/app/assets/stylesheets/application.css). Keep the two alike: only
   --accent and --accent-text differ (purple is far from the status colours, so --warn is Organizations
   Mattyr's own again), and what Contacts Mattyr adds for itself is at the end. */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1d1f24;
  --muted: #5b6070;
  --line: #dedbd2;
  --accent: #6b2fa0;
  --accent-text: #ffffff;
  --ok: #1f6b3a;
  --warn: #8a5300;
  --bad: #9b1c1c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --surface: #1d2026;
    --text: #e9e7e1;
    --muted: #a3a7b3;
    --line: #333740;
    --accent: #c3a6f2;
    --accent-text: #1a1026;
    --ok: #7ed39b;
    --warn: #f0b45c;
    --bad: #f28b8b;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", "Noto Sans Hebrew", sans-serif;
}
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface);
}
.masthead nav { display: flex; align-items: center; gap: 1rem; }
.brand { font-weight: 650; color: var(--text); text-decoration: none; letter-spacing: 0.01em; }
main { max-width: 46rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 0.5rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }
.lede { color: var(--muted); margin: 0 0 1.5rem; }
a { color: var(--accent); }
.flash { padding: 0.7rem 0.9rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
.flash-alert { border-color: var(--bad); color: var(--bad); }
.button, button, input[type=submit] {
  font: inherit; cursor: pointer; border-radius: 6px; padding: 0.55rem 1rem;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
}
.button.secondary, button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
form.button_to { display: inline; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.muted { color: var(--muted); }
.badge { display: inline-block; font-size: 0.8rem; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.bad { color: var(--bad); border-color: var(--bad); }
label { display: block; font-weight: 600; margin: 1rem 0 0.3rem; }
input[type=text], input[type=search], select, textarea {
  font: inherit; width: 100%; padding: 0.5rem 0.6rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
table { width: 100%; border-collapse: collapse; }
.table-scroll { overflow-x: auto; }
th, td { text-align: start; padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
fieldset.roles { border: 0; padding: 0; margin: 1rem 0 0; }
fieldset.roles legend { font-weight: 600; margin-bottom: 0.3rem; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin: 0.3rem 0; }
form.inline { margin: 0.5rem 0; }

/* Access pages: roles, sites and members, as in Organizations Mattyr. */
[hidden] { display: none !important; } /* the picker hides choices that don't match; label.check sets display */
form.search { margin: 1rem 0; }
form.search input[type=search] { width: 100%; max-width: 28rem; }
fieldset.picker { border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.75rem; margin: 1rem 0 0; }
fieldset.picker legend { font-weight: 600; padding: 0 0.25rem; }
fieldset.picker input[type=search] { width: 100%; margin: 0.25rem 0 0.5rem; }
.picker-list { max-height: 16rem; overflow-y: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; min-height: 0.5rem; }
.badge.chip { color: var(--text); }
details > summary { cursor: pointer; }

/* Contacts Mattyr's own, below what it shares with Organizations Mattyr: a form taken a part at a time,
   and a code or identifier set in a fixed-width face. */
section.step > h2 { outline: none; }
input[type=email], input[type=tel], input[type=url] {
  font: inherit; width: 100%; padding: 0.5rem 0.6rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
input.code { max-width: 12rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.15em; }
.card .value { font-weight: 650; overflow-wrap: anywhere; }
.card .row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
h2.kind { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
h2.kind a { font-size: 0.95rem; font-weight: 400; }
pre.copy { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.75rem; overflow-x: auto; margin: 0.4rem 0; direction: ltr; text-align: left; }
details.way { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.9rem; margin: 0.6rem 0; background: var(--surface); }
details.way > summary { font-weight: 600; }
pre.label { font: inherit; margin: 0 0 0.75rem; white-space: pre-wrap; unicode-bidi: plaintext; }
.steps-nav ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; padding: 0; margin: 0 0 0.25rem; counter-reset: step; }
.steps-nav li { counter-increment: step; }
.steps-nav button.link { text-decoration: none; color: var(--muted); }
.steps-nav button.link::before { content: counter(step) ". "; }
.steps-nav button.link[aria-current=step] { color: var(--text); font-weight: 650; border-bottom: 2px solid var(--accent); }
.steps-nav p { margin: 0; font-size: 0.9rem; }
form[data-controller=steps] section.step > h2 { margin-top: 1.25rem; }
.identifier { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; letter-spacing: 0.03em; color: var(--muted); white-space: nowrap; }
strong > .identifier:only-child, h1 > .identifier:only-child { color: var(--text); }
/* Being asked what a site may be given: a kind, its switch, and the verified ones to select from. */
fieldset.ask { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0.6rem 1rem 0.9rem; margin: 1rem 0 0; }
fieldset.ask legend { font-weight: 650; padding: 0 0.3rem; }
fieldset.ask label { display: flex; align-items: center; gap: 0.65rem; font-weight: 400; margin: 0.55rem 0 0; }
fieldset.ask label.agree { font-weight: 600; margin-bottom: 0.7rem; }
fieldset.ask label.option { overflow-wrap: anywhere; }
fieldset.ask input[type=radio] { flex: none; accent-color: var(--accent); width: 1.1rem; height: 1.1rem; margin: 0; }
input.switch {
  appearance: none; flex: none; position: relative; cursor: pointer; margin: 0;
  width: 2.5rem; height: 1.4rem; border-radius: 999px; border: 1px solid var(--muted); background: var(--bg);
}
input.switch::before {
  content: ""; position: absolute; inset-block-start: 2px; inset-inline-start: 2px;
  width: calc(1.4rem - 6px); height: calc(1.4rem - 6px); border-radius: 50%; background: var(--muted);
  transition: inset-inline-start 0.15s;
}
input.switch:checked { background: var(--accent); border-color: var(--accent); }
input.switch:checked::before { inset-inline-start: calc(1.1rem + 2px); background: var(--accent-text); }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { input.switch::before { transition: none; } }
