:root {
  color-scheme: light;
  --purple: #6344a9;
  --purple-deep: #4c2f8a;
  --lavender: #efe8f8;
  --lavender-soft: #f6f2fb;
  --green: #2f9e6b;
  --green-soft: #e5f6ee;
  --danger: #9b2c2c;
  --danger-soft: #fdeaea;
  --ink: #2a2438;
  --muted: #6b6280;
  --line: #e4dced;
  --card: #fff;
  --page: #f4f0f8;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  line-height: 1.55;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
img, svg { max-width: 100%; height: auto; }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -5rem; background: var(--card); color: var(--ink); padding: .75rem 1rem; z-index: 10; }
.skip-link:focus { top: 1rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  min-height: 4rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand { color: var(--purple); font-size: 1.125rem; font-weight: 800; text-decoration: none; }
.header-nav { display: flex; align-items: center; gap: 1.25rem; }
.header-nav a, .header-nav .text-link, .text-link {
  color: var(--muted);
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
}
.intent-edit {
  margin-left: .5rem;
  font-size: .8rem;
  font-weight: 650;
  color: var(--purple);
}
.help-button, .secondary {
  border: 1px solid var(--purple);
  border-radius: 999px;
  background: var(--card);
  color: var(--purple);
  padding: .45rem 1rem;
}
.secondary.future { border-style: dashed; color: var(--muted); }

.journey-nav {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: .85rem 0 0;
}
.journey-nav .steps {
  display: flex;
  gap: .35rem;
  padding: 0;
  margin: 0;
  list-style: none;
  overflow-x: auto;
}
.journey-nav .steps li { flex: 1; min-width: 5.5rem; }
.journey-nav .steps button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .4rem;
  border: 0;
  border-top: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: .55rem .2rem 0;
  text-align: left;
  font: inherit;
}
.journey-nav .steps .step-num {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--purple-deep);
  font-size: .75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.journey-nav .steps [aria-current="step"] {
  color: var(--purple-deep);
  border-color: var(--purple);
  font-weight: 700;
}
.journey-nav .steps [aria-current="step"] .step-num {
  color: #fff;
  background: var(--purple);
}
.journey-nav .steps button.is-complete {
  border-color: var(--green);
  color: var(--ink);
}
.journey-nav .steps button.is-complete .step-num {
  background: var(--green-soft);
  color: var(--green);
}
.journey-nav .steps button.is-locked {
  opacity: .45;
  cursor: not-allowed;
}
.journey-nav .steps .step-label { white-space: nowrap; }
.step-empty {
  display: grid;
  gap: .75rem;
  background: var(--lavender-soft);
  border-style: dashed;
}
.step-empty .primary { justify-self: start; }
.empty-hint { margin: .75rem 0 0; color: var(--muted); font-size: .9rem; }
.tile-grid .tile[hidden], .step-guidance[hidden], .step-empty[hidden] { display: none !important; }
.adaptive-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.step-caption { margin: 0; color: var(--muted); font-size: .85rem; }
.persist-hint { margin: .15rem 0 .85rem; color: var(--muted); font-size: .8rem; }
.step-guidance {
  display: grid;
  gap: .85rem;
  background: var(--lavender-soft);
}
.step-guidance .primary { justify-self: start; }
.tile .secondary[data-goto-step] { margin-top: .75rem; }
.tile.is-current {
  border-color: var(--purple);
  border-width: 2px;
}
.tile.is-complete { opacity: .92; }

main.workspace {
  width: min(1440px, calc(100% - 2rem));
  min-width: 0;
  margin: 0 auto;
  padding: 1.25rem 0 5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(22rem, 2.3fr);
  grid-template-areas:
    "conversation understanding"
    "conversation main";
  gap: 1.15rem;
  align-items: start;
}
.conversation { grid-area: conversation; }
.workspace-main { grid-area: main; display: grid; gap: 1rem; min-width: 0; }
.workspace-label { margin: 0; font-weight: 800; font-size: .9rem; color: var(--purple-deep); }

.panel, .tile-grid .tile { border: 1px solid var(--line); border-radius: .75rem; background: var(--card); }
.panel { padding: 1rem 1.15rem 1.2rem; }
.eyebrow { margin: 0 0 .2rem; color: var(--purple); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.15rem; }
.subtitle, .hint, .disclosure, .reassurance, #message-hint { color: var(--muted); font-size: .85rem; }
.conversation > header { display: flex; justify-content: space-between; gap: 1rem; }
.status { align-self: start; border-radius: 999px; padding: .3rem .65rem; background: var(--lavender); color: var(--purple-deep); font-size: .75rem; font-weight: 700; }
.welcome-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .8rem;
  align-items: center;
  padding: .9rem 1rem;
  border: 0;
  border-radius: .75rem;
  color: #fff;
  background: linear-gradient(120deg, var(--purple) 0%, #8b6ad4 55%, #b48ad9 100%);
}
.welcome-copy { display: grid; gap: .25rem; }
.welcome-copy strong { font-size: 1.05rem; }
.welcome-art { width: 4.75rem; border-radius: .6rem; }
.messages { min-height: 8rem; margin: 1rem 0 .65rem; padding: .75rem; border-radius: .5rem; background: var(--lavender-soft); }
.messages p { width: fit-content; max-width: 80%; margin: .45rem 0; padding: .65rem .8rem; border-radius: .7rem; }
.assistant-message { background: var(--card); border: 1px solid var(--line); }
.assistant-message::before {
  content: "";
  display: inline-block;
  width: .85rem;
  height: .85rem;
  margin-right: .4rem;
  border-radius: 50%;
  background: var(--purple);
  vertical-align: -1px;
}
.customer-message { margin-left: auto !important; color: #fff; background: var(--purple); }
.customer-message.is-pending { opacity: .72; }
.disclosure { margin: 0 0 .85rem; }
.suggestions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 .65rem; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--purple-deep);
  padding: .3rem .7rem;
  font-size: .8rem;
  font-weight: 650;
}
.chip:hover { border-color: var(--purple); }
.composer { display: flex; gap: .5rem; align-items: flex-end; }
.composer textarea { flex: 1; }
label { display: block; margin: .55rem 0 .3rem; font-weight: 700; }
textarea, input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: .5rem;
  padding: .55rem .7rem;
  color: inherit;
  background: var(--card);
}
.primary, .send {
  min-height: 2.75rem;
  border: 0;
  border-radius: .5rem;
  padding: .55rem 1rem;
  color: #fff;
  background: var(--purple);
  font-weight: 700;
}
.primary:hover, .send:hover { background: var(--purple-deep); }
.primary.lock::before { content: "🔒 "; }
.form-error {
  margin: .65rem 0 0;
  padding: .65rem .75rem;
  border-radius: .5rem;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .85rem;
  font-weight: 650;
}
.understanding { grid-area: understanding; background: var(--lavender-soft); }
.understanding dl { display: grid; grid-template-columns: 1fr 1.5fr; gap: .5rem; }
.understanding dt { color: var(--muted); }
.understanding dd { margin: 0; font-weight: 650; }
.understanding dd.is-updated { color: var(--purple-deep); }
.intent-status {
  margin: .45rem 0 .7rem;
  padding: .45rem .65rem;
  border-radius: .45rem;
  background: var(--card);
  color: var(--purple-deep);
  font-size: .85rem;
  font-weight: 650;
}

.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.card { border: 1px solid var(--line); border-radius: .65rem; padding: .75rem; display: grid; gap: .4rem; background: var(--card); }
.card .thumb { width: 100%; min-height: 8rem; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; border-radius: .45rem; background: var(--lavender); }
.selection-thumb { width: min(100%, 16rem); min-height: 8rem; aspect-ratio: 4 / 3; object-fit: cover; object-position: center; border-radius: .45rem; background: var(--lavender); }
.photo-credit { margin: .65rem 0 0; }
.photo-credits { margin: .35rem 0 .75rem; color: var(--muted); font-size: .85rem; }
.photo-credits summary {
  cursor: pointer;
  font-weight: 650;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.photo-credits ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.photo-credits a { color: var(--purple-deep); }
.card .price { margin: 0; font-weight: 800; color: var(--purple-deep); }
.badge {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: .15rem .55rem;
  background: var(--green-soft);
  color: var(--green);
  font-size: .7rem;
  font-weight: 700;
}
.badge.unavailable { background: var(--lavender); color: var(--muted); }
fieldset { border: 0; padding: 0; margin: .5rem 0; }
fieldset label { font-weight: 500; display: flex; gap: .5rem; align-items: center; }
.destination-card, .payment-card, .latest-status, .confirm-panel {
  margin: .75rem 0;
  padding: .8rem;
  border-radius: .65rem;
  background: var(--lavender-soft);
}
.destination-label { margin: 0 0 .35rem; font-weight: 800; color: var(--purple-deep); }
.confirm-facts { margin: 0; display: grid; gap: .55rem; }
.confirm-facts > div { display: grid; gap: .15rem; }
.confirm-facts dt { font-size: .75rem; color: var(--muted); font-weight: 650; }
.confirm-facts dd { margin: 0; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.choice { display: flex; gap: .5rem; align-items: flex-start; font-weight: 500; margin: .45rem 0; }
.choice code { font-size: .85em; }
.confirm-ack { margin: .75rem 0 1rem; font-weight: 650; }
.timeline { padding-left: 1.1rem; }
.timeline li { margin: .4rem 0; color: var(--muted); }
.timeline li.done { color: var(--green); font-weight: 650; }
.timeline li.done::marker { color: var(--green); }
.confirmed-banner {
  margin: .6rem 0;
  padding: .7rem .85rem;
  border-radius: .6rem;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}
.tracking-layout { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: start; }
.latest-status img { width: 100%; border-radius: .5rem; }
.support-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
#escalation-form .primary, #support-form .primary, #correct-form .primary { margin-top: .75rem; }
#escalation-ack { margin-top: .75rem; font-weight: 650; }
#summary-lines { display: grid; gap: .35rem; }
.charge { display: flex; justify-content: space-between; color: var(--muted); }
#summary-total { font-weight: 800; color: var(--purple-deep); }

.aso {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  z-index: 5;
}
dialog { width: min(32rem, calc(100% - 2rem)); border: 0; border-radius: 1rem; padding: 2rem; box-shadow: 0 20px 60px rgba(76, 47, 138, .25); }
dialog::backdrop { background: rgba(42, 36, 56, .45); }
.notice { position: fixed; right: 1rem; bottom: 5.5rem; max-width: 28rem; border-radius: .6rem; padding: .9rem 1rem; color: #fff; background: var(--purple-deep); }
.notice.is-error { background: var(--danger); }

@media (max-width: 60rem) {
  /* T-01 and T-02 are workspace siblings. Nested order cannot swap them. */
  main.workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "conversation understanding"
      "main main";
  }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 40rem) {
  .site-header { min-height: 4rem; padding-inline: 1rem; position: relative; z-index: 5; }
  .help-button, .primary, .send, .secondary, .aso, .operator .text-link { min-height: 44px; }
  .journey-nav {
    width: min(calc(100% - 2rem), 1440px);
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--page);
    padding-bottom: .35rem;
    min-width: 0;
  }
  .journey-nav .steps {
    gap: .12rem;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
  }
  .journey-nav .steps li { flex: 1 1 0; min-width: 0; }
  .journey-nav .steps button {
    flex-direction: column;
    align-items: center;
    font-size: .7rem;
    padding: .45rem 0 0;
    min-width: 0;
    min-height: 44px;
    gap: .12rem;
  }
  .journey-nav .steps .step-num { width: 1.35rem; height: 1.35rem; font-size: .68rem; }
  .journey-nav .steps .step-label { font-size: 0; max-width: 100%; }
  .journey-nav .steps .step-label::after {
    content: attr(data-short);
    display: block;
    font-size: .62rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  main.workspace {
    width: min(calc(100% - 2rem), 1440px);
    min-width: 0;
    overflow-x: clip;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
    grid-template-columns: 1fr;
    grid-template-areas:
      "conversation"
      "understanding"
      "main";
  }
  /* Header Help already opens ASO (ADR-004). Hide the duplicate FAB so it
     cannot cover full-width Send or other primary actions on T-01. */
  /* Path B Dual-Viewport: Mobile Linear Concierge (<768px / 40rem) */
  .aso { display: none; }
  .panel { padding: 1rem; border-radius: .75rem; max-width: 100%; }
  .welcome-card { grid-template-columns: 1fr; }
  .messages p { max-width: 92%; overflow-wrap: anywhere; }
  textarea { min-height: 7rem; }
  .primary, .send { width: 100%; box-shadow: 0 4px 12px rgba(99, 68, 169, 0.2); }
  .understanding dl { grid-template-columns: 1fr; }
  .tile-grid, .cards, .tracking-layout { grid-template-columns: 1fr; }
  .composer { flex-direction: column; }
  .notice { left: .5rem; right: .5rem; bottom: max(1rem, env(safe-area-inset-bottom, 0px)); max-width: none; }
  /* Non-blocking bottom-sheet drawer for Contact Florist & ASO on mobile */
  dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0 0;
    border-radius: 1.25rem 1.25rem 0 0;
    padding: 1.5rem 1.25rem max(1.5rem, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(42, 36, 56, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .status, .primary, .send, .aso, .badge, .welcome-card { border: 1px solid ButtonText; }
}

body.operator { background: var(--page); }
.operator .header-note {
  margin: 0;
  max-width: 22rem;
  color: var(--muted);
  font-size: .8rem;
  text-align: right;
}
.operator-shell {
  width: min(1440px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
  display: grid;
  gap: 1.15rem;
}
.operator-banner {
  margin: 0;
  padding: .85rem 1rem;
  border: 1px dashed var(--purple);
  border-radius: .75rem;
  background: var(--lavender-soft);
  color: var(--ink);
}
.operator-banner details { margin-top: .45rem; color: var(--muted); font-size: .85rem; }
.operator-banner summary { cursor: pointer; font-weight: 650; color: var(--purple-deep); }
.operator-mode { justify-self: start; }
.operator-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  align-items: start;
}
.operator .panel > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.operator h1 { font-size: 1.35rem; line-height: 1.2; margin: 0; }
.operator-table { width: 100%; border-collapse: collapse; }
.operator-table th, .operator-table td {
  text-align: left;
  padding: .7rem .55rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.operator-table tbody tr.is-selected { background: var(--lavender-soft); }
.operator-table .text-link { color: var(--purple); font-weight: 650; }
.operator-empty { color: var(--muted); padding: 1rem .55rem; }
.operator-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.operator-facts { margin: 0; display: grid; grid-template-columns: 8.5rem 1fr; gap: .45rem .75rem; }
.operator-facts dt { color: var(--muted); font-size: .8rem; }
.operator-facts dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.operator-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.operator-transcript { min-height: 8rem; }
.operator h1, .operator h2, .operator h3 { color: var(--purple-deep); }
.operator h3 { margin: 1rem 0 .35rem; font-size: 1rem; }
.operator h3:first-child { margin-top: 0; }
.operator .hint { color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.operator-secondary { opacity: .96; }
.operator-secondary h2 { font-size: 1.05rem; }

@media (max-width: 60rem) {
  .operator-split, .operator-facts { grid-template-columns: 1fr; }
  .operator .header-note { max-width: none; text-align: left; }
}

/* UX-P03: WCAG 2.1 AAA 44x44px Minimum Tap Target Enforcement */
button, input[type="button"], input[type="submit"], select, .stem-counter-btn {
  min-height: 44px;
  min-width: 44px;
}

