/* ============================================
   Create New Event flow (start screen, Describe, Upload, review, step-by-step wizards)
   Neutral by design: ink, greys and white only. The one color is the AI avatar glow.
   Every class is prefixed .ew- and scoped under .ew so nothing leaks into the app.
   ============================================ */

.ew {
  --ew-ink: var(--grey-900);
  --ew-ink-2: var(--grey-700);
  --ew-muted: var(--n-500);
  --ew-faint: var(--n-400);
  --ew-line: var(--n-200);
  --ew-line-strong: var(--n-300);
  --ew-wash: var(--n-50);
  --ew-fill: var(--n-100);
  --ew-surface: #fff;
  --ew-ok: var(--semantic-success);
  --ew-warn: var(--semantic-warning);
  --ew-warn-ink: color-mix(in srgb, var(--semantic-warning) 62%, black);
  --ew-danger: var(--semantic-danger);

  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ew-ink);
  -webkit-font-smoothing: antialiased;
}
.ew *, .ew *::before, .ew *::after { box-sizing: border-box; }
/* :where keeps these resets at class weight so component classes below win. */
.ew :where(button, input, textarea, select) { font: inherit; color: inherit; }
.ew button { cursor: pointer; }
.ew button[disabled] { cursor: not-allowed; }
.ew :focus-visible { outline: 2px solid var(--ew-ink); outline-offset: 2px; border-radius: 6px; }
.ew :where(h1, h2, h3) { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -.01em; text-wrap: balance; color: var(--ew-ink); }
.ew :where(p) { margin: 0; }
.ew [hidden] { display: none !important; }

/* ---- Frame: fills the bare popup, one scroll area, sticky footer ---- */
.ew-root { display: flex; flex-direction: column; flex: 1; min-height: 0; height: 100%; }
@media (min-width: 1024px) { .ew-root { min-height: min(620px, 90vh); } }
.ew-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; display: flex; flex-direction: column; }
.ew-body { width: 100%; max-width: 760px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 22px; padding: 36px 44px 28px; }
.ew-body--center { justify-content: center; }
.ew-foot {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 44px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-top: 1px solid var(--ew-line);
}
.ew-foot-inner { width: 100%; max-width: 672px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ew-foot-end { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.ew-foot-note { font-size: 12px; color: var(--ew-muted); }

/* ---- Top bar: back link left, quiet link right (clear of the close button) ---- */
.ew-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-right: 28px; min-height: 22px; }
.ew-back { border: none; background: none; padding: 0; color: var(--ew-muted); font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.ew-back:hover { color: var(--ew-ink); }
.ew-back svg { width: 14px; height: 14px; }
.ew-link { border: none; background: none; padding: 0; font-size: 12px; font-weight: 600; color: var(--ew-muted); text-decoration: underline; text-underline-offset: 3px; }
.ew-link:hover { color: var(--ew-ink); }

/* ---- Headings ---- */
.ew-head { display: flex; flex-direction: column; gap: 6px; }
.ew-headrow { display: flex; align-items: center; gap: 12px; }
.ew-head h2 { font-size: 26px; line-height: 1.15; }
.ew-head p { color: var(--ew-muted); font-size: 14px; }
.ew-hint { font-size: 12px; color: var(--ew-muted); }

/* ---- Buttons ---- */
.ew-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ew-line); background: var(--ew-surface); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ew-ink); transition: background .15s, border-color .15s, opacity .15s; }
.ew-btn:hover { border-color: var(--ew-faint); }
.ew-btn--primary { background: var(--ew-ink); border-color: var(--ew-ink); color: #fff; }
.ew-btn--primary:hover { background: var(--ew-ink-2); border-color: var(--ew-ink-2); }
.ew-btn--text { border-color: transparent; background: none; color: var(--ew-ink-2); padding: 8px; }
.ew-btn--text:hover { background: var(--ew-wash); border-color: transparent; }
.ew-btn[disabled], .ew-btn[aria-disabled="true"] { opacity: .45; }
.ew-btn--primary[disabled]:hover { background: var(--ew-ink); border-color: var(--ew-ink); }

/* ---- Start screen: one grouped list ---- */
.ew-choices { display: flex; flex-direction: column; border: 1px solid var(--ew-line); border-radius: 14px; overflow: hidden; }
.ew-choice { display: grid; grid-template-columns: 40px minmax(0, 1fr) 20px; gap: 14px; align-items: center; width: 100%; padding: 16px 18px; border: none; border-top: 1px solid var(--ew-line); background: var(--ew-surface); text-align: left; color: var(--ew-ink); }
.ew-choice:first-child { border-top: none; }
.ew-choice:hover { background: var(--ew-wash); }
.ew-choice:focus-visible { outline-offset: -2px; border-radius: 0; }
.ew-choice b { display: block; font-size: 15px; font-weight: 600; }
.ew-choice span.ew-choice-sub { display: block; font-size: 13px; color: var(--ew-muted); }
.ew-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--ew-fill); display: flex; align-items: center; justify-content: center; color: var(--ew-ink); }
.ew-ico svg { width: 20px; height: 20px; }
.ew-chev { color: var(--ew-faint); display: flex; }
.ew-chev svg { width: 16px; height: 16px; }

/* ---- Working screen (reading, planning, creating): spinner only ---- */
.ew-working { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 40px 24px; }
.ew-working h2 { font-size: 20px; }
.ew-working p { color: var(--ew-muted); max-width: 44ch; }
.ew-rsteps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ew-faint); text-align: left; }
.ew-rsteps li { display: flex; align-items: center; gap: 10px; transition: color .2s; }
.ew-rsteps .is-on { color: var(--ew-ink); font-weight: 600; }
.ew-rsteps .is-done { color: var(--ew-muted); }
/* Status mark: an empty ring while waiting, a spinning ring while working, an ink check when done. */
.ew-mark { position: relative; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--ew-line); display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s; }
.ew-mark svg { width: 10px; height: 10px; }
.is-on > .ew-mark { border-color: var(--ew-fill); }
.is-on > .ew-mark::after { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid transparent; border-top-color: var(--ew-ink); border-right-color: var(--ew-ink); animation: ew-mark-spin .8s linear infinite; }
.is-done > .ew-mark { background: var(--ew-ink); border-color: var(--ew-ink); animation: ew-mark-pop .25s ease-out; }
@keyframes ew-mark-spin { to { transform: rotate(360deg); } }
@keyframes ew-mark-pop { from { transform: scale(.6); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .is-on > .ew-mark::after { animation: none; border-color: var(--ew-ink); border-left-color: transparent; }
  .is-done > .ew-mark { animation: none; }
}

/* ---- Error notice (plain words, a way forward) ---- */
.ew-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--ew-line); border-left: 3px solid var(--ew-danger); border-radius: 12px; background: var(--ew-surface); font-size: 13px; }
.ew-error b { display: block; }

/* ---- Slim stepper ---- */
.ew-stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; flex-wrap: wrap; row-gap: 6px; }
.ew-stepper li { display: flex; align-items: center; gap: 4px; }
.ew-stepper li + li::before { content: ""; width: 10px; height: 1px; background: var(--ew-line); }
.ew-stepper button { border: none; background: none; display: flex; align-items: center; gap: 6px; padding: 4px 5px 4px 3px; border-radius: 999px; color: var(--ew-faint); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ew-stepper button[disabled] { cursor: default; }
.ew-stepper .ew-sn { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--ew-line); display: flex; align-items: center; justify-content: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.ew-stepper .ew-sn svg { width: 10px; height: 10px; }
.ew-stepper li.is-done button { color: var(--ew-muted); }
.ew-stepper li.is-done button:hover { background: var(--ew-wash); color: var(--ew-ink); }
.ew-stepper li.is-done .ew-sn { background: var(--ew-ink); border-color: var(--ew-ink); color: #fff; }
.ew-stepper li.is-on button { color: var(--ew-ink); }
.ew-stepper li.is-on .ew-sn { border-color: var(--ew-ink); color: var(--ew-ink); }

/* ---- AI avatar spin (EventioAvatar Spin="true") ---- */
.eventio-avatar-spin { animation: eventio-avatar-spin 2.2s linear infinite; }
@keyframes eventio-avatar-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .eventio-avatar-spin { animation: none; } }

/* ---- Groups (heading row + content) ---- */
.ew-group { display: flex; flex-direction: column; gap: 10px; }
.ew-gh { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ew-gh h3 { font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: 0; }
.ew-gh h3 label { font: inherit; color: inherit; }
.ew-fc { font-size: 12px; color: var(--ew-muted); }

/* ---- Text areas ---- */
.ew-textarea { width: 100%; border: 1px solid var(--ew-line); border-radius: 12px; padding: 11px 13px; min-height: 84px; resize: vertical; font-size: 14px; background: var(--ew-surface); outline: none; }
.ew-textarea:focus { border-color: var(--ew-ink); }
.ew-textarea::placeholder { color: var(--ew-faint); }

/* ---- Describe: compose box, live hints, examples ---- */
.ew-compose { border: 1px solid var(--ew-line); border-radius: 14px; background: var(--ew-surface); overflow: hidden; }
.ew-compose:focus-within { border-color: var(--ew-ink); }
.ew-compose .ew-textarea { border: none; border-radius: 0; min-height: 150px; font-size: 15px; padding: 14px 16px; }
.ew-compose .ew-textarea:focus-visible { outline: none; }
.ew-hints { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--ew-line); background: var(--ew-wash); }
.ew-hints .ew-hint { margin-right: 4px; }
.ew-hchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ew-muted); border: 1px solid var(--ew-line); background: var(--ew-surface); border-radius: 999px; padding: 2px 9px; transition: all .15s; }
.ew-hchip.is-on { background: var(--ew-ink); border-color: var(--ew-ink); color: #fff; }
.ew-hchip svg { width: 11px; height: 11px; }
.ew-examples { display: flex; flex-direction: column; border: 1px solid var(--ew-line); border-radius: 12px; overflow: hidden; }
.ew-ex { border: none; border-top: 1px solid var(--ew-line); background: var(--ew-surface); text-align: left; padding: 11px 14px; font-size: 13px; color: var(--ew-ink-2); }
.ew-ex:first-child { border-top: none; }
.ew-ex:hover { background: var(--ew-wash); color: var(--ew-ink); }

/* ---- Upload: file list ---- */
.ew-files { border: 1px solid var(--ew-line); border-radius: 12px; overflow: hidden; }
.ew-file { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 28px; gap: 12px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--ew-line); }
.ew-file:first-child { border-top: none; }
.ew-ft { width: 28px; height: 32px; border-radius: 6px; background: var(--ew-fill); font-size: 8px; font-weight: 800; color: var(--ew-muted); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; text-transform: uppercase; }
.ew-fn { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; }
.ew-fs { font-size: 12px; color: var(--ew-muted); }
.ew-ready { font-size: 12px; color: var(--ew-muted); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.ew-ready i { width: 6px; height: 6px; border-radius: 50%; background: var(--ew-ok); }
.ew-ready.is-error i { background: var(--ew-danger); }
.ew-x { border: none; background: none; color: var(--ew-faint); padding: 5px; border-radius: 6px; display: flex; }
.ew-x:hover { background: var(--ew-wash); color: var(--ew-ink); }
.ew-x svg { width: 14px; height: 14px; }
.ew-addrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--ew-line); background: var(--ew-wash); flex-wrap: wrap; }
.ew-emptyfiles { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; flex-wrap: wrap; }
.ew-filepick { position: relative; overflow: hidden; cursor: pointer; }
.ew-filepick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.ew-filepick:focus-within { outline: 2px solid var(--ew-ink); outline-offset: 2px; }
.ew-btn svg { width: 14px; height: 14px; }

/* ---- Switch lists (options, goals, compliance) ---- */
.ew-switch { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--ew-line-strong); position: relative; flex-shrink: 0; transition: background .2s; margin: 0; cursor: pointer; border: none; }
.ew-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: left .2s; }
.ew-switch:checked { background: var(--ew-ink); }
.ew-switch:checked::after { left: 18px; }
.ew-switch:focus-visible { outline: 2px solid var(--ew-ink); outline-offset: 2px; border-radius: 11px; }
.ew-swlist { border: 1px solid var(--ew-line); border-radius: 12px; }
.ew-swrow { border-top: 1px solid var(--ew-line); padding: 12px 14px; }
.ew-swlist > .ew-swrow:first-child { border-top: none; }
.ew-swrow--flat { border: none; padding: 0; }
.ew-swh { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.ew-swh label { cursor: pointer; }
.ew-swh b { display: block; font-size: 13px; font-weight: 600; }
.ew-swh span { display: block; font-size: 12px; color: var(--ew-muted); margin-top: 1px; }
.ew-swb { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }

/* ---- Review: summary, tabs, notices ---- */
.ew-summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 18px; background: var(--ew-wash); border-radius: 14px; flex-wrap: wrap; }
.ew-summary h3 { font-size: 18px; }
.ew-meta { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; color: var(--ew-ink-2); margin-top: 6px; }
.ew-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ew-tbd { color: var(--ew-warn-ink); font-weight: 600; }
.ew-tbd i { width: 6px; height: 6px; border-radius: 50%; background: var(--ew-warn); display: inline-block; }
.ew-pop { font-size: 12px; color: var(--ew-ink-2); background: var(--ew-surface); border: 1px solid var(--ew-line); border-radius: 10px; padding: 8px 10px; margin-top: 8px; display: flex; flex-direction: column; gap: 3px; white-space: pre-wrap; }
.ew-pop span { display: inline-flex; gap: 6px; align-items: center; }
.ew-pop svg { width: 12px; height: 12px; flex-shrink: 0; }
.ew-needs { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--ew-line); border-radius: 12px; background: var(--ew-surface); flex-wrap: wrap; }
.ew-needs .ew-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ew-warn); flex-shrink: 0; }
.ew-needs b { display: block; font-size: 13px; }
.ew-needs span { font-size: 13px; color: var(--ew-muted); }
.ew-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--ew-fill); border-radius: 10px; padding: 3px; }
.ew-tabs button { border: none; background: none; border-radius: 8px; padding: 7px 8px; font-size: 13px; font-weight: 600; color: var(--ew-muted); display: flex; gap: 6px; justify-content: center; align-items: center; }
.ew-tabs button.is-on { background: var(--ew-surface); color: var(--ew-ink); box-shadow: 0 1px 3px rgba(9, 17, 59, .12); }
.ew-tabs .ew-c { font-size: 12px; font-weight: 600; color: var(--ew-faint); font-variant-numeric: tabular-nums; }
.ew-tabs button.is-on .ew-c { color: var(--ew-muted); }
.ew-tabs--4 { grid-template-columns: repeat(4, 1fr); }
.ew-tabs--5 { grid-template-columns: repeat(5, 1fr); }
/* Pages tab: what's in each file, then one card per page the files fill. */
/* .ew-row is declared further down, so these need the extra class to win over its three-column grid. */
.ew-row.ew-row--file { grid-template-columns: minmax(0, 1fr); padding: 8px 0; }
.ew-row--file .ew-tx { white-space: normal; overflow-wrap: anywhere; }
.ew-row.ew-row--line { grid-template-columns: minmax(0, 1fr) auto; }
.ew-row--file .ew-tx > .ew-fc { display: block; margin-top: 2px; font-weight: 400; line-height: 1.45; }
.ew-page .ew-sh { justify-content: flex-start; }
.ew-page > .ew-fc { padding: 6px 0 2px; }
.ew-notes { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--ew-muted); }
.ew-notes li + li { margin-top: 2px; }
.ew-panel { display: flex; flex-direction: column; gap: 12px; }
.ew-next { display: flex; justify-content: flex-end; padding-top: 4px; }
.ew-tbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- Review: task and expense rows ---- */
.ew-sec { display: flex; flex-direction: column; }
.ew-sh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0 6px; border-bottom: 1px solid var(--ew-line); }
.ew-sh h4 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ew-muted); font-family: var(--font-body); }
.ew-sh h4 .ew-n { letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--ew-faint); margin-left: 6px; }
.ew-sh .ew-link { text-decoration: none; }
.ew-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 42px; padding: 4px 0; border-bottom: 1px solid var(--ew-line); }
.ew-ck { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ew-line-strong); background: var(--ew-surface); display: flex; align-items: center; justify-content: center; padding: 0; transition: all .12s; }
.ew-ck.is-on { background: var(--ew-ink); border-color: var(--ew-ink); }
.ew-ck svg { width: 10px; height: 10px; opacity: 0; }
.ew-ck.is-on svg { opacity: 1; }
.ew-tx { font-size: 14px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-row.is-off .ew-tx { color: var(--ew-muted); }
.ew-rm { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ew-cat { font-size: 12px; color: var(--ew-muted); white-space: nowrap; }
.ew-pill { display: inline-flex; align-items: center; border-radius: 7px; background: var(--ew-wash); padding: 3px 8px; font-size: 12px; font-weight: 600; color: var(--ew-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; border: 1px solid transparent; }
.ew-pill--nodate { color: var(--ew-faint); font-weight: 500; background: transparent; border: 1px dashed var(--ew-line); }
.ew-pill--amt { min-width: 70px; justify-content: flex-end; }
.ew-pill--est { background: transparent; border: 1px dashed var(--ew-line-strong); color: var(--ew-muted); }
.ew-iconbtn { border: none; background: none; color: var(--ew-faint); padding: 4px; border-radius: 6px; display: flex; }
.ew-iconbtn:hover, .ew-iconbtn.is-on { color: var(--ew-ink); background: var(--ew-wash); }
.ew-iconbtn svg { width: 15px; height: 15px; }
.ew-who { display: flex; flex-direction: column; min-width: 0; padding: 4px 0; }
.ew-whosub { font-size: 12px; color: var(--ew-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-feedback { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 12px; }
.ew-fb { display: flex; flex-direction: column; gap: 2px; padding-left: 10px; border-left: 2px solid var(--ew-line-strong); color: var(--ew-ink-2); font-size: 13px; line-height: 1.45; }
.ew-fb b { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ew-muted); }
.ew-fbsrc { font-size: 12px; color: var(--ew-faint); }
.ew-flag { font-size: 11px; font-weight: 700; color: var(--ew-warn-ink); background: color-mix(in srgb, var(--semantic-warning) 12%, white); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.ew-src { grid-column: 2 / -1; font-size: 12px; color: var(--ew-muted); padding: 0 0 8px; margin-top: -4px; }
.ew-editbox { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; align-items: end; background: var(--ew-wash); border-radius: 12px; padding: 12px; margin: 2px 0 10px; }
.ew-ea { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; }
.ew-ef { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ew-ef label { font-size: 11px; font-weight: 600; color: var(--ew-muted); }
.ew-fi { width: 100%; border: 1px solid var(--ew-line); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: var(--ew-surface); outline: none; min-width: 0; }
.ew-fi:focus { border-color: var(--ew-ink); }
.ew-totals { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--ew-wash); border-radius: 12px; font-size: 13px; flex-wrap: wrap; }
.ew-totals b { font-variant-numeric: tabular-nums; }
.ew-meter { flex: 1; min-width: 140px; height: 6px; border-radius: 3px; background: var(--ew-line); overflow: hidden; }
.ew-meter span { display: block; height: 100%; background: var(--ew-ink); }
.ew-bulk { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: var(--ew-ink); color: #fff; border-radius: 12px; font-size: 13px; flex-wrap: wrap; }
.ew-bulk label { color: #fff; }
.ew-bulk input { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; padding: 4px 8px; color: #fff !important; color-scheme: dark; font-size: 13px; }
.ew-bulk .ew-btn { padding: 5px 10px; font-size: 12px; background: #fff; color: var(--ew-ink); border-color: #fff; }

/* ---- Review: label/value list with inline edit ---- */
.ew-form { border: 1px solid var(--ew-line); border-radius: 12px; }
.ew-fr { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--ew-line); }
.ew-fr:first-child { border-top: none; }
.ew-fr > label, .ew-fr > .ew-fl { font-size: 13px; color: var(--ew-muted); }
.ew-frv { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ew-frv > span { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.ew-frx { display: flex; flex-direction: column; gap: 8px; }
.ew-frx .ew-fi { font-size: 14px; }
.ew-frx .ew-ea { display: flex; justify-content: flex-end; gap: 6px; }
.ew-addv { font-size: 13px; color: var(--ew-faint); }

/* ---- Toast ---- */
.ew-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ew-ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: 0 12px 32px rgba(9, 17, 59, .18); z-index: 10050; max-width: calc(100% - 32px); }

/* ---- Step-by-step wizard: tiles, chips, field groups ---- */
.ew-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ew-tile { display: flex; align-items: center; gap: 10px; border: 1px solid var(--ew-line); background: var(--ew-surface); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 600; text-align: left; color: var(--ew-ink); min-width: 0; min-height: 46px; }
.ew-tile > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-tile:hover { border-color: var(--ew-faint); }
.ew-tile.is-on { border-color: var(--ew-ink); box-shadow: 0 0 0 1px var(--ew-ink); }
.ew-tile-ico { width: 28px; height: 28px; border-radius: 7px; background: var(--ew-fill); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ew-ink-2); font-size: 16px; }
.ew-tile-ico svg { width: 16px; height: 16px; }
.ew-tile.is-on .ew-tile-ico { background: var(--ew-ink); color: #fff; }
.ew-subs { background: var(--ew-wash); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ew-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ew-chip { border: 1px solid var(--ew-line); background: var(--ew-surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; color: var(--ew-ink-2); }
.ew-chip:hover { border-color: var(--ew-faint); }
.ew-chip.is-on { background: var(--ew-ink); border-color: var(--ew-ink); color: #fff; }
.ew-fg { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--ew-line); }
.ew-fg > h4 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ew-muted); font-family: var(--font-body); }
.ew-g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ew-g3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 12px; }
.ew-g4 { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr 1fr; gap: 12px; }
.ew-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ew-field > label, .ew-field > .ew-label { font-size: 12px; font-weight: 600; color: var(--ew-ink-2); }
.ew-req { color: var(--ew-ink); }
.ew-optional { font-weight: 500; color: var(--ew-faint); }
.ew-input { width: 100%; height: 38px; border: 1px solid var(--ew-line); border-radius: 9px; padding: 0 11px; font-size: 14px; background: var(--ew-surface); outline: none; min-width: 0; }
textarea.ew-input { height: auto; padding: 9px 11px; resize: vertical; }
.ew-input:focus { border-color: var(--ew-ink); }
.ew-input:disabled { background: var(--ew-wash); color: var(--ew-faint); }
.ew-input::placeholder { color: var(--ew-faint); }
.ew-seg { display: inline-flex; background: var(--ew-fill); border-radius: 9px; padding: 3px; align-self: flex-start; }
.ew-seg button { border: none; background: none; border-radius: 7px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--ew-muted); }
.ew-seg button.is-on { background: var(--ew-surface); color: var(--ew-ink); box-shadow: 0 1px 3px rgba(9, 17, 59, .12); }
.ew-num { display: flex; align-items: center; gap: 6px; }
.ew-num button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--ew-line); background: var(--ew-surface); font-size: 16px; font-weight: 600; }
.ew-num .ew-input { width: 80px; text-align: center; font-variant-numeric: tabular-nums; }
.ew-money { display: flex; align-items: center; border: 1px solid var(--ew-line); border-radius: 9px; background: var(--ew-surface); overflow: hidden; }
.ew-money:focus-within { border-color: var(--ew-ink); }
.ew-money > span { padding: 0 4px 0 11px; color: var(--ew-muted); }
.ew-money .ew-input { border: none; padding-left: 2px; }
.ew-styles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ew-style { position: relative; border: 1px solid var(--ew-line); background: var(--ew-surface); border-radius: 10px; padding: 0; overflow: hidden; text-align: left; display: flex; flex-direction: column; }
.ew-style .ew-ph { display: block; aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--ew-fill); }
.ew-style .ew-sn2 { font-size: 12px; font-weight: 600; padding: 7px 9px; color: var(--ew-ink); }
.ew-style.is-on { border-color: var(--ew-ink); box-shadow: 0 0 0 1px var(--ew-ink); }
.ew-style--own .ew-ph { display: flex; align-items: center; justify-content: center; color: var(--ew-ink-2); }
.ew-tick { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--ew-ink); display: flex; align-items: center; justify-content: center; }
.ew-tick svg { width: 10px; height: 10px; }
.ew-pals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ew-pal { border: 1px solid var(--ew-line); background: var(--ew-surface); border-radius: 10px; padding: 10px; text-align: left; display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.ew-pal.is-on { border-color: var(--ew-ink); box-shadow: 0 0 0 1px var(--ew-ink); }
.ew-sw5 { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin-bottom: 5px; }
.ew-sw5 i { flex: 1; }
.ew-pal b { font-size: 13px; font-weight: 600; }
.ew-pal span { font-size: 11px; color: var(--ew-muted); }
.ew-pal--own { border-style: dashed; align-items: flex-start; }
.ew-plus { width: 22px; height: 22px; border-radius: 50%; background: var(--ew-fill); display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--ew-ink); margin-bottom: 5px; }
.ew-rsec { border: 1px solid var(--ew-line); border-radius: 12px; padding: 12px 14px; }
.ew-rsh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ew-rsh h4 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ew-muted); font-family: var(--font-body); }
.ew-rsh .ew-link { color: var(--ew-ink); text-decoration: none; }
.ew-rsec dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; }
.ew-rsec dt { color: var(--ew-muted); }
.ew-rsec dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.ew-muted2 { color: var(--ew-faint) !important; }
.ew-aiready { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--ew-wash); border-radius: 12px; }
.ew-aiready b { display: block; font-size: 13px; }
.ew-aiready span { font-size: 12px; color: var(--ew-muted); }
.ew-headline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }

/* ---- Phone ---- */
@media (max-width: 640px) {
  .ew-body { padding: 24px 16px 20px; gap: 18px; }
  .ew-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ew-head h2 { font-size: 22px; }
  .ew-choice { padding: 14px; gap: 12px; }
  .ew-stepper .ew-sl { display: none; }
  .ew-stepper li.is-on .ew-sl { display: inline; }
  .ew-editbox { grid-template-columns: 1fr; }
  .ew-cat { display: none; }
  .ew-fr { grid-template-columns: 1fr; gap: 2px; }
  .ew-tabs button { font-size: 12px; padding: 7px 4px; }
  .ew-tabs--4 .ew-c, .ew-tabs--5 .ew-c { display: none; }
  .ew-tabs--5 button { font-size: 11px; padding: 7px 2px; }
  .ew-cats, .ew-pals { grid-template-columns: 1fr 1fr; }
  .ew-styles { grid-template-columns: 1fr 1fr; }
  .ew-g2, .ew-g3, .ew-g4 { grid-template-columns: 1fr; }
  .ew-rsec dl { grid-template-columns: 1fr; gap: 2px; }
  .ew-rsec dd { margin-bottom: 6px; }
}
.ew-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
