/* integratorlog.com/resources: the free templates library. Loaded after /css/pages.css and uses its tokens
   (light and dark). No inline styles anywhere on these pages (CSP style-src 'self'). */

.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--primary); color: var(--text); }
.btn .size { font-weight: 400; opacity: .8; font-size: .85em; margin-left: .25em; }
.fine { font-size: .875rem; color: var(--muted); }

/* hub */
.page-head .lede p { margin: 0 0 .75rem; }
.cards { list-style: none; padding: 0; margin: 1.5rem 0 2rem; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0 18px; display: flex; flex-direction: column; overflow: hidden; }
.card-img { display: block; border-bottom: 1px solid var(--line); background: #fff; }
.card-img img { display: block; width: 100%; height: auto; aspect-ratio: 600 / 390; object-fit: cover; object-position: top; }
.card h2 { font-size: 1.125rem; margin: 14px 18px 6px; line-height: 1.3; }
.card h2 a { color: var(--text); text-decoration: none; }
.card h2 a:hover { color: var(--primary); text-decoration: underline; }
.card p { margin: 0 18px 14px; color: var(--muted); font-size: .95rem; flex: 1; }
.card .dl { margin: 0 18px; }

.dl { display: flex; flex-wrap: wrap; gap: 8px; }
.dl .btn { min-height: 44px; display: inline-flex; align-items: center; }
.dl-compact .btn { min-height: 40px; padding: 8px 14px; font-size: .9rem; }

/* resource page */
.crumbs { font-size: .9rem; color: var(--muted); margin: 20px 0 8px; }
.crumbs a { color: var(--muted); }
.res-head { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: 8px; }
.res-head h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; margin: 6px 0 14px; }
.res-head p { max-width: var(--text-w); }
.get { margin: 20px 0 8px; }
.preview { margin: 0; }
.preview img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; box-shadow: 0 6px 24px rgba(13, 19, 26, .10); }
.preview figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; text-align: center; }
@media (min-width: 900px) {
  .res-head { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; }
  .preview { position: sticky; top: calc(var(--header-h) + 16px); }
}
.res-body { max-width: var(--text-w); margin-top: 24px; }
.res-body h3 { margin-top: 1.4rem; }
.more { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); margin: 32px 0; }
.more section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.more h2 { font-size: 1.05rem; margin: 0 0 8px; }
.more ul { margin: 0 0 8px; padding-left: 1.2rem; }
.more li { margin: 4px 0; }

.promo { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 18px 20px; margin: 28px 0 40px; }
.promo p { margin: 0; flex: 1 1 320px; }

/* the online tools */
.tool-wrap { max-width: 860px; }
.tool-wrap h1 { margin: 6px 0 8px; font-size: clamp(1.5rem, 4vw, 2rem); }
.tool { margin: 20px 0; }
.tool fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 14px 16px 16px; margin: 0 0 16px; min-width: 0; }
.tool legend { font-weight: 700; padding: 0 6px; }
.tool .grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.tool label.f { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
.tool label.f span.h { font-weight: 400; color: var(--muted); font-size: .8rem; }
.tool input[type=text], .tool input[type=date], .tool input[type=number], .tool textarea, .tool select {
  font: inherit; font-weight: 400; color: var(--text); background: var(--page); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; width: 100%;
}
.tool textarea { min-height: 70px; resize: vertical; }
.tool input:focus-visible, .tool textarea:focus-visible, .tool select:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--primary); }
.tool .unit-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tool .unit-head h2 { font-size: 1.1rem; margin: 0; }
.tool .item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--soft); }
.tool .item:first-of-type { border-top: 0; }
.tool .item .q b { display: block; }
.tool .item .q span { font-size: .85rem; color: var(--muted); }
@media (min-width: 640px) { .tool .item { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .tool .item .note { grid-column: 1 / -1; } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; min-height: 44px; padding: 0 12px; font-weight: 600; border-left: 1px solid var(--line); background: var(--card); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--primary); color: var(--on-primary); }
.seg input[value="Fail"]:checked + span { background: #B42318; color: #fff; }
.seg input:focus-visible + span { box-shadow: inset var(--focus); }
.tool .row-card { border-top: 1px solid var(--soft); padding-top: 12px; margin-top: 12px; }
.tool .row-card:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.tool .calc { font-size: .9rem; background: var(--soft); border-radius: var(--radius-sm); padding: 8px 10px; }
.tool .calc.warn { background: var(--warn-bg); }
.tool .dup { background: #FDE2E0; color: #7A1A12; border-radius: var(--radius-sm); padding: 8px 10px; font-size: .9rem; font-weight: 600; }
.tool .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.tool .actions .btn { min-height: 44px; }
.tool .bar { position: sticky; bottom: 0; background: var(--page); border-top: 1px solid var(--line); padding: 10px 0; margin-top: 8px; z-index: 2; }
.tool .linkish { background: none; border: 0; color: var(--primary); font: inherit; text-decoration: underline; cursor: pointer; padding: 8px; min-height: 44px; }
.tool .summary { font-weight: 600; }
.tool .status { min-height: 1.5em; color: var(--muted); }
.tool .logo-prev { max-height: 48px; max-width: 160px; display: block; margin-top: 6px; background: #fff; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tool .dup { background: #4A1A16; color: #FFD9D4; } }
.tool fieldset.seg-wrap { border: 0; padding: 0; margin: 0; background: none; min-width: 0; }
.tool label.f.check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; margin-top: 8px; }
.tool label.f.check input { width: 22px; height: 22px; accent-color: var(--primary); }
.tool { min-height: 1300px; } /* the form replaces the loading line: keep the page from jumping */
