/* KB_TOOLGAP: shared everyday-tool UI. Mobile first, no horizontal scroll. */
.tg-app{--tg-gap:14px;display:flex;flex-direction:column;gap:var(--tg-gap);min-width:0}
.tg-app *{box-sizing:border-box}
.tg-tabs{display:flex;flex-wrap:wrap;gap:6px}
.tg-tabs .tab,.tg-chip{appearance:none;border:1px solid var(--border, #d8dee6);background:var(--card, #fff);color:inherit;border-radius:999px;padding:8px 12px;font:inherit;font-size:.92rem;cursor:pointer;min-height:40px}
.tg-tabs .tab.on,.tg-chip.on{background:var(--ink, #0f172a);color:#fff;border-color:transparent}
.tg-grid{display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:720px){.tg-grid-2{grid-template-columns:1fr 1fr}.tg-split{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start}}
.tg-field{display:flex;flex-direction:column;gap:4px;font-weight:600;min-width:0}
.tg-field input,.tg-field select,.tg-field textarea{font:inherit;font-weight:500;width:100%;min-height:44px;padding:8px 10px;border:1px solid var(--border,#d8dee6);border-radius:10px;background:var(--card,#fff);color:inherit}
.tg-field input[type=color]{padding:4px;height:44px}
.tg-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tg-out{background:var(--soft,#f4f7fb);border-radius:14px;padding:14px 16px;min-width:0}
.tg-out .res-row{display:flex;justify-content:space-between;gap:12px;align-items:baseline;padding:6px 0;border-bottom:1px solid var(--border,#e6ebf2)}
.tg-out .res-row:last-child{border-bottom:0}
.tg-out .res-row.big{font-size:1.35rem;font-weight:700}
.tg-out .res-row.big b{word-break:break-all}
.tg-formula,.tg-note{margin:8px 0 0;color:var(--muted,#5b6777)}
.tg-history{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:6px}
.tg-history button{width:100%;text-align:left;border:1px solid var(--border,#d8dee6);background:var(--card,#fff);border-radius:10px;padding:8px 10px;font:inherit;cursor:pointer}
.tg-history button:hover,.tg-history button:focus-visible{border-color:var(--ink,#0f172a)}
.tg-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tg-actions .btn{min-height:40px}
.tg-bigtime{font-size:clamp(2.2rem,8vw,3.6rem);font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:-.03em;text-align:center;line-height:1.1}
.tg-swatch{width:56px;height:56px;border-radius:12px;border:1px solid var(--border,#d8dee6);flex:0 0 auto}
.tg-palette{display:flex;flex-wrap:wrap;gap:8px}
.tg-palette button{width:40px;height:40px;border-radius:8px;border:1px solid rgba(0,0,0,.12);cursor:pointer}
.tg-imgpick{width:100%;max-height:240px;object-fit:contain;background:#0f172a0d;border-radius:12px;cursor:crosshair}
.tg-aa{display:inline-block;padding:2px 8px;border-radius:999px;font-size:.8rem;font-weight:700}
.tg-aa.ok{background:#dcfce7;color:#166534}
.tg-aa.no{background:#fee2e2;color:#991b1b}
.tg-ip{font-size:clamp(1.4rem,4vw,2rem);font-weight:700;word-break:break-all}
.tg-laps{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.tg-laps th,.tg-laps td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--border,#e6ebf2)}
.tg-app .trust{margin:4px 0 0}
.tg-check{display:flex;gap:8px;align-items:flex-start;font-weight:500}
.tg-check input{margin-top:3px;width:18px;height:18px}
.tg-presets{display:flex;flex-wrap:wrap;gap:6px}
@media(max-width:640px){
  .tg-out .res-row{flex-direction:column;gap:2px}
  .tg-out .res-row.big{font-size:1.5rem}
}

/* batch 2 */
.tg-tablewrap{overflow:auto;max-height:420px;border:1px solid var(--border,#e6ebf2);border-radius:12px;-webkit-overflow-scrolling:touch}
.tg-laps.tg-amort{min-width:520px;font-size:.9rem}
.tg-laps .is-extra{background:#fef9c3}
.tg-wheel-wrap{display:grid;gap:16px;justify-items:center}
@media(min-width:800px){.tg-wheel-wrap{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}}
.tg-wheel-canvas{width:100%;max-width:420px;height:auto;aspect-ratio:1;display:block;touch-action:none}
.tg-wheel-pointer{width:0;height:0;border-left:14px solid transparent;border-right:14px solid transparent;border-top:22px solid var(--ink,#0f172a);margin:-8px auto 8px}
.tg-winner{font-size:1.4rem;font-weight:700;text-align:center;margin:8px 0}
.tg-type-board{font:1.15rem/1.7 ui-monospace,Menlo,Consolas,monospace;background:var(--soft,#f4f7fb);border-radius:14px;padding:16px;min-height:8.5em;letter-spacing:.01em;word-break:break-word}
.tg-type-board .ok{color:#166534}
.tg-type-board .bad{color:#991b1b;background:#fee2e2;border-radius:3px}
.tg-type-board .cur{border-left:2px solid var(--ink,#0f172a);animation:tgblink 1s step-end infinite}
@keyframes tgblink{50%{border-color:transparent}}
.tg-type-hidden{position:absolute;opacity:0;width:1px;height:1px;overflow:hidden}
.tg-drop{border:2px dashed var(--border,#c9d2de);border-radius:14px;padding:22px 14px;text-align:center;cursor:pointer;background:var(--soft,#f4f7fb)}
.tg-drop:focus-visible,.tg-drop.over{border-color:var(--ink,#0f172a);outline:none}
.tg-video{width:100%;max-height:280px;background:#0f172a;border-radius:12px;object-fit:cover}
.tg-thumbs{display:grid;gap:12px;grid-template-columns:1fr}
@media(min-width:720px){.tg-thumbs{grid-template-columns:1fr 1fr}}
.tg-thumbs figure{margin:0;background:var(--soft,#f4f7fb);border-radius:12px;padding:10px;min-width:0}
.tg-thumbs img{width:100%;height:auto;border-radius:8px;background:#111;display:block}
.tg-meta{width:100%;border-collapse:collapse;font-size:.92rem}
.tg-meta th,.tg-meta td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--border,#e6ebf2);vertical-align:top;word-break:break-word}
.tg-preview{max-width:100%;max-height:280px;border-radius:12px;display:block;margin:0 auto}
.tg-scan-text{font-size:1.05rem;word-break:break-all;background:var(--card,#fff);border-radius:10px;padding:10px;border:1px solid var(--border,#e6ebf2)}
.tg-type-input{width:100%;min-height:48px;font:1.15rem/1.4 ui-monospace,Menlo,Consolas,monospace;padding:10px 12px;border:1px solid var(--border,#d8dee6);border-radius:10px;background:var(--card,#fff);color:inherit}
.tg-type-input:focus{outline:2px solid var(--ink,#0f172a);outline-offset:2px}
.tg-exif-item{border:1px solid var(--border,#e6ebf2);border-radius:12px;padding:12px;margin:0 0 12px;min-width:0}
.tg-exif-item img{max-width:100%;max-height:200px;border-radius:8px;display:block;margin:0 0 8px auto}
.tg-badge{display:inline-block;padding:2px 8px;border-radius:999px;font-size:.8rem;font-weight:700;background:#e2e8f0}
.tg-badge.gps{background:#fee2e2;color:#991b1b}
.tg-badge.ok{background:#dcfce7;color:#166534}
