@font-face { font-family: Archive; src: url("/ai/aonofam/manage/newsreader-latin.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: Plain; src: url("/ai/aonofam/manage/hanken-grotesk-latin.woff2") format("woff2"); font-display: swap; }
:root {
  color-scheme: light;
  --ink: #32281c;
  --muted: #655641;
  --paper: #f5efe2;
  --surface: #fffbf2;
  --line: #cbbda5;
  --action: #5b431d;
  --action-hover: #463314;
  --focus: #795223;
  font: 16px/1.55 Plain, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, legend, .archive { font-family: Archive, Georgia, serif; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, .archive { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(18px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid var(--line);
  background: #e9dfcc;
}
.archive { display: inline-flex; gap: 9px; align-items: center; min-height: 44px; font-size: 1.16rem; color: inherit; text-decoration: none; }
.archive img { flex: none; }
.local { font-size: .8rem; font-weight: 650; white-space: nowrap; color: var(--muted); }
main { max-width: 1156px; margin: auto; padding: clamp(26px, 5vw, 62px) 18px 42px; }
.intro { margin-bottom: clamp(22px, 4vw, 38px); }
h1 { font-size: clamp(2.35rem, 6vw, 4.6rem); font-weight: 500; line-height: .98; letter-spacing: -.03em; }
.intro p { max-width: 52ch; margin-top: 10px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(190px, 240px) minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: start; }
.picker { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #ede5d5; }
.picker input, .picker select { margin: 5px 0 12px; width: 100%; }
label { display: grid; min-width: 0; font-weight: 650; gap: 4px; }
input, textarea, select {
  max-width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #b9a88d;
  border-radius: 8px;
  background: var(--surface);
}
textarea { width: 100%; resize: vertical; }
.hint { color: var(--muted); font-size: .89rem; font-weight: 400; }
.relationships { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.relationships summary { min-height: 44px; padding-top: 8px; font: 650 1.15rem/1.4 Archive, Georgia, serif; cursor: pointer; }
.relationships dl { margin: 0; font-size: .9rem; }
.relationships dt { font-weight: 700; }
.relationships dd { margin: 0 0 7px; color: var(--muted); overflow-wrap: anywhere; }
.workbench { min-width: 0; }
form { padding: clamp(16px, 4vw, 34px); background: var(--surface); border-radius: 14px; box-shadow: 0 14px 42px rgb(65 42 19 / .09); }
.profile-heading, .event-head, .savebar { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.profile-heading h2 { font-size: clamp(1.6rem, 4vw, 2.35rem); line-height: 1.05; overflow-wrap: anywhere; }
.profile-heading p { margin-top: 4px; }
fieldset { margin: 25px 0 0; padding: 10px 0 0; min-width: 0; border: 0; border-top: 1px solid var(--line); }
legend { padding: 0 10px 0 0; font-size: 1.3rem; font-weight: 650; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.fields .wide { grid-column: 1 / -1; }
#story, #birthSources, #addEvent { margin-top: 8px; }
.event { margin-top: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.event-head { margin-bottom: 6px; }
.event h3 { font-size: 1.15rem; }
.event p { margin-top: 6px; }
button { min-height: 44px; padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; background: var(--action); color: #fffaf0; cursor: pointer; font-weight: 650; }
button:hover { background: var(--action-hover); }
button:disabled { opacity: .55; cursor: default; }
.secondary { background: #f4eddf; color: var(--ink); border-color: var(--line); }
.secondary:hover { background: #eae0cd; }
.savebar { margin-top: 22px; justify-content: flex-end; }
.savebar p { margin-right: auto; }
.status:not(:empty) { margin-bottom: 8px; padding: 9px 12px; border-radius: 8px; background: #eee4d2; }
.status:empty { display: none; }
[data-error="true"] { color: #843626; }
@media (min-width: 721px) { .picker { position: sticky; top: 18px; } }
@media (max-width: 720px) { .workspace { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 400px) {
  .masthead { padding-inline: 12px; }
  .archive { font-size: .99rem; gap: 5px; }
  main { padding-inline: 12px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
}
