/* PALMATOWN static Tools pages (built by build_tools_pages.py). Light theme, matching the app's Tools tab. */
:root { --bg:#e4e9f0; --panel:#f6f8fb; --text:#23211d; --dim:#5d6470; --line:#c9d1dc; --steel:#46556b; --black:#0b0e13; --accent:#b5730a; --link:#2c5a8a; }
* { box-sizing:border-box; }
html { background:var(--bg); }
body { margin:0; color:var(--text); font:16px/1.65 'JetBrains Mono','SF Mono',Consolas,'Liberation Mono',monospace;
  background-image:repeating-linear-gradient(135deg, rgba(40,60,90,.035) 0 2px, transparent 2px 9px); }
a { color:var(--link); }
.tp-top { position:relative; display:flex; align-items:center; gap:10px; padding:12px 22px; background:var(--panel); border-bottom:2px solid var(--line); flex-wrap:wrap; }
.tp-top::before { content:''; position:absolute; left:0; right:0; top:0; height:4px; background:repeating-linear-gradient(-45deg, var(--steel) 0 10px, var(--black) 10px 20px); }
.tp-brand { font-weight:900; letter-spacing:2px; color:var(--accent); text-decoration:none; }
.tp-crumb { color:var(--dim); } .tp-crumb a { color:var(--dim); text-decoration:none; }
.tp-applink { margin-left:auto; font-weight:800; font-size:14px; text-decoration:none; color:var(--steel); border:2px solid var(--steel); padding:3px 10px; border-radius:4px; }
.tp-main { max-width:900px; margin:0 auto; padding:26px 22px 40px; }
h1 { font-size:30px; font-weight:900; letter-spacing:1px; margin:6px 0 10px; padding-bottom:12px; position:relative; line-height:1.2; }
h1::after { content:''; position:absolute; left:0; bottom:0; width:100%; max-width:300px; height:8px; background:repeating-linear-gradient(-45deg, var(--steel) 0 10px, var(--black) 10px 20px); }
h2 { font-size:20px; font-weight:900; margin:34px 0 10px; padding-bottom:6px; border-bottom:2px solid var(--line); }
h3 { font-size:16px; margin:0 0 6px; }
.tp-lead { font-size:17px; color:var(--dim); margin:8px 0 14px; }
.tp-btn { display:inline-block; background:#2c3643; color:#f2f5f9; font-weight:900; letter-spacing:1px; text-decoration:none; padding:10px 18px;
  border:3px solid var(--black); border-radius:4px; box-shadow:4px 4px 0 rgba(0,0,0,.45); }
.tp-btn:hover { transform:translate(-1px,-1px); box-shadow:5px 5px 0 rgba(0,0,0,.45); }
.tp-cta { margin:30px 0 10px; }
.tp-fig { margin:18px 0; padding:8px; background:var(--panel); border:1px solid var(--line); border-radius:8px; }
.tp-fig img { display:block; width:100%; height:auto; }
.tp-body table { border-collapse:collapse; width:100%; margin:12px 0; background:var(--panel); font-size:14px; }
.tp-body th, .tp-body td { border:1px solid var(--line); padding:6px 10px; text-align:left; vertical-align:top; }
.tp-body th { background:#dfe5ee; }
.tp-body li { margin-bottom:6px; }
.tp-body p strong, .tp-body li strong { color:#1c2530; }
.tp-danger { border:3px solid #111; border-radius:6px; overflow:hidden; margin:16px 0; background:#fff; }
.tp-danger-h { display:flex; align-items:center; gap:12px; background:#c8102e; color:#fff; padding:7px 14px; font-family:Arial,Helvetica,sans-serif; font-weight:900; letter-spacing:3px; font-size:22px; }
.tp-danger-ico { width:34px; height:30px; flex:none; }
.tp-danger-sub { font-size:14px; letter-spacing:2px; margin-left:auto; }
.tp-danger-b { padding:10px 14px; font-weight:600; }
.tp-related li { margin-bottom:8px; }
.tp-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); gap:14px; }
.tp-card { background:var(--panel); border:3px solid var(--black); border-radius:4px; padding:12px 14px; box-shadow:4px 4px 0 rgba(0,0,0,.4); }
.tp-card h3 { border-bottom:2px solid var(--steel); padding-bottom:4px; }
.tp-card h3 a { color:var(--text); text-decoration:none; }
.tp-card p { font-size:14px; margin:6px 0; }
.tp-card-links { font-weight:800; }
.tp-foot { text-align:center; padding:20px; color:var(--dim); font-size:14px; border-top:2px solid var(--line); }
@media (max-width:600px){ body { font-size:15px; } h1 { font-size:24px; } .tp-danger-sub { display:none; } }
/* home cards with pictures (matches the app's Tools tab blocks) */
.tp-main:has(.tp-grid) { max-width:1180px; }
.tp-grid { grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); align-items:stretch; }
.tp-card { display:flex; flex-direction:column; }
.tp-card-pic { display:block; margin-top:auto; padding-top:8px; }
.tp-card-pic img { display:block; width:100%; height:auto; max-height:170px; object-fit:contain; background:#eef1f5; border:1px solid var(--line); border-radius:4px; }
.tp-card-wide { grid-column:span 2; display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr); gap:16px; align-items:start; }
.tp-card-wide .tp-card-pic { margin:0; padding:0; }
.tp-card-wide .tp-card-pic img { max-height:260px; }
@media (max-width:640px){ .tp-card-wide { grid-column:auto; display:flex; flex-direction:column; } }
/* library pages */
.tp-kicker { margin:0; font-size:13px; font-weight:800; letter-spacing:1.5px; text-transform:uppercase; color:var(--steel); }
.tp-series { background:var(--panel); border:1px solid var(--line); border-left:5px solid var(--steel); border-radius:6px; padding:10px 14px; margin:16px 0; font-size:14px; }
.tp-series ol { margin:6px 0 0; padding-left:22px; }
.tp-series li { margin:3px 0; }
.tp-series li span { font-weight:800; }
.tp-next { margin-top:26px; font-weight:800; }
.tp-body img { max-width:100%; height:auto; border:1px solid var(--line); border-radius:6px; background:#fff; }
.tp-body h2 { scroll-margin-top:12px; }
.tp-body blockquote { margin:12px 0; padding:6px 14px; border-left:4px solid var(--steel); background:var(--panel); }
.tp-body code { background:#dfe5ee; padding:1px 5px; border-radius:3px; font-size:.92em; }
.tp-jump { font-weight:800; }
.tp-lib { columns:2 380px; column-gap:22px; }
.tp-lib-series { break-inside:avoid; background:var(--panel); border:1px solid var(--line); border-left:6px solid var(--c, var(--steel)); border-radius:6px; padding:10px 14px; margin:0 0 14px; }
.tp-lib-series h3 { margin:0 0 6px; font-size:15px; }
.tp-lib-series ul { margin:0; padding-left:18px; font-size:14px; }
.tp-lib-series li { margin:4px 0; }
.tp-body img { display:block; max-width:min(100%, 680px); margin:14px auto; }

/* Library articles: a diagram and its bench photo on consecutive lines sit side by side,
   stacked on a phone (matches the app). */
.tp-body p:has(> img + img) { display:flex; gap:14px; align-items:flex-start; }
.tp-body p:has(> img + img) > img { flex:1 1 0; min-width:0; max-width:none; margin:0; object-fit:contain; }
@media (max-width:760px){ .tp-body p:has(> img + img) { flex-direction:column; } .tp-body p:has(> img + img) > img { width:100%; } }
