/* Moment of inertia and section properties calculator (/moment-of-inertia-calculator/).
   Every selector is scoped to .wm-inertia (the print rules use :has() on the
   page that holds the tool, so they never touch another page). */

.wm-inertia .wm-in-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wm-inertia .wm-in-top .wm-tabs { margin-bottom: 0; }
.wm-inertia .wm-tabs button { min-height: 40px; }
/* chips and "Load this example" scroll #app to the top: keep it clear of the sticky nav */
#app:has(.wm-inertia) { scroll-margin-top: 64px; }
@media (max-width: 720px) { #app:has(.wm-inertia) { scroll-margin-top: 104px; } }
.wm-inertia .wm-in-unit { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--wm-text); }
.wm-inertia .wm-in-unit select { width: auto; min-height: 40px; padding: 6px 10px; }

.wm-inertia .wm-in-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .wm-inertia .wm-in-grid { grid-template-columns: 1fr; gap: 14px; } }

/* shape picker */
.wm-inertia .wm-in-shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.wm-inertia .wm-in-shape { appearance: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px; padding: 6px 4px;
  border: 1px solid var(--wm-line); border-radius: 10px; background: #fff; color: var(--wm-text); font: 600 .74rem/1.15 'Segoe UI', system-ui, sans-serif; cursor: pointer; text-align: center;
  transition: background var(--wm-fast), border-color var(--wm-fast), color var(--wm-fast); }
.wm-inertia .wm-in-shape svg { width: 26px; height: 26px; }
.wm-inertia .wm-in-shape:hover { background: var(--wm-green-bg); border-color: var(--wm-green-line); color: var(--wm-green); }
.wm-inertia .wm-in-shape[aria-pressed="true"] { background: var(--wm-green-bg); border-color: var(--wm-green-2); color: var(--wm-green); box-shadow: inset 0 0 0 1px var(--wm-green-2); }
.wm-inertia .wm-in-shape:focus-visible, .wm-inertia .wm-in-del:focus-visible, .wm-inertia .wm-in-chk input:focus-visible,
.wm-inertia summary:focus-visible { outline: 2px solid var(--wm-green-2); outline-offset: 2px; }

/* dimension fields with the unit inside the box */
.wm-inertia .wm-in-dims { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px 12px; margin-top: 14px; align-items: end; }
.wm-inertia .wm-in-f { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--wm-text); min-width: 0; }
.wm-inertia .wm-in-f i { font-family: var(--wm-math); font-size: .95rem; color: var(--wm-ink); }
.wm-inertia .wm-in-iw { position: relative; display: block; }
.wm-inertia .wm-in-iw input { font: 1.02rem var(--wm-math); padding: 9px 46px 9px 10px; min-height: 42px; }
.wm-inertia .wm-in-iw em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: .82rem 'Segoe UI', system-ui, sans-serif; font-style: normal; color: var(--wm-mute); pointer-events: none; }
.wm-inertia .wm-in-f select { min-height: 42px; }
.wm-inertia .wm-in-hint { margin: 10px 0 0; font-size: .84rem; line-height: 1.5; color: var(--wm-mute); }
.wm-inertia [data-k="err"] { margin-top: 12px; }

/* built-up parts */
.wm-inertia .wm-in-part { border: 1px solid var(--wm-line); border-radius: 12px; padding: 10px 12px 12px; margin-top: 10px; background: var(--wm-soft); }
.wm-inertia .wm-in-part.hole { border-style: dashed; border-color: #94a3b8; background: #fff; }
.wm-inertia .wm-in-part .wm-in-dims { margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.wm-inertia .wm-in-ph { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.wm-inertia .wm-in-ph b { font-size: .9rem; color: var(--wm-ink); }
.wm-inertia .wm-in-ph { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; }
.wm-inertia .wm-in-ph select { width: 100%; min-width: 0; min-height: 40px; }
.wm-inertia .wm-in-ph b { white-space: nowrap; }
.wm-inertia .wm-in-chk { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--wm-text); min-height: 40px; cursor: pointer; }
.wm-inertia .wm-in-chk input { width: 18px; height: 18px; accent-color: var(--wm-green-2); }
.wm-inertia .wm-in-del { margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--wm-line); border-radius: 8px; background: #fff; color: var(--wm-mute); font-size: 20px; line-height: 1; cursor: pointer; }
.wm-inertia .wm-in-del:hover { color: var(--wm-err); border-color: #fecaca; background: var(--wm-err-bg); }
.wm-inertia .wm-in-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wm-inertia .wm-in-actions .wm-btn { min-height: 40px; }

/* the drawing */
.wm-inertia .wm-in-svg svg { display: block; width: 100%; height: auto; border: 1px solid var(--wm-line); border-radius: 12px; background: #fff;
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px); background-size: 18px 18px; }
.wm-inertia .wm-in-svg .solid { fill: #bbf7d0; fill-opacity: .8; stroke: #15803d; stroke-width: 1.6; stroke-linejoin: round; }
.wm-inertia .wm-in-svg .tab { fill: #dbeafe; fill-opacity: .8; stroke: #2563eb; stroke-width: 1.4; stroke-dasharray: 6 4; }
.wm-inertia .wm-in-svg .hole { fill: #fff; stroke: #64748b; stroke-width: 1.4; stroke-dasharray: 5 3; }
.wm-inertia .wm-in-svg .axis { stroke: #334155; stroke-width: 1; stroke-dasharray: 7 3 2 3; }
.wm-inertia .wm-in-svg .pax { stroke: #ea580c; stroke-width: 1.4; stroke-dasharray: 9 4; }
.wm-inertia .wm-in-svg text { font: 12px 'Segoe UI', system-ui, sans-serif; fill: #334155; }
.wm-inertia .wm-in-svg .axl { font: italic 13px var(--wm-math); fill: #0f172a; }
.wm-inertia .wm-in-svg .pal { font: 700 12px 'Segoe UI', sans-serif; fill: #ea580c; }
.wm-inertia .wm-in-svg .num { font: 700 11px 'Segoe UI', sans-serif; fill: #14532d; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.wm-inertia .wm-in-svg .tabl { font-size: 11px; fill: #1d4ed8; }
.wm-inertia .wm-in-svg .cen circle { fill: #fff; stroke: #0f172a; stroke-width: 1.3; }
.wm-inertia .wm-in-svg .cen path { fill: #0f172a; }
.wm-inertia .wm-in-svg .cl { font: 700 13px 'Segoe UI', sans-serif; fill: #0f172a; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.wm-inertia .wm-in-svg .ref circle { fill: #0f172a; }
.wm-inertia .wm-in-svg .ref text { font-weight: 700; }
.wm-inertia .wm-in-svg .dim line { stroke: #64748b; stroke-width: 1; }
.wm-inertia .wm-in-svg .dim text { font-size: 11.5px; fill: #475569; }
.wm-inertia .wm-in-svg .dim.bar line { stroke: #15803d; }
.wm-inertia .wm-in-svg .dim.bar text { fill: #15803d; font-weight: 600; }
.wm-inertia .wm-in-key { margin: 10px 0 0; font: .95rem/1.6 var(--wm-math); color: var(--wm-text); }
.wm-inertia .wm-in-key b { color: var(--wm-ink); }
.wm-inertia .wm-in-key span { white-space: nowrap; }
.wm-inertia .stale { opacity: .45; transition: opacity var(--wm-mid); }

/* results */
.wm-inertia .wm-in-out h3 { margin: 22px 0 0; font-size: 1rem; color: var(--wm-ink); }
.wm-inertia .wm-in-out .wm-stat-cards { margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.wm-inertia .wm-in-out .wm-stat-cards b { font-size: 1.02rem; white-space: nowrap; overflow-wrap: normal; }
.wm-inertia .wm-in-out .wm-stat-cards small { display: block; font-size: .72rem; color: var(--wm-mute); margin-top: 2px; }
.wm-inertia .wm-in-warn { margin-top: 14px; padding: 10px 14px; border: 1px solid #fde68a; background: #fffbeb; color: #92400e; border-radius: 10px; font-size: .9rem; line-height: 1.5; }
.wm-inertia .wm-in-det { margin-top: 14px; }
.wm-inertia .wm-in-det > summary { padding: 6px 0; min-height: 40px; display: flex; align-items: center; }
.wm-inertia .wm-in-det .wm-steps .m { font-size: .98rem; }
.wm-inertia .wm-in-own { margin: 8px 0 0; padding-left: 22px; font-size: .92rem; line-height: 1.7; color: var(--wm-text); }
.wm-inertia .wm-in-own li { margin: 4px 0; }
.wm-inertia .wm-in-mohr { display: block; width: 100%; max-width: 460px; height: auto; margin-top: 8px; border: 1px solid var(--wm-line); border-radius: 12px; background: #fff; }
.wm-inertia .wm-in-mohr text { font: 11.5px 'Segoe UI', system-ui, sans-serif; fill: #334155; }
.wm-inertia .wm-in-mohr .axl { font: italic 12px var(--wm-math); }
.wm-inertia .wm-in-mohr .axis { stroke: #64748b; stroke-width: 1; }
.wm-inertia .wm-in-mohr .mohr { fill: #f0fdf4; stroke: #15803d; stroke-width: 1.6; }
.wm-inertia .wm-in-mohr .mohrd { stroke: #ea580c; stroke-width: 1.3; }
.wm-inertia .wm-in-mohr .mpt { fill: #0f172a; }
.wm-inertia .wm-in-mohr .mpt.c { fill: #15803d; }

/* the working table */
.wm-inertia table.wm-in-tab { border-collapse: collapse; width: 100%; min-width: 760px; font: .86rem/1.35 'Segoe UI', system-ui, sans-serif; font-variant-numeric: tabular-nums; margin: 8px 0 0; }
.wm-inertia table.wm-in-tab th, .wm-inertia table.wm-in-tab td { padding: 7px 9px; border: 1px solid var(--wm-line); text-align: right; white-space: nowrap; text-transform: none; letter-spacing: normal; }
.wm-inertia table.wm-in-tab thead th { background: var(--wm-soft); color: var(--wm-ink); font-weight: 700; text-align: center; white-space: normal; min-width: 72px; }
.wm-inertia table.wm-in-tab tbody th, .wm-inertia table.wm-in-tab tfoot th { text-align: left; font-weight: 600; color: var(--wm-ink); }
.wm-inertia table.wm-in-tab tr.hole td, .wm-inertia table.wm-in-tab tr.hole th { color: #b45309; background: #fffbeb; }
.wm-inertia table.wm-in-tab tfoot td, .wm-inertia table.wm-in-tab tfoot th { background: var(--wm-green-bg); font-weight: 700; color: var(--wm-ink); }
.wm-inertia table.wm-in-tab td.on { background: var(--wm-green-bg); font-weight: 600; }
.wm-inertia .wm-in-det table.wm-in-tab { min-width: 520px; }

@media (max-width: 520px) {
  .wm-inertia .wm-in-shapes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wm-inertia .wm-in-shape { font-size: .7rem; min-height: 58px; }
  .wm-inertia .wm-in-dims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-inertia .wm-in-part .wm-in-dims { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-inertia .wm-in-out .wm-stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wm-inertia .wm-in-out .wm-stat-cards div { padding: 8px 10px; }
  .wm-inertia .wm-in-out .wm-stat-cards b { font-size: .9rem; }
  .wm-inertia .wm-in-top { gap: 10px; }
  .wm-inertia .wm-in-top .wm-tabs { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .wm-inertia .wm-in-shape, .wm-inertia .stale { transition: none; } }

/* exam sheet: the drawing, results and working only */
@media print {
  body:has(.wm-inertia) .nav, body:has(.wm-inertia) .breadcrumb, body:has(.wm-inertia) .wm-examples, body:has(.wm-inertia) footer,
  body:has(.wm-inertia) .content, body:has(.wm-inertia) ins.adsbygoogle, body:has(.wm-inertia) .wm-disclaimer, body:has(.wm-inertia) .google-auto-placed { display: none !important; }
  .wm-inertia { border: 0; box-shadow: none; padding: 0; }
  .wm-inertia .wm-in-shapes, .wm-inertia .wm-in-actions, .wm-inertia .wm-in-top .wm-tabs, .wm-inertia .wm-in-del, .wm-inertia .wm-in-hint { display: none !important; }
  .wm-inertia .wm-in-grid { grid-template-columns: 1fr 1fr; }
  .wm-inertia table.wm-in-tab { min-width: 0; font-size: 8.5pt; }
  .wm-inertia table.wm-in-tab th, .wm-inertia table.wm-in-tab td { padding: 3px 4px; }
  .wm-inertia .wm-in-det { break-inside: avoid; }
}
