.topbar > .w09-guide-entry,
.w09-preview-tools > .w09-guide-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  margin-inline-start: auto;
  padding: 4px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: #4b6b74;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.w09-guide-entry[hidden] {
  display: none !important;
}

.topbar > .w09-guide-entry:hover,
.w09-preview-tools > .w09-guide-entry:hover {
  background: #e5efed;
}

.w09-guide-entry svg {
  flex: none;
  width: 24px;
  height: 24px;
  fill: #e9f5f0;
  stroke: #208281;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.w09-guide-entry .w09-book-page {
  fill: #fff;
  transform-origin: 14px 13px;
  transition: transform 350ms ease;
}

.w09-guide-entry:is(:hover, :focus-visible) .w09-book-page {
  transform: rotateY(35deg);
}

.w09-guide-entry:focus-visible,
.w09-guide button:focus-visible {
  outline: 1px solid #648d80;
  outline-offset: 1px;
}

.w09-preview-tools > .w09-preview-refresh {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #123f4a;
  color: #fff;
  cursor: pointer;
}

.w09-guide [hidden] { display: none !important; }

.w09-guide {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 12px;
  overflow: hidden;
  border: 0;
  color: #173842;
  background: transparent;
}

.w09-guide[open] {
  display: grid;
  place-items: center;
}

.w09-guide::backdrop { background: rgb(25 48 51 / 35%); }
.w09-guide.has-spot::backdrop { background: transparent; }

.w09-guide-spot {
  display: none;
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #b4ddd4;
  border-radius: 12px;
  box-shadow: 0 0 0 200vmax rgb(25 48 51 / 30%);
}

.w09-guide.has-spot .w09-guide-spot { display: block; }

.w09-guide-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(100%, 470px);
  max-height: calc(100dvh - 24px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8e8e2;
  border-radius: 18px;
  background: linear-gradient(145deg, #fff 62%, #edf7f3);
  box-shadow: 0 14px 44px #12262639;
}

.w09-guide.has-spot .w09-guide-card {
  position: absolute;
  width: min(calc(100% - 24px), 470px);
  left: var(--w09-guide-left);
  top: var(--w09-guide-top);
}

.w09-guide.has-scene .w09-guide-card {
  width: min(100%, 1020px);
}

.w09-guide-bar,
.w09-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 16px;
}

.w09-guide-bar {
  border-bottom: 1px solid #e6efeb;
}

.w09-guide-bar-text,
.w09-guide-controls,
.w09-guide-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.w09-guide-bar-text { flex-wrap: wrap; gap: 4px 10px; }

.w09-guide-kicker {
  color: #356c68;
  font-size: 12px;
  font-weight: 680;
}

.w09-guide-example-tag {
  padding: 3px 8px;
  border-radius: 6px;
  background: #f5eddd;
  color: #765a25;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.w09-guide button {
  min-height: 34px;
  padding: 5px 11px;
  border: 1px solid #dce9e5;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #365a61;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.w09-guide button:hover { background: #eaf4f1; }
.w09-guide .w09-guide-close { flex: none; border-color: transparent; background: transparent; }

.w09-guide button.w09-guide-primary {
  border-color: transparent;
  background: #0c6b72;
  color: #fff;
}

.w09-guide button.w09-guide-primary:hover { background: #0e5359; }

.w09-guide-dots { gap: 5px; }
.w09-guide-dots span { width: 5px; height: 5px; border-radius: 6px; background: #c4d9d4; }
.w09-guide-dots .is-current { width: 15px; background: #188279; }

.has-portrait .w09-guide-body {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
}

.w09-guide-portrait {
  display: grid;
  justify-items: center;
  padding: 7px 0 0 8px;
  user-select: none;
}

.w09-guide-portrait img {
  display: block;
  width: 88px;
  height: 120px;
  object-fit: contain;
  object-position: center bottom;
  mask-image: linear-gradient(to bottom, #000 83%, transparent);
}

.w09-guide-content { min-width: 0; padding: 12px 16px 2px; }
.w09-guide-content h2 { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; }
.w09-guide-content h2:focus { outline: none; }
.w09-guide-copy { margin: 5px 0 0; color: #48656e; font-size: 14px; line-height: 1.55; }

.w09-guide-stage {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  max-height: min(520px, 57dvh);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border-bottom: 1px solid #e4eeea;
  background: #f3f7f5;
}

.w09-guide-stage:focus-visible { outline: 1px solid #648d80; outline-offset: -1px; }

.w09-demo-grid,
.w09-demo-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.w09-demo-panel {
  min-width: 0;
  padding: 15px;
  border: 1px solid #dce9e5;
  border-radius: 12px;
  background: #fff;
}

.w09-demo-panel.is-focused {
  border-color: #c9a76c;
  background: #fffdf8;
}

.w09-demo-panel h3 { margin: 0 0 12px; font-size: 16px; line-height: 1.35; }
.w09-demo-panel p { margin: 8px 0; }
.w09-demo-field, .w09-demo-file, .w09-demo-choice { overflow-wrap: anywhere; }

.w09-demo-field {
  display: grid;
  flex: 1;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid #dce8e4;
  border-radius: 8px;
}

.w09-demo-field span,
.w09-demo-muted { color: #56716e; font-size: 12px; line-height: 1.45; }
.w09-demo-field strong { font-size: 14px; }

.w09-demo-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px;
  border-radius: 9px;
  background: #edf6f1;
}

.w09-demo-badge {
  display: inline-block;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 6px;
  background: #e8f4eb;
  color: #36664f;
  font-size: 12px;
}

.w09-demo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.w09-demo-fields + .w09-demo-actions,
.w09-demo-table + .w09-demo-actions { margin-top: 12px; }

.w09-demo-control {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid #dce8e4;
  border-radius: 8px;
  background: #fff;
}

.w09-demo-control.is-primary { background: #154852; border-color: #154852; color: #fff; }
.w09-demo-table { margin-top: 7px; }
.w09-demo-table table {
  width: 100%;
  min-width: 0; /* The shared table minimum is wider than a guide panel. */
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
.w09-demo-table :is(th, td) { padding: 7px 8px; border-bottom: 1px solid #e6efeb; overflow-wrap: anywhere; }
.w09-demo-table th { color: #496863; background: #f4f8f5; font-weight: 550; }
.w09-demo-amount { font-size: 24px; font-weight: 710; font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  .w09-guide-stage { padding: 12px; gap: 9px; }
  .w09-demo-grid { grid-template-columns: 1fr; gap: 9px; }
  .w09-demo-fields { gap: 8px; }
  .w09-demo-panel { padding: 10px; }
}

@media (max-width: 460px), (max-height: 520px) {
  .has-portrait .w09-guide-body { display: block; }
  .w09-guide-portrait { display: none; }
  .w09-guide-bar, .w09-guide-footer, .w09-guide-content { padding-inline: 11px; }
  .w09-guide-copy { font-size: 13px; }
}


.w09-demo-delivery .w09-demo-field + .w09-demo-field { margin-top: 7px; }

.w09-demo-delivery-toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #155b5d;
  font-size: 14px;
  font-weight: 650;
}

.w09-demo-costs { margin: 0; }

.w09-demo-costs > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #e6efeb;
}

.w09-demo-costs dt { min-width: 0; font-size: 14px; }
.w09-demo-costs dt small { display: block; margin-top: 3px; color: #56716e; font-size: 12px; }
.w09-demo-costs dd { margin: 0; white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }

.w09-demo-costs .w09-demo-cost-total {
  margin-top: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: #eaf5ee;
  color: #124952;
}

.w09-demo-cost-total dt { font-weight: 700; }
.w09-demo-cost-total dd { font-size: clamp(18px, 2.4vw, 24px); font-weight: 710; }

@media (max-width: 620px) {
  .w09-demo-delivery .is-focused { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  .w09-guide-entry .w09-book-page { transition: none; transform: none !important; }
}
