@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

.vp-rte {
  --blue:#444DF9; --teal:#00C3C4; --violet:#8C2FFC;
  --green:#15803D; --green-bg:#DCFCE7;
  --red:#B91C1C; --red-bg:#FEE2E2;
  --amber:#B45309; --amber-bg:#FEF3C7;
  --ink:#0F172A; --text:#1E293B; --muted:#5A6B82; --soft:#94A3B8;
  --line:#E4E9F2; --line-soft:#EEF2F8;
  --bg:#F7F9FC; --surface:#FFFFFF; --hover:#F8FAFF;
  --r:10px; --mono:"JetBrains Mono","Roboto Mono",ui-monospace,monospace;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.vp-rte *, .vp-rte *::before, .vp-rte *::after { box-sizing: border-box; }
.vp-rte h1, .vp-rte h2, .vp-rte h3 { margin: 0; color: var(--ink); letter-spacing: -.02em; }
.vp-rte button { font-family: inherit; cursor: pointer; }
.vp-rte a { color: var(--blue); text-decoration: none; }
.vp-rte a:hover { text-decoration: underline; }
.vp-rte :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.vp-rte svg { display: block; flex-shrink: 0; }
.vp-rte .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.vp-rte-src { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.vp-rte .appbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.vp-rte .appbar-in { max-width: 1140px; margin: 0 auto; padding: 13px 8px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vp-rte .appbar-in > div:first-child { min-width: 0; }
.vp-rte .crumb { font-size: 12.5px; color: var(--soft); }
.vp-rte .crumb a { color: var(--muted); }
.vp-rte .titlerow { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.vp-rte .appbar h1 { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.vp-rte .spacer { flex: 1; }

.vp-rte .btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--text);
  transition: border-color .14s, background .14s; text-decoration: none !important; }
.vp-rte .btn:hover { border-color: #C9D3E6; background: #FCFDFF; text-decoration: none !important; }
.vp-rte .btn-primary { background: var(--blue); border-color: var(--blue); color: #fff !important; }
.vp-rte .btn-primary:hover { background: #3A42D8; }
.vp-rte .btn-sm { padding: 7px 12px; font-size: 13px; }
.vp-rte .btn-danger { color: var(--red); border-color: #EFC9C9; }
.vp-rte .btn-danger:hover { background: #FEF7F7; border-color: var(--red); }

.vp-rte .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; }
.vp-rte .chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.vp-rte .chip.ok { background: var(--green-bg); color: var(--green); }
.vp-rte .chip.ok .dot { background: var(--green); }
.vp-rte .chip.warn { background: var(--amber-bg); color: var(--amber); }
.vp-rte .chip.warn .dot { background: var(--amber); }

.vp-rte .shell { max-width: 1140px; margin: 0 auto; padding: 22px 8px 110px; }

.vp-rte .alert { display: none; gap: 11px; align-items: flex-start; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
  background: var(--amber-bg); border: 1px solid #F3DCA8; color: #7A4A0B; font-size: 13px; }
.vp-rte .alert.on { display: flex; }
.vp-rte .alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--amber); }
.vp-rte .alert b { font-weight: 700; }

.vp-rte .flow { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 14px; }
.vp-rte .flow h2 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.vp-rte .flow .p { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; }
.vp-rte .stages { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.vp-rte .stage { flex: 1; min-width: 150px; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; background: #FBFCFE; }
.vp-rte .stage.skipped { background: #FFFBF2; border-color: #F3DCA8; }
.vp-rte .stage.act { background: linear-gradient(160deg,#FFFFFF,#F1F3FF); border-color: #D9DEFF; }
.vp-rte .stage .num { font-family: var(--mono); font-size: 10.5px; font-weight: 700; color: var(--soft); }
.vp-rte .stage .t { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-top: 5px; }
.vp-rte .stage .d { font-size: 11.5px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.vp-rte .stage .badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 5px; margin-top: 8px; }
.vp-rte .stage .badge.off { background: var(--amber-bg); color: var(--amber); }
.vp-rte .stage .badge.on { background: var(--green-bg); color: var(--green); }
.vp-rte .gap { display: flex; align-items: center; justify-content: center; padding: 0 8px; color: var(--soft); }
.vp-rte .gap svg { width: 18px; height: 18px; }

.vp-rte .cols { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: start; }
.vp-rte .card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; margin-bottom: 14px; overflow: hidden; }
.vp-rte .card-head { padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.vp-rte .card-head h2 { font-size: 14.5px; font-weight: 700; }
.vp-rte .card-head .desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.vp-rte .card-body { padding: 16px 20px 20px; }

.vp-rte .dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px 22px; }
.vp-rte .di .k { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.vp-rte .di .v { font-size: 13.5px; color: var(--ink); }
.vp-rte .di .v.mono { font-family: var(--mono); font-size: 12.5px; }
.vp-rte .di .v.empty { color: var(--soft); font-style: italic; }
.vp-rte .di .v.off { color: var(--amber); font-weight: 600; }

.vp-rte .vrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0;
  border-top: 1px solid var(--line-soft); }
.vp-rte .vrow:first-of-type { border-top: none; }
.vp-rte .vrow .vt { font-size: 13px; font-weight: 600; color: var(--ink); }
.vp-rte .vrow .vd { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.vp-rte .tog { width: 38px; height: 21px; border-radius: 999px; background: #D9DFE9; position: relative; flex-shrink: 0;
  border: none; transition: background .15s; padding: 0; }
.vp-rte .tog::after { content: ""; position: absolute; left: 2px; top: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.2); transition: transform .15s; }
.vp-rte .tog[aria-checked="true"] { background: var(--green); }
.vp-rte .tog[aria-checked="true"]::after { transform: translateX(17px); }

.vp-rte .linkline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0;
  border-top: 1px solid var(--line-soft); font-size: 13px; }
.vp-rte .linkline:first-of-type { border-top: none; }
.vp-rte .linkline .k { color: var(--muted); font-size: 12.5px; }

.vp-rte .danger { border: 1px solid #EFC9C9; background: #FEF7F7; border-radius: 13px; padding: 16px 20px; }
.vp-rte .danger h3 { font-size: 13.5px; font-weight: 700; color: var(--red); margin-bottom: 6px; }
.vp-rte .danger p { font-size: 12.5px; color: #7F1D1D; margin: 0 0 12px; }

.vp-rte .fld { min-width: 0; }
.vp-rte .fld.span { grid-column: 1 / -1; }
.vp-rte li.input { list-style: none; margin: 0; padding: 0; }
.vp-rte li.input .inline-hints { display: none !important; }
.vp-rte .fld label, .vp-rte li.input > label, .vp-rte label.label {
  font-size: 12.5px; font-weight: 600; color: var(--text); }
.vp-rte .fld .req, .vp-rte abbr { color: var(--red); text-decoration: none; border: 0; }
.vp-rte .fld input[type=text], .vp-rte .fld input[type=number], .vp-rte .fld select,
.vp-rte li.input input[type=text], .vp-rte li.input input[type=number], .vp-rte li.input select {
  width: 100% !important; max-width: none !important; padding: 9px 11px; font-family: inherit; font-size: 13.5px;
  color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.vp-rte .ts-wrapper { width: 100% !important; max-width: 100% !important; }
.vp-rte .ts-wrapper .ts-control { border: 1px solid var(--line) !important; border-radius: var(--r) !important;
  padding: 8px 11px !important; min-height: 40px; background: var(--surface) !important; }
.vp-rte .ts-wrapper.focus .ts-control { border-color: var(--blue) !important; box-shadow: 0 0 0 3px rgba(68,77,249,.10) !important; }
.vp-rte .fld input:focus, .vp-rte .fld select:focus, .vp-rte li.input input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(68,77,249,.10); }
.vp-rte .help { font-size: 11.5px; color: var(--soft); margin-top: 5px; line-height: 1.45; }

.vp-rte .qbtn { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--soft); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; padding: 0; line-height: 1; }
.vp-rte .qbtn:hover, .vp-rte .qbtn[aria-expanded="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.vp-rte-lab { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }

.vp-rte-pop { position: absolute; z-index: 2147483646; width: 330px; max-width: calc(100vw - 32px); background: #0F172A;
  color: #E2E8F5; border-radius: 11px; padding: 14px 15px; box-shadow: 0 16px 40px rgba(15,23,42,.30);
  font-size: 12.5px; line-height: 1.55; }
.vp-rte-pop h4 { font-size: 13px; color: #fff; margin-bottom: 6px; font-weight: 700; }
.vp-rte-pop p { margin: 0 0 9px; color: #B9C6DE; }
.vp-rte-pop .ex { background: rgba(255,255,255,.07); border-radius: 7px; padding: 9px 11px; }
.vp-rte-pop .ex .exl { font-size: 10px; font-weight: 700; letter-spacing: .05em; color: #7E8CA8; margin-bottom: 4px; }
.vp-rte-pop .ex code { font-family: var(--mono); font-size: 11.5px; color: #7EE0C3; display: block; }
.vp-rte-pop .ex .note { color: #94A3B8; font-size: 11.5px; margin-top: 6px; }
.vp-rte-pop::after { content: ""; position: absolute; left: 22px; top: -5px; width: 10px; height: 10px;
  background: #0F172A; transform: rotate(45deg); border-radius: 2px; }
.vp-rte-pop.above::after { top: auto; bottom: -5px; }

.vp-rte .rg { display: grid; grid-template-columns: 26px 1fr 34px; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #FBFCFE; margin-bottom: 8px; }
.vp-rte .rg .ord { display: flex; align-items: center; justify-content: center; font-family: var(--mono);
  font-size: 11px; font-weight: 700; color: var(--soft); background: #EEF2F8; border-radius: 6px; height: 22px; }
.vp-rte .rg .nm { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.vp-rte .rg .nm a { color: var(--ink); }
.vp-rte .rg .meta { font-size: 11.5px; color: var(--soft); margin-top: 1px; }
.vp-rte .rg .rm { border: none; background: none; color: var(--soft); border-radius: 6px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center; }
.vp-rte .rg .rm:hover { background: var(--red-bg); color: var(--red); }
.vp-rte .rg .rm svg { width: 14px; height: 14px; }
.vp-rte .addrow { margin-top: 10px; }
.vp-rte .addrow .hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.vp-rte .sidep { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.vp-rte .sidep b { color: var(--ink); font-weight: 700; }
.vp-rte .sidep .step { margin-bottom: 9px; }
.vp-rte .sidep .step:last-child { margin-bottom: 0; }

.vp-rte .savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.vp-rte .savebar-in { max-width: 1140px; margin: 0 auto; padding: 13px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vp-rte .savebar .msg { font-size: 13px; color: var(--muted); }

.vp-rte .errors, .vp-rte .semantic-errors, .vp-rte .flash { border-radius: 10px; padding: 12px 16px; margin: 0 0 14px; }

.vp-rte fieldset.inputs { border: 0; margin: 0; padding: 0; background: transparent; }
.vp-rte fieldset.inputs > legend, .vp-rte fieldset.inputs > ol { margin: 0; padding: 0; list-style: none; }
.vp-rte form.formtastic > h2,
.vp-rte form.formtastic > h3,
.vp-rte fieldset > legend { display: none !important; }

@media (max-width: 900px) {
  .vp-rte .cols { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .vp-rte .stages { flex-direction: column; }
  .vp-rte .gap { padding: 8px 0; transform: rotate(90deg); }
}

body.vp-rte-on #footer,
body.vp-rte-on #title_bar,
body.vp-rte-on #sidebar { display: none !important; }
body.vp-rte-on #vp-ws { background: #F7F9FC; }
body.routing_routing_plans.edit #main_content_wrapper,
body.routing_routing_plans.new #main_content_wrapper,
body.routing_routing_plans.edit #main_content,
body.routing_routing_plans.new #main_content,
body.routing_routing_plans.edit #active_admin_content,
body.routing_routing_plans.new #active_admin_content {
  margin: 0 !important; padding: 0 !important; width: 100% !important; max-width: none !important; float: none !important;
}
