:root {
  --ink: #0c0c0d;
  --muted: #5f6368;
  --line: #e5e5e5;
  --soft: #f7f7f7;
  --error: #b3261e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--line);
}
.brand { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.secure { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }

.wrap {
  max-width: 1080px; margin: 0 auto; padding: 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px; align-items: start;
}
.pay h1 { font-size: 22px; margin: 8px 0 20px; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.status { padding: 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.status.error { color: var(--error); border-color: #f1c4c1; background: #fdf3f2; }
.status.error a { margin-left: 4px; font-weight: 600; }
#checkout { min-height: 200px; }
.fine { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 20px; }

.summary {
  position: sticky; top: 24px;
  background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 20px;
}
.summary-toggle { display: none; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.thumb i {
  position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: #555; color: #fff; font: 600 12px/22px Inter, sans-serif; text-align: center;
}
.name b { display: block; font-size: 14px; font-weight: 500; }
.name small { color: var(--muted); font-size: 12px; }
.price { font-size: 14px; font-weight: 500; }

.totals { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; margin: 8px 0; font-size: 14px; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; }
#savedRow dd { color: #1e7e34; font-weight: 600; }
.totals .grand { font-size: 18px; font-weight: 700; padding-top: 12px; border-top: 1px solid var(--line); }
.totals .grand dt { color: var(--ink); }

.promises { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--muted); }
.promises li { margin: 6px 0; }
.promises b { color: var(--ink); font-weight: 600; }

@media (max-width: 860px) {
  .top { padding: 14px 16px; }
  .brand { font-size: 22px; }
  .wrap { grid-template-columns: 1fr; gap: 16px; padding: 0 16px 32px; }
  .summary { order: -1; position: static; border-radius: 0; margin: 0 -16px; border-width: 0 0 1px; padding: 0; }
  .summary-toggle {
    display: flex; width: 100%; justify-content: space-between; align-items: center;
    padding: 16px; border: 0; background: none; font: 600 15px Inter, sans-serif; color: var(--ink); cursor: pointer;
  }
  .summary-toggle span:first-child::after { content: " \25BE"; }
  .summary.open .summary-toggle span:first-child::after { content: " \25B4"; }
  .summary-body { display: none; padding: 0 16px 16px; }
  .summary.open .summary-body { display: block; }
}
