/*
 * The Website page (src/views/websiteView.js): the steps on the left, her
 * real site on the right. The page fits the window; the left column scrolls on
 * its own and the preview fills the rest.
 *
 * The preview itself is a layer on <body> (`.wb-layer`), laid over the empty
 * box the page draws (`.wb-slot`), under the band, the menu and the side panel.
 */

.wb-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--band-height) - var(--gap-3) - var(--gap-4));
  min-height: 520px;
}

.wb-page .page__head {
  flex: none;
}

.wb {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: var(--gap-3);
}

.wb-side {
  /* Its width never comes from its words (420 wide, as real content always
     makes it, down to 360 on a narrow window): drawn grey while her site is read,
     it would be a few pixels narrower, and the preview beside it would move. */
  contain: inline-size;
  contain-intrinsic-inline-size: 420px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px var(--gap-2) 2px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-2);
}

.wb-side > .notice {
  margin-bottom: 0;
}

.wb-card {
  padding: var(--gap-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-card .card__title {
  margin: 0;
}

.wb-small {
  margin: 0;
  font-size: var(--size-small);
  color: var(--ink-2);
}

.wb-status {
  display: flex;
  align-items: center;
  gap: var(--gap-1);
  font-weight: 700;
}

.wb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}

.wb-dot--live {
  background: var(--green);
}

.wb-address {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wb-address__url {
  display: block;
  min-width: 0;
  font-weight: 600;
  color: var(--brand);
}

/* Each part whole: the line breaks only between them (E3). */
.wb-address__host,
.wb-address__slug {
  white-space: nowrap;
}

.wb-address-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-2);
}

.wb-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--gap-1);
}

.wb-actions svg,
.wb-step svg,
.wb-line svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.wb-actions--main {
  padding-top: 4px;
}

/* The steps, and the parts of a live site: a list of rows, the open one with
   its controls under it. */
.wb-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wb-step {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.wb-step:hover {
  background: var(--hover);
}

.wb-step.is-on {
  background: var(--chip);
}

.wb-step__n {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line-strong);
  font-size: var(--size-small);
  font-weight: 700;
}

.wb-step.is-on .wb-step__n {
  background: var(--brand);
  box-shadow: none;
  color: var(--on-fill);
}

.wb-step__name {
  flex: 1;
  font-weight: 600;
}

.wb-step__value {
  color: var(--ink-2);
  text-align: right;
}

.wb-step__chev {
  color: var(--ink-2);
}

.wb-step[aria-expanded="true"] .wb-step__chev {
  transform: rotate(90deg);
}

.wb-step__body {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-badge {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--red);
  color: var(--on-fill);
  font-size: var(--size-small);
  font-weight: 700;
  text-align: center;
}

.wb-danger-link {
  align-self: flex-start;
  background: transparent;
  color: var(--red);
  padding-left: 12px;
}

/* A question asked in place before it acts. */
.wb-ask {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
  padding: 12px;
  border-radius: var(--radius);
  background: var(--chip);
}

.wb-ask__title {
  margin: 0;
  font-weight: 700;
}

.wb-ask__body {
  margin: 0;
}

.wb-pending__text {
  margin: 0;
  font-weight: 600;
}

/* Designs and colours: one choice of several. */
.wb-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-1);
}

.wb-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line-strong);
  color: var(--ink);
  text-align: left;
  font-weight: 500;
}

.wb-choice:hover {
  background: var(--hover);
}

.wb-choice.is-on {
  box-shadow: 0 0 0 2px var(--brand);
  font-weight: 700;
}

.wb-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
}

/* Your business: one line each, opening the side panel. */
.wb-lines {
  gap: 0;
}

.wb-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.wb-line:last-child {
  border-bottom: 0;
}

.wb-line:hover {
  background: var(--hover);
}

.wb-line__label {
  flex: 1;
  font-weight: 600;
}

.wb-line__value {
  text-align: right;
  overflow-wrap: anywhere;
}

.wb-line__value--dim {
  color: var(--ink-2);
}

/* Photos: every spot of the design. */
.wb-spots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
}

.wb-spot {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line);
}

.wb-spot .notice {
  margin-bottom: 0;
}

.wb-spot__name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

/* About you. */
.wb-about {
  min-height: 180px;
}

.wb-count {
  align-self: flex-end;
}

.wb-offer {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
  padding: 12px;
  border-radius: var(--radius);
  background: var(--chip);
}

.wb-offer__text {
  margin: 0;
  white-space: pre-wrap;
}

.wb-tick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
}

.wb-tick input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
}

.wb-ticks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: var(--gap-2);
}

.wb-failed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--gap-1);
  max-width: 560px;
}

/* The side panels. */
.panel-form .wb-small {
  margin-bottom: var(--gap-1);
}

.wb-add {
  display: flex;
  gap: var(--gap-1);
  margin-bottom: var(--gap-2);
}

.wb-towns {
  list-style: none;
  margin: 0 0 var(--gap-1);
  padding: 0;
}

.wb-towns li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-1);
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.wb-day {
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.wb-day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-1);
}

.wb-day__name {
  font-weight: 700;
}

.wb-day__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--gap-1);
}

.wb-mode {
  width: auto;
  min-width: 170px;
}

.wb-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-time .field-input {
  width: 140px;
}

.wb-day > .btn {
  align-self: flex-start;
  min-height: 32px;
  padding: 4px 12px;
}

.wb-slug-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Not the panel's own space under a line (.panel-form .wb-small): in a row centred
   on the box, that space lifted "briofield.com/" above the box's text (E11). */
.panel-form .wb-slug-row .wb-small {
  margin-bottom: 0;
}

.wb-logo {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gap-1);
  border-radius: var(--radius);
  background: var(--hover);
  box-shadow: 0 0 0 1px var(--line);
}

.wb-logo__img {
  max-width: 90%;
  max-height: 140px;
  object-fit: contain;
}

.panel-form .wb-actions,
.panel-form .wb-tick {
  margin-bottom: var(--gap-1);
}

.wb-quotes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-1);
}

.wb-quote {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--line);
}

.wb-quote.is-new {
  box-shadow: 0 0 0 2px var(--brand);
}

.wb-quote__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-1);
}

.wb-quote__name {
  font-weight: 700;
}

.wb-quote__text {
  margin: 4px 0;
  white-space: pre-wrap;
}

/* The right side: Phone or Computer, and the box the preview is laid over. */
.wb-view {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wb-view__bar {
  display: flex;
  justify-content: center;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--chip);
}

.seg__item {
  min-height: 34px;
  padding: 6px 18px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
}

.seg__item[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--card-ring);
}

.wb-slot {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius-lg);
  background: var(--chip);
}

.wb-layer {
  position: fixed;
  z-index: 10;
  display: flex;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.wb-layer[hidden] {
  display: none;
}

.wb-stage {
  position: relative;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--card-ring), 0 2px 8px rgba(16, 24, 40, 0.08);
}

.wb-layer[data-mode="phone"] .wb-stage {
  border-radius: 20px;
}

.wb-frame {
  display: block;
  border: 0;
  background: #ffffff;
  transform-origin: top left;
}

.wb-updating {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  font-size: var(--size-small);
  font-weight: 600;
}

.wb-updating[hidden],
.wb-note[hidden],
.wb-message[hidden],
.wb-message .btn[hidden] {
  display: none;
}

.wb-note {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(12, 26, 46, 0.92);
  color: var(--on-fill);
  text-align: left;
  font-size: var(--size-small);
}

.wb-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-2);
  padding: var(--gap-3);
  background: var(--chip);
  text-align: center;
}

.wb-message__text {
  margin: 0;
  max-width: 420px;
  color: var(--ink);
}
