@page {
  size: 6in 4in;
  margin: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4efe4;
  color: #17211b;
  font-family: "Assistant", sans-serif;
}

.toolbar {
  padding: 24px;
  background: #fbf7ee;
  color: #17211b;
  font-family: "Assistant", sans-serif;
  border-bottom: 1px solid rgb(100 112 68 / 0.18);
}

.toolbar-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.toolbar-heading {
  display: grid;
  gap: 4px;
}

.toolbar-eyebrow {
  margin: 0;
  color: #b88b3e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.toolbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.toolbar p {
  margin: 0;
  color: rgb(23 33 27 / 0.66);
  font-size: 15px;
}

.toolbar form {
  display: grid;
  gap: 12px;
  border-radius: 18px;
  border: 1px solid rgb(100 112 68 / 0.16);
  background: white;
  padding: 16px;
  box-shadow: 0 1px 2px rgb(23 33 27 / 0.06);
}

.toolbar-field {
  display: grid;
  gap: 6px;
  color: rgb(23 33 27 / 0.68);
  font-size: 13px;
  font-weight: 800;
}

.toolbar input {
  min-height: 42px;
  border: 1px solid rgb(100 112 68 / 0.22);
  border-radius: 12px;
  background: rgb(251 247 238 / 0.75);
  color: #17211b;
  padding: 9px 12px;
  font: inherit;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.toolbar-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(100 112 68 / 0.24);
  border-radius: 999px;
  background: white;
  color: #17211b;
  padding: 9px 16px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.toolbar-button.primary {
  background: #17211b;
  color: white;
  border-color: #17211b;
}

@media (min-width: 760px) {
  .toolbar form {
    grid-template-columns: minmax(0, 180px) minmax(0, 180px) 1fr;
    align-items: end;
  }
}

.print-card {
  width: 6in;
  height: 4in;
  page-break-after: always;
  margin: 18px auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid #bbb;
  padding: 0.04in 0.14in 0.08in;
  font-size: 8pt;
  line-height: 1.15;
  direction: rtl;
  text-align: right;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.18in;
  align-items: baseline;
  border-bottom: 2px solid #333;
  padding-bottom: 0.03in;
  margin-bottom: 0.05in;
}

.print-card h1 {
  margin: 0;
  font-size: 17pt;
  line-height: 1;
  display: inline;
}

.card-title p {
  margin: 0;
  display: inline;
  color: #555;
  font-weight: 700;
  font-size: 10pt;
  padding-left: 0.08in;
}

.aliyah-badge {
  color: #8B0000;
  font-size: 11pt;
  font-weight: 800;
  margin-left: 0.05in;
}

.card-title,
.card-section h2,
.person-label,
.muted {
  direction: ltr;
}

.card-title {
  flex: 1;
  text-align: left;
}

.person-label {
  text-align: right;
}

.card-grid {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.07in;
  height: 3.34in;
  direction: rtl;
}

.top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0;
}

.his-side,
.her-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0;
}

.his-side {
  padding-left: 0.09in;
}

.her-side {
  padding-right: 0.09in;
  border-right: 1px solid #ccc;
}

.bottom-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  column-gap: 0.18in;
  min-height: 0;
  border-top: 1px solid #888;
  padding-top: 0.035in;
  margin-top: 0.02in;
}

.children-section {
  min-width: 0;
}

.side-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.02in;
  border-right: 1px solid #ccc;
  padding-right: 0.06in;
}

.side-column .card-section {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.side-column .card-section:not(:first-child) {
  border-top: 1px solid #888;
  padding-top: 0.035in;
  margin-top: 0.025in;
}

.bottom-row > .card-section {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

.hebrew-name {
  font-family: "Noto Sans Hebrew", "Assistant", sans-serif;
  font-weight: 650;
}

.card-section {
  border-top: 1px solid #888;
  padding-top: 0.035in;
  margin-top: 0.025in;
}

.card-section h2,
.person-label {
  margin: 0 0 0.015in;
  padding-bottom: 0.008in;
  color: #555;
  font-size: 5.8pt;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: right;
  border-bottom: 1px solid #ddd;
}

.card-section h2 {
  border-bottom-color: #ccc;
}

.person-label {
  border-bottom: 0;
  padding-bottom: 0;
}

.name-block .person-label,
.stacked-entry .person-label,
.yahrzeit-entry .person-label {
  border-bottom: 0;
  padding-bottom: 0;
}

.card-section p {
  margin: 0.01in 0;
}

.name-block {
  margin: 0.006in 0 0.018in;
}

.primary-name-block {
  margin-bottom: 0.008in;
}

.primary-name-block + .card-section {
  margin-top: 0.005in;
  padding-top: 0.02in;
}


.primary-name .hebrew-name {
  font-size: 11.5pt;
  font-weight: 700;
  color: #111;
}

.parents-section p .hebrew-name,
.card-section:not(.primary-section) p .hebrew-name {
  font-size: 9pt;
}

.children-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.children-grid {
  flex: 1;
  min-height: 0;
}

.children-grid.two-col {
  columns: 2;
  column-gap: 0.14in;
  column-rule: 1px solid #ccc;
  column-fill: auto;
}

.child-line {
  margin-bottom: 0.015in;
  break-inside: avoid;
}

.child-line p {
  margin: 0.004in 0;
}

.child-line .hebrew-name {
  font-size: 8.8pt;
}

.child-line .inlaw-inline {
  color: #444;
  padding-right: 0.18in;
  position: relative;
}

.child-line .inlaw-inline::before {
  content: '';
  position: absolute;
  right: 0.05in;
  top: 0.01in;
  width: 0.09in;
  height: 0.06in;
  border-right: 1px solid #8a8a8a;
  border-bottom: 1px solid #8a8a8a;
}

.inlaw-inline .hebrew-name {
  font-size: 6.8pt;
  font-weight: 500;
}

.stacked-entry {
  margin-bottom: 0.035in;
}

.stacked-entry p {
  margin: 0;
}

.stacked-entry .hebrew-name {
  font-size: 9pt;
  font-weight: 650;
}

.yahrzeit-section .stacked-entry .hebrew-name {
  font-size: 8.6pt;
}

.yahrzeit-entry .person-label {
  margin-top: 0.004in;
}

.stacked-entry:not(:last-child) {
  padding-bottom: 0.025in;
  margin-bottom: 0.025in;
  position: relative;
}

.stacked-entry:not(:last-child)::after {
  content: '';
  display: block;
  width: 80%;
  height: 1px;
  background: #bbb;
  margin: 0.012in 0 0 auto;
}

.yahrzeit-date {
  color: #555;
  font-size: 6pt;
  font-weight: 700;
  margin-bottom: 0.003in;
  text-align: right;
}

.yahrzeit-date .hebrew-name {
  font-size: 6.8pt;
  font-weight: 700;
}

.muted {
  color: #9a9488;
}

@media print {
  body {
    background: white;
  }

  .toolbar {
    display: none;
  }

  .print-card {
    margin: 0;
    border: 0;
  }
}
