
:root{color-scheme:dark;--bg:#09131d;--panel:#10212f;--panel2:#142a38;--line:#294252;--text:#e9e7dc;--muted:#a8bac4;--gold:#e5bc76;--gold2:#a37e43;--red:#e69b98;--green:#93d2b0;--radius:16px}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(ellipse at 60% -16%,#234657 0%,transparent 53%),linear-gradient(180deg,#08131d,#0b1b27 70%,#09131d);color:var(--text);font:15px/1.55 system-ui,-apple-system,"Segoe UI",sans-serif;min-height:100vh}button,input{font:inherit}button{cursor:pointer}button:disabled{opacity:.42;cursor:not-allowed}a{color:var(--gold)}.app{width:min(1280px,calc(100% - 44px));margin:auto;min-height:100vh;display:flex;flex-direction:column}.masthead{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:36px 0 27px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:19px}.brand-mark{display:grid;place-items:center;width:72px;height:72px;border:1px solid var(--gold2);color:var(--gold);border-radius:50%;font-size:34px;background:#182d3b;box-shadow:0 0 0 5px #13263066}.eyebrow{font-size:11px;letter-spacing:.19em;text-transform:uppercase;color:var(--gold);font-weight:750;margin:0 0 4px}h1{font-family:Georgia,"Times New Roman",serif;letter-spacing:.01em;font-weight:500;font-size:clamp(24px,3.5vw,38px);line-height:1.1;margin:0}.tagline{margin:7px 0 0;color:var(--muted);font-size:13px}.top-controls{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px;max-width:380px}.dot{width:8px;height:8px;background:var(--gold);border-radius:100%;flex:0 0 auto}.dot.ready{background:var(--green)}.dot.error{background:var(--red)}.tabs{display:flex;gap:7px;padding:16px 0 28px;overflow:auto}.tab{border:1px solid transparent;padding:10px 18px;color:var(--muted);border-radius:9px;background:transparent;white-space:nowrap;font-weight:650}.tab:hover,.tab:focus-visible{color:var(--text);border-color:var(--line)}.tab.active{color:#191d1e;background:var(--gold);border-color:var(--gold);box-shadow:0 3px 15px #e5bc761c}.button{border:1px solid var(--gold2);border-radius:9px;background:#243a46;color:#f6e6c3;padding:10px 15px;font-weight:650;white-space:nowrap;transition:background .2s}.button:hover{background:#375267}.button.subtle{color:var(--muted);border-color:var(--line);background:#142735}.button.primary{border-color:var(--gold);background:var(--gold);color:#172128}.button.primary:hover{background:#f7d497}.view{padding-bottom:52px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 12px}.section-head h2{font-family:Georgia,"Times New Roman",serif;font-weight:500;font-size:clamp(23px,2.6vw,31px);margin:0}.info-tag{display:inline-block;background:#30434a;color:#f2d9a9;border:1px solid #52645a;border-radius:99px;padding:5px 11px;font-size:12px;white-space:normal}.helper{color:var(--muted);margin:0 0 26px;max-width:820px}.market-grid{display:grid;grid-template-columns:minmax(300px,0.84fr) minmax(340px,1.4fr);gap:20px;align-items:start}.panel{background:linear-gradient(145deg,#152c3a 0%,#0f202d 95%);border:1px solid var(--line);border-radius:var(--radius);padding:23px;min-width:0;box-shadow:0 13px 40px #00000026}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:36px;margin-bottom:20px}.panel-head h3{font-family:Georgia,"Times New Roman",serif;font-size:21px;font-weight:500;margin:0}.muted{color:var(--muted);font-size:13px}.empty{color:var(--muted);padding:25px 12px;text-align:center}.item-list{border:1px solid var(--line);border-radius:10px;max-height:515px;overflow:auto;background:#0b1b27}.item-button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:left;background:transparent;color:var(--text);border:0;border-bottom:1px solid #243b4a;padding:12px 15px;min-height:55px}.item-button:last-child{border-bottom:0}.item-button:hover,.item-button:focus-visible{background:#1b3b4d}.item-button.active{background:#2c4653;border-left:3px solid var(--gold);padding-left:12px}.item-label{font-weight:600}.item-sub{display:block;font-size:11px;color:var(--muted)}.pagination{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:18px}.pagination .button{padding:7px 11px}.inline-fields{display:flex;align-items:center;gap:8px}.inline-fields input{min-width:0;flex:1}.inline-fields .button{flex:0 0 auto}label{display:block;color:#cbdbdf;font-size:13px;font-weight:650;margin:0 0 7px}input{width:100%;min-height:42px;background:#0a1924;border:1px solid #36505e;border-radius:9px;color:var(--text);padding:9px 12px;outline:none}input:focus-visible{border-color:var(--gold);box-shadow:0 0 0 3px #e5bc7625}input::placeholder{color:#8195a3}.catalog-panel input{margin-bottom:14px}.table-scroll{overflow:auto;min-height:250px}table{border-collapse:collapse;width:100%;min-width:470px;font-variant-numeric:tabular-nums}th{text-align:left;white-space:nowrap;font-size:11px;letter-spacing:.12em;color:var(--gold);text-transform:uppercase;font-weight:750;padding:13px 10px;border-bottom:1px solid #4e6163}td{padding:14px 10px;border-bottom:1px solid var(--line);vertical-align:middle}td:first-child{font-weight:650}td:last-child{text-align:right}.price{color:#f1d29d;font-weight:750}.stock-unknown{color:var(--muted);font-size:12px}.footnote{font-size:12px;line-height:1.6;color:var(--muted);margin:17px 0 0}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px;margin-bottom:26px}.form-grid .wide{grid-column:1/-1}.stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin:0}.stat-grid div{border:1px solid var(--line);border-radius:12px;background:#102431;padding:15px}.stat-grid dt{color:var(--muted);font-size:12px}.stat-grid dd{margin:3px 0 0;font-size:clamp(18px,2.3vw,28px);font-weight:700;font-variant-numeric:tabular-nums}.stat-grid .highlight-stat{background:#3e3425;border-color:#887244}.positive{color:var(--green)}.negative{color:var(--red)}.plan-entry{border-bottom:1px solid var(--line);padding:13px 0}.plan-entry:last-child{border-bottom:0}.plan-entry strong{display:block;font-size:15px}.plan-entry small{display:block;color:var(--muted);font-size:12px}.footer{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;margin-top:auto;padding:20px 0 28px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}#feedback{background:#50322e;border:1px solid #935950;padding:12px 16px;border-radius:9px;margin:0 0 22px;color:#fff2e9}[hidden]{display:none!important}:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media(max-width:900px){.market-grid{grid-template-columns:1fr}.masthead{align-items:flex-start}.top-controls{flex-wrap:wrap;justify-content:flex-end}.item-list{max-height:320px}}@media(max-width:580px){.app{width:min(100% - 26px,1280px)}.masthead{padding-top:22px;flex-direction:column;gap:15px}.brand{gap:12px}.brand-mark{width:52px;height:52px;font-size:25px}.top-controls{width:100%;max-width:none;justify-content:space-between}.panel{padding:15px}.section-head{align-items:flex-start;flex-direction:column}.inline-fields{flex-wrap:wrap}.inline-fields input{flex-basis:100%}.form-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}.stat-grid{grid-template-columns:1fr}.tabs{padding-bottom:18px}.tab{padding:9px 13px}table{min-width:430px}}

/* Abastecimiento: a single task-oriented workflow, no market/simulator tabs. */
.planner-lead{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:32px 0 22px}
.planner-lead h2{font:500 clamp(25px,3vw,34px)/1.2 Georgia,serif;margin:0 0 10px}
.planner-lead .helper{margin:0;color:#b4c6cd}
.search-panel{padding:28px;background:linear-gradient(130deg,#1b3644,#10232f)}
.step-grid{display:grid;grid-template-columns:repeat(2,minmax(250px,1fr));gap:22px;align-items:start}
.lookup{position:relative;min-width:0}.lookup label{margin-bottom:10px;font-size:15px;font-weight:700}
.lookup input{height:49px;font-size:16px;background:#0b1e2a}
.step-number{display:inline-grid;place-items:center;width:27px;height:27px;border-radius:50%;border:1px solid #97794b;color:var(--gold);font:650 11px system-ui;margin-right:8px}
.selection-help{font-size:12px;color:var(--muted);margin:8px 0 0;min-height:22px}
.selection-help.selected{color:var(--green)}
.suggestions{position:absolute;z-index:20;left:0;right:0;top:84px;background:#102534;border:1px solid #637889;max-height:290px;overflow:auto;border-radius:11px;box-shadow:0 12px 36px #0009}
.suggestion{display:block;width:100%;padding:12px 15px;border:0;border-bottom:1px solid var(--line);color:#f2efe3;background:transparent;text-align:left;cursor:pointer}
.suggestion:hover,.suggestion:focus-visible{background:#315064;color:#fff}
.suggestions .empty{padding:15px}
.main-action{margin-top:19px;min-width:235px;min-height:48px}
.results-area,.saved-area{margin-top:38px;margin-bottom:15px}
.results-area h2,.saved-area h2{font:500 clamp(24px,2.8vw,30px)/1.25 Georgia,serif;margin:0}
.route-notice{background:#233944;color:#e8d5b1;border-left:3px solid var(--gold);padding:14px 18px;margin:10px 0 17px;border-radius:7px;font-size:13px}
.producer-card{padding:17px 10px;display:flex;align-items:center;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line)}
.producer-card:first-child{padding-top:4px}.producer-card:last-child{border-bottom:0;padding-bottom:4px}
.producer-card strong{display:block;font-size:17px;color:var(--text)}
.producer-card small{display:block;color:var(--green);font-size:12px;margin-top:4px}
.producer-actions{display:flex;align-items:center;gap:15px;flex-wrap:wrap;justify-content:flex-end}
.route-pending{font-size:12px;color:#e2c596}
.saved-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:15px}
.saved-card{padding:20px}.saved-card h3{font:500 23px/1.3 Georgia,serif;margin:0 0 14px}
.saved-card p{margin:8px 0}.saved-location{color:#d2dfdf;font-size:14px}
.saved-count{display:inline-block;background:#314b51;color:#f2dcb3;padding:5px 11px;border-radius:18px;margin-top:12px!important;font-size:13px}
.success-notice{background:#194435!important;border-color:#387a60!important;color:#d8ffee!important}
@media(max-width:960px){.step-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.planner-lead{display:block;padding:22px 0 18px}.planner-lead .info-tag{margin-top:14px}.search-panel{padding:17px}.step-grid{grid-template-columns:1fr;gap:15px}.main-action{width:100%}.producer-card{align-items:flex-start;flex-direction:column}.producer-actions{width:100%;justify-content:space-between}.saved-grid{grid-template-columns:1fr}.results-area,.saved-area{margin-top:27px}.suggestions{top:83px}}


/* Strict three-section order: strategic map, saved routes, new route. */
.map-section{margin:27px 0 31px}
.map-section h2,.saved-area h2,.planner-section h2{font:500 clamp(23px,3vw,31px)/1.2 Georgia,serif;margin:0}
.map-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.map-tools input{width:225px;max-width:100%;height:42px}
#strategicMap{height:min(72vh,720px);min-height:450px;width:100%;border:1px solid #887d6d;border-radius:15px;background:#8e8678;z-index:1}
#strategicMap.leaflet-container{font:14px/1.45 system-ui,-apple-system,sans-serif}
.map-section .leaflet-popup-content-wrapper,.map-section .leaflet-popup-tip{background:#172e40;color:#f7f5ef}
.map-section .leaflet-popup-content{min-width:160px;margin:13px}
.map-section .leaflet-popup-content strong{display:block;font-size:16px}
.map-section .leaflet-popup-content p{margin:6px 0;font-size:13px}
.commerce-port-pin{display:flex;align-items:center;justify-content:center;border-radius:50%;background:#173248bd;border:1px solid #466476;filter:drop-shadow(0 2px 3px #000b)}
.commerce-flag{font-size:22px;line-height:1;display:block;transform:translateY(-1px)}
.commerce-port-pin.commerce-base-port{background:#93703ccc;border:2px solid #ffdd89;box-shadow:0 0 0 6px #f5ce6d3b}
.commerce-port-pin.commerce-producer-port{background:#265e45dd;border:2px solid #9cecb7;box-shadow:0 0 0 6px #73ce9940}
.map-legend{display:flex;justify-content:space-between;gap:10px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:12px;margin:12px 0 6px}
.map-route-note{color:#d7d6c9;background:#1b303e;border-left:3px solid var(--gold2);border-radius:6px;padding:12px 15px;margin:14px 0 6px;font-size:13px}
.source-credit{color:#a7b7c4;font-size:11px;margin:7px 0}
.saved-area{margin:26px 0 32px}
.saved-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr))}
.saved-card button{margin-top:9px;white-space:normal}
.sea-steps{color:var(--gold);font-weight:650;font-size:12px;display:block;margin:9px 0}
.planner-section{margin:24px 0 45px}
.planner-section>.helper{max-width:880px}
.planner-section .results-area{margin-top:27px}
.planner-section #resultsTitle{font:500 25px/1.2 Georgia,serif;margin:0}
@media(max-width:700px){#strategicMap{height:61vh;min-height:365px}.map-section .section-head{align-items:flex-start;flex-direction:column}.map-tools{width:100%}.map-tools input{flex:1;min-width:140px}.map-section{margin-top:20px}}

/* Operational bases: single-open accordion; compact list, not large cards. */
#planList.saved-operations{display:block;border:1px solid var(--line);border-radius:15px;overflow:hidden;background:#102533}
.operations-base+.operations-base{border-top:1px solid #38505c}
.operations-base-toggle{display:flex;align-items:center;gap:14px;width:100%;min-height:68px;padding:15px 20px;border:0;background:transparent;color:var(--text);text-align:left;cursor:pointer}
.operations-base-toggle:hover,.operations-base-toggle:focus-visible{background:#1a3544}
.operations-base-toggle[aria-expanded=true]{background:#1b3746;border-bottom:1px solid #50606a}
.operations-base-name{font:500 clamp(19px,2.7vw,25px)/1.25 Georgia,serif;flex:1;min-width:0}
.operations-base-count{color:var(--muted);font-size:13px;white-space:nowrap}
.operations-base-chevron{color:var(--gold);font-size:20px;line-height:1;transition:transform .16s ease}
.operations-base-toggle[aria-expanded=true] .operations-base-chevron{transform:rotate(180deg)}
.operations-base-content{padding:0;background:#0e222f}
.saved-route-table{overflow-x:auto}
.saved-route-header,.saved-route-row{display:grid;grid-template-columns:minmax(140px,1.45fr) minmax(130px,1.25fr) minmax(105px,.8fr) minmax(115px,.9fr) minmax(105px,.8fr) 116px;gap:12px;align-items:center}
.saved-route-table:not(.has-status) .saved-route-header,.saved-route-table:not(.has-status) .saved-route-row{grid-template-columns:minmax(140px,1.45fr) minmax(130px,1.25fr) minmax(105px,.8fr) minmax(115px,.9fr) 116px}
.saved-route-header{background:#172f3c;color:var(--gold);font-size:11px;font-weight:750;text-transform:uppercase;letter-spacing:.065em;padding:12px 20px}
.saved-route-row{padding:13px 20px;border-top:1px solid #2a4350;min-height:64px}
.saved-route-row:first-of-type{border-top:none}
.route-cell{min-width:0;overflow-wrap:anywhere;color:#d5e1e2;font-size:14px}
.route-product{font-weight:700;color:#f4eee0}
.route-price{font-variant-numeric:tabular-nums}
.route-rating{font-weight:750}
.route-rating.cheap{color:#91dcaa}
.route-rating.acceptable{color:#e8d2a4}
.route-rating.expensive{color:#f7a9a1}
.route-map-btn{justify-self:end;white-space:nowrap;padding:8px 12px;font-size:12px}
@media(max-width:760px){
  .operations-base-toggle{padding:14px 15px;min-height:63px}
  .operations-base-name{font-size:21px}
  .saved-route-header{display:none}
  .saved-route-row,.saved-route-table:not(.has-status) .saved-route-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;padding:15px;align-items:start}
  .saved-route-row+.saved-route-row{border-top:1px solid #36505d}
  .saved-route-row .route-product,.saved-route-row .route-provider{grid-column:1/-1}
  .saved-route-row .route-product{font-size:16px}
  .saved-route-row .route-cell:not(.route-product)::before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;font-weight:550;margin-bottom:3px}
  .saved-route-row .route-provider{margin-bottom:2px}
  .route-map-btn{grid-column:1/-1;justify-self:start;margin-top:2px}
}



/* RC-01: isolated commerce navigation; keep existing map and route styles intact. */
#commerceNavBackdrop[hidden],#commerceSidebar[hidden],
[data-commerce-view][hidden]{display:none!important}
.commerce-nav-backdrop{position:fixed;inset:0;background:#020910d9;z-index:1100}
.commerce-sidebar{position:fixed;inset:0 auto 0 0;width:min(380px,calc(100vw - 40px));max-height:100dvh;overflow-y:auto;z-index:1101;background:#0e2230;border-right:1px solid #56717c;box-shadow:20px 0 55px #0009;padding:24px;outline:none}
.commerce-nav-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:20px;border-bottom:1px solid var(--line)}
.commerce-nav-heading h2{font:500 25px/1.2 Georgia,serif;margin:0}
.commerce-nav-toggle,.commerce-nav-close{display:grid;place-items:center;flex:0 0 auto;width:44px;height:44px;border:1px solid var(--line);border-radius:10px;background:#193342;color:var(--text);font-size:23px}
.commerce-nav-toggle:hover,.commerce-nav-close:hover{background:#2b4b5d}
.commerce-nav-toggle:focus-visible,.commerce-nav-close:focus-visible,.commerce-nav-links a:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.commerce-nav-links{display:grid;gap:8px;margin:24px 0}
.commerce-nav-links a{display:flex;gap:12px;align-items:center;color:var(--text);text-decoration:none;border:1px solid transparent;border-radius:11px;padding:14px;font-weight:600}
.commerce-nav-links a:hover{background:#1b3647;border-color:#406075}
.commerce-nav-links a[aria-current=page]{background:#304657;border-color:var(--gold2);color:#f9e5bd}
.commerce-nav-links a span{font-size:20px}
.commerce-nav-footnote{margin-top:28px;color:var(--muted);font-size:12px}
.commerce-future-view{padding:30px 0 65px;min-height:47vh}
.commerce-future-view>h2{font:500 clamp(25px,3vw,33px)/1.2 Georgia,serif;margin:3px 0 22px}
.commerce-future-panel{max-width:830px}
.commerce-future-panel h3{font:500 23px Georgia,serif;margin:0 0 12px;color:var(--gold)}
.commerce-future-panel p{max-width:670px}
.commerce-future-note{color:var(--muted);border-top:1px solid var(--line);padding-top:16px;font-size:13px}
body.commerce-nav-open{overflow:hidden}
.masthead .brand{flex:1;min-width:0}
@media(max-width:760px){
  .masthead{gap:12px;flex-wrap:wrap;padding:22px 0}
  .masthead .brand{flex:1 1 calc(100% - 60px);gap:11px}
  .masthead .brand-mark{width:52px;height:52px;font-size:25px}
  .masthead .top-controls{flex:1 1 100%;justify-content:flex-end;max-width:none}
  .commerce-sidebar{padding:20px}
  .commerce-future-view{padding-top:24px}
}

/* RC-03: owner-scoped outpost management, isolated from route planner/map. */
.commerce-port-layout{display:grid;grid-template-columns:minmax(300px,0.92fr) minmax(340px,1.08fr);gap:20px;align-items:start}
.commerce-port-form h3,.commerce-my-ports h3{font:500 23px/1.3 Georgia,serif;margin:0 0 19px}
.commerce-my-ports .section-head{margin-bottom:12px}
.commerce-my-ports .section-head h3{margin:0}
.commerce-port-search{position:relative;margin:0 0 20px}
.commerce-port-suggestions{position:absolute;z-index:10;top:100%;left:0;right:0;border:1px solid var(--gold2);border-radius:8px;background:#0a1b28;box-shadow:0 10px 22px #0008;max-height:260px;overflow:auto}
.commerce-port-suggestions[hidden]{display:none}
.commerce-port-choice{display:block;width:100%;padding:11px 13px;border:0;border-bottom:1px solid var(--line);text-align:left;background:#102633;color:var(--text)}
.commerce-port-choice:hover,.commerce-port-choice:focus-visible{background:#2a485a}
.commerce-building-options{border:1px solid var(--line);border-radius:10px;padding:14px 16px 17px;margin:0 0 19px}
.commerce-building-options legend{padding:0 8px;color:var(--gold);font-weight:650}
.commerce-check{display:flex;align-items:center;gap:12px;padding:9px 0;margin:0;font-size:15px;cursor:pointer}
.commerce-check input{width:18px;height:18px;min-height:18px;flex:0 0 auto}
.commerce-building-options select,.commerce-port-form textarea{display:block;width:100%;background:#0a1924;color:var(--text);border:1px solid #526775;border-radius:8px;padding:10px 12px}
.commerce-building-options select{min-height:42px}
.commerce-port-form textarea{resize:vertical;min-height:66px}
.commerce-port-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}
.commerce-port-hint,.commerce-port-status{font-size:13px;color:var(--muted)}
.commerce-port-status[data-state="error"]{color:var(--red)}
.commerce-port-status[data-state="success"]{color:var(--green)}
.commerce-port-entry{padding:17px 0;border-top:1px solid var(--line)}
.commerce-port-entry:first-child{border-top:0}
.commerce-port-entry h4{font:500 20px/1.3 Georgia,serif;margin:0 0 8px}
.commerce-port-entry .commerce-building-list{font-size:13px;color:#d6e3dd;margin:6px 0}
.commerce-port-entry .commerce-personal-note{font-size:12px;color:var(--muted);margin:8px 0;white-space:pre-wrap;overflow-wrap:anywhere}
.commerce-port-entry-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:13px}
.commerce-port-entry-actions .button{padding:7px 12px;font-size:12px}
@media(max-width:850px){.commerce-port-layout{grid-template-columns:1fr}}

/* RC-05: books learned and physical stock remain separate. */
.commerce-recipe-notice{border:1px solid #736446;border-left:4px solid var(--gold);border-radius:9px;background:#282b2b;padding:14px 18px;margin:10px 0 23px;max-width:930px}
.commerce-recipe-notice strong{color:var(--gold)}
.commerce-recipe-notice p{margin:6px 0 0;color:var(--muted);font-size:13px}
.commerce-book-layout{display:grid;grid-template-columns:minmax(300px,.94fr) minmax(350px,1.06fr);gap:20px;align-items:start}
.commerce-book-form h3,.commerce-book-list h3{font:500 23px/1.3 Georgia,serif;margin:0 0 19px}
.commerce-book-list .section-head h3{margin:0}
.commerce-book-lookup{position:relative;margin:0 0 15px}
.commerce-book-suggestions{position:absolute;top:100%;left:0;right:0;z-index:11;max-height:245px;overflow:auto;border:1px solid var(--gold2);border-radius:9px;background:#0b1b28;box-shadow:0 10px 22px #0008}
.commerce-book-suggestions[hidden]{display:none}
.commerce-book-choice{display:block;text-align:left;width:100%;border:0;border-bottom:1px solid var(--line);padding:10px 12px;background:#102735;color:var(--text)}
.commerce-book-choice:hover,.commerce-book-choice:focus-visible{background:#29475a}
.commerce-book-fieldset{margin:18px 0;border:1px solid var(--line);border-radius:10px;padding:16px}
.commerce-book-fieldset legend{color:var(--gold);font-weight:650;padding:0 8px}
.commerce-book-check{display:flex;align-items:center;gap:11px;cursor:pointer;margin-bottom:13px}
.commerce-book-check input{width:18px;height:18px;min-height:18px}
.commerce-book-fieldset .button{margin-top:7px}
.commerce-book-hint,.commerce-book-status{font-size:13px;color:var(--muted)}
.commerce-book-status[data-state="error"]{color:var(--red)}
.commerce-book-status[data-state="success"]{color:var(--green)}
.commerce-book-entry{padding:18px 0;border-top:1px solid var(--line)}
.commerce-book-entry:first-child{border-top:0}
.commerce-book-entry h4{font:500 19px/1.3 Georgia,serif;margin:0 0 6px}
.commerce-book-state{font-size:13px;color:var(--gold);margin:4px 0}
.commerce-book-stock{font-size:13px;color:var(--muted);padding-left:15px;margin:8px 0}
.commerce-book-entry-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:12px}
.commerce-book-entry-actions .button{font-size:12px;padding:7px 11px}
@media(max-width:850px){.commerce-book-layout{grid-template-columns:1fr}}

.commerce-craft-profile{margin:0 0 18px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.commerce-craft-profile h3{font:500 20px Georgia,serif;margin:0 0 4px}
.commerce-craft-profile p{color:var(--muted);font-size:12px;margin:0 0 10px;max-width:480px}
.commerce-craft-profile label{margin:0}
.commerce-craft-profile input{max-width:112px}
#commerceCraftLevelStatus{font-size:12px;color:var(--muted)}
@media(max-width:650px){.commerce-craft-profile{align-items:stretch;flex-direction:column}.commerce-craft-profile input{max-width:100%}}

/* RC-08 verified-only personal logistics with original NA Map. */
.commerce-recipe-planner{margin:20px 0}
.commerce-recipe-planner .section-head h3{font:500 23px/1.3 Georgia,serif;margin:0}
.commerce-recipe-hint,.commerce-recipe-plan-status{color:var(--muted);font-size:13px}
.commerce-recipe-controls{display:grid;grid-template-columns:minmax(180px,1fr) minmax(220px,1.2fr) auto;gap:13px;align-items:end;margin:18px 0}
.commerce-recipe-controls select,.commerce-recipe-controls input{width:100%;min-height:43px;border:1px solid #567080;border-radius:9px;color:var(--text);background:#0a1924;padding:10px}
.commerce-recipe-origin{position:relative}
.commerce-recipe-origin-suggestions{position:absolute;z-index:8;background:#0a1924;border:1px solid var(--gold2);border-radius:9px;width:100%;max-height:235px;overflow:auto}
.commerce-recipe-origin-suggestions[hidden],.commerce-recipe-map-wrap[hidden]{display:none}
.commerce-recipe-port-choice{display:block;width:100%;background:#0d2635;color:var(--text);border:0;border-bottom:1px solid var(--line);padding:10px;text-align:left}
.commerce-recipe-port-choice:hover,.commerce-recipe-port-choice:focus-visible{background:#244557}
.commerce-recipe-alternative{padding:15px 0;border-top:1px solid var(--line)}
.commerce-recipe-alternative h4{font:500 20px Georgia,serif;margin:0 0 4px}
.commerce-recipe-alternative p,.commerce-recipe-alternative li{font-size:13px;color:var(--muted)}
.commerce-recipe-alternative ul{padding-left:18px;margin:8px 0 14px}
.commerce-recipe-results{margin:15px 0}
.commerce-recipe-alternative .button{font-size:12px}
.commerce-recipe-map-wrap{border-top:1px solid var(--line);padding-top:18px}
#commerceRecipeMap{width:100%;height:min(65vh,630px);min-height:390px;
  border:1px solid #8f7d61;border-radius:12px;background:#888276;z-index:1}
#commerceRecipeMap.leaflet-container{font:14px/1.45 system-ui,sans-serif}
#commerceRecipeMapStatus{font-size:13px;padding:11px 0;color:var(--muted)}
@media(max-width:850px){
 .commerce-recipe-controls{grid-template-columns:1fr}
 .commerce-recipe-controls .button{width:100%}
 #commerceRecipeMap{min-height:330px;height:55vh}
}
/* Banner preview never shipped to production. */
.preview-banner{position:sticky;top:0;z-index:9999;display:flex;gap:12px;
  flex-wrap:wrap;justify-content:center;align-items:center;
  color:#fff;background:#7d421c;border-bottom:2px solid #ffc58e;
  font:600 13px/1.45 system-ui,-apple-system,sans-serif;
  padding:11px 18px;text-align:center}
.preview-banner strong{letter-spacing:.06em}
.preview-banner span{font-weight:400}
@media(max-width:700px){.preview-banner{font-size:11px}}