/* Styles for the tools added 2026-08-08: world clock, business days, working
   hours, countdown/timer/stopwatch, QR codes, text case, encoding tools, JSON,
   discount and tip.

   Loaded only by those pages, the same way css/pdf-tools.css is, so nothing
   here can affect the other 290 pages and no sitewide cache bust is needed.
   Tokens come from style.css; nothing below redefines a colour of its own. */

/* ---- shared bits --------------------------------------------------------- */

.r-main-sm{font-size:clamp(18px,2.6vw,24px)!important;line-height:1.25}
.big-clock{font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.readout .r-main.big-clock{font-size:clamp(30px,6vw,46px)}
.readout .r-main.big-clock.done{color:var(--red)}

/* Checkbox rows. The label element is display:block site-wide, which would put
   the box on its own line. */
.ck{display:flex;align-items:center;gap:9px;font-weight:500;font-size:14px;margin:8px 0 0}
.ck input{width:auto;margin:0;flex:0 0 auto}
.ck-inline{display:inline-flex;margin:0 0 0 4px}

.r-row.hl{font-weight:700}
.r-row.hl span{color:var(--ink)}
.r-row.head{border-bottom:1px solid var(--line)}
.r-row.head span,.r-row.head b{font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);font-weight:500}
.r-row b.mono{font-family:var(--mono);font-size:12px;overflow-wrap:anywhere;white-space:normal;text-align:right}
.hashrow{align-items:baseline}
.hashrow span{flex:0 0 auto}

.op-head{font-size:12px;font-family:var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin:18px 0 2px;font-weight:500}
.op-head:first-child{margin-top:0}

/* .btn.sm renders 30px tall, which is under the 32px minimum tap target that
   tests/css-audit.js enforces at 320 and 360. The rest of the site only ever
   uses .btn.sm with .ghost inside a .btn-row, where the row's own padding takes
   it over the line, so this is scoped here rather than changed in style.css
   where it would need a sitewide cache bust. */
.btn.sm{min-height:34px;display:inline-flex;align-items:center;justify-content:center}

/* An "on" state for the small ghost buttons used as quick pickers. */
.btn-row .btn.ghost.on,.btn.ghost.sm.on{background:var(--ink);color:#fff;border-color:var(--ink)}
.btn-row .btn.ghost.on:hover{background:var(--ink);color:#fff}

/* ---- world clock --------------------------------------------------------- */

.wc-add{display:flex;gap:12px;align-items:flex-end;margin-bottom:18px;flex-wrap:wrap}
.wc-search{position:relative;flex:1 1 280px;margin-bottom:0}
.wc-search .search-list button{display:flex;justify-content:space-between;gap:12px;align-items:baseline}
.wc-search .search-list b{font-weight:600}
.wc-search .search-list span{font-family:var(--mono);font-size:11px;color:var(--muted)}

.wc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr));gap:14px}
.wc-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px 16px 14px;position:relative}
.wc-card.me{border-color:var(--green);border-top:3px solid var(--green);padding-top:14px}
/* Night is a slightly cooler, darker card. Text stays on the same ink colour so
   the contrast ratio does not move. */
.wc-card.night{background:linear-gradient(180deg,#F2F5F3,#EAEFEC)}
.wc-top{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.wc-city{font-weight:700;font-size:15px;line-height:1.3;overflow-wrap:anywhere}
/* The glyph is small but the hit area must not be: 34px square, pulled back
   with a negative margin so the card padding still looks right. */
.wc-del{border:0;background:none;cursor:pointer;color:var(--muted);font-size:20px;line-height:1;flex:0 0 auto;
  min-width:34px;min-height:34px;display:inline-flex;align-items:center;justify-content:center;margin:-8px -8px 0 0;border-radius:8px}
.wc-del:hover{color:var(--red);background:rgba(192,57,43,.08)}
.wc-time{font-family:var(--mono);font-size:clamp(22px,3.4vw,27px);font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:-.02em;margin-top:8px}
.wc-date{font-size:13px;color:var(--muted);margin-top:2px}
.wc-meta{margin-top:10px;padding-top:9px;border-top:1px dashed var(--line);display:flex;flex-direction:column;gap:2px}
.wc-off{font-family:var(--mono);font-size:11.5px;color:var(--green-d);font-weight:500}
.wc-rel{font-size:12px;color:var(--muted)}

/* ---- working hours ------------------------------------------------------- */

.wh-tbl input[type=time],.wh-tbl input[type=number]{padding:7px 8px;font-size:13.5px;min-width:96px}
.wh-tbl input[type=number]{min-width:76px}
.wh-tbl td{vertical-align:middle}
.wh-tbl td.wh-tot{font-family:var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}
.wh-tbl tr.off td{opacity:.5}
.wh-tbl tr.off td.wh-tot{font-weight:500}
.wh-day{display:flex;align-items:center;gap:8px;margin:0;font-weight:600;white-space:nowrap}
.wh-day input{width:auto;margin:0;flex:0 0 auto}

/* ---- QR ------------------------------------------------------------------ */

.qr-out{text-align:center}
.qr-out canvas{max-width:100%;height:auto;border:1px solid var(--line);border-radius:10px;background:#fff;margin:12px auto 0;display:block;image-rendering:pixelated}
.qr-out .btn-row{justify-content:center}
.qr-out .hint{margin:10px 0 0}
#qrMeta{font-family:var(--mono);font-size:11.5px}
.qr-style input[type=color]{width:100%;height:44px;padding:4px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer}

/* ---- JSON ---------------------------------------------------------------- */

.jf-cols{grid-template-columns:1fr 1fr}
@media(max-width:900px){.jf-cols{grid-template-columns:1fr}}
#jfIn,#jfOut{font-family:var(--mono);font-size:13px;line-height:1.5;white-space:pre;overflow-wrap:normal;overflow-x:auto}
.jf-status{border-radius:10px;padding:11px 14px;font-size:13.5px;margin-bottom:14px}
.jf-status b{display:block;font-weight:700}
.jf-status span{display:block;margin-top:5px;font-size:12.5px;overflow-wrap:anywhere}
.jf-status.ok{background:var(--green-t);border:1px solid rgba(11,122,85,.25);color:var(--green-d)}
/* Deep enough red on a pale wash to clear AA for body text, checked with
   tests/contrast.test.js rather than eyeballed. */
.jf-status.bad{background:rgba(192,57,43,.07);border:1px solid rgba(192,57,43,.3);color:#8E2A20}
.jf-status.bad span{font-family:var(--mono)}

/* ---- encoding tools ------------------------------------------------------ */

#etB64In,#etB64Out,#etUrlIn,#etUrlOut,#etUuidOut,#etJwtIn,#etHashIn{font-family:var(--mono);font-size:13px}
.jwt-out{font-family:var(--mono);font-size:12.5px;line-height:1.55;background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
.jwt-out:empty{display:none}

/* ---- text tools ---------------------------------------------------------- */

#tcText{font-family:var(--mono);font-size:13.5px;line-height:1.5}

/* ---- tabs and panes ------------------------------------------------------ */

#bdTabs,#cdTabs,#dcTabs,#etTabs{margin-bottom:18px}
/* Five tabs will not fit on a phone in one row, so the strip scrolls sideways
   rather than squeezing the labels to nothing. */
@media(max-width:560px){
  .seg-eq{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .seg-eq button{flex:0 0 auto;font-size:12.5px;padding:10px 12px}
}
