:root {
  color-scheme: light;
  --ink: #22312b;
  --muted: #6b776f;
  --line: #e6dfd1;
  --paper: #f7f3ea;
  --card: #fffdf8;
  --green: #1f5a49;
  --green-dark: #17473a;
  --green-soft: #e2ebe3;
  --warm: #d9784a;
  --warm-soft: #fbeedd;
  --red: #a63d2f;
  --red-soft: #f8e2dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(34 49 43 / 6%), 0 6px 20px rgb(34 49 43 / 6%);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans CJK SC',
    'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  line-height: 1.55;
  min-height: 100dvh;
}
h1,
h2,
h3,
p {
  margin: 0;
}
img {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid #e3a06f;
  outline-offset: 2px;
}

/* ---------- buttons ---------- */

button,
.button,
a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}
button:active:not(:disabled),
.button:active,
a.primary:active {
  transform: scale(0.98);
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
.primary,
a.primary,
button[aria-pressed='true']:not(.style):not(.font-opt) {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
@media (hover: hover) {
  button:hover:not(:disabled):not(.primary) {
    border-color: #c9bfa9;
  }
  .primary:hover:not(:disabled) {
    background: var(--green-dark);
  }
}
.big {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
  border-radius: 14px;
}
.ghost {
  background: transparent;
  border-style: dashed;
  color: var(--green);
}
.wide {
  width: 100%;
}
.link {
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--green);
  font-weight: 500;
}
.danger {
  color: var(--red);
}
.mini {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 9px;
}
.icon-button {
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: #ece6d9;
}
.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- form ---------- */

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.optional {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}
input:not([type='file']):not([type='checkbox']),
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  font-weight: 400;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(31 90 73 / 14%);
}
input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.stack {
  display: grid;
  gap: 14px;
}
.form {
  gap: 16px;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.row3 button {
  padding-inline: 6px;
  white-space: nowrap;
}
.hint,
.quiet {
  color: var(--muted);
  font-size: 14px;
}
.inline-error,
.error {
  color: var(--red);
  font-size: 14px;
}
.inline-error:empty {
  display: none;
}
.progress-text:empty {
  display: none;
}
.progress-text {
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
}
.chip {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
}

/* ---------- frame ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  height: calc(54px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 10px 0;
  background: rgb(247 243 234 / 88%);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgb(230 223 209 / 70%);
}
.bar-back {
  width: 40px;
  padding: 0;
  border: 0;
  background: none;
}
.bar-back svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand {
  gap: 9px;
  padding: 0 6px;
  border: 0;
  background: none;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.mark {
  display: inline-flex;
  gap: 3px;
}
.mark i {
  width: 7px;
  height: 16px;
  border-radius: 3px;
  background: var(--green);
}
.mark i:nth-child(2) {
  background: var(--warm);
  transform: translateY(2px);
}
.mark i:nth-child(3) {
  background: #e7b84c;
}
.bar-link {
  margin-left: auto;
  min-height: 36px;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
}
main {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 18px 16px 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.section {
  margin-top: 26px;
}
.section h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 17px;
}
.section h2 small {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}
.eyebrow {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.page-title {
  font-size: 25px;
  line-height: 1.3;
  margin: 18px 0 4px;
}
.lead {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 18px;
}
.dock {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 18px -16px 0;
  padding: 14px 16px calc(14px + var(--safe-bottom));
  background: linear-gradient(to bottom, rgb(247 243 234 / 0%), var(--paper) 34%);
}
.dock-stack {
  display: grid;
  gap: 10px;
}
.note {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--warm-soft);
  color: #7a4c14;
  font-size: 14px;
}
.empty {
  padding: 26px 18px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  font-size: 15px;
}
.meter {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: #ebe5d8;
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.4s;
}
.meter.thick {
  height: 9px;
}
.spinner {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 2.5px solid var(--green-soft);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}
.spinner.light {
  width: 18px;
  height: 18px;
  border-color: rgb(255 255 255 / 35%);
  border-top-color: #fff;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-bottom));
  z-index: 20;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 11px 16px;
  border-radius: 12px;
  background: rgb(34 49 43 / 94%);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 8px 26px rgb(0 0 0 / 18%);
}

/* ---------- login ---------- */

.login {
  display: grid;
  margin: -18px -16px 0;
}
.login-cover {
  width: 100%;
  height: 38dvh;
  object-fit: cover;
  object-position: top;
}
.login form {
  margin: -36px 16px 24px;
  position: relative;
}
.login h1 {
  font-size: 26px;
}

/* ---------- home ---------- */

.hello h1 {
  margin: 6px 0 18px;
  font-size: 28px;
  line-height: 1.3;
}
.cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 18px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 28px rgb(31 90 73 / 24%);
}
.cta strong {
  display: block;
  font-size: 18px;
}
.cta small {
  display: block;
  opacity: 0.82;
  font-size: 13px;
}
.cta-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  background: rgb(255 255 255 / 16%);
}
.cta-icon .i {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}
.month-list {
  display: grid;
  gap: 10px;
}
.month-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  text-decoration: none;
}
.month-card img {
  width: 54px;
  height: 96px;
  flex: none;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  background: #eee;
}
.month-card div {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.month-card strong {
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.month-card small {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- wizard ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  position: relative;
}
.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 13px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 1.5px;
  background: var(--line);
}
.steps b {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 13px;
}
.steps .now {
  color: var(--ink);
  font-weight: 700;
}
.steps .now b {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.steps .done b {
  background: var(--green-soft);
  border-color: var(--green-soft);
  color: var(--green);
}
.steps .done b .i {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}
.styles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 560px) {
  .styles {
    grid-template-columns: repeat(3, 1fr);
  }
}
.style {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 0;
  min-height: 0;
  border: 0;
  background: none;
  text-align: center;
  font-size: 14px;
}
.style img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top;
  border-radius: 12px;
  /* Built-in previews render on first view; keep the slot calm until they arrive. */
  background: #efe8da;
  box-shadow: var(--shadow);
  outline: 3px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s;
}
.style.on img {
  outline-color: var(--green);
}
.style.on span {
  color: var(--green);
}
.tick {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.tick .i {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}
.style.on .tick {
  display: grid;
}
#style-pick {
  display: grid;
  gap: 16px;
}
.filters {
  display: grid;
  gap: 8px;
}
/* Sideways chip rows on phones; they wrap once there is room. */
.scroller {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -16px;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
}
.scroller::-webkit-scrollbar {
  display: none;
}
.scroller .chip {
  flex: none;
}
.scroller .sep {
  flex: none;
  width: 1px;
  height: 18px;
  background: var(--line);
}
@media (min-width: 720px) {
  .scroller {
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}
.lib-grid {
  display: grid;
  gap: 12px;
}
#font-pick {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.font-pick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 720px) {
  .font-pick {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.font-opt {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 7px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
}
.font-opt img {
  width: 100%;
  aspect-ratio: 56 / 17;
  border-radius: 9px;
  background: #fbf6ea;
}
.font-opt span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 3px 2px;
  font-size: 14px;
  font-weight: 600;
}
.font-opt small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.font-opt[aria-pressed='true'] {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}
.font-opt[aria-pressed='true'] span {
  color: var(--green);
}
.group-title {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.more summary {
  padding: 8px 0;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
}
.more .styles {
  margin-top: 8px;
}

/* ---------- photo picker ---------- */

.picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1.5px dashed #cdbf9f;
  border-radius: var(--radius);
  background: #fffaf0;
  cursor: pointer;
}
.picker .i {
  width: 30px;
  height: 30px;
  color: var(--warm);
}
.picker strong {
  display: block;
  font-size: 16px;
}
.picker small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}
.picked {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
}
.picked:empty {
  display: none;
}
.picker + .picked {
  margin-top: 14px;
}
.picked figure {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
}
.picked img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: var(--ink);
  color: #fff;
}
.remove .i {
  width: 13px;
  height: 13px;
  stroke-width: 2.6;
}
.import-list {
  display: grid;
  max-height: 34dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.import-list:empty {
  display: none;
}
.import-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 14px;
}
.import-row + .import-row {
  border-top: 1px solid var(--line);
}

/* ---------- sample ---------- */

.sample-who {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.working {
  display: flex;
  align-items: center;
  gap: 14px;
}
.working strong {
  display: block;
}
.working small {
  color: var(--muted);
  font-size: 13px;
}
.sample-pages,
.child-pages {
  display: grid;
  gap: 14px;
  justify-items: center;
}
.sample-pages .page,
.child-pages .page {
  width: 100%;
  max-width: 460px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgb(34 49 43 / 8%), 0 18px 40px rgb(34 49 43 / 14%);
}
/* Pages of one book sit side by side so the send button stays on the first screen. */
.child-pages {
  display: flex;
  gap: 12px;
  margin: 0 -16px;
  padding: 4px 16px 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.child-pages::-webkit-scrollbar {
  display: none;
}
.child-pages .page {
  flex: none;
  width: auto;
  height: min(52dvh, 560px);
  max-width: none;
  scroll-snap-align: center;
  box-shadow: 0 2px 4px rgb(34 49 43 / 8%), 0 10px 24px rgb(34 49 43 / 12%);
}
.child-pages > :first-child {
  margin-left: auto;
}
.child-pages > :last-child {
  margin-right: auto;
}
.page-count {
  margin-top: -6px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.skip {
  margin: 4px 0 30px;
  text-align: center;
}

/* ---------- class ---------- */

.month-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.month-head h1 {
  margin: 2px 0 2px;
  font-size: 27px;
  line-height: 1.25;
}
.theme-line {
  min-height: 34px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 16px;
  font-weight: 600;
}
.theme-line .i {
  width: 16px;
  height: 16px;
}
.style-mini {
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  color: var(--green);
}
.style-mini img {
  width: 56px;
  height: 100px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.progress {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.progress p {
  font-size: 14px;
  color: var(--muted);
}
.progress strong {
  color: var(--ink);
  font-size: 18px;
}
.warn {
  color: #9a5b16;
}
.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.tool {
  flex-direction: column;
  gap: 6px;
  min-height: 82px;
  padding: 12px 8px;
  border-radius: var(--radius);
  font-size: 14px;
}
.tool .i {
  width: 26px;
  height: 26px;
  color: var(--green);
}
.tool em {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--green-soft);
  color: var(--green);
  font-style: normal;
  font-size: 12px;
}
.roster {
  display: grid;
  gap: 8px;
}
@media (min-width: 900px) {
  main:has(.roster) {
    width: min(920px, 100%);
  }
  .roster {
    grid-template-columns: 1fr 1fr;
  }
}
.kid {
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 8px 12px 8px 8px;
  border-radius: var(--radius);
  text-align: left;
  font-weight: 400;
}
.kid-thumb {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  background: #f0ebe0;
  color: #b9ad94;
}
.kid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.kid-thumb.is-page img {
  object-position: top;
}
.kid-main {
  display: grid;
  flex: 1;
  min-width: 0;
}
.kid-main strong {
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kid-main small {
  color: var(--muted);
  font-size: 13px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.s-ready {
  background: var(--green-soft);
  color: var(--green);
}
.s-writing,
.s-queued,
.s-rendering {
  background: var(--warm-soft);
  color: #8a5212;
}
.s-failed {
  background: var(--red-soft);
  color: var(--red);
}
.s-draft {
  background: #ece9e1;
  color: #4d5852;
}
.s-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

/* ---------- sheets ---------- */

dialog {
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 -10px 40px rgb(0 0 0 / 16%);
  overflow: hidden;
}
dialog[open] {
  animation: rise 0.22s ease-out;
}
@keyframes rise {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
}
dialog::backdrop {
  background: rgb(28 36 32 / 45%);
}
dialog.full {
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}
#dialog-body {
  max-height: inherit;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px calc(20px + var(--safe-bottom));
}
.dialoghead {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px 6px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgb(247 243 234 / 94%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
dialog:not(.full) .dialoghead {
  padding-top: 14px;
}
.dialoghead h2 {
  font-size: 19px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#dialog-body > .stack {
  padding-top: 4px;
}
#dialog-body .dock {
  margin: 4px -16px 0;
  padding-bottom: 6px;
}
@media (min-width: 720px) {
  dialog,
  dialog.full {
    width: min(620px, calc(100% - 48px));
    height: auto;
    max-height: 90vh;
    margin: auto;
    border-radius: 20px;
  }
  .dialoghead,
  dialog:not(.full) .dialoghead {
    padding-top: 16px;
  }
}
.share-row {
  margin-top: 2px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 4px;
}
.section-head h3 {
  font-size: 16px;
}
.photo-edit {
  display: grid;
  gap: 10px;
}
.photo-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.photo-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 9px;
}
.photo-fields {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.photo-fields input:not([type='file']) {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 16px;
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.photo-actions .i {
  width: 15px;
  height: 15px;
}
.tag {
  padding: 2px 8px;
  border-radius: 99px;
  background: #ece6d9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.tag.main {
  background: var(--warm-soft);
  color: #8a5212;
}
.added {
  color: var(--green);
  font-weight: 600;
}
.existing {
  margin-bottom: 4px;
}
#child-delete {
  margin: 8px auto 4px;
  display: flex;
}
#dialog-body > .stack > .page {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
