/* Presenter frame shared by the Colliers demo walkthroughs.
   Uses the Colliers demo page tokens from ../colliers.css. */
.aw {
  /* break out of the 1160px column so the portal gets most of the screen */
  margin-inline: calc(50% - min(700px, 50vw - 24px));
  background: var(--white); border: 1px solid var(--border-strong);
  border-radius: 1.1rem; box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.aw-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px 12px 20px; background: var(--ink); color: #fff;
}
.aw-top-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.aw-top h3 { font-size: 1rem; font-weight: 600; color: #fff; }
.aw-safe { font-size: 0.8rem; color: rgba(255, 255, 255, 0.82); }
.aw-safe::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #8fd19e; margin-right: 7px; vertical-align: 1px; }

.aw-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  grid-template-areas:
    "stage head"
    "stage notes"
    "controls notes";
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.aw-head { grid-area: head; padding: 20px 20px 0; border-left: 1px solid var(--border); background: var(--cream); }
.aw-notes { grid-area: notes; position: relative; min-height: 0; border-left: 1px solid var(--border); background: var(--cream); }
/* on desktop the notes scroll inside the column so the portal frame sets the height */
.aw-notes-inner { position: absolute; inset: 0; overflow-y: auto; padding: 16px 20px 20px; }
.aw-stage { grid-area: stage; display: flex; flex-direction: column; padding: 16px; background: #efe9e2; }
.aw-controls {
  grid-area: controls;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--white);
}

.aw-frame {
  position: relative; height: clamp(500px, calc(100vh - 250px), 760px);
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(42, 31, 23, 0.1), 0 12px 30px -16px rgba(42, 31, 23, 0.35);
}

/* Presenter panel */
.aw-stepno { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terracotta-ink); }
.aw-steptitle { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 700; line-height: 1.25; margin-top: 4px; }
.aw-bar { height: 4px; margin-top: 12px; border-radius: 4px; background: rgba(42, 31, 23, 0.08); overflow: hidden; }
.aw-bar span { display: block; height: 100%; background: var(--terracotta); transform-origin: left; transform: scaleX(var(--aw-fill, 0.1)); transition: transform 0.25s ease; }
.aw-select {
  margin-top: 14px; padding: 12px 14px; border-radius: 0.75rem;
  background: var(--white); border: 1.5px solid var(--terracotta-ink);
}
.aw-select-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terracotta-ink); }
.aw-select-text { display: block; margin-top: 2px; font-weight: 600; font-size: 0.95rem; line-height: 1.4; }
.aw-notes dl { margin: 0; }
.aw-notes dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); margin-top: 14px; }
.aw-notes dt:first-child { margin-top: 0; }
.aw-notes dl > div + div { margin-top: 14px; }
.aw-notes dd { margin: 3px 0 0; font-size: 0.93rem; line-height: 1.55; color: var(--ink-soft); }
.aw-resp dd { color: var(--ink); font-weight: 600; }
.aw-resp { margin-top: 14px; padding: 12px 14px; border-radius: 0.75rem; background: var(--terracotta-soft); border-left: 3px solid var(--terracotta-ink); }
.aw-resp dt { margin-top: 0 !important; color: var(--terracotta-ink); }
.aw.is-emphasis .aw-notes [data-aw-field="why"] { font-weight: 700; color: var(--ink); }
.aw.is-emphasis .aw-why-wrap { padding: 12px 14px; margin-top: 14px; border-radius: 0.75rem; background: var(--green-soft); }
.aw.is-emphasis .aw-why-wrap dt { margin-top: 0; color: var(--green-ink); }

.aw-steps { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.aw-steps-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); margin-bottom: 8px; }
.aw-list { display: flex; flex-direction: column; gap: 2px; }
.aw-list button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 6px 8px; border: 0; border-radius: 0.5rem; background: transparent;
  font: inherit; font-size: 0.85rem; color: var(--ink-soft); text-align: left; cursor: pointer;
}
.aw-list button:hover { background: rgba(42, 31, 23, 0.05); color: var(--ink); }
.aw-list-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-strong); background: var(--white);
  font-size: 0.72rem; font-weight: 700; color: var(--grey);
}
.aw-list button.is-done .aw-list-num { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }
.aw-list button[aria-current="step"] { background: var(--terracotta-soft); color: var(--ink); font-weight: 600; }
.aw-list button[aria-current="step"] .aw-list-num { background: var(--terracotta-ink); border-color: var(--terracotta-ink); color: #fff; }

/* Controls */
.aw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px; border-radius: 0.55rem;
  font-family: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.3;
  border: 1.5px solid var(--border-strong); background: var(--white); color: var(--ink);
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.aw-btn:hover:not(:disabled) { border-color: var(--terracotta-ink); color: var(--terracotta-ink); }
.aw-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.aw-btn-primary { background: var(--terracotta-ink); border-color: var(--terracotta-ink); color: #fff; }
.aw-btn-primary:hover:not(:disabled) { background: var(--terracotta-deep); border-color: var(--terracotta-deep); color: #fff; }
.aw-btn-quiet { border-color: transparent; background: transparent; }
.aw-controls-mid { display: flex; align-items: center; gap: 12px; }
.aw-progress { font-size: 0.92rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; min-width: 7.5em; text-align: center; }
.aw-full { min-height: 36px; padding: 6px 12px; background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.aw-full:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: #fff; }
.aw-full:focus-visible { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px #fff; }

/* Completion */
.aw-frame.is-complete { display: flex; align-items: center; justify-content: center; background: var(--base); }
.aw-complete { max-width: 520px; padding: 32px 24px; text-align: center; }
.aw-complete-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink);
}
.aw-complete-mark svg { width: 34px; height: 34px; stroke-width: 2.4; }
.aw-complete h4 { font-family: var(--font-heading); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.02em; margin-top: 18px; }
.aw-complete p { margin-top: 10px; font-size: 1.05rem; line-height: 1.6; color: var(--ink-soft); }
.aw-complete-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }

/* Full screen: portal and presenter guidance only */
.aw:fullscreen { width: 100vw; height: 100vh; margin: 0; border: 0; border-radius: 0; display: flex; flex-direction: column; }
.aw.is-expanded {
  position: fixed; inset: 0; z-index: 250; margin: 0; border: 0; border-radius: 0;
  display: flex; flex-direction: column;
}
.aw:fullscreen .aw-grid, .aw.is-expanded .aw-grid { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
.aw:fullscreen .aw-stage, .aw.is-expanded .aw-stage { display: flex; min-height: 0; }
.aw:fullscreen .aw-frame, .aw.is-expanded .aw-frame { flex: 1; height: auto; min-height: 0; }
.aw:fullscreen .aw-steps, .aw.is-expanded .aw-steps { display: none; }

/* Tablet and mobile: heading and instruction first, portal, controls, then notes */
@media (max-width: 1100px) {
  .aw-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "stage" "controls" "notes";
    grid-template-rows: auto;
  }
  .aw-head { border-left: 0; padding: 16px 16px 14px; border-bottom: 1px solid var(--border); }
  .aw-notes { border-left: 0; border-top: 1px solid var(--border); }
  .aw-notes-inner { position: static; overflow: visible; }
  .aw-head-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: end; }
  .aw-select { margin-top: 0; }
  .aw-steps { display: none; }
  .aw-notes dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .aw-notes dt { margin-top: 0; }
  .aw-resp { margin-top: 0; }
  .aw.is-emphasis .aw-why-wrap { margin-top: 0; }
  .aw:fullscreen .aw-grid, .aw.is-expanded .aw-grid { grid-template-rows: auto minmax(0, 1fr) auto auto; }
  .aw:fullscreen .aw-notes, .aw.is-expanded .aw-notes { display: none; }
}
@media (max-width: 760px) {
  .aw { margin-inline: calc(50% - 50vw + 8px); border-radius: 0.9rem; }
  .aw-top { padding: 10px 12px 10px 16px; }
  .aw-stage { padding: 8px; }
  .aw-frame { height: 600px; }
  .aw-head-inner { grid-template-columns: 1fr; gap: 12px; }
  .aw-notes dl { grid-template-columns: 1fr; gap: 0; }
  .aw-notes dt { margin-top: 14px; }
  .aw-resp, .aw.is-emphasis .aw-why-wrap { margin-top: 14px; }
  .aw-controls { padding: 10px 12px; }
  .aw-controls .aw-btn { padding: 8px 12px; }
  .aw-progress { min-width: 0; }
  .aw-controls-mid { order: 3; width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .aw *, .aw *::before, .aw *::after { animation: none !important; transition: none !important; }
}

/* Arrangement journey additions: who completes each stage, simulation control */
.aw-owner { margin-top: 6px; font-size: 0.85rem; color: var(--ink-soft); }
.aw-owner-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); margin-right: 4px; }
.aw-sim { display: block; text-align: center; width: 100%; margin-top: 10px; border-style: dashed; border-color: var(--green-ink); color: var(--green-ink); background: var(--green-soft); }
.aw-sim::before { content: "Demo control \00b7\00a0"; font-weight: 500; }
.aw-sim:hover:not(:disabled) { border-color: var(--green-ink); color: var(--green-ink); background: #d7eadb; }
.aw-sim:disabled { opacity: 0.7; }
.aw-sim[hidden] { display: none; }
.aw-list button:disabled { opacity: 0.45; cursor: not-allowed; }
.aj-complete { max-width: 600px; }
.aj-next { text-align: left; margin: 18px auto 0; display: flex; flex-direction: column; gap: 10px; max-width: 480px; }
.aj-next li { display: flex; gap: 10px; align-items: flex-start; font-size: 1rem; line-height: 1.5; color: var(--ink-soft); }
.aj-next svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px; color: var(--green-ink); }
