* {
  box-sizing: border-box;
}
:root {
  --paper: #fbfaf7;
  --panel: #f1efe9;
  --ink: #242722;
  --muted: #575b51;
  --red: #ac322e;
  --ruby: #962a25;
  --white: #fff;
  --focus: #a72b27;
  --sage: #e4eade;
  --blush: #f4e3dd;
  --blue: #e1e8ee;
  --gold: #f1e8cf;
  --lavender: #eae5ef;
  --text: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
}
body.ic {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
button {
  border: 0;
  background: transparent;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  background: white;
  padding: 10px;
  z-index: 9;
}
.skip:focus {
  top: 8px;
}
.shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: clamp(220px, 21vw, 286px) minmax(0, 1fr);
}
.sidebar {
  background: var(--panel);
  padding: 38px clamp(18px, 2vw, 32px) 25px;
  display: flex;
  flex-direction: column;
  align-self: start;
  position: sticky;
  top: 0;
  height: 100svh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  width: max-content;
  max-width: 100%;
  line-height: 1.1;
}
.brand img {
  flex: none;
}
.brand strong {
  font-size: clamp(20px, 1.65vw, 25px);
  letter-spacing: -0.065em;
  font-weight: 650;
}
.brand small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
#nav {
  display: grid;
  gap: 5px;
  margin-top: 70px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 7px;
  padding: 12px 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
}
.nav-link:hover,
.nav-link[aria-current] {
  background: #e4e1d9;
  color: var(--ink);
}
.icon {
  display: inline-block;
  vertical-align: middle;
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-bottom {
  margin-top: auto;
}
.side-bottom p {
  font-size: 14px;
  margin: 5px 0;
  color: var(--muted);
}
.mode-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
}
.mode-title:before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
}
.site-back {
  display: inline-block;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}
main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(46px, 6.2vw, 92px) clamp(24px, 5.5vw, 92px) 70px;
  min-width: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: normal;
  text-wrap: pretty;
}
h1 {
  font-size: clamp(44px, 4.9vw, 78px);
  letter-spacing: -0.055em;
  line-height: 1.05;
}
h2 {
  font-size: 32px;
  line-height: 1.13;
  letter-spacing: -0.035em;
}
h3 {
  font-size: 23px;
  line-height: 1.2;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.heading p {
  color: var(--muted);
  margin-top: 10px;
}
.heading > div {
  min-width: 0;
}
.btn,
.minor,
.text-btn,
.tab,
.back-link {
  font-size: 15px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  min-height: 42px;
  border-radius: 6px;
  padding: 9px 13px;
}
.btn {
  background: var(--red);
  color: white;
  padding: 11px 18px;
  white-space: nowrap;
}
.btn:hover {
  background: var(--ruby);
}
.minor {
  background: var(--panel);
}
.minor:hover,
.tab:hover {
  background: #e5e2da;
}
.text-btn,
.back-link {
  color: var(--ruby);
  padding: 7px 4px;
}
.text-btn:hover,
.back-link:hover {
  text-decoration: underline;
}
.warning {
  color: var(--ruby);
}
.searchline {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid #aaa99e;
  border-radius: 8px;
  padding: 5px 8px 5px 16px;
}
.searchline:focus-within {
  border-color: var(--focus);
}
.searchline > input {
  border: 0;
  min-width: 0;
  flex: 1;
  background: transparent;
  padding: 11px 0;
  outline: 0;
  font-size: 17px;
}
.searchline input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
.searchline .minor {
  min-height: 38px;
  padding: 7px 11px;
}
.filters,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.filters {
  padding: 20px;
  background: var(--panel);
  margin-top: 8px;
  border-radius: 8px;
}
.filters[hidden],
[hidden] {
  display: none !important;
}
.list-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 30px 0 12px;
}
.tabs,
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.tab {
  color: var(--muted);
  min-height: 38px;
}
.tab.active {
  background: var(--ink);
  color: #fff;
}
.count,
small,
.muted {
  color: var(--muted);
  font-size: 14px;
}
.count {
  white-space: nowrap;
}
.list {
  display: grid;
  gap: 2px;
}
.person-row,
.event-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 19px 13px;
  border-radius: 8px;
  min-width: 0;
  text-decoration: none;
}
.person-row:nth-child(odd),
.event-row:nth-child(odd) {
  background: #f3f2ec;
}
.person-row:hover,
.event-row:hover {
  background: #ece9e1;
}
.avatar {
  height: 43px;
  width: 43px;
  display: grid;
  place-items: center;
  flex: none;
  font: 22px var(--display);
  color: #35362e;
  border-radius: 9px;
}
.tone0 {
  background: var(--sage);
}
.tone1 {
  background: var(--blush);
}
.tone2 {
  background: var(--blue);
}
.tone3 {
  background: var(--gold);
}
.tone4 {
  background: var(--lavender);
}
.row-who {
  min-width: 0;
  flex: 1;
}
.row-who strong,
.row-who small,
.row-context strong,
.row-context small {
  display: block;
}
.row-who strong {
  font: normal 23px/1.25 var(--display);
  letter-spacing: -0.025em;
}
.row-who small {
  margin-top: 3px;
}
.row-context {
  flex: 0 1 29%;
  min-width: 0;
}
.row-context strong {
  font: 500 14px var(--text);
}
.row-context small {
  margin-top: 3px;
  font-size: 13px;
}
.row-end {
  color: var(--muted);
}
.why {
  display: block;
  margin-top: 7px;
  color: var(--ruby);
  font-size: 13px;
}
.why,
.row-who,
.facts dd,
.note,
main,
dialog {
  overflow-wrap: anywhere;
}
.empty,
.panel {
  background: var(--panel);
  border-radius: 9px;
  padding: 24px;
}
.empty p,
.panel > p {
  margin: 8px 0 12px;
}
.section {
  margin-top: 35px;
}
.section > h2 {
  margin-bottom: 15px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 14px;
}
.back-link {
  margin-bottom: 18px;
}
.detail-hero {
  display: flex;
  align-items: center;
  gap: 18px;
}
.detail-hero .avatar {
  width: 60px;
  height: 60px;
  font-size: 28px;
}
.detail-hero h1 {
  font-size: clamp(34px, 3.6vw, 58px);
}
.facts {
  display: grid;
  grid-template-columns: minmax(100px, 150px) 1fr;
  gap: 11px 20px;
  margin: 0;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
}
.notes {
  display: grid;
  gap: 12px;
}
.note {
  background: var(--white);
  padding: 20px;
  border-radius: 8px;
}
.note p {
  white-space: pre-wrap;
  margin: 8px 0;
}
.note .actions {
  margin-top: 8px;
}
.stack {
  display: grid;
  gap: 15px;
}
.stack > details {
  background: var(--panel);
  border-radius: 8px;
  padding: 15px;
}
.stack summary {
  cursor: pointer;
  font-weight: 550;
}
.stack details .form-grid {
  margin-top: 15px;
}
.event-date {
  display: grid;
  justify-items: center;
  min-width: 52px;
  color: var(--ruby);
}
.event-date b {
  font: 26px/1.1 var(--display);
}
.event-date small {
  font-size: 12px;
}
dialog {
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  width: min(540px, calc(100vw - 28px));
  max-height: 88svh;
  padding: 25px;
  box-shadow: 0 12px 50px #2223;
}
dialog::backdrop {
  background: #211c184f;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.close {
  font-size: 24px;
  width: 42px;
  height: 42px;
  background: var(--panel);
  border-radius: 50%;
}
.form-field {
  display: grid;
  gap: 5px;
  font-size: 14px;
  font-weight: 550;
}
.form-field input,
.form-field select,
.form-field textarea,
select.control {
  width: 100%;
  min-width: 0;
  border: 1px solid #a8aa9f;
  background: var(--white);
  border-radius: 5px;
  padding: 10px;
  font-weight: 400;
  font-size: 16px;
}
.form-field textarea {
  resize: vertical;
}
.wide {
  grid-column: 1/-1;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}
.check input {
  accent-color: var(--red);
  width: 17px;
  height: 17px;
}
.actions.end {
  justify-content: flex-end;
  margin-top: 8px;
}
.error {
  color: var(--ruby);
  font-weight: 550;
}
.error:empty {
  display: none;
}
#notice {
  position: fixed;
  bottom: 19px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  border-radius: 7px;
  padding: 10px 18px;
  z-index: 5;
  width: max-content;
  max-width: 90vw;
}
#notice:empty {
  display: none;
}
.qr {
  width: 200px;
  max-width: 100%;
  margin: auto;
  background: white;
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.registers {
  max-height: 240px;
  overflow: auto;
}
.registers li {
  margin-block: 5px;
}
.mobile-mode {
  display: none;
}
@media (max-width: 820px) {
  .shell {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .sidebar {
    padding: 28px 13px;
  }
  .brand {
    gap: 6px;
  }
  .brand img {
    width: 29px;
  }
  .brand strong {
    font-size: 19px;
  }
  main {
    padding: 44px 25px;
  }
  .row-context {
    flex-basis: 26%;
  }
  .row-who strong {
    font-size: 21px;
  }
}
@media (max-width: 650px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 14px 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .brand strong {
    font-size: 21px;
  }
  .brand small {
    font-size: 12px;
  }
  .side-bottom {
    margin: 0;
  }
  .side-bottom .site-back,
  .side-bottom p,
  .side-bottom .text-btn {
    display: none;
  }
  .mode-title {
    font-size: 13px;
  }
  #nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    margin: 0;
    padding: 6px 7px max(6px, env(safe-area-inset-bottom));
    background: var(--panel);
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }
  .nav-link {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 3px;
    font-size: 12px;
  }
  .nav-link .icon {
    width: 19px;
    height: 19px;
  }
  main {
    padding: 32px 17px 105px;
  }
  .heading {
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 22px;
  }
  .heading p {
    margin-top: 7px;
    font-size: 15px;
  }
  .heading h1 {
    font-size: 41px;
  }
  .heading .btn {
    font-size: 14px;
    padding: 9px 12px;
    min-height: 40px;
  }
  .heading .btn .icon {
    width: 15px;
  }
  .list-tools {
    margin: 21px 0 8px;
  }
  .person-row,
  .event-row {
    padding: 15px 10px;
    gap: 11px;
  }
  .row-context {
    display: none;
  }
  .row-end {
    width: 15px;
  }
  .avatar {
    width: 36px;
    height: 38px;
    font-size: 19px;
  }
  .count {
    font-size: 12px;
  }
  .searchline {
    gap: 8px;
    padding-left: 10px;
  }
  .searchline input {
    font-size: 16px;
  }
  .searchline .minor {
    font-size: 13px;
  }
  .filters,
  .form-grid {
    gap: 10px;
  }
  .panel,
  .empty {
    padding: 18px;
  }
  .detail-hero {
    gap: 10px;
  }
  .detail-hero .avatar {
    width: 44px;
    height: 46px;
  }
  .form-field {
    font-size: 14px;
  }
  #notice {
    bottom: 80px;
  }
  .heading .actions {
    justify-content: flex-end;
  }
  dialog {
    padding: 20px;
  }
  .facts {
    grid-template-columns: 95px 1fr;
    gap: 8px 12px;
  }
}
@media (max-width: 375px) {
  .heading {
    flex-wrap: wrap;
  }
  .heading .btn {
    min-height: 36px;
  }
  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .btn,
  .nav-link,
  .person-row,
  .event-row {
    transition: background 0.14s ease;
  }
  .btn:active,
  .minor:active {
    transform: translateY(1px);
  }
}
.short-label {
  display: none;
}
@media (max-width: 650px) {
  .heading:has(.quick-save) {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
  }
  .heading:has(.quick-save) > div {
    display: contents;
  }
  .heading:has(.quick-save) h1 {
    font-size: clamp(32px, 9vw, 42px);
    grid-column: 1;
    grid-row: 1;
  }
  .heading:has(.quick-save) p {
    grid-column: 1/-1;
    grid-row: 2;
    margin: 0;
  }
  .quick-save {
    grid-column: 2;
    grid-row: 1;
  }
  .quick-save .long-label {
    display: none;
  }
  .quick-save .short-label {
    display: inline;
  }
  .side-bottom:has([data-action='signin']) .text-btn {
    display: block;
    font-size: 13px;
    min-height: 24px;
    padding: 0;
    margin-left: auto;
  }
}
@media (max-width: 375px) {
  .sidebar {
    gap: 7px;
  }
  .brand strong {
    font-size: 18px;
  }
  .brand img {
    width: 25px;
  }
  .mode-title {
    font-size: 12px;
    white-space: nowrap;
  }
  .heading:has(.quick-save) h1 {
    font-size: 29px;
  }
  .quick-save {
    padding-inline: 9px;
  }
  .list-tools .tab {
    font-size: 13px;
    padding-inline: 8px;
  }
  .list-tools .tabs {
    gap: 2px;
  }
}
