/* Simulator page */
.sim { background: var(--bg); }
.sim h2 { text-transform: none; letter-spacing: 0; }

/* Selection bar */
.sim .simbar { border-top: 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.sim .simbar .in { max-width: 1320px; padding: 26px 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 640px); gap: 18px 48px; align-items: end; }
.sim .brand h1 { font: 600 30px/1.15 var(--font-display); letter-spacing: -.005em; margin: 0 0 6px; }
.sim .brand p { font-size: 15px; color: var(--muted); }
.sim .brand p #count { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.sim .brand .theme { margin-top: 14px; }
.sim .searchbox { max-width: none; flex: none; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "lab brand" "q q" "ex ex"; align-items: end; column-gap: 12px; }
.sim .searchbox label { grid-area: lab; font-size: 13px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.sim .brandsw { grid-area: brand; justify-self: end; margin: 0 0 8px; }
.sim #q { grid-area: q; height: 52px; padding: 0 16px 0 46px; font: 500 18px var(--font-mono); border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5' fill='none' stroke='%235e6872' stroke-width='1.8'/%3E%3Cpath d='M12.8 12.8 17 17' stroke='%235e6872' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 16px 50% / 20px; transition: border-color .15s, background-color .15s; }
.sim #q:focus { background-color: var(--panel); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sim #results { grid-column: 1 / -1; top: 100%; border-radius: 10px; box-shadow: 0 16px 40px rgba(15, 17, 20, .14); }
.sim .res { padding: 11px 16px; }
.sim .res .rc { font-weight: 600; }
.sim .examples { grid-area: ex; margin-top: 10px; font-size: 13px; gap: 6px; }
.sim .examples button { font: 500 12.5px var(--font-mono); border: 0; background: var(--panel2); color: var(--ink); padding: 4px 10px; border-radius: 999px; }
.sim .examples button:hover { background: var(--accent-soft); color: var(--accent); }

/* Segmented controls */
.sim .theme, .sim .brandsw, .sim .viewsw { display: inline-flex; gap: 2px; padding: 3px; background: var(--panel2); border: 0; border-radius: 8px; overflow: visible; }
.sim .theme button, .sim .brandsw button, .sim .viewsw button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: 600 12.5px var(--font-body); padding: 5px 12px; }
.sim .brandsw button { font-size: 13.5px; padding: 6px 16px; }
.sim .theme button[aria-checked="true"], .sim .viewsw button[aria-checked="true"], .sim .brandsw button[aria-checked="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 17, 20, .12), 0 0 0 1px var(--line); }
.sim .brandsw button[aria-checked="true"] { color: var(--accent); }
.sim .theme button:hover, .sim .viewsw button:hover, .sim .brandsw button:hover { color: var(--ink); }

/* Layout and panels */
.sim .wrap { padding: 24px 20px 40px; grid-template-columns: 350px minmax(0, 1fr); gap: 20px; }
.sim .side, .sim .main, .sim .cols { gap: 20px; }
.sim .panel { border-radius: 12px; padding: 18px 20px 20px; border: 1px solid var(--line); }
.sim .panel > h2, .sim .simhead, .sim .valhead { margin: -18px -20px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.sim .panel > h2, .sim .simhead h2, .sim .valhead h2 { font: 600 16px var(--font-display); color: var(--ink); letter-spacing: 0; }
.sim .simhead, .sim .valhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sim .valhead { justify-content: space-between; }
.sim .valhead h2, .sim .simhead h2 { margin: 0; }
.sim .simhead .viewsw { margin: 0 auto 0 4px; }
.sim #methTitle { font: 500 13px var(--font-body); color: var(--muted); }
.sim .valhead .theme.unit { margin: 0; }

/* Product */
.sim #item .code { font: 600 25px/1.2 var(--font-mono); letter-spacing: -.01em; word-break: break-all; }
.sim #item .type { font-size: 15px; color: var(--muted); margin: 4px 0 16px; }
.sim .dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.sim .dims div { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.sim .dims var { display: block; font: italic 15px Georgia, "Times New Roman", serif; color: var(--muted); margin-bottom: 2px; }
.sim .dims b { font: 600 19px var(--font-body); font-variant-numeric: tabular-nums; }
.sim .dims small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.sim .dims .inf { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sim dl.spec { grid-template-columns: auto 1fr; gap: 0; font-size: 14.5px; margin: 0 0 12px; }
.sim dl.spec dt, .sim dl.spec dd { padding: 8px 0; border-bottom: 1px solid var(--line); }
.sim dl.spec dt { font-family: var(--font-body); color: var(--muted); padding-right: 16px; }
.sim dl.spec dd { font-weight: 600; text-align: right; }
.sim #item .ext { font-weight: 600; font-size: 14px; text-underline-offset: 3px; }
.sim #item .small { margin: 8px 0 0; }

/* Mounting type */
.sim .meth { border-radius: 10px; padding: 12px 14px 12px 42px; margin-bottom: 8px; border: 1px solid var(--line); transition: border-color .15s, background-color .15s; }
.sim .meth:hover { border-color: var(--accent); }
.sim .meth input { left: 15px; top: 15px; width: 16px; height: 16px; }
.sim .meth.on { border: 1.5px solid var(--accent); padding: 11.5px 13.5px 11.5px 41.5px; }
.sim .meth .mn { font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sim .meth .ms { font-size: 13px; margin-top: 2px; }
.sim .badge { text-transform: none; letter-spacing: 0; font: 600 11.5px var(--font-body); background: var(--accent); color: var(--panel); border-radius: 999px; padding: 2px 9px; vertical-align: 0; }

/* Site conditions */
.sim label.f { font-size: 13.5px; color: var(--ink); font-weight: 500; gap: 6px; margin-bottom: 14px; }
.sim select, .sim input[type=number] { height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); font: 400 15px var(--font-body); background-color: var(--panel); }
.sim select { appearance: none; -webkit-appearance: none; padding-right: 36px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%235e6872' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 12px; }
.sim select:hover, .sim input[type=number]:hover { border-color: var(--muted); }
.sim select:focus, .sim input[type=number]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sim .hint { font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.5; }
.sim .infolink { display: inline-block; font-weight: 600; font-size: 14px; text-underline-offset: 3px; margin-top: 2px; }

/* Tools */
.sim ul.tools { list-style: none; padding: 0; margin: 0; font-size: 14.5px; }
.sim ul.tools li { position: relative; padding: 8px 0 8px 18px; border-bottom: 1px solid var(--line); line-height: 1.45; }
.sim ul.tools li:last-child { border-bottom: 0; padding-bottom: 0; }
.sim ul.tools li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); }

/* Stage and step */
.sim .stagebox { margin-top: 0; }
.sim #stage, .sim #stage3d { border-radius: 10px; }
.sim #hint3d { font-size: 12.5px; margin-top: 8px; }
.sim .stepbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.sim #stepNo { font: 600 13px var(--font-body); font-variant-numeric: tabular-nums; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 5px 11px; margin-top: 2px; }
.sim #stepTitle { font: 600 23px/1.25 var(--font-display); }
.sim #stepText { margin-top: 8px; font-size: 15.5px; line-height: 1.65; max-width: 72ch; color: var(--ink); }
.sim .nav { gap: 8px; }
.sim .nav button { height: 40px; padding: 0 16px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.sim button.primary { box-shadow: 0 1px 2px rgba(15, 17, 20, .15); }
.sim button.primary:hover:not(:disabled) { filter: brightness(1.12); }
.sim #live { margin-top: 18px; padding-top: 18px; }
.sim .sl-row label { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.sim .sl-row output { font: 600 18px var(--font-body); font-variant-numeric: tabular-nums; }
.sim .kv { gap: 10px; margin-top: 14px; }
.sim .kv > div { border: 0; background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.sim .kv .k { font-size: 12.5px; margin-bottom: 2px; }
.sim .kv .v { font: 600 18px var(--font-body); font-variant-numeric: tabular-nums; }
.sim .status { border-radius: 8px; border-left-width: 3px; padding: 11px 14px; }

/* Mounting values */
.sim table.vals { font-size: 14.5px; }
.sim table.vals tr:first-child th, .sim table.vals tr:first-child td { border-top: 0; padding-top: 0; }
.sim table.vals th { color: var(--muted); font-weight: 400; padding: 11px 16px 11px 0; width: 44%; line-height: 1.4; }
.sim table.vals td { font: 600 15px/1.4 var(--font-body); font-variant-numeric: tabular-nums; color: var(--ink); padding: 11px 0; }
.sim table.vals td .q { font-weight: 600; }
.sim table.vals .nt { font-weight: 400; font-size: 12.5px; line-height: 1.45; margin-top: 3px; }
.sim table.vals td.srccell { font-weight: 500; font-size: 14px; }

/* Steps */
.sim ol.steps { gap: 4px; counter-reset: none; }
.sim .sl { gap: 12px; align-items: center; border: 0; border-radius: 8px; padding: 9px 10px; font-size: 14.5px; line-height: 1.35; color: var(--ink); }
.sim .sl:hover:not(:disabled) { background: var(--bg); }
.sim .sl .sn { flex: none; width: 26px; height: 26px; min-width: 0; border-radius: 50%; display: inline-grid; place-items: center; font: 600 12.5px var(--font-body); font-variant-numeric: tabular-nums; color: var(--muted); background: var(--panel2); }
.sim .sl.done .sn { color: var(--accent); background: var(--accent-soft); }
.sim .sl.on { background: var(--accent-soft); font-weight: 600; }
.sim .sl.on .sn { background: var(--accent); color: var(--panel); }

/* Warnings */
.sim #warnBox { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--panel); }
.sim #warnBox > h2 { color: var(--warn); }
.sim #warnBox ul { list-style: none; padding: 0; }
.sim #warnBox li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.6; margin-bottom: 8px; }
.sim #warnBox li:last-child { margin-bottom: 0; }
.sim #warnBox li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

@media (max-width: 980px) {
  .sim .simbar .in { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; }
  .sim .brand h1 { font-size: 24px; }
  .sim .wrap { padding: 16px; }
}
@media (max-width: 560px) {
  .sim .stepbar { grid-template-columns: minmax(0, 1fr); }
  .sim #stepNo { justify-self: start; }
  .sim .dims b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .sim #q, .sim .meth { transition: none; } }
.sim .stepbar { grid-template-columns: auto minmax(0, 1fr); }
.sim .stepbar .nav { grid-column: 2; justify-content: flex-start; margin-top: 2px; }
.sim .badge { display: inline-block; }
.sim .badge::first-letter { text-transform: uppercase; }
@media (max-width: 560px) { .sim .stepbar .nav { grid-column: 1; } }
@media (max-width: 980px) { .sim .wrap { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .sim .stepbar { grid-template-columns: minmax(0, 1fr); } .sim .stepbar .nav { grid-column: 1; } }
