/* Shared layout for the smaller BMK Free Flight Toolkit calculators (use with theme.css). */
.muted { color: var(--text-muted); }
.spacer { flex: 1; }
.topbar { height: 56px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.brand img { width: 36px; height: 36px; flex: none; }
.topbar .sep { color: var(--border); }
.topbar h1 { font-size: 15px; font-weight: 600; margin: 0; white-space: nowrap; }
.page { max-width: 1240px; margin: 0 auto; padding: 18px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.intro { color: var(--text-muted); font-size: 14px; margin: 0; max-width: 820px; }
.cols { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.block { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; min-width: 0; }
.block > h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.block > h2 .muted { font-weight: 400; font-size: 12px; font-family: var(--font-mono); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .full { grid-column: 1 / -1; }
.form > *, .cols > *, .cols-2 > * { min-width: 0; }
/* phones: a results column marked .res-col goes above the (long) form; items marked .m-after stay below it */
@media (max-width: 900px) {
  .cols > .res-col { display: contents !important; }
  .cols:has(> .res-col) > .block:first-child { order: 2; }
  .res-col > .m-after { order: 3; }
}
.input select { max-width: 100%; text-overflow: ellipsis; }
.block > h2 { flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > label { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input { position: relative; display: flex; align-items: center; }
.input input, .input select, .field textarea { width: 100%; height: 34px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); padding: 0 8px; font-size: 13px; min-width: 0; }
.field textarea { height: auto; min-height: 60px; padding: 6px 8px; font: 13px var(--font-ui); resize: vertical; }
.input input[type="number"] { padding-right: 44px; -moz-appearance: textfield; font-family: var(--font-mono); }
.input input::-webkit-inner-spin-button, .input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input .unit { position: absolute; right: 8px; font: 11px var(--font-mono); color: var(--text-muted); pointer-events: none; }
.input input:focus, .input select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.input input.invalid { border-color: var(--danger); }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chk input { accent-color: var(--accent); }
.presets { display: flex; flex-wrap: wrap; gap: 4px; }
.presets button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; padding: 2px 9px; font: 11px var(--font-mono); cursor: pointer; }
.presets button:hover { background: var(--surface-2); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--border); background: var(--surface); color: var(--text); font: 12px var(--font-ui); padding: 0 10px; height: 28px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.card { background: var(--background); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.card .k { font-size: 12px; color: var(--text-muted); }
.card .v { font: 500 20px var(--font-mono); font-variant-numeric: tabular-nums; margin-top: 2px; }
.card .v small { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.card.big .v { font-size: 28px; }
table.data { border-collapse: collapse; width: 100%; font-size: 12px; }
table.data th, table.data td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
table.data th { color: var(--text-muted); font-weight: 500; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.data tr.hi td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.table-wrap { overflow-x: auto; }
.tag { display: inline-block; border-radius: 10px; padding: 1px 8px; font: 11px var(--font-ui); border: 1px solid var(--border); margin: 1px 2px 1px 0; white-space: nowrap; }
.tag.ok { border-color: var(--accent); color: var(--accent); }
.tag.no { opacity: .45; }
.note { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 10px 0 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chart { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px 6px; position: relative; background: var(--surface); }
.chart h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--background); font: 11px var(--font-mono); padding: 4px 6px; border-radius: 4px; white-space: nowrap; display: none; z-index: 5; }
.chart .legend { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--text); color: var(--background); padding: 9px 16px; border-radius: 8px; font-size: 13px; transition: transform .2s; z-index: 100; }
.toast.show { transform: translateX(-50%) translateY(0); }
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .topbar select.btn { max-width: 150px; }
  .cols, .cols-2 { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .topbar .sep, .topbar h1 { display: none; }
}
@media (max-width: 520px) { .brand span { display: none; } .form { grid-template-columns: 1fr; } }
