.flow-open {
  overflow: hidden;
}

.flow-dialog {
  --flow-surface: #f7f2e8;
  --flow-raised: #fffcf5;
  --flow-brown: #89503a;
  --flow-muted: #536358;
  position: fixed;
  inset: 0;
  width: min(92vw, 620px);
  max-width: none;
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  margin: auto;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 25px;
  padding: 0;
  background: var(--flow-surface);
  color: var(--ink, #223b2e);
  font: inherit;
  box-shadow: 0 30px 95px #0d211b79, inset 0 1px 0 #fff;
  overflow: auto;
  overscroll-behavior: contain;
}

.flow-dialog[open] {
  animation: flow-enter .23s cubic-bezier(.3, .8, .25, 1) both;
}

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

.flow-dialog::backdrop {
  background: rgba(14, 38, 28, .66);
  backdrop-filter: blur(5px);
}

.flow-dialog.flow-wide {
  width: min(93vw, 925px);
}

.flow-panel {
  position: relative;
}

.flow-content {
  padding: 34px 33px 32px;
}

.flow-close {
  position: absolute;
  inset-block-start: 15px;
  inset-inline-end: 15px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 50%;
  background: rgba(255, 252, 245, .94);
  color: var(--ink, #223b2e);
  cursor: pointer;
  box-shadow: 2px 4px 11px #152b1928;
  transition: background .2s ease, transform .2s ease;
}

.flow-close:hover {
  background: #fff;
  transform: rotate(8deg);
}

.flow-close svg {
  pointer-events: none;
}

.flow-figure {
  margin: 0;
}

.flow-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 5px 15px;
  color: var(--flow-muted);
  background: #ede8dc;
  font-size: .74rem;
  overflow-wrap: anywhere;
}

.flow-figure figcaption a {
  color: inherit;
  text-decoration: underline;
}

.flow-cover {
  display: block;
  width: 100%;
  height: clamp(155px, 28vh, 250px);
  object-fit: cover;
}

.flow-figure + .flow-content {
  padding-block-start: 24px;
}

.flow-eyebrow {
  padding-inline-end: 48px;
  margin: 0 0 4px;
  color: var(--flow-brown);
  font-size: .88rem;
  font-weight: 760;
}

.flow-content h2 {
  margin: 0;
  color: var(--green, #214a36);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 850;
  line-height: 1.4;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.flow-content h2:focus {
  outline: 0;
}

.flow-content h3 {
  margin: 0;
  color: var(--green, #214a36);
  font-size: 1rem;
}

.flow-intro,
.flow-description {
  margin: 9px 0 19px;
  color: var(--flow-muted);
  line-height: 1.9;
}

.flow-location {
  display: flex;
  align-items: start;
  gap: .4rem;
  color: var(--flow-brown);
  margin: 9px 0 13px;
  line-height: 1.65;
}

.flow-location svg,
.flow-facts svg {
  margin-top: .2rem;
  flex: none;
}

.flow-note {
  padding: 10px 13px;
  margin: 0;
  color: #624a32;
  border: 1px solid #eadbbe;
  background: #f1e7d2;
  border-radius: 10px;
  line-height: 1.65;
  font-size: .9rem;
}

.flow-bookings {
  margin-block-start: 22px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--line, #dfddce);
}

.flow-bookings h3,
.flow-booking-code {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-bookings p {
  color: var(--flow-muted);
}

.flow-bookings ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 13px 0 0;
  list-style: none;
}

.flow-bookings li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #dfddce);
  border-radius: 12px;
  background: var(--flow-raised);
}

.flow-bookings li span {
  display: block;
  color: var(--flow-muted);
  font-size: .82rem;
}

.flow-bookings bdi,
.flow-booking-code bdi {
  border-radius: 7px;
  padding: 2px 6px;
  color: #315744;
  background: #e5ebdf;
  font: 600 .81rem/1.7 ui-monospace, SFMono-Regular, monospace;
}

.flow-booking-code {
  width: fit-content;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin: 16px 0 0;
  border-radius: 13px;
  background: #e5ebdf;
}

.flow-booking-code bdi {
  background: #f7f9f1;
}

.flow-booking-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 11px;
  color: #334c3a;
  background: #e8eadb;
  font-size: .9rem;
}

.flow-booking-total output {
  font-weight: 780;
}

.flow-message {
  margin: 0;
  color: var(--flow-brown);
  font-size: .9rem;
  line-height: 1.6;
}

.flow-message:empty {
  display: none;
}

.flow-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 17px 0;
}

.flow-facts:empty {
  display: none;
}

.flow-facts > div {
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid #ebe7d9;
  background: var(--flow-raised);
}

.flow-facts dt {
  display: flex;
  align-items: start;
  gap: .45rem;
  color: var(--flow-muted);
  font-size: .82rem;
}

.flow-facts dd {
  margin: 4px 0 0;
  color: var(--ink, #223b2e);
  font-size: .92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.flow-highlights {
  margin-block: 14px;
  padding-inline-start: 23px;
  color: var(--flow-muted);
}

.flow-highlights li {
  margin: 4px 0;
}

.flow-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.flow-dialog .flow-btn {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  position: relative;
  width: fit-content;
  padding: 7px 15px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 760;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
}

.flow-dialog .flow-btn[hidden],
.flow-dialog [data-flow="journal-preview"] {
  display: none;
}

.flow-dialog .btn-primary {
  border: 1px solid #284736;
  color: #fffcf3;
  background: #2e543e;
  box-shadow: 2px 4px 9px #1d392a3a, inset 0 1px 0 #ffffff29;
}

.flow-dialog .btn-ghost {
  border: 1px solid #dfdacc;
  color: #345443;
  background: var(--flow-raised);
  box-shadow: 2px 3px 7px #1d392a11, inset 0 1px 0 #fff;
}

.flow-dialog .btn-danger {
  border: 1px solid #8c4535;
  color: #fff8ed;
  background: #8c4535;
}

.flow-dialog .btn-primary:hover {
  background: #1d4230;
}

.flow-dialog .btn-ghost:hover {
  background: #f0eddf;
}

.flow-dialog .btn-danger:hover {
  background: #6f3629;
}

.flow-form {
  display: grid;
  gap: 14px;
  margin-block: 12px 0;
}

.flow-field {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--ink, #223b2e);
  font-size: .88rem;
  font-weight: 690;
}

.flow-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.flow-field input:not([type="file"]),
.flow-field select,
.flow-field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid #d6d2c4;
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--ink, #223b2e);
  background: #fffdf7;
  box-shadow: inset 2px 2px 5px #2035220b, 0 1px 1px #fff;
  line-height: 1.5;
  font-family: inherit;
  font-size: 1rem;
}

.flow-field input::placeholder,
.flow-field textarea::placeholder {
  color: #646b60;
  opacity: 1;
}

.flow-field textarea {
  resize: vertical;
}

.flow-dialog :focus-visible,
.flow-image-field:has(#flow-photo:focus-visible) label[for="flow-photo"] {
  outline: 2px solid #a65c39;
  outline-offset: 2px;
}

.flow-demo-code {
  margin-inline-start: 5px;
  padding-inline: 6px;
  border-radius: 5px;
  background: #fff7e9;
  letter-spacing: .16em;
}

.flow-journal-empty {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 17px;
  margin-block: 14px 20px;
  padding: 18px;
  border-radius: 16px;
  background: #ebe9da;
  border: 1px solid #e3e1d4;
}

.flow-journal-empty p {
  margin: 0;
  color: var(--flow-muted);
  line-height: 1.8;
}

.flow-journal-art {
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  border: 1px solid #fff8e8;
  border-radius: 16px;
  background: #f6efdf;
  color: #3c5844;
  box-shadow: 6px 8px 15px #283e2628, -4px -4px 9px #fffef872;
  transform: rotate(-8deg);
}

.flow-editor {
  display: grid;
  grid-template-columns: 1.24fr 1fr;
  align-items: start;
  gap: clamp(17px, 4vw, 31px);
  margin-block-start: 14px;
}

.flow-editor .flow-form {
  margin-block-start: 0;
}

.flow-inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.flow-theme-picker {
  padding: 0;
  border: 0;
  margin: 0;
  color: var(--ink, #223b2e);
  font-size: .88rem;
  font-weight: 690;
}

.flow-theme-picker legend {
  padding: 0;
  margin-block-end: 5px;
}

.flow-theme-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.flow-theme-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 7px;
  border: 1px solid #dcdbcc;
  border-radius: 7px;
  background: var(--flow-raised);
  font-size: .79rem;
  cursor: pointer;
}

.flow-theme-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.flow-theme-option:has(:checked) {
  border-color: #42694c;
  color: #244431;
  box-shadow: inset 0 0 0 1px #42694c;
}

.flow-theme-option:has(:focus-visible) {
  outline: 2px solid #a65c39;
  outline-offset: 2px;
}

.flow-swatch {
  width: 13px;
  height: 13px;
  border: 1px solid #25332230;
  border-radius: 50%;
  background: var(--theme-accent, #a48758);
}

.flow-image-field > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
  border: 0;
}

.flow-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.flow-tags:empty {
  display: none;
}

.flow-tag,
.flow-tags > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 12px;
  color: inherit;
  background: transparent;
  font-family: inherit;
  font-size: .75rem;
  overflow-wrap: anywhere;
}

.flow-tag {
  cursor: pointer;
}

.flow-live-preview h3 {
  margin: 0 0 9px;
}

.theme-classic {
  --theme-paper: #efe7d3;
  --theme-text: #4c452f;
  --theme-accent: #a48758;
  --theme-line: #a4875842;
}

.theme-autumn {
  --theme-paper: #f0d6b9;
  --theme-text: #632e20;
  --theme-accent: #b96841;
  --theme-line: #b9684161;
}

.theme-halloween {
  --theme-paper: #382e3d;
  --theme-text: #ffdebc;
  --theme-accent: #cb7b53;
  --theme-line: #ed9f694f;
}

.theme-forest {
  --theme-paper: #d7e2cb;
  --theme-text: #235140;
  --theme-accent: #4d7157;
  --theme-line: #4d71574f;
}

.flow-journal-paper {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 11px;
  min-height: 330px;
  padding: 15px;
  border: 1px solid var(--theme-line);
  border-radius: 11px 20px 20px 11px;
  color: var(--theme-text);
  background:
    radial-gradient(circle at 70% -30%, #fffcdb3e, transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 23px, var(--theme-line) 23px 24px),
    var(--theme-paper);
  box-shadow: inset -5px 0 12px #00000010, 4px 6px 11px #2b392525;
}

.flow-paper-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: .75rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.flow-paper-top span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.flow-stamp {
  --perforation: radial-gradient(circle at 50% 50%, transparent 0 3px, #000 3.5px);
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(85%, 215px);
  aspect-ratio: 1.35;
  padding: 10px;
  color: #624c3e;
  background: #fff5df;
  transform: rotate(-4deg);
  filter: drop-shadow(3px 5px 3px #21150349);
  mask:
    linear-gradient(#000, #000) center / calc(100% - 8px) calc(100% - 8px) no-repeat,
    var(--perforation) top left / 11px 8px repeat-x,
    var(--perforation) bottom left / 11px 8px repeat-x,
    var(--perforation) top left / 8px 11px repeat-y,
    var(--perforation) top right / 8px 11px repeat-y;
}

.flow-stamp img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.flow-stamp-empty {
  color: #745c45;
  background: #ffefd9;
}

.flow-stamp-empty::after {
  position: absolute;
  inset: 12px;
  content: "";
  border: 1px dashed #8e765762;
}

.flow-paper-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.flow-paper-copy strong {
  font-size: 1.2rem;
  font-weight: 850;
}

.flow-paper-copy p {
  margin: 0;
  white-space: pre-wrap;
}

.flow-paper-mood {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  font-size: .78rem;
}

.flow-paper-date {
  align-self: end;
  margin-block-start: 4px;
  font-size: .7rem;
}

.flow-journal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
  align-items: start;
  margin-block: 15px 19px;
}

.flow-entry-card {
  display: block;
  padding: 5px;
  border: 1px solid #e4ded0;
  border-radius: 15px 20px 20px 15px;
  color: var(--ink, #223b2e);
  background: var(--flow-raised);
  text-align: start;
  font-family: inherit;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.flow-entry-card:hover {
  transform: translateY(-3px);
  box-shadow: 3px 6px 12px #2b392518;
}

.flow-entry-edit {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 6px 4px;
  font-size: .8rem;
  font-weight: 700;
}

.flow-compact {
  min-height: 202px;
  padding: 11px;
}

.flow-compact .flow-stamp {
  width: min(78%, 115px);
  padding: 7px;
}

.flow-compact .flow-paper-copy strong {
  font-size: 1rem;
}

@keyframes flow-enter {
  from {
    opacity: 0;
    transform: translateY(9px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 690px) {
  .flow-content {
    padding: 27px 19px 22px;
  }

  .flow-editor {
    grid-template-columns: 1fr;
  }

  .flow-dialog [data-flow="journal-preview"] {
    display: inline-flex;
  }

  .flow-live-preview {
    border-block-start: 1px solid var(--line, #dfddce);
    padding-block-start: 12px;
  }
}

@media (max-width: 380px) {
  .flow-field-row,
  .flow-facts {
    grid-template-columns: 1fr;
  }

  .flow-close {
    inset-block-start: 9px;
    inset-inline-end: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-dialog[open] {
    animation: none;
  }

  .flow-close,
  .flow-entry-card {
    transition: none;
  }
}
