dialog.rev { width: min(920px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overscroll-behavior: contain; padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); color: var(--text); background: #f5f8f5; }
dialog.rev::backdrop { background: rgba(10,25,18,.55); }
dialog.rev[open] { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { dialog.rev[open] { animation: none; } }
.rev-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; background: #fff; border-bottom: 1px solid var(--line-soft); }
.rev-head h2 { font-size: 1.3rem; }
.rev-head p { margin: 2px 0 0; font-size: .88rem; }
.x { flex: none; border: 0; background: #f0f3f1; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.x:hover { background: #e4ebe6; }
.rev-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; padding: 18px 22px 22px; align-items: start; }
#rev-title, #done-title { outline: none; }

.rc { background: #fff; border: 1px solid var(--line-soft); border-radius: 14px; padding: 14px 16px; }
.rc + .rc { margin-top: 12px; }
.rc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rc-head h3, .rc-head .h3 { display: flex; gap: 8px; align-items: center; font-size: 1rem; }
.rc-head h3 svg, .rc-head .h3 svg { width: 18px; height: 18px; color: var(--brand); }
.edit { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: #fff; color: var(--brand); border-radius: 999px; padding: 6px 16px; min-height: 44px; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; transition: background-color .2s, border-color .2s; }
.edit:hover { background: var(--soft); border-color: var(--brand); }
.edit svg { width: 14px; height: 14px; }

.route { list-style: none; margin: 0; padding: 0; }
.route li { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.route li:last-child { padding-bottom: 0; }
.route li:first-child:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; border-left: 2px dashed var(--line-strong); }
.route .dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--brand); background: #fff; margin-top: 4px; position: relative; z-index: 1; }
.route .dot.end { background: var(--brand); }
.route small { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.route b { display: block; color: var(--ink); line-height: 1.3; }
.route .addr { display: block; font-size: .85rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rc-head + .tags { margin-top: 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600; }
.tag svg { width: 15px; height: 15px; color: var(--brand); }
.carrow { display: flex; align-items: center; gap: 16px; }
.carrow img { width: 120px; height: 60px; object-fit: contain; flex: none; }
.carrow b { color: var(--ink); font-size: 1.05rem; }
.carrow .tags { margin-top: 6px; }
.note { margin: 12px 0 0; padding: 10px 12px; background: var(--field); border-left: 3px solid var(--brand-light); border-radius: 6px; font-size: .9rem; color: var(--ink); }
.info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 0; }
.info dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.info dd { margin: 2px 0 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

.rev-side { position: sticky; top: 92px; }
.sum { background: #fff; border: 1px solid var(--line-soft); border-radius: 14px; padding: 18px; box-shadow: 0 10px 30px rgba(30,20,36,.08); }
.sum h3 { font-size: 1rem; margin-bottom: 6px; }
.sum .line { font-size: .9rem; color: var(--muted); }
.total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; font-weight: 700; color: var(--ink); }
.total b { font-size: 2rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.total b.tbc, .rev .total b.tbc { font-size: 1rem; }
.sum-ticks { list-style: none; padding: 0; margin: 10px 0 16px; display: grid; gap: 6px; font-size: .85rem; color: var(--ink); }
.sum-ticks li { display: flex; gap: 8px; align-items: center; }
.sum-ticks svg { width: 16px; height: 16px; color: var(--brand); }
.sum .msg { margin: 0 0 12px; }
.fine { font-size: .78rem; color: var(--muted); margin: 10px 0 0; text-align: center; }
.fine a { color: var(--brand); text-decoration: underline; }
.rev .btn-green { width: 100%; justify-content: center; min-height: 52px; font-size: 1.05rem; }

.done-box { text-align: center; padding: 40px 22px 32px; background: #fff; }
.done-box .ok { width: 68px; height: 68px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; }
.done-box .ok svg { width: 36px; height: 36px; stroke-width: 3; }
.done-box h2 + p { margin: 8px 0 0; }
.done-box .ref { display: inline-block; margin: 12px 0 18px; padding: 8px 16px; border-radius: 8px; background: var(--soft); font-weight: 800; color: var(--ink); letter-spacing: .04em; }
.done-box .btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.done-box .btn-green { width: auto; min-width: 160px; }
.done-box b { overflow-wrap: anywhere; } /* long email addresses */

@media (max-width: 760px) {
  dialog.rev { scroll-padding-bottom: 180px; } /* a focused Edit button never hides under the price bar */
  .rev-grid { grid-template-columns: 1fr; padding: 14px; }
  .rev-side { position: sticky; top: auto; bottom: 0; z-index: 2; margin: 0 -14px -14px; }
  .rev .sum { border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(30,20,36,.14); padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .rev .sum h3, .rev .sum .line, .rev .sum-ticks { display: none; }
  .rev .total { border: 0; margin: 0 0 8px; padding: 0; }
  .rev .total b { font-size: 1.6rem; }
  .fine { margin-top: 6px; }
  .rev-head { padding: 14px 16px; }
  .info { grid-template-columns: 1fr; }
  .carrow img { width: 90px; }
}

@media (max-width: 560px) {
  .done-box .btns { flex-direction: column; }
  .done-box .btns .btn { justify-content: center; }
  .rev dl { grid-template-columns: 1fr; gap: 0; }
  .rev dd { margin-bottom: 8px; }
}
