.rg-dialog {
  color-scheme: light;
  --rg-ink: #1c211f;
  --rg-muted: #58645e;
  --rg-line: #d8ddd8;
  --rg-orange: #ae410b;
  width: min(94vw, 520px);
  max-height: min(90dvh, 840px);
  background: #fff;
  color: var(--rg-ink);
  border: 0;
  padding: 0;
  border-radius: 18px;
  box-shadow: 0 24px 90px #10161240;
  overflow: auto;
  margin: auto;
  font: inherit;
}
.rg-dialog::backdrop { background: #12181570; }
.rg-dialog *,.rg-page * { box-sizing: border-box; }
.rg-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 24px 18px; border-bottom: 1px solid var(--rg-line); }
.rg-header h2,.rg-page h2 { margin: 0; font-size: 1.45rem; line-height: 1.25; letter-spacing: -.035em; color: inherit; }
.rg-header p { margin: 6px 0 0; font-size: .9rem; color: var(--rg-muted); }
.rg-close,.rg-step button,.rg-iconbtn { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--rg-line); border-radius: 10px; background: #fff; color: #28362d; font-size: 1.25rem; cursor: pointer; }
.rg-form,.rg-body { display: grid; gap: 17px; padding: 20px 24px 24px; }
.rg-field { display: grid; gap: 6px; color: var(--rg-ink); font-size: .92rem; font-weight: 650; }
.rg-field input,.rg-field select,.rg-field textarea,.rg-search { font: inherit; font-weight: 450; color: #223127; background: #fff; border: 1px solid #b8c2b9; border-radius: 9px; padding: 10px 12px; min-height: 44px; width: 100%; min-width: 0; }
.rg-field textarea { resize: vertical; min-height: 64px; }
.rg-field small,.rg-help { margin: 0; color: var(--rg-muted); font-weight: 450; font-size: .86rem; line-height: 1.45; }
.rg-dialog :focus-visible,.rg-page :focus-visible { outline: 3px solid #ee904a; outline-offset: 2px; }
.rg-row,.rg-actions,.rg-stageactions,.rg-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rg-row > .rg-field { flex: 1 1 150px; }
.rg-step { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; }
.rg-step button { width: 44px; height: 44px; }
.rg-step input { text-align: center; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.rg-primary,.rg-secondary,.rg-chip { cursor: pointer; display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:9px 15px; border:1px solid transparent; border-radius:9px; font:inherit; font-size:.92rem; font-weight:650; }
.rg-primary { background: #ad400b; color: #fff; }
.rg-primary:hover { background: #933708; }
.rg-secondary,.rg-chip { background:#fff; border-color:#ccd4cd; color:#26382b; }
.rg-secondary:hover,.rg-chip:hover { background:#f2f5f1; }
.rg-actions { justify-content:flex-end; margin-top:2px; }
.rg-error { background:#fff0ee; color:#953224; border-radius:8px; padding:8px 12px; margin:0; }
.rg-form [hidden],.rg-body [hidden],.rg-page [hidden] { display:none !important; }
.rg-timer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; padding:14px; border-radius:10px; background:#f4f6f2; }
.rg-clock { font-size:1.3rem; letter-spacing:-.025em; font-variant-numeric:tabular-nums; }
.rg-page { color:inherit; width:100%; }
.rg-page .rg-top { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; margin:0 0 22px; }
.rg-search { max-width:480px; }
.rg-filters { margin:12px 0 18px; }
.rg-chip { min-height:38px; padding:6px 13px; border-radius:100px; font-size:.86rem; }
.rg-chip[aria-pressed=true] { background:#27362d; color:#fff; border-color:#27362d; }
.rg-contacts { border:1px solid #dbe0da; background:#fff; border-radius:14px; overflow:hidden; color:#222e25; }
.rg-contact { display:flex; align-items:center; width:100%; gap:14px; text-align:left; border:0; background:#fff; color:inherit; padding:15px 17px; font:inherit; cursor:pointer; }
.rg-contact + .rg-contact { border-top:1px solid #e3e7e1; }
.rg-contact:hover { background:#f7f8f5; }
.rg-avatar { display:grid; place-items:center; flex:none; width:40px; height:40px; border-radius:12px; background:#faebdd; color:#86431c; font-weight:750; font-size:.9rem; }
.rg-detail { flex:1; min-width:0; display:grid; gap:3px; }
.rg-detail strong,.rg-detail small { overflow-wrap:anywhere; }
.rg-detail small,.rg-empty { color:#55635a; font-size:.9rem; }
.rg-stage { padding:4px 9px; background:#f2f4ef; color:#445745; font-size:.78rem; border-radius:20px; text-align:center; }
.rg-empty { margin:0; padding:24px; }
.rg-history { list-style:none; margin:0; padding:0; }
.rg-history li { padding:9px 0; display:grid; gap:3px; border-top:1px solid #e4e8e3; font-size:.9rem; }
.rg-history small { color:var(--rg-muted); overflow-wrap:anywhere; }
.rg-body h3 { margin:0; font-size:1rem; }
.rg-toast { position:fixed; bottom:18px; left:50%; transform:translateX(-50%); max-width:calc(100vw - 30px); z-index:1000; background:#233529; color:#fff; padding:11px 18px; border-radius:9px; font:inherit; font-size:.92rem; box-shadow:0 8px 22px #10161125; pointer-events:none; }
@media(max-width:560px) {
 .rg-dialog { max-height:92dvh; width:calc(100vw - 12px); border-radius:17px 17px 11px 11px; }
 .rg-header,.rg-form,.rg-body { padding-left:17px; padding-right:17px; }
 .rg-actions > .rg-primary { flex:1; }
 .rg-contact { padding:12px; gap:9px; }
 .rg-toast { bottom:80px; }
}
