.product-layer {
  position: fixed;
  z-index: 80;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(26, 23, 20, 0.72);
  backdrop-filter: blur(6px);
}

.layer-panel {
  width: min(100%, 520px);
  min-height: 100%;
  margin-left: auto;
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-layer);
}

.layer-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: grid;
  min-height: 68px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  color: var(--white);
  background: var(--ink);
}

.layer-header__title {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.08rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-control {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.layer-control .ui-icon { width: 21px; height: 21px; }

.layer-body {
  padding: 30px 24px max(38px, env(safe-area-inset-bottom));
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--copper-deep);
  font-size: 0.68rem;
  font-weight: 600;
}

.progress-track {
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  background: rgba(26,23,20,0.12);
}

.progress-track span {
  display: block;
  width: 25%;
  height: 100%;
  background: var(--copper);
  transition: width var(--motion-normal) ease;
}
.progress-track[data-progress="50"] span { width: 50%; }
.progress-track[data-progress="75"] span { width: 75%; }
.progress-track[data-progress="100"] span { width: 100%; }

.flow-title,
.qr-title {
  margin: 30px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 2.55rem);
  font-weight: 400;
  line-height: 1.1;
}

.flow-note,
.qr-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.65;
}

.choice-list,
.service-choice-list,
.counter-list,
.language-list,
.channel-list,
.summary-list {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.choice-row,
.service-choice,
.language-choice,
.channel-choice {
  --icon-stroke: 1.6;
  display: grid;
  width: 100%;
  min-height: 72px;
  padding: 12px 4px;
  grid-template-columns: 42px minmax(0,1fr) 24px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.choice-row { grid-template-columns: minmax(0,1fr) 24px; }

.choice-row.is-selected,
.service-choice.is-selected,
.language-choice.is-selected,
.channel-choice.is-selected {
  color: var(--copper-deep);
  background: rgba(196,137,110,0.08);
}

.choice-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.choice-icon .ui-icon { width: 20px; height: 20px; }

.choice-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.choice-copy strong { font-size: 0.91rem; font-weight: 600; }
.choice-copy small { color: var(--muted); font-size: 0.69rem; line-height: 1.4; }
.choice-row > .ui-icon,
.service-choice > .ui-icon,
.language-choice > .ui-icon,
.channel-choice > .ui-icon { width: 19px; height: 19px; }

.field-label {
  display: block;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.date-field,
.owner-input,
.owner-select,
.owner-textarea {
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--paper);
  font-size: 0.84rem;
}

.counter-row {
  display: flex;
  min-height: 82px;
  padding: 14px 4px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.counter-row__copy { display: grid; gap: 4px; }
.counter-row__copy strong { font-size: 0.88rem; }
.counter-row__copy small { color: var(--muted); font-size: 0.68rem; }

.counter-control {
  display: grid;
  grid-template-columns: 42px 36px 42px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.counter-control button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: var(--copper-deep);
  background: transparent;
  cursor: pointer;
}

.counter-control .ui-icon { width: 17px; height: 17px; }
.counter-control output { font-size: 0.82rem; font-weight: 600; text-align: center; }

.language-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.language-choice { min-height: 64px; grid-template-columns: minmax(0,1fr) 22px; }
.channel-list { display: grid; grid-template-columns: 1fr; }

.flow-actions {
  display: grid;
  margin-top: 28px;
  gap: 10px;
}

.primary-button,
.secondary-button,
.quiet-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.primary-button { color: var(--white); background: var(--copper-deep); }
.secondary-button { color: var(--copper-deep); border: 1px solid var(--copper-deep); background: transparent; }
.quiet-button { color: var(--ink); border: 1px solid var(--line); background: var(--paper-soft); }
.primary-button .ui-icon,
.secondary-button .ui-icon,
.quiet-button .ui-icon { width: 19px; height: 19px; }

.context-note,
.safety-note {
  display: flex;
  margin: 22px 0 0;
  padding: 14px 16px;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  border-left: 2px solid var(--copper);
  background: var(--paper-soft);
  font-size: 0.68rem;
  line-height: 1.55;
}

.context-note .ui-icon,
.safety-note .ui-icon { width: 18px; height: 18px; flex: 0 0 auto; }

.summary-row {
  display: grid;
  min-height: 68px;
  padding: 12px 4px;
  grid-template-columns: 30px minmax(0,1fr) 42px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.summary-row > .ui-icon { width: 18px; height: 18px; color: var(--copper-deep); }
.summary-row__copy { display: grid; gap: 3px; }
.summary-row__copy small { color: var(--muted); font-size: 0.62rem; }
.summary-row__copy strong { font-size: 0.75rem; line-height: 1.35; }
.summary-edit { display: grid; width: 40px; height: 40px; padding: 0; place-items: center; color: var(--copper-deep); background: transparent; cursor: pointer; }
.summary-edit .ui-icon { width: 18px; height: 18px; }

.message-preview {
  margin-top: 18px;
  padding: 16px;
  border-left: 2px solid var(--copper);
  background: var(--paper-soft);
}

.message-preview strong { color: var(--copper-deep); font-size: 0.68rem; }
.message-preview p { margin: 10px 0 0; color: var(--muted); font-size: 0.71rem; line-height: 1.55; white-space: pre-line; }

.success-mark {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 30px auto 0;
  place-items: center;
  color: var(--copper-deep);
  border: 1px solid var(--copper);
  border-radius: 50%;
}

.success-mark .ui-icon { width: 28px; height: 28px; }
.success-copy { text-align: center; }

.segment-control {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(2,minmax(0,1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segment-control button {
  min-height: 48px;
  padding: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.segment-control button.is-selected { color: var(--white); background: var(--ink); }

.qr-card {
  margin-top: 24px;
  padding: 28px 20px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  text-align: center;
}

.qr-card img { width: min(100%, 260px); margin: 0 auto; image-rendering: crisp-edges; }
.qr-card h3 { margin: 22px 0 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; overflow-wrap: anywhere; }
.qr-card p { margin: 8px 0 0; color: var(--muted); font-size: 0.68rem; line-height: 1.5; }
.verified-line { display: inline-flex; margin-top: 14px; align-items: center; gap: 8px; color: var(--success); font-size: 0.65rem; font-weight: 600; }
.verified-line .ui-icon { width: 17px; height: 17px; }

html[dir="rtl"] .choice-row,
html[dir="rtl"] .service-choice,
html[dir="rtl"] .language-choice,
html[dir="rtl"] .channel-choice { text-align: right; }

@media (min-width: 760px) {
  .layer-panel { min-height: calc(100% - 48px); margin-top: 24px; margin-bottom: 24px; margin-right: 24px; border-radius: 4px; overflow: hidden; }
}

@media (max-width: 360px) {
  .layer-body { padding-inline: 18px; }
  .language-list { grid-template-columns: 1fr; }
}
