/* route-builder.css — Mongolia Drive: Route Builder (/route-builder) */
.rb-hero { padding: 48px 0 40px; background: linear-gradient(135deg, #1B5E3B 0%, #24724a 60%, #2f7d55 100%); }
.rb-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: var(--sand-gold); margin-bottom: 6px; }
.rb-lead { max-width: 720px; margin-top: 12px; opacity: .92; font-size: 1.02rem; }

.rb-app { background: var(--ivory); padding: 28px 0 56px; }
.rb-wrap { width: min(1320px, 100% - 32px); margin: 0 auto; display: grid; grid-template-columns: minmax(340px, 470px) 1fr; gap: 24px; align-items: start; }
.rb-mapcol { position: sticky; top: calc(var(--header-h) + 12px); display: grid; gap: 10px; }
@media (max-width: 980px) {
  .rb-wrap { grid-template-columns: 1fr; }
  .rb-mapcol { position: static; order: -1; }
}

/* Төлөвлөгөө */
.rb-plan { display: grid; gap: 14px; }
.rb-plan-top { background: #fff; border: 1px solid #e3e2da; border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.rb-title-field, .rb-start-field { display: grid; gap: 4px; font-size: .78rem; font-weight: 700; color: #5b625f; text-transform: uppercase; letter-spacing: .06em; }
.rb-title-field input, .rb-start-field select { font: inherit; font-size: 1.05rem; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--charcoal); border: 1px solid #d7d6cc; border-radius: 8px; padding: 9px 12px; background: #fff; width: 100%; }
.rb-title-field input:focus, .rb-start-field select:focus, .rb-add-field input:focus { outline: 2px solid rgba(27, 94, 59, .35); border-color: var(--altai-forest); }
.rb-start-field { background: #fff; border: 1px solid #e3e2da; border-radius: 12px; padding: 12px 16px; }
.rb-total { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; color: #4b524f; }
.rb-total b { color: var(--altai-forest); font-size: 1.05rem; }

.rb-days { list-style: none; display: grid; gap: 12px; counter-reset: none; }
.rb-day { background: #fff; border: 1px solid #e3e2da; border-left: 4px solid #cfd8d2; border-radius: 12px; padding: 12px 14px 14px; display: grid; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.rb-day.is-active { border-left-color: var(--altai-forest); box-shadow: 0 6px 18px rgba(31, 35, 35, .07); }
.rb-day.is-long { border-left-color: #d9a96c; }
.rb-day.is-far { border-left-color: #D64545; }
.rb-day-head { display: grid; grid-template-columns: auto 1fr auto auto; gap: 4px 10px; align-items: center; }
.rb-day-no { background: var(--altai-forest); color: #fff; font-weight: 800; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 6px; }
.rb-day-route { font-weight: 700; font-size: .98rem; line-height: 1.25; }
.rb-day-stat { font-size: .82rem; color: #5b625f; white-space: nowrap; }
.rb-day-stat i { font-style: normal; font-size: .7rem; background: #f0efe8; padding: 1px 5px; border-radius: 4px; margin-left: 4px; }
@media (max-width: 520px) { .rb-day-head { grid-template-columns: auto 1fr auto; } .rb-day-stat { grid-column: 1 / -1; grid-row: 2; } }
.rb-x { border: none; background: none; font-size: 1.3rem; line-height: 1; color: #8a908d; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.rb-x:hover { background: #f2f1ea; color: var(--charcoal); }
.rb-empty { font-size: .9rem; color: #5b625f; }

.rb-stops { list-style: none; display: grid; gap: 8px; }
.rb-stop { border: 1px solid #ecebe4; border-radius: 10px; padding: 8px 10px; background: #fcfcf9; }
.rb-stop-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.rb-stop-ic { width: 32px; height: 32px; border-radius: 50%; background: #eaf2ed; color: var(--altai-forest); display: grid; place-items: center; }
.rb-stop-name { text-align: left; border: none; background: none; font: inherit; cursor: pointer; display: grid; color: inherit; padding: 0; }
.rb-stop-name b { font-size: .95rem; }
.rb-stop-name small { font-size: .78rem; color: #6b726f; }
.rb-stop-name:hover b { color: var(--altai-forest); text-decoration: underline; }
.rb-stop-tools { display: flex; gap: 2px; }
.rb-stop-tools button { border: 1px solid #e3e2da; background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: .9rem; color: #5b625f; }
.rb-stop-tools button:hover { border-color: var(--altai-forest); color: var(--altai-forest); }
.rb-more { margin-top: 6px; font-size: .88rem; }
.rb-more summary { cursor: pointer; color: var(--altai-forest); font-weight: 700; font-size: .82rem; }
.rb-more[open] summary { margin-bottom: 6px; }

.rb-sum { font-size: .9rem; color: #3f4644; margin-bottom: 8px; }
.rb-x-block { margin-top: 8px; }
.rb-x-block h5 { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #6b726f; margin-bottom: 4px; }
.rb-bullets { padding-left: 18px; font-size: .88rem; }
.rb-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.rb-tags li { background: #eaf2ed; color: #1B5E3B; border-radius: 999px; padding: 3px 11px; font-size: .82rem; font-weight: 700; }
.rb-tags li small { font-weight: 400; color: #4b524f; margin-left: 6px; }
.rb-camps { list-style: none; display: grid; gap: 4px; font-size: .88rem; }
.rb-camps li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rb-camps button, .rb-town { border: none; background: none; font: inherit; color: var(--altai-forest); font-weight: 700; cursor: pointer; padding: 0; text-align: left; }
.rb-camps button:hover, .rb-town:hover { text-decoration: underline; }
.rb-camps small { color: #6b726f; }
.rb-svcs { display: flex; flex-wrap: wrap; gap: 4px; }
.rb-svc { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; background: #f4f3ec; border-radius: 999px; padding: 1px 8px 1px 6px; margin-left: 2px; }
.rb-svc span { color: #4b524f; }
.rb-onway ul .rb-svc span, .rb-camps .rb-svc span { display: none; }
.rb-onway { background: #f7f8f5; border-radius: 10px; padding: 8px 10px; }
.rb-onway h4 { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #6b726f; margin-bottom: 4px; }
.rb-onway ul { list-style: none; display: grid; gap: 3px; font-size: .88rem; }
.rb-onway li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }

.rb-warn { border-radius: 10px; padding: 10px 12px; font-size: .88rem; }
.rb-warn.is-long { background: #fbf3e6; color: #6d4a17; }
.rb-warn.is-far { background: #fdeeee; color: #7c2323; }
.rb-opts { display: grid; gap: 6px; margin-top: 8px; }
.rb-opt { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; text-align: left; background: #fff; border: 1px solid #f0c9c9; border-radius: 8px; padding: 8px 10px; font: inherit; cursor: pointer; color: var(--charcoal); }
.rb-opt:hover { border-color: var(--altai-forest); }
.rb-opt b { display: block; font-size: .9rem; }
.rb-opt small { font-size: .78rem; color: #5b625f; }
.rb-opt .rm-ic { color: var(--altai-forest); }

.rb-add { position: relative; }
.rb-add-field { display: flex; align-items: center; gap: 8px; border: 1px dashed #c8cdc4; border-radius: 10px; padding: 2px 10px; background: #fff; }
.rb-add-field span { color: var(--altai-forest); font-weight: 800; font-size: 1.2rem; }
.rb-add-field input { border: none; flex: 1; font: inherit; font-size: .92rem; padding: 9px 0; background: none; min-width: 0; }
.rb-add-field input:focus { outline: none; }
.rb-add.is-open .rb-add-field { border-style: solid; border-color: var(--altai-forest); }
.rb-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #dcdbd2; border-radius: 10px; box-shadow: 0 14px 34px rgba(31, 35, 35, .16); max-height: 360px; overflow: auto; }
.rb-results ul { list-style: none; }
.rb-results button { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; border: none; background: none; padding: 8px 12px; font: inherit; cursor: pointer; color: var(--charcoal); }
.rb-results button:hover, .rb-results button:focus { background: #f2f6f3; outline: none; }
.rb-results b { display: block; font-size: .9rem; }
.rb-results small { font-size: .75rem; color: #6b726f; }
.rb-results em { font-style: normal; font-size: .76rem; color: #3f6e52; white-space: nowrap; }
.rb-results em.is-long { color: #a26b1b; }
.rb-results em.is-far { color: #b33636; }
.rb-results .rm-ic { color: var(--altai-forest); }
.rb-none { padding: 14px; color: #6b726f; font-size: .9rem; }

.rb-add-day { border: 2px dashed #c8cdc4; background: transparent; border-radius: 12px; padding: 12px; font: inherit; font-weight: 700; color: var(--altai-forest); cursor: pointer; }
.rb-add-day:hover { background: #fff; border-color: var(--altai-forest); }
.rb-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rb-reset { border: none; background: none; font: inherit; color: #6b726f; text-decoration: underline; cursor: pointer; font-size: .9rem; }
.rb-flash { background: #1B5E3B; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: .9rem; }

/* Газрын зураг */
.rb-regions { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-regions button { border: 1px solid #d7d6cc; background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: .84rem; font-weight: 700; color: #4b524f; cursor: pointer; }
.rb-regions button.is-on { background: var(--altai-forest); border-color: var(--altai-forest); color: #fff; }
.rb-map { background: #fff; border: 1px solid #e3e2da; border-radius: 12px; overflow: hidden; min-height: 240px; }
.rb-dots .rb-dot { cursor: pointer; }
.rb-dots .rb-hit { fill: transparent; stroke: none; }
.rb-dots circle:not(.rb-hit) { fill: #fff; stroke: #1B5E3B; opacity: .9; }
.rb-dots .is-town circle:not(.rb-hit) { stroke: #6e7d72; }
.rb-dots .is-camp circle:not(.rb-hit) { stroke: #C0832B; }
.rb-dots .rb-dot:hover circle:not(.rb-hit), .rb-dots .rb-dot:focus circle:not(.rb-hit) { fill: #1B5E3B; opacity: 1; }
.rb-dots .rb-dot:focus { outline: none; }
.rb-hint { font-size: .8rem; color: #5b625f; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.rb-hint-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #1B5E3B; background: #fff; display: inline-block; }
.rb-hint-dot.is-town { border-color: #6e7d72; }
.rb-hint-dot.is-camp { border-color: #C0832B; }

.rb-info { background: #fff; border: 1px solid #e3e2da; border-radius: 12px; padding: 14px 16px; box-shadow: 0 8px 22px rgba(31, 35, 35, .08); }
.rb-info header { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.rb-info h3 { font-size: 1.1rem; }
.rb-info header small { font-size: .8rem; color: #6b726f; }
.rb-info-ic { width: 40px; height: 40px; border-radius: 50%; background: #eaf2ed; color: var(--altai-forest); display: grid; place-items: center; }
.rb-info-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.rb-info-actions .btn { padding: 10px 18px; font-size: .92rem; }
.rb-info-actions small { color: #5b625f; font-size: .82rem; }
.rb-contact { margin-top: 8px; font-size: .88rem; display: flex; gap: 12px; }

/* Бэлэн маршрутууд */
.rb-samples { background: #fff; }
.rb-samples .section-head { margin-bottom: 22px; }
.rb-sample-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rb-sample { border: 1px solid #e3e2da; border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--ivory); }
.rb-sample h3 { font-size: 1.15rem; color: var(--altai-forest); }
.rb-sample p { font-size: .9rem; color: #3f4644; }
.rb-sample-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-sample-meta span { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: #fff; border: 1px solid #e3e2da; padding: 2px 8px; border-radius: 999px; color: #5b625f; }
.rb-sample-stat b { color: var(--charcoal); }
.rb-sample-path { font-size: .8rem !important; color: #6b726f !important; flex: 1; }
.rb-sample .btn { align-self: flex-start; padding: 10px 18px; font-size: .92rem; }

.rb-how { background: var(--ivory); }
.rb-how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.rb-how h3 { font-size: 1.05rem; color: var(--altai-forest); margin-bottom: 6px; }
.rb-how p { font-size: .92rem; color: #3f4644; }
.rb-cta { background: var(--altai-forest); color: #fff; border-radius: 12px; padding: 18px; }
.rb-cta h3, .rb-cta p { color: #fff; }
.rb-cta .btn { margin-top: 12px; background: #fff; color: var(--altai-forest); padding: 10px 18px; font-size: .92rem; }

/* Имэйлийн цонх */
.rb-dialog { margin: auto; border: none; border-radius: 14px; padding: 0; width: min(480px, calc(100% - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.rb-dialog::backdrop { background: rgba(20, 25, 23, .55); }
.rb-dialog form { padding: 24px; display: grid; gap: 12px; position: relative; }
.rb-dialog h2 { font-size: 1.4rem; margin: 0; padding-right: 30px; }
.rb-dialog p { font-size: .92rem; color: #3f4644; }
.rb-dialog label { display: grid; gap: 4px; font-size: .85rem; font-weight: 700; }
.rb-dialog label small { font-weight: 400; color: #6b726f; }
.rb-dialog input:not([type="checkbox"]) { font: inherit; font-weight: 400; border: 1px solid #d7d6cc; border-radius: 8px; padding: 10px 12px; }
.rb-dialog .rb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rb-dialog .rb-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: .84rem; color: #3f4644; }
.rb-dialog .rb-check input { margin-top: 3px; }
.rb-dialog-x { position: absolute; top: 14px; right: 14px; }
.rb-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; }
.rb-msg { color: #b33636 !important; min-height: 1em; font-size: .86rem !important; }
.rb-small { font-size: .8rem !important; color: #6b726f !important; }
@media (max-width: 480px) { .rb-dialog .rb-row { grid-template-columns: 1fr; } }

/* Хадгалах: account мөр, хадгалсан төлөв, "My routes" цонх */
.rb-account { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; background: #eaf2ed; border-radius: 10px; padding: 9px 14px; font-size: .88rem; color: #3f4644; }
.rb-account[hidden] { display: none; }
.rb-acc-who { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.rb-acc-link { border: none; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--altai-forest); text-decoration: underline; cursor: pointer; }
.rb-acc-link.is-muted { color: #6b726f; font-weight: 400; }
.rb-save { display: inline-flex; align-items: center; gap: 8px; }
.rb-save.is-saved { border-color: var(--altai-forest); color: var(--altai-forest); background: #eaf2ed; }
.rb-save-state { font-size: .85rem; color: var(--altai-forest); margin: 0; }
.rb-save-state[hidden] { display: none; }
.rb-save-state[data-kind="error"] { color: #b33636; }
.rb-dialog form[hidden] { display: none; }
.rb-code { font-size: 1.5rem !important; letter-spacing: .4em; text-align: center; font-weight: 700 !important; }
.rb-dialog-body { padding: 24px; display: grid; gap: 14px; position: relative; }
.rb-routes-dlg { width: min(560px, calc(100% - 32px)); }
.rb-routes-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.rb-routes-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid #e3e2da; border-radius: 10px; padding: 10px 12px; }
.rb-routes-list li.is-current { border-color: var(--altai-forest); background: #f4f9f6; }
.rb-routes-list li > div:first-child { display: grid; gap: 2px; min-width: 0; }
.rb-routes-list b { color: var(--charcoal); overflow-wrap: anywhere; }
.rb-routes-list small { color: #6b726f; font-size: .8rem; }
.rb-routes-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rb-routes-tools .btn { padding: 7px 14px; font-size: .86rem; }
.rb-routes-tools span { font-size: .8rem; font-weight: 700; color: var(--altai-forest); }
.rb-routes-list .rb-routes-empty { display: block; color: #6b726f; font-size: .9rem; border-style: dashed; }

/* Замын төрөл: засмал / хэсэгчлэн засмал / шороон (route-builder-roads.js-тэй ижил өнгө) */
.rb-map .rm-leg { display: none; }
.rb-swatch { display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: #1B5E3B; }
.rb-swatch.is-mixed { background: #D08A2E; }
.rb-swatch.is-offroad { background: repeating-linear-gradient(90deg, #8A5A34 0 6px, transparent 6px 10px); }
.rb-swatch.is-est { background: repeating-linear-gradient(90deg, #7d8682 0 2px, transparent 2px 6px); }
.rb-roads-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: .82rem; color: #3f4644; }
.rb-roads-legend span { display: inline-flex; align-items: center; }
.rb-surf-split { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: #5b6260; }
.rb-surf-km b { font-size: .86rem !important; color: var(--charcoal) !important; }
.rb-day-surf { display: grid; gap: 5px; margin: 2px 0 10px; }
.rb-surf-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: #ecebe4; }
.rb-surf-bar .rb-swatch { height: 6px; margin: 0; border-radius: 0; }
.rb-day-surf p { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 0; font-size: .8rem; color: #5b6260; }
.rb-day-surf b { color: var(--charcoal); }
/* Урт имэйл хаяг цонхыг хажуу тийш сунгахгүй: grid мөрүүд агуулгаасаа өргөн болохгүй, үгийг таслана */
.rb-dialog { overflow-x: hidden; max-width: calc(100vw - 32px); }
.rb-dialog form, .rb-dialog-body { grid-template-columns: minmax(0, 1fr); }
.rb-dialog form > *, .rb-dialog-body > * { min-width: 0; }
.rb-dialog p, .rb-dialog b { overflow-wrap: anywhere; }
.rb-dialog input:not([type="checkbox"]) { width: 100%; box-sizing: border-box; min-width: 0; }
.rb-dialog-foot { flex-wrap: wrap; }
