/* ==========================================================================
   holdonquietly — shared styles for /tools/* web tools
   Sits on top of hoq.css (glass, btn, cta, pagehead ...).
   ========================================================================== */

.tool { padding: 24px; }
.tool + .tool { margin-top: 16px; }
.tool h2 { font-size: 17px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.01em; }
.tool .hint { font-size: 13px; color: var(--dim2); margin-top: 8px; }
.tool .hint a, .tool-note a, .faq a { color: #fff; }

/* drop zone */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 180px; padding: 28px 20px; text-align: center; cursor: pointer;
  border: 2px dashed rgba(255,255,255,.34); border-radius: 7px; background: rgba(255,255,255,.04);
  transition: background .18s ease, border-color .18s ease;
}
.drop:hover, .drop:focus-visible, .drop.over { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); outline: none; }
.drop svg { width: 38px; height: 38px; opacity: .9; }
.drop strong { font-size: 16px; }
.drop span { font-size: 13px; color: var(--dim2); }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* the [hidden] attribute must win over display rules below (.fields, .field, .btn ...) */
[hidden] { display: none !important; }

/* form controls */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim2); }
.inp, .sel {
  width: 100%; font: inherit; font-size: 14px; color: #fff; padding: 10px 12px; border-radius: 6px;
  background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.26); outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.inp:focus, .sel:focus { border-color: rgba(255,255,255,.7); background: rgba(0,0,0,.3); }
.inp::placeholder { color: rgba(255,255,255,.45); }
.sel { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.sel option, .sel optgroup { background: #1b1d33; color: #fff; }
/* number inputs: no native spinner arrows */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* sliders (fill amount comes from --p, set by tools-common.js) */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #a597ff 0, #7f9cf5 var(--p, 50%), rgba(255,255,255,.16) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0,0,0,.45), 0 0 0 4px rgba(139,124,247,.25); transition: box-shadow .15s ease; }
input[type=range]:focus-visible::-webkit-slider-thumb, input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 2px 8px rgba(0,0,0,.45), 0 0 0 6px rgba(139,124,247,.4); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(255,255,255,.16); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #a597ff, #7f9cf5); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0,0,0,.45), 0 0 0 4px rgba(139,124,247,.25); }

/* colour picker: swatch + hex, styled like an input */
.colorpick { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 6px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.26); cursor: pointer; font-size: 14px; font-variant-numeric: tabular-nums; }
.colorpick:hover { border-color: rgba(255,255,255,.5); }
.colorpick input[type=color] { -webkit-appearance: none; appearance: none; width: 30px; height: 28px; padding: 0; border: 0; border-radius: 5px; background: none; cursor: pointer; flex: none; }
.colorpick input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.colorpick input[type=color]::-webkit-color-swatch { border: 1px solid rgba(255,255,255,.35); border-radius: 5px; }
.colorpick input[type=color]::-moz-color-swatch { border: 1px solid rgba(255,255,255,.35); border-radius: 5px; }
.colorpick .hex { text-transform: uppercase; color: var(--dim); }

/* checkboxes */
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--dim); cursor: pointer; user-select: none; }
.field > label.check { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--dim); min-height: 41px; }
.check input { -webkit-appearance: none; appearance: none; width: 19px; height: 19px; flex: none; margin: 0; border-radius: 6px; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.5); background: rgba(0,0,0,.22); display: grid; place-items: center; transition: background .15s ease, border-color .15s ease; }
.check input::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg) translate(-1px, -1px) scale(0); transition: transform .12s ease; }
.check input:checked { background: #8B7CF7; border-color: #a597ff; }
.check input:checked::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.check input:focus-visible { outline: 2px solid rgba(255,255,255,.7); outline-offset: 2px; }

/* custom dropdown (replaces native <select class="sel">; the select stays as the source of truth) */
.dd { position: relative; width: 100%; }
.dd-native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; }
.dd-btn { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; font-size: 14px; color: #fff; padding: 10px 12px; border-radius: 6px; cursor: pointer;
  background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.26); transition: border-color .15s ease, background .15s ease; }
.dd-btn:hover { border-color: rgba(255,255,255,.5); }
.dd-btn:focus-visible, .dd-btn[aria-expanded=true] { outline: none; border-color: rgba(255,255,255,.75); background: rgba(0,0,0,.3); }
.dd-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-btn svg { width: 16px; height: 16px; flex: none; opacity: .8; transition: transform .18s ease; }
.dd-btn[aria-expanded=true] svg { transform: rotate(180deg); }
.dd-menu { position: fixed; z-index: 1000; max-height: min(340px, 60vh); overflow-y: auto; padding: 6px; border-radius: 7px;
  background: rgba(26,27,52,.94); border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 18px 50px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.18);
  animation: ddIn .14s ease; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-menu::-webkit-scrollbar { width: 8px; }
.dd-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
.dd-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim2); }
.dd-opt { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 5px; font-size: 14px; color: rgba(255,255,255,.9); cursor: pointer; white-space: nowrap; }
.dd-opt.active { background: rgba(255,255,255,.12); color: #fff; }
.dd-opt[aria-selected=true] { color: #fff; font-weight: 700; }
.dd-opt::before { content: ""; width: 14px; flex: none; height: 14px; }
.dd-opt[aria-selected=true]::before { background: no-repeat center/14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8acff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

/* resizer live preview */
.preview { margin-top: 16px; }
.pv-stage { position: relative; display: grid; place-items: center; min-height: 220px; max-height: 460px; padding: 14px; border-radius: 6px; overflow: hidden;
  background-color: rgba(0,0,0,.25); background-image: conic-gradient(rgba(255,255,255,.07) 25%, transparent 0 50%, rgba(255,255,255,.07) 0 75%, transparent 0); background-size: 22px 22px; border: 1px solid rgba(255,255,255,.14); }
.pv-stage canvas { display: block; max-width: 100%; max-height: 430px; width: auto; height: auto; border-radius: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.pv-bar .hint { margin: 0; }
.file.pickable { cursor: pointer; }
.file.pickable:hover { background: rgba(255,255,255,.1); }
.file.active { border-color: rgba(184,172,255,.75); background: rgba(139,124,247,.16); }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 6px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.2); }
.seg button { font: inherit; font-size: 13px; font-weight: 700; color: var(--dim); background: transparent; border: 0; padding: 7px 14px; border-radius: 5px; cursor: pointer; }
.seg button:hover { color: #fff; }
.seg button[aria-pressed=true] { background: rgba(255,255,255,.2); color: #fff; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 10px; }
button.btn, button.cta { font-family: inherit; }
.btn[disabled], .cta[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

/* file list */
.files { display: flex; flex-direction: column; gap: 10px; }
.file {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  padding: 10px 12px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
}
.file .thumb { width: 56px; height: 56px; border-radius: 5px; object-fit: cover; background: rgba(0,0,0,.25); display: grid; place-items: center; overflow: hidden; }
.file .thumb svg { width: 24px; height: 24px; opacity: .8; }
.file .meta { min-width: 0; }
.file .name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .sub { font-size: 12.5px; color: var(--dim2); margin-top: 2px; }
.file .sub b { color: #fff; font-weight: 700; }
.file .acts { display: flex; gap: 8px; align-items: center; }
.file .x { background: none; border: 0; color: var(--dim2); cursor: pointer; padding: 6px; border-radius: 5px; line-height: 0; }
.file .x:hover { color: #fff; background: rgba(255,255,255,.1); }
.file .x svg { width: 16px; height: 16px; }
.bar { height: 5px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 7px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8B7CF7, #6d8bf2); transition: width .2s ease; }
.bar.indet i { width: 35%; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.ok { color: #8ef0b6; }
.err { color: #ff9d9d; }

/* result stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 6px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); }
.stat .k { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--dim2); }
.stat .v { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; line-height: 1.15; }
.stat .s { font-size: 12.5px; color: var(--dim2); margin-top: 3px; }

/* tables */
.tbl-wrap { overflow-x: auto; border-radius: 6px; border: 1px solid rgba(255,255,255,.14); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim2); font-weight: 700; padding: 10px 12px; background: rgba(0,0,0,.2); position: sticky; top: 0; }
.tbl td { padding: 9px 12px; border-top: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
.tbl tr:hover td { background: rgba(255,255,255,.05); }
.tbl td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { color: #fff; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); white-space: nowrap; }
.pill.a { background: rgba(109,139,242,.35); }
.pill.b { background: rgba(167,139,250,.35); }

/* notes, faq */
.tool-note { padding: 14px 16px; border-radius: 6px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); font-size: 13.5px; color: var(--dim); }
.tool-note.warn { border-color: rgba(255,200,120,.5); background: rgba(255,190,90,.1); }
.tool-note b { color: #fff; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.faq details p { color: var(--dim); font-size: 14px; margin-top: 8px; }
.lock { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dim2); }
.lock svg { width: 13px; height: 13px; }

/* Camelot wheel */
.wheel-wrap { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 22px; align-items: center; }
@media (max-width: 760px) { .wheel-wrap { grid-template-columns: 1fr; } }
.wheel { width: 100%; height: auto; display: block; user-select: none; }
.wheel .seg-path { fill: rgba(255,255,255,.06); stroke: rgba(255,255,255,.28); stroke-width: 1; cursor: pointer; transition: fill .15s ease; }
.wheel .seg-path:hover { fill: rgba(255,255,255,.18); }
.wheel .seg-path.compat { fill: rgba(139,124,247,.45); }
.wheel .seg-path.sel { fill: rgba(255,255,255,.75); }
.wheel text { fill: #fff; font-family: inherit; pointer-events: none; text-anchor: middle; dominant-baseline: central; }
.wheel text.code { font-size: 15px; font-weight: 800; }
.wheel text.kname { font-size: 10px; fill: rgba(255,255,255,.75); font-weight: 600; }
.wheel .sel-t text, .wheel text.on-sel { fill: #14152a; }
.compat-list { display: flex; flex-wrap: wrap; gap: 8px; }
.compat-list .pill { font-size: 13px; padding: 5px 12px; cursor: pointer; }

/* tap tempo */
.tap { width: 100%; min-height: 110px; font: inherit; font-size: 20px; font-weight: 800; color: #fff; border-radius: 7px; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.3); transition: background .08s ease, transform .08s ease; }
.tap:active, .tap.hit { background: rgba(255,255,255,.24); transform: scale(.99); }

/* image previews */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 560px) {
  .tool { padding: 18px; }
  .file { grid-template-columns: 44px 1fr; }
  .file .thumb { width: 44px; height: 44px; }
  .file .acts { grid-column: 1 / -1; justify-content: flex-end; }
}

/* card links (popular conversions) inherit site text colour, no underline */
a.card { display: block; color: #fff; text-decoration: none; }
a.card:focus-visible { outline: 2px solid rgba(255,255,255,.7); outline-offset: 2px; }

/* image resizer: settings + sticky preview side by side */
.rz-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 16px; }
.rz-grid:has(> #preview[hidden]) { grid-template-columns: minmax(0, 1fr); }
.rz-grid > .tool { margin-top: 0 !important; }
.rz-preview { position: sticky; top: 12px; }
.rz-preview .pv-stage { min-height: 180px; max-height: 62vh; }
.rz-preview .pv-stage canvas { max-height: calc(62vh - 30px); }
@media (max-width: 900px) {
  .rz-grid { grid-template-columns: minmax(0, 1fr); }
  .rz-preview { position: static; order: -1; }
}
