/* Automation Library pages. Loaded after styles.css. */
.lib main { background: var(--paper, #f4f4f0); color: var(--ink, #111111); font-family: "Figtree", system-ui, sans-serif; overflow-wrap: anywhere; }
.lib main h1, .lib main h2, .lib-card-name { font-family: "Epilogue", system-ui, sans-serif; font-weight: 900; letter-spacing: -0.03em; line-height: 1.02; margin: 0; }
.lib main p, .lib main li, .lib main dd { max-width: 68ch; }

.lib-crumbs { padding: 20px var(--m, 24px) 0; font-size: 0.95rem; }
.lib-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lib-crumbs li + li::before { content: "/"; margin-right: 10px; color: #55554f; }
.lib-crumbs a { color: var(--ink, #111111); text-underline-offset: 3px; }
.lib-crumbs [aria-current] { color: #4a4a45; }

.lib-hero { padding: clamp(32px, 6vw, 96px) var(--m, 24px) clamp(28px, 4vw, 56px); }
.lib-kicker { margin: 0 0 14px; font-size: 1.05rem; font-weight: 600; color: #4a4a45; }
.lib-hero h1 { font-size: clamp(2.25rem, 1.2rem + 4.6vw, 5.25rem); max-width: 18ch; }
.lib-lead { margin: 24px 0 0; font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem); line-height: 1.45; }

.lib-body { padding: 0 var(--m, 24px) clamp(40px, 6vw, 80px); display: grid; gap: clamp(36px, 5vw, 64px); }
.lib-body h2, .lib-related h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem); margin-bottom: 16px; }
.lib-body p { margin: 0 0 12px; line-height: 1.6; }
.lib-list { margin: 0; padding-left: 1.2em; line-height: 1.6; }
.lib-list li + li { margin-top: 6px; }

.lib-scenario { background: var(--grey, #e8e8e1); padding: clamp(24px, 4vw, 48px); margin: 0 calc(var(--m, 24px) * -1); }
@media (min-width: 768px) { .lib-scenario { margin: 0; } }
.lib-scenario p { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); }

.lib-steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 10px; }
.lib-steps li { counter-increment: s; display: grid; grid-template-columns: 2.6rem 1fr; gap: 14px; align-items: start; background: var(--grey, #e8e8e1); padding: 16px 18px; max-width: 72ch; line-height: 1.5; }
.lib-steps li::before { content: counter(s); font-family: "Epilogue", system-ui, sans-serif; font-weight: 900; font-size: 1.1rem; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--ink, #111111); color: var(--lime, #dcf522); display: grid; place-items: center; }

.lib-tags, .lib-inds { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lib-tags li { background: var(--ink, #111111); color: var(--paper, #f4f4f0); padding: 8px 14px; border-radius: 999px; font-weight: 600; }
.lib-inds a { display: block; background: var(--grey, #e8e8e1); color: var(--ink, #111111); padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.lib-inds a:hover { background: var(--lime, #dcf522); }

.lib-facts { background: var(--ink, #111111); color: var(--paper, #f4f4f0); padding: clamp(24px, 4vw, 48px); margin: 0 calc(var(--m, 24px) * -1); }
@media (min-width: 768px) { .lib-facts { margin: 0; } }
.lib-facts dl { margin: 0; display: grid; gap: 24px; }
@media (min-width: 900px) { .lib-facts dl { grid-template-columns: 1fr 1fr 2fr; } }
.lib-facts dt { font-weight: 600; color: #c8c8c0; margin-bottom: 6px; }
.lib-facts dd { margin: 0; line-height: 1.5; }
.lib-facts .price { font-family: "Epilogue", system-ui, sans-serif; font-weight: 900; font-size: 2rem; letter-spacing: -0.03em; }
.lib-facts .price-now { background: var(--lime, #dcf522); color: var(--ink, #111111); padding: 0 8px; }
.lib-facts .price-was { color: #c8c8c0; font-size: 0.6em; }
.lib-facts .price-unit { font-family: "Figtree", system-ui, sans-serif; font-weight: 400; font-size: 1rem; letter-spacing: 0; margin-left: 8px; }
.lib-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lib-faq details { background: var(--grey, #e8e8e1); margin-bottom: 8px; max-width: 72ch; }
.lib-faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: 1.1rem; }
.lib-faq details p { padding: 0 18px 18px; margin: 0; }

.lib-cta { background: var(--ink, #111111); color: var(--paper, #f4f4f0); padding: clamp(40px, 7vw, 96px) var(--m, 24px); }
.lib-cta h2 { font-size: clamp(2rem, 1.2rem + 3vw, 3.75rem); max-width: 16ch; color: var(--paper, #f4f4f0); }
.lib-cta p { margin: 18px 0 28px; font-size: 1.15rem; line-height: 1.5; }

.lib-related { padding: clamp(40px, 6vw, 80px) var(--m, 24px) 0; }
.lib-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.lib-card a { display: flex; flex-direction: column; gap: 10px; height: 100%; background: var(--grey, #e8e8e1); color: var(--ink, #111111); padding: 22px; text-decoration: none; transition: background-color .15s; }
.lib-card a:hover { background: var(--lime, #dcf522); }
.lib-card-cat { font-weight: 600; color: #4a4a45; font-size: 0.95rem; }
.lib-card a:hover .lib-card-cat { color: var(--ink, #111111); }
.lib-card-name { font-size: 1.45rem; }
.lib-card-short { line-height: 1.5; }
.lib-card-price { margin-top: auto; font-weight: 700; }
.lib-card-price .price-was { color: #4a4a45; font-weight: 400; }
.lib-card-price .price-unit { margin-left: 6px; font-weight: 400; }

.lib-back { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 32px var(--m, 24px) clamp(48px, 6vw, 80px); }
.lib-back a { color: var(--ink, #111111); font-weight: 600; text-underline-offset: 4px; }

.lib-filters { display: grid; gap: 12px; padding: 0 var(--m, 24px); grid-template-columns: 1fr; }
@media (min-width: 768px) { .lib-filters { grid-template-columns: 2fr 1fr 1fr; } }
.lib-field label { display: block; font-weight: 700; margin-bottom: 6px; }
.lib-field input, .lib-field select { width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink, #111111); background: var(--grey, #e8e8e1); border: 0; border-bottom: 3px solid var(--ink, #111111); border-radius: 0; padding: 12px 14px; min-height: 48px; }
.lib-field input:focus-visible, .lib-field select:focus-visible { outline: 3px solid var(--ink, #111111); outline-offset: 2px; background: #fff; }
.lib-count { padding: 20px var(--m, 24px) 12px; margin: 0; font-weight: 600; }
.lib-index { padding: 0 var(--m, 24px) clamp(48px, 6vw, 80px); }
.lib-empty { padding: 0 var(--m, 24px) 48px; margin: 0; font-size: 1.15rem; }
[hidden] { display: none !important; }

@media (min-width: 1600px) {
  .lib-hero, .lib-body, .lib-related, .lib-back, .lib-crumbs, .lib-filters, .lib-count, .lib-index { padding-left: max(var(--m, 40px), calc((100vw - 1520px) / 2)); padding-right: max(var(--m, 40px), calc((100vw - 1520px) / 2)); }
}
@media (prefers-reduced-motion: reduce) { .lib-card a { transition: none; } }

/* two-column detail with sticky price card */
@media (min-width: 1000px) {
  .lib-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: start; padding-right: var(--m, 24px); }
  .lib-side { position: sticky; top: 96px; }
  .lib-layout .lib-facts dl { grid-template-columns: 1fr; }
}
.lib-side .lib-facts { margin: 0 var(--m, 24px) 40px; }
@media (min-width: 1000px) { .lib-side .lib-facts { margin: 0; } }
.lib-side-btns { display: grid; gap: 10px; margin-top: 24px; }
.lib-side-btns .btn { text-align: center; justify-content: center; }
.lib-side-btns .btn-ghost { color: inherit; border-color: currentColor; }
.lib-side-mail { color: inherit; text-align: center; font-weight: 700; }
.lib-shipped { display: inline-block; align-self: start; width: max-content; padding: 4px 10px; background: var(--lime, #dcf522); color: #111; font-weight: 800; font-size: .8125rem; border: 2px solid #111; margin-bottom: 12px; }
.lib-empty { text-align: center; display: grid; justify-items: center; gap: 16px; padding: 48px var(--m, 24px); }
.lib-empty[hidden] { display: none; }
.lib-empty p { max-width: 42ch; margin: 0; }
