/* app/static/css/library-tonnage.css
   Library steps: Maritime -> tonnage -> Deck/Engine. A step opens by animating its grid row from 0fr to 1fr
   (height auto without JS measuring); the unchosen tonnage card fades but keeps its place. */
.lib-step { display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: grid-template-rows .5s ease, opacity .45s ease, transform .5s ease, margin-top .5s ease; }
.lib-step-inner { overflow: hidden; min-height: 0; padding: 4px; margin: -4px; }
.lib-step.lib-step-open { grid-template-rows: 1fr; opacity: 1; transform: none; pointer-events: auto; }
#tonnageStep.lib-step-open, #deptSelect.lib-step-open { margin-top: 16px; }
.lib-dept-grid-single { grid-template-columns: minmax(0, 1fr); max-width: 296px; margin: 0 auto; }
#maritimeStep.lib-step-closed { grid-template-rows: 0fr; opacity: 0; transform: scale(.96); }
.lib-ton-card { transition: all .3s, opacity .45s ease, filter .45s ease; }
.lib-ton-card.is-chosen { border-color: rgba(232, 160, 32, 0.6); background: rgba(232, 160, 32, 0.09); }
.lib-ton-card.is-faded { opacity: .3; filter: grayscale(.6); }
.lib-ton-card.is-faded:hover { opacity: .6; }
.lib-dept-btn { min-width: 0; }
.lib-dept-header-sub { margin-top: 6px; font-size: 13px; color: rgba(232, 237, 242, 0.55); }
@media (max-width: 480px) {
  .lib-dept-grid { gap: 10px; }
  .lib-dept-btn.dept-btn { padding: 24px 10px; }
  .lib-dept-title { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .lib-step, .lib-ton-card { transition: none; } }

/* Back: a long arrow button (tap area >= 36px), right-aligned under the search row (same 600px width as the search box):
   shown once Maritime is opened and in every department view, in the library and in the free demo */
.lib-back-row { max-width: 600px; margin: 0 auto; display: flex; justify-content: flex-end; }
.lib-back-btn { display: flex; align-items: center; justify-content: center; width: 84px; height: 40px; margin: 0;
  padding: 0; background: none; border: 0; border-radius: 10px; color: rgba(232, 237, 242, 0.55); cursor: pointer;
  transition: color .2s, background .2s; }
.lib-back-btn svg { transition: transform .2s; }
.lib-back-btn:hover, .lib-back-btn:focus-visible { color: #E8A020; background: rgba(232, 160, 32, 0.08); }
.lib-back-btn:hover svg, .lib-back-btn:focus-visible svg { transform: translateX(-4px); }
#libBackStep.lib-step-open { margin-bottom: 4px; }

/* The page gets a scrollbar only in long department views: reserve its width so nothing (the back arrow included) shifts sideways */
.lib-scroll { scrollbar-gutter: stable; }
