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

.vp-sim {
  --navy:#0c1729; --blue:#2166e8; --blue-dark:#174da8; --blue-light:#eef5ff;
  --text:#20324b; --muted:#71819a; --border:#dfe5ed; --background:#f4f7fb; --white:#ffffff;
  --success:#2eb879; --success-bg:#edf9f3; --shadow:0 2px 8px rgba(23,44,74,.06);
  --green:#15803D; --green-bg:#DCFCE7; --red:#B91C1C; --red-bg:#FEE2E2;
  --amber:#B45309; --amber-bg:#FEF3C7; --ink:#0F172A; --soft:#94A3B8;
  --line:#E4E9F2; --r:8px; --mono:"JetBrains Mono","Roboto Mono",ui-monospace,monospace;
  max-width: 1100px; margin: 0 auto; padding: 8px 16px 32px;
  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-sim, .vp-sim *, .vp-sim *::before, .vp-sim *::after,
.vp-sim-drawer, .vp-sim-drawer *, .vp-sim-drawer *::before, .vp-sim-drawer *::after {
  box-sizing: border-box; text-shadow: none !important; -webkit-text-stroke: 0 !important;
}
body.active_admin .vp-sim button,
body.active_admin .vp-sim .preset,
body.active_admin .vp-sim .tab,
body.active_admin .vp-sim .preset-title,
body.active_admin .vp-sim .preset-description,
body.active_admin .vp-sim-drawer button {
  text-shadow: none !important;
  background-image: none !important;
  filter: none !important;
  box-shadow: none !important;
  -webkit-font-smoothing: antialiased;
}
body.active_admin .vp-sim button.preset,
body.active_admin .vp-sim button.tab,
body.active_admin .vp-sim button.btn,
body.active_admin .vp-sim button.tog {
  color: #29405f !important;
  -webkit-text-fill-color: currentColor !important;
  background: #fff !important;
  box-shadow: none !important;
}
body.active_admin .vp-sim button.preset.active {
  background: #eef5ff !important;
  border-color: #2972f3 !important;
}
body.active_admin .vp-sim button.tab.active {
  background: #2669eb !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
body.active_admin .vp-sim button.btn-primary {
  background: #266be9 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
body.active_admin .vp-sim .preset-title { color: #29405f !important; font-weight: 700 !important; }
body.active_admin .vp-sim .preset-description { color: #7d8da5 !important; font-weight: 400 !important; }
.vp-sim h1, .vp-sim h2, .vp-sim h3 { margin: 0; color: var(--ink); letter-spacing: -.02em; }
.vp-sim button { font-family: inherit; cursor: pointer; }
.vp-sim a { color: var(--blue); text-decoration: none; }
.vp-sim a:hover { text-decoration: underline; }
.vp-sim :focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.vp-sim svg { display: block; flex-shrink: 0; }

.vp-sim .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.vp-sim .crumb { font-size: 14px; color: #667893; margin-bottom: 10px; }
.vp-sim .crumb a { color: var(--blue); font-weight: 700; }
.vp-sim .page-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 3px; }
.vp-sim .page-heading .phone { width: 36px; height: 36px; color: #315f9b; }
.vp-sim .page-heading h1 { font-size: 29px; font-weight: 700; letter-spacing: -.5px; }
.vp-sim .subtitle { color: #617594; font-size: 14px; }
.vp-sim .brand-inline { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 8px; }
.vp-sim .brand-logo, .vp-sim-drawer .brand-logo { height: 32px; width: auto; max-width: 160px; display: block; }
.vp-sim .yeti-subtitle { font-size: 12px; color: #3d6494; font-weight: 600; letter-spacing: .04em; }

.vp-sim .card { background: var(--white); border: 1px solid #e0e6ee; border-radius: 8px; box-shadow: var(--shadow); }
.vp-sim .simulation-card { padding: 16px 20px 14px; }
.vp-sim .presets-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.vp-sim .preset { border: 1px solid #dbe3ee; border-radius: 10px; padding: 12px 14px; display: flex; gap: 11px;
  cursor: pointer; transition: .15s ease; background: #fff; width: 100%; text-align: left; }
.vp-sim .preset:hover { border-color: #8bb3fa; background: #f8fbff; }
.vp-sim .preset.active { border: 1.5px solid #2972f3; background: #eef5ff; }
.vp-sim .preset-icon { width: 27px; flex-shrink: 0; color: #315f9b; padding-top: 1px; }
.vp-sim .preset-title { font-weight: 700; font-size: 13px; color: #29405f; }
.vp-sim .preset-description { font-size: 11px; color: #7d8da5; margin-top: 3px; }

.vp-sim .tabs { display: flex; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid #e3e8ef; }
.vp-sim .tab { padding: 9px 18px; border-radius: 7px; color: #45617f; font-weight: 600; font-size: 13px;
  border: none; background: none; }
.vp-sim .tab.active { background: #2669eb; color: #fff; }
.vp-sim .form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; padding: 16px 0 8px; }
.vp-sim .form-grid.three { grid-template-columns: minmax(240px, 1.4fr) 1fr 1fr; }
.vp-sim .advanced-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px 20px; padding: 16px 0 4px; }
.vp-sim .details-tab[hidden], .vp-sim .advanced[hidden] { display: none !important; }

.vp-sim .fld { min-width: 0; }
.vp-sim .fld label {
  display: block; font-size: 12px; font-weight: 700; color: #7388a5; margin-bottom: 7px; }
.vp-sim .fld input[type=text], .vp-sim .fld input[type=number], .vp-sim .fld select {
  height: 39px; width: 100% !important; max-width: none !important; border: 1px solid #d9e1eb; border-radius: 9px;
  background: #fff; color: #263d5d; padding: 0 12px; font-size: 13px; font-family: inherit; }
.vp-sim .fld input:focus, .vp-sim .fld select:focus {
  outline: none; border-color: #6da1f4; box-shadow: 0 0 0 3px rgba(43,110,232,.08); }
.vp-sim .help { font-size: 10px; color: #8998ad; margin-top: 5px; }

.vp-sim .vrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; }
.vp-sim .vrow .vt { font-size: 13px; font-weight: 600; color: var(--ink); }
.vp-sim .vrow .vd { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.vp-sim .tog { width: 38px; height: 21px; border-radius: 999px; background: #D9DFE9; position: relative; flex-shrink: 0;
  border: none; transition: background .15s; padding: 0; }
.vp-sim .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-sim .tog[aria-checked="true"] { background: var(--success); }
.vp-sim .tog[aria-checked="true"]::after { transform: translateX(17px); }

.vp-sim .locked { margin-top: 4px; padding: 10px 12px; background: #f6f8fc; border: 1px solid #e4ebf4; border-radius: 8px;
  font-size: 12px; color: #5a7394; }
.vp-sim .locked b { color: #243d61; font-weight: 700; }
.vp-sim .form-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; gap: 10px; flex-wrap: wrap; }
.vp-sim .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border-radius: 8px;
  padding: 0 18px; border: 1px solid #b7cce8; background: #fff; color: #526b89; font-size: 13px; font-weight: 700; text-decoration: none !important; }
.vp-sim .btn:hover { background: #f5f8fc; }
.vp-sim .btn-primary { background: #266be9; border-color: #266be9; color: #fff !important; min-width: 220px; }
.vp-sim .btn-primary:hover { background: #1d5bd0; }
.vp-sim .btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.vp-sim .btn svg { width: 14px; height: 14px; }
.vp-sim .flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; background: #FEE2E2; color: #B91C1C; }

/* CDR-style result drawer */
.vp-sim-scrim {
  position: fixed; inset: 0; background: rgba(15,23,42,.34); opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s; z-index: 5000;
}
.vp-sim-scrim.on { opacity: 1; visibility: visible; }
.vp-sim-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(920px, 96vw);
  background: #fff; border-left: 1px solid #E4E9F2; z-index: 5001;
  transform: translateX(100%); transition: transform .24s ease; visibility: hidden;
  display: flex; flex-direction: column; box-shadow: -16px 0 44px rgba(15,23,42,.14);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20324b; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.vp-sim-drawer.on { transform: none; visibility: visible; }
.vp-sim-drawer .dr-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid #E4E9F2; flex-shrink: 0;
}
.vp-sim-drawer .dr-close {
  border: none; background: none; width: 32px; height: 32px; border-radius: 7px; color: #5A6B82;
  display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.vp-sim-drawer .dr-close:hover { background: #EDF1F8; color: #0F172A; }
.vp-sim-drawer .connection { background: #edf9f3; border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 9px; }
.vp-sim-drawer .status-dot { width: 10px; height: 10px; background: #2eb879; border-radius: 50%; box-shadow: 0 0 0 4px rgba(46,184,121,.1); flex-shrink: 0; }
.vp-sim-drawer .connection-title { font-weight: 700; color: #25805c; font-size: 15px; }
.vp-sim-drawer .connection-text { color: #6b9a88; font-size: 11px; margin-top: 2px; }
.vp-sim-drawer .dr-meta { font-size: 12.5px; color: #5A6B82; margin-top: 10px; font-family: "JetBrains Mono","Roboto Mono",ui-monospace,monospace; }
.vp-sim-drawer .dr-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }
.vp-sim-drawer .checks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.vp-sim-drawer .chip { display: inline-flex; align-items: flex-start; gap: 6px; padding: 7px 10px; border-radius: 8px;
  background: #f4f7fb; font-size: 12px; color: #334e73; max-width: 100%; }
.vp-sim-drawer .chip.ok { background: #edf9f3; color: #1f7a4d; }
.vp-sim-drawer .chip.fail { background: #FEE2E2; color: #B91C1C; }
.vp-sim-drawer .chip.warn { background: #FEF3C7; color: #B45309; }
.vp-sim-drawer .chip .mark { width: 14px; flex-shrink: 0; margin-top: 1px; }
.vp-sim-drawer .chip svg { width: 14px; height: 14px; }
.vp-sim-drawer .th { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #2d507c; text-transform: uppercase;
  margin: 4px 0 10px; }
.vp-sim-drawer .lcr-hero { background: #edf9f3; border: 1px solid #c8ecd8; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.vp-sim-drawer .lcr-kicker { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: #25805c; text-transform: uppercase; }
.vp-sim-drawer .lcr-name { font-size: 22px; font-weight: 700; color: #146044; margin: 4px 0 10px; }
.vp-sim-drawer .lcr-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.vp-sim-drawer .lcr-grid .k { font-size: 11px; color: #5a8f73; }
.vp-sim-drawer .lcr-grid .v { font-size: 14px; font-weight: 700; color: #146044; }
.vp-sim-drawer .lcr-grid .v.neg { color: #b91c1c; }
.vp-sim-drawer .lcr-grid .v.pos { color: #15803d; }
.vp-sim-drawer .routegrip { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vp-sim-drawer .routecard { border: 1px solid #e0e6ee; border-radius: 9px; padding: 12px 14px; background: #fbfcfe; }
.vp-sim-drawer .routecard.sel { border-color: #2972f3; background: #f5f8ff; }
.vp-sim-drawer .routecard.cheap { box-shadow: inset 3px 0 0 #2eb879; }
.vp-sim-drawer .routecard .nm { font-weight: 700; color: #172b48; font-size: 13px; margin-bottom: 4px; }
.vp-sim-drawer .kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; padding: 3px 0; }
.vp-sim-drawer .kv .k { color: #667e9f; }
.vp-sim-drawer .kv .v { color: #3c5d85; font-weight: 600; text-align: right; }
.vp-sim-drawer .trow { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; color: #334e73; }
.vp-sim-drawer .trow.fail { color: #b91c1c; }
.vp-sim-drawer .result-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 700; margin-top: 16px; }
.vp-sim-drawer .result-pill.ok { background: #edf9f3; color: #257854; }
.vp-sim-drawer .result-pill.fail { background: #FEE2E2; color: #B91C1C; }
.vp-sim-drawer .result-pill svg { width: 14px; height: 14px; }

@media (max-width: 900px) {
  .vp-sim .form-grid.three, .vp-sim .advanced-grid, .vp-sim .presets-row { grid-template-columns: 1fr; }
  .vp-sim .top { flex-direction: column; }
  .vp-sim .brand-inline { align-items: flex-start; }
  .vp-sim-drawer .routegrip { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .vp-sim .page-heading h1 { font-size: 24px; }
  .vp-sim .form-footer { flex-direction: column-reverse; align-items: stretch; }
  .vp-sim .btn, .vp-sim .btn-primary { width: 100%; min-width: 0; }
}

body.vp-sim-on #footer,
body.vp-sim-on #title_bar,
body.vp-sim-on #sidebar { display: none !important; }
body.active_admin .vp-sim h1,
body.active_admin .vp-sim h2,
body.active_admin .vp-sim .preset-title,
body.active_admin .vp-sim .preset-description,
body.active_admin .vp-sim .subtitle {
  text-shadow: none !important;
  filter: none !important;
  -webkit-text-stroke: 0 !important;
}
body.vp-sim-on #main_content_wrapper { display: none !important; }
body.vp-sim-on #vp-ws { background: #f4f7fb; }
body.vp-sim-drawer-on { overflow: hidden; }
body.routing_simulation #main_content_wrapper,
body.routing_simulation #main_content,
body.routing_simulation #active_admin_content {
  margin: 0 !important; padding: 0 !important; width: 100% !important; max-width: none !important; float: none !important;
}
