/* tools-extra.css — the QR code generator, the calculator, the screenshot tool and blur background. */

/* QR code: the form on the left, the code on the right */
.qr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 24px; align-items: start; }
.qr-form textarea { width: 100%; }
.qr-view { aspect-ratio: 1; border-radius: 12px; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.qr-view svg { display: block; width: 100%; height: 100%; }
.qr-side { display: grid; gap: 10px; }
@media (max-width: 640px) { .qr-grid { grid-template-columns: 1fr; } .qr-side { max-width: 320px; } }

/* calculator: a screen and a keypad, the earlier sums below */
.calc-main { display: grid; gap: 12px; max-width: 420px; }
.calc-screen { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--soft); }
.calc-in { font: 600 28px/1.2 var(--body, inherit); font-variant-numeric: tabular-nums; border: 0; background: none; color: var(--ink); text-align: right; padding: 0; width: 100%; min-width: 0; }
.calc-in:focus { outline: none; }
.calc-screen:focus-within { box-shadow: 0 0 0 3px var(--blue); }
.calc-out { font: 600 18px/1.3 var(--body, inherit); text-align: right; color: var(--muted); min-height: 1.3em; font-variant-numeric: tabular-nums; }
.calc-out.bad { font-weight: 400; font-size: 14px; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calc-k { padding: 14px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font: 600 20px var(--body, inherit); cursor: pointer;
  transition: background-color .15s ease, transform .1s var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .calc-k:hover { background: var(--soft); } }
.calc-k:active { transform: scale(.96); }
.calc-k.op { background: var(--soft); }
.calc-k.eq { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.calc-hist { list-style: none; margin: 16px 0 0; padding: 0; max-width: 420px; display: grid; gap: 2px; }
.calc-hist button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; text-align: left; }
.calc-hist button:hover { background: var(--soft); color: var(--ink); }
.calc-hist b { color: var(--ink); white-space: nowrap; }

/* screenshot and blur: the picture, at most the width of the window */
.blur-view { touch-action: none; cursor: crosshair; }
.blur-modes .btn[aria-pressed="true"] { background: var(--yellow); color: var(--yellow-ink); }
.blur-sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 4px; }
.shot-view img, .blur-view { display: block; max-width: 100%; height: auto; max-height: 60vh; border-radius: 10px; margin: 12px 0; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 620px) { .blur-sep { display: none; } }

/* the rename helper's how-to, under the renamer (live.js): the warning stands out */
.ren-helper { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--soft); font-size: 14.5px; }
.ren-helper ol { margin: 8px 0; padding-left: 20px; }
.ren-warn { margin: 0; padding: 8px 10px; border-left: 4px solid var(--yellow); background: var(--panel); border-radius: 6px; }
.ren-cmd { margin: 8px 0 0; padding: 8px 10px; background: var(--panel); border-radius: 6px; font-size: 13px; overflow-x: auto; white-space: pre; }


/* dictation: the record button, a level bar and the clock on one line; the text below */
.dict-bar { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.dict-rec { min-width: 11em; }
.dict-rec.on { background: #C0362C; color: #fff; }
.dict-level { flex: 1; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.dict-level span { display: block; height: 100%; width: 0; background: #1B7347; transition: width 80ms linear; }
.dict-clock { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3.5em; text-align: right; }
/* a letter, not code: the body font, not the tool textareas' monospace */
.tool .dict-text { width: 100%; min-height: 14em; margin: 10px 0; font: 17px/1.6 var(--body); resize: vertical; }
.dict-more { margin-top: 10px; }
.dict-more summary { cursor: pointer; font-weight: 600; }
.dict-corr { padding-left: 1.2em; }
.dict-corr li { display: flex; gap: 12px; align-items: baseline; }
@media (prefers-reduced-motion: reduce) { .dict-level span { transition: none; } }

/* Office converters: the font options for PDFs, and which fonts were used */
.ok-fontopts { display: grid; gap: 8px; margin: 6px 0 4px; }
.ok-fontopts .fileslot { padding: 10px; font-size: .92em; }
.ok-fonts { font-size: .9em; }

/* Office viewers: like a suite. Pages lie on a grey desk; a sheet is a grid with letters, numbers and tabs */
.ov { --desk: #D5DAD8; --grid: #D3D9D6; --head: #E9EDEB; }
:root[data-theme="dark"] .ov { --desk: #0E1214; --grid: #2E383D; --head: #1D2428; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ov { --desk: #0E1214; --grid: #2E383D; --head: #1D2428; } }
.ov-frame { min-width: 0; }
.ov-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; background: var(--head); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; font-size: 14px; }
.ov-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.ov-grow { flex: 1; }
.ov-count, .ov-info { color: var(--muted); font-variant-numeric: tabular-nums; }
.ov-bar select { width: auto; padding: 4px 8px; }
.ov-bar .btn { padding: 6px 12px; font-size: 14px; }
.ov-modes { display: inline-flex; gap: 4px; }
.ov-modes .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ov-desk { background: var(--desk); border: 1px solid var(--line); border-radius: 0 0 10px 10px; padding: 24px; height: min(78vh, 1000px); overflow: auto; text-align: center; }
.ov-page { display: block; margin: 0 auto 20px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.12); }
.ov-formula { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; }
.ov-ref { min-width: 4.5em; padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; font: 600 13px var(--mono); text-align: center; }
.ov-fxl { font: italic 600 14px Georgia, serif; color: var(--muted); }
.tool .ov-fx { flex: 1; min-height: 0; height: 28px; padding: 2px 8px; font: 13px var(--mono); border-radius: 4px; }
.ov-grid { height: min(70vh, 800px); overflow: auto; border: 1px solid var(--line); background: var(--panel); }
.ov-grid:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.ov-sheet { border-collapse: separate; border-spacing: 0; font: 13px/1.3 var(--body); }
.ov-sheet th { position: sticky; top: 0; z-index: 1; min-width: 44px; padding: 3px 8px; background: var(--head); border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); color: var(--muted); font-weight: 600; text-align: center; }
.ov-sheet th[scope="row"] { left: 0; top: auto; z-index: 1; }
.ov-sheet .ov-corner { left: 0; z-index: 2; }
.ov-sheet td { min-width: 88px; max-width: 320px; height: 24px; padding: 3px 8px; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; }
.ov-sheet td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ov-sheet td.on { outline: 2px solid #1B7347; outline-offset: -2px; }
.ov-foot { display: flex; align-items: center; gap: 12px; padding: 0 10px 0 0; background: var(--head); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; font-size: 13px; }
.ov-tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; padding: 0 6px; scrollbar-width: thin; }
.ov-tabs button { border: 0; background: none; padding: 8px 14px; font: 600 13px var(--body); color: var(--muted); cursor: pointer; white-space: nowrap; border-radius: 0 0 6px 6px; }
.ov-tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: inset 0 -3px 0 #1B7347; }
.ov-xls .ov-desk { border-radius: 0; }
.ov-frame > [hidden] { display: none; }
@media (max-width: 620px) { .ov-desk { padding: 10px; } .ov-title { max-width: 16ch; } }
