/* ==========================================================================
   Auraline
   --------------------------------------------------------------------------
   A note on motion: photosensitive epilepsy is triggered by flashing, strobing
   and high-contrast oscillating patterns. This stylesheet contains no keyframe
   animation, no flashing, and no transition faster than 150ms. Nothing on this
   site should ever flicker. Please keep it that way.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
  --paper:        #faf8f5;
  --paper-raised: #ffffff;
  --paper-sunken: #f2eee9;
  --ink:          #1c1922;
  --ink-soft:     #57515f;
  --ink-faint:    #8b8494;
  --rule:         #e4ddd4;
  --rule-strong:  #d2c9bd;

  --violet:       #5c4b8a;
  --violet-deep:  #453766;
  --violet-tint:  #efebf7;
  --violet-edge:  #d9d0ec;

  --amber:        #8a6a25;
  --amber-tint:   #fbf3e2;
  --rose:         #8f3f4d;
  --rose-tint:    #fbeef0;
  --moss:         #3f6b4f;
  --moss-tint:    #eaf4ed;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 34rem;
  --page: 68rem;
  --radius: 10px;

  --shadow: 0 1px 2px rgba(28, 25, 34, 0.04), 0 8px 24px -12px rgba(28, 25, 34, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #15131a;
    --paper-raised: #1d1a24;
    --paper-sunken: #221e2b;
    --ink:          #ece8f2;
    --ink-soft:     #b3abc0;
    --ink-faint:    #857e93;
    --rule:         #2e2939;
    --rule-strong:  #3d3750;

    --violet:       #b9a8e6;
    --violet-deep:  #cfc2f2;
    --violet-tint:  #241f33;
    --violet-edge:  #3a3252;

    --amber:        #e0bd77;
    --amber-tint:   #2a2318;
    --rose:         #e79aa6;
    --rose-tint:    #2c1c20;
    --moss:         #96c9a8;
    --moss-tint:    #1a2620;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.7);
  }
}

/* --- Base --------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 5.2vw, 3.35rem); }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-family: var(--sans); font-weight: 600; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--violet);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--violet-deep); }

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

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

.lede {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); font-size: 0.9rem; }
.serif { font-family: var(--serif); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--violet);
  color: #fff;
  padding: 0.7rem 1.1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* --- Layout ------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.wrap--narrow { max-width: 46rem; }

.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section--tight { padding-block: clamp(2rem, 5vw, 3rem); }
.section--sunken { background: var(--paper-sunken); }

.stack > * + * { margin-top: 1.15rem; }
.stack-lg > * + * { margin-top: 2.5rem; }

.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 1.75rem; }
.mt-lg { margin-top: 2.5rem; }

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand__mark { color: var(--violet); flex: none; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.94rem;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
}
.nav a:hover { color: var(--ink); background: var(--paper-sunken); }
.nav a[aria-current="page"] { color: var(--violet); font-weight: 600; }

.nav__divider {
  width: 1px;
  height: 1.4rem;
  background: var(--rule-strong);
  margin-inline: 0.4rem;
}

.avatar {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  object-fit: cover;
  flex: none;
}

.linkbutton {
  background: none;
  border: 0;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 7px;
}
.linkbutton:hover { color: var(--ink); background: var(--paper-sunken); }

/* --- Language picker ----------------------------------------------------- */
/* A native <details> element, so it opens and closes without any script and
   stays inside the strict CSP. No animation -- it simply appears. */

.langpicker { position: relative; }

.langpicker > summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  list-style: none;
  user-select: none;
}

/* Suppress the default disclosure triangle in every engine. */
.langpicker > summary::-webkit-details-marker { display: none; }
.langpicker > summary::marker { content: ""; }

.langpicker > summary:hover { color: var(--ink); background: var(--paper-sunken); }

.langpicker[open] > summary {
  color: var(--ink);
  border-color: var(--violet);
  background: var(--paper-sunken);
}

.langpicker__code { letter-spacing: 0.04em; }

.langpicker__chevron { color: var(--ink-faint); flex: none; }
.langpicker[open] .langpicker__chevron { transform: rotate(180deg); }

.langpicker__menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 50;
  min-width: 11rem;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.langpicker__menu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 7px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}

.langpicker__menu a:hover { background: var(--paper-sunken); }

.langpicker__menu a[aria-current="true"] {
  color: var(--violet);
  font-weight: 600;
  background: var(--violet-tint);
}

/* Flags carry meaning here, so they keep a hairline edge against pale
   backgrounds -- the white band of either flag would otherwise bleed out. */
.flag {
  flex: none;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(28, 25, 34, 0.18);
}

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

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn--primary {
  background: var(--violet);
  color: #fff;
  border-color: var(--violet);
}
.btn--primary:hover { background: var(--violet-deep); border-color: var(--violet-deep); color: #fff; }

@media (prefers-color-scheme: dark) {
  .btn--primary { color: #17141f; }
  .btn--primary:hover { color: #17141f; }
}

.btn--ghost {
  background: var(--paper-raised);
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn--ghost:hover { background: var(--paper-sunken); color: var(--ink); }

.btn--quiet {
  background: none;
  border-color: transparent;
  color: var(--ink-soft);
  padding-inline: 0.5rem;
}
.btn--quiet:hover { color: var(--ink); }

.btn--danger { color: var(--rose); border-color: transparent; background: none; }
.btn--danger:hover { background: var(--rose-tint); color: var(--rose); }

.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* --- Cards & surfaces --------------------------------------------------- */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem;
}

.card--pad { padding: clamp(1.6rem, 4vw, 2.5rem); }

.panel {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.note {
  border-left: 3px solid var(--violet-edge);
  background: var(--violet-tint);
  padding: 1.1rem 1.35rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.97rem;
}

.note--amber { border-left-color: var(--amber); background: var(--amber-tint); }
.note--rose  { border-left-color: var(--rose);  background: var(--rose-tint); }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.9rem;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  padding-block: clamp(3.5rem, 11vw, 7rem);
  border-bottom: 1px solid var(--rule);
}

.hero__inner { max-width: 40rem; }

.hero h1 { margin-bottom: 0.6rem; }

.hero__lede {
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 2rem;
}

/* --- Statistics --------------------------------------------------------- */

.stats {
  display: grid;
  gap: 2rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.stat__figure {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 2.9rem);
  line-height: 1;
  color: var(--violet);
  margin-bottom: 0.5rem;
}

.stat__body { color: var(--ink-soft); font-size: 0.97rem; margin: 0; }

/* --- Steps -------------------------------------------------------------- */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3.1rem;
  padding-bottom: 1.8rem;
  border-left: 1px solid var(--rule-strong);
  margin-left: 1.05rem;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }

.steps li::before {
  content: counter(step);
  position: absolute;
  left: -1.05rem;
  top: -0.15rem;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--violet-tint);
  border: 1px solid var(--violet-edge);
  color: var(--violet);
  font-family: var(--serif);
  font-size: 0.95rem;
}

.steps h3 { margin-bottom: 0.3rem; }

/* --- Do / Don't lists ---------------------------------------------------- */

.rules { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }

.rules__col { border-radius: var(--radius); padding: 1.5rem; border: 1px solid var(--rule); }
.rules__col--do    { background: var(--moss-tint); border-color: color-mix(in srgb, var(--moss) 30%, transparent); }
.rules__col--dont  { background: var(--rose-tint); border-color: color-mix(in srgb, var(--rose) 30%, transparent); }

.rules__col h3 { display: flex; align-items: center; gap: 0.5rem; }
.rules__col--do h3 { color: var(--moss); }
.rules__col--dont h3 { color: var(--rose); }

.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.7rem; }
.ticks li:last-child { margin-bottom: 0; }
.ticks li::before {
  position: absolute;
  left: 0;
  top: -0.05rem;
  font-weight: 700;
}
.rules__col--do .ticks li::before { content: "\2713"; color: var(--moss); }
.rules__col--dont .ticks li::before { content: "\00d7"; color: var(--rose); font-size: 1.2rem; line-height: 1.35; }

/* --- Forms -------------------------------------------------------------- */

.field { margin-bottom: 1.5rem; }

.field > label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.field__hint {
  display: block;
  color: var(--ink-faint);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 0.68rem 0.85rem;
  transition: border-color 150ms ease;
}

input:hover, select:hover, textarea:hover { border-color: var(--ink-faint); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-tint);
}

textarea { min-height: 6.5rem; resize: vertical; line-height: 1.6; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b8494' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.4rem;
}

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.required { color: var(--rose); }

/* A checkbox and its label read as one target, so the whole row is clickable
   and the label sits beside the box rather than above it. */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.checkbox-row input[type="checkbox"] {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
  accent-color: var(--violet);
  cursor: pointer;
}

fieldset { border: 0; padding: 0; margin: 0 0 2.75rem; }

legend {
  font-family: var(--serif);
  font-size: 1.35rem;
  padding: 0;
  margin-bottom: 0.2rem;
}

.fieldset__intro {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.form-actions .spacer { margin-left: auto; }

/* --- Flash messages ------------------------------------------------------ */

.flashes { list-style: none; margin: 1.5rem 0 0; padding: 0; }

.flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
  font-size: 0.96rem;
  border: 1px solid;
}
.flash--success { background: var(--moss-tint);   border-color: color-mix(in srgb, var(--moss) 35%, transparent);   color: var(--moss); }
.flash--error   { background: var(--rose-tint);   border-color: color-mix(in srgb, var(--rose) 35%, transparent);   color: var(--rose); }
.flash--info    { background: var(--violet-tint); border-color: var(--violet-edge); color: var(--violet); }

/* --- The record --------------------------------------------------------- */

.record-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.record-head h1 { margin-bottom: 0.25rem; }

.record-section { margin-bottom: 2.75rem; }

.record-section > h2 {
  font-size: 1.3rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.25rem;
}

.record-list { margin: 0; }

.record-list > div {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) 1fr;
  gap: 0.5rem 2rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.record-list > div:last-child { border-bottom: 0; }

.record-list dt { color: var(--ink-soft); font-size: 0.94rem; }

.record-list dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record-list dd.is-blank { color: var(--ink-faint); font-style: italic; }

@media (max-width: 34rem) {
  .record-list > div { grid-template-columns: 1fr; gap: 0.15rem; }
}

.empty-state {
  text-align: center;
  padding: clamp(2.5rem, 8vw, 4.5rem) 1.5rem;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
}
.empty-state h2 { margin-bottom: 0.5rem; }
.empty-state p { max-width: 30rem; margin-inline: auto; color: var(--ink-soft); }

/* --- Tables (admin) ------------------------------------------------------ */

.table-scroll { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  min-width: 44rem;
}

table.data th, table.data td {
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

table.data th { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-faint); }

table.data td { white-space: pre-wrap; }

.pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid;
}
.pill--new         { background: var(--violet-tint); color: var(--violet); border-color: var(--violet-edge); }
.pill--in-progress { background: var(--amber-tint);  color: var(--amber);  border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.pill--sent        { background: var(--moss-tint);   color: var(--moss);   border-color: color-mix(in srgb, var(--moss) 35%, transparent); }
.pill--closed      { background: var(--paper-sunken); color: var(--ink-faint); border-color: var(--rule-strong); }

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 3rem;
  margin-top: 4rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.site-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-bottom: 2.5rem;
}

.site-footer h4 { margin-bottom: 0.7rem; color: var(--ink); }

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--violet); text-decoration: underline; }

.colophon {
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--ink-faint);
}

/* --- Sign-in ------------------------------------------------------------- */

.signin { max-width: 27rem; margin-inline: auto; padding-block: clamp(3rem, 10vw, 6rem); }
.signin__head { text-align: center; margin-bottom: 2rem; }
.signin .panel { text-align: left; }
.signin .field:last-of-type { margin-bottom: 1.75rem; }

.alt-action {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.inline-link {
  float: right;
  font-weight: 400;
  font-size: 0.88rem;
}

/* --- Danger zone --------------------------------------------------------- */

.danger-zone {
  border: 1px solid color-mix(in srgb, var(--rose) 35%, transparent);
  background: var(--rose-tint);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2rem);
}

.danger-zone h2 { color: var(--rose); font-size: 1.2rem; }

/* --- Emergency card ------------------------------------------------------ */
/* Read by a stranger, on a phone, under pressure. Type is larger and contrast
   higher than anywhere else on the site, and there is no navigation to get
   lost in. Still no motion of any kind. */

.ec-body {
  background: var(--paper-sunken);
  font-size: 1.125rem;
}

.ec {
  max-width: 44rem;
  margin-inline: auto;
  padding: 0 0 3rem;
  background: var(--paper-raised);
  min-height: 100vh;
}

.ec__head {
  padding: 1.75rem 1.5rem 1.5rem;
  border-bottom: 3px solid var(--rose);
  background: var(--rose-tint);
}

.ec__head--quiet { border-bottom-color: var(--rule-strong); background: var(--paper-sunken); }

.ec__flag {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  margin: 0 0 0.5rem;
}

.ec__flag--quiet { color: var(--ink-soft); }

.ec__head h1 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  margin: 0;
  line-height: 1.15;
}

.ec__dob { margin: 0.5rem 0 0; color: var(--ink-soft); font-size: 1rem; }

.ec__section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.ec__section--urgent {
  background: var(--amber-tint);
  border-left: 5px solid var(--amber);
}

.ec__section > h2 {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.1rem;
}

.ec__section--urgent > h2 { color: var(--amber); }

.ec__row { margin-bottom: 1.35rem; }
.ec__row:last-child { margin-bottom: 0; }

.ec__label {
  margin: 0 0 0.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.ec__value {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ec__value .tel {
  font-weight: 600;
  white-space: nowrap;
  text-decoration-thickness: 2px;
}

.ec__foot {
  padding: 1.5rem;
  color: var(--ink-faint);
  font-size: 0.92rem;
}

.ec__foot p { margin: 0 0 0.5rem; }

.ec__emergency { font-weight: 600; color: var(--ink-soft); }

@media print {
  .ec-body { background: #fff; }
  .ec { max-width: none; min-height: 0; }
  .ec__section { break-inside: avoid; }
}

/* --- Emergency tag management ------------------------------------------- */

.tag-url {
  display: block;
  font-family: var(--mono);
  font-size: 0.95rem;
  word-break: break-all;
  background: var(--paper-sunken);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--ink);
}

.qr-block {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  align-items: flex-start;
}

.qr-block img {
  width: 10.5rem;
  height: 10.5rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #fff;
  padding: 0.4rem;
  flex: none;
}

.qr-block__body { flex: 1 1 15rem; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.status::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: currentColor;
}

.status--live { color: var(--moss); }
.status--off { color: var(--ink-faint); }

.access-log { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }

.access-log li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.access-log li:last-child { border-bottom: 0; }

/* --- Accessibility & print ---------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .site-header, .site-footer, .no-print, .flashes { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .panel, .card { box-shadow: none; border: 1px solid #999; }
  .wrap { max-width: none; padding: 0; }
  .record-section { break-inside: avoid; }
  a { text-decoration: none; color: #000; }
}
