/* === Shared Extra-Tool Fields === */
.field-stack {
  display: grid;
  gap: .38rem;
  margin-top: .78rem;
}
.tool-editor > .field-stack:first-child { margin-top: 0; }
#timer-cd-controls, #timer-sw-controls { margin-top: .78rem; }
.field-stack label { font-size: .92rem; font-weight: 710; }

.text-input {
  width: 100%;
  min-height: 2.6rem;
  padding: .45rem .72rem;
  border: 1px solid #c9d4ea;
  border-radius: .72rem;
  background: #f8faff;
  color: var(--ink);
  font-size: .95rem;
}

.two-col-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.range-grid {
  display: grid;
  gap: .55rem;
  margin-top: .85rem;
}
.range-item {
  display: grid;
  gap: .25rem;
  font-size: .88rem;
  font-weight: 660;
}
.range-item > span {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.range-item strong { color: var(--blue); font-variant-numeric: tabular-nums; }
.range-item input[type="range"] { width: 100%; accent-color: var(--blue); cursor: pointer; }

.color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-top: .8rem;
  font-size: .9rem;
  font-weight: 700;
}
.swatch-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .36rem;
}
.swatch {
  width: 1.85rem;
  height: 1.85rem;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: var(--sw);
  cursor: pointer;
}
.swatch:hover { transform: scale(1.08); border-color: var(--blue); }
.swatch-list input[type="color"] {
  width: 2.15rem;
  height: 2.05rem;
  padding: 2px;
  border: 1px solid #cbd5e1;
  border-radius: .5rem;
  background: #fff;
  cursor: pointer;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .9rem;
}
.btn-row .primary-button { flex: 1; min-width: 9rem; }

.empty-hint {
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 1.8rem 1rem;
}

/* === 4. Watermark + Mosaic === */
.mosaic-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .78rem;
  padding-top: .72rem;
  border-top: 1px solid var(--line);
}
.wm-export-row {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  gap: .55rem;
  margin-top: .85rem;
}

.wm-stage {
  display: grid;
  place-items: center;
  min-height: clamp(18rem, 36vw, 29rem);
  padding: 1.1rem;
  background:
    radial-gradient(ellipse at center, #e5eeff, transparent 72%),
    radial-gradient(circle, #b6c5e578 1px, transparent 1.5px),
    #f3f6fc;
  background-size: auto, 1.18rem 1.18rem, auto;
}
.wm-stage[data-has-image] {
  background: repeating-conic-gradient(#e7edf6 0% 25%, #f7f9fd 0% 50%) center / 1.24rem 1.24rem;
}
.wm-stage canvas {
  max-width: 100%;
  max-height: 28rem;
  height: auto;
  border-radius: .5rem;
  box-shadow: 0 .35rem 1.2rem #1724401c;
  display: block;
}
.wm-stage[data-mosaic="true"] canvas {
  cursor: crosshair;
  touch-action: none;
  outline: 2px dashed var(--blue);
  outline-offset: 4px;
}

/* === 5. QR Code === */
.qr-stage {
  display: grid;
  place-items: center;
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  background:
    radial-gradient(ellipse at center, #e8eeff, transparent 72%),
    #f6f8fd;
  min-height: 22rem;
}
.qr-stage canvas {
  width: min(100%, 20.5rem);
  height: auto;
  border-radius: .9rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 .5rem 1.4rem #1e316818;
}
.qr-decode-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.qr-cam-wrap {
  margin-top: .8rem;
  border: 1px solid var(--line);
  border-radius: .95rem;
  overflow: hidden;
  background: #0b1120;
}
.qr-cam-viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #060a14;
  overflow: hidden;
}
#qr-cam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qr-cam-reticle {
  position: absolute;
  inset: 18%;
  border: 2px solid rgba(147, 197, 253, .85);
  border-radius: .9rem;
  box-shadow: 0 0 0 9999px rgba(6, 10, 20, .34);
  pointer-events: none;
}
.qr-cam-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .8rem;
  background: #111a2e;
  color: #e2e8f0;
  font-size: .82rem;
}
.qr-cam-bar .chip-btn {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: #f8fafc;
}
.qr-cam-bar .chip-btn:hover {
  border-color: rgba(147, 197, 253, .6);
  background: rgba(59, 130, 246, .28);
  color: #ffffff;
}
.qr-decode-thumb-wrap {
  margin-top: .8rem;
  display: grid;
  place-items: center;
}
.qr-decode-thumb-wrap img {
  max-width: 100%;
  max-height: 14rem;
  border-radius: .72rem;
  border: 1px solid var(--line);
  object-fit: contain;
}
.qr-decode-body { padding: 1.15rem clamp(1rem, 2.8vw, 1.45rem); min-height: 14rem; }
.qr-result-box pre {
  margin: 0;
  padding: .9rem 1rem;
  border: 1px solid #d5dff4;
  border-radius: .82rem;
  background: #f8faff;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.qr-wifi-card {
  margin-top: .75rem;
  padding: .85rem 1rem;
  border: 1px solid #cfe3dc;
  border-radius: .82rem;
  background: #eef9f4;
  display: grid;
  gap: .35rem;
  font-size: .9rem;
}
.qr-wifi-card button { justify-self: start; margin-top: .25rem; }

/* === 6. PDF Tools === */
.pdf-queue-body { padding: .85rem clamp(1rem, 2.6vw, 1.4rem) 1.2rem; min-height: 15rem; }
.file-queue-list {
  display: grid;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.file-queue-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .65rem;
  border: 1px solid #e1e8f5;
  border-radius: .78rem;
  background: #f9fbff;
}
.file-thumb {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: .46rem;
  object-fit: cover;
  border: 1px solid #dce4f4;
  flex-shrink: 0;
}
.pdf-badge {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: .5rem;
  background: #fde6e8;
  color: #b42336;
  font-size: .78rem;
  font-weight: 800;
  flex-shrink: 0;
}
.file-meta { flex: 1; min-width: 0; display: grid; }
.file-meta strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta small { font-size: .78rem; color: var(--muted); }
.file-ops { display: flex; align-items: center; gap: .28rem; flex-shrink: 0; }
.file-ops button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0 .45rem;
  border: 1px solid #d5dff2;
  border-radius: .48rem;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 660;
}
.file-ops button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.file-ops button.danger:hover { border-color: #c81e1e; color: #c81e1e; background: #fef2f2; }
.file-ops button:disabled { opacity: .4; cursor: default; }

.selected-banner {
  margin-top: .55rem;
  padding: .55rem .78rem;
  border: 1px solid #d2dcf0;
  border-radius: .72rem;
  background: #f5f8ff;
  color: var(--blue);
  font-size: .86rem;
  font-weight: 660;
}
.pdf-split-tips {
  padding: 1.15rem clamp(1rem, 2.8vw, 1.45rem);
  color: var(--muted);
  font-size: .9rem;
}
.pdf-split-tips h3 { color: var(--ink); font-size: .98rem; margin-bottom: .5rem; }
.pdf-split-tips ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .42rem; }
.pdf-split-tips code {
  padding: .08rem .36rem;
  border-radius: .35rem;
  background: #eef2ff;
  color: var(--blue);
  font-weight: 700;
}

/* === 7. Fullscreen Timer & Stopwatch === */
.hms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .78rem;
}
.hms-grid label { display: grid; gap: .25rem; font-size: .84rem; font-weight: 680; color: var(--muted); }
.hms-grid input {
  width: 100%;
  min-height: 2.65rem;
  padding: .35rem .5rem;
  border: 1px solid #c9d4ea;
  border-radius: .7rem;
  background: #f8faff;
  color: var(--ink);
  text-align: center;
  font-size: 1.05rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.timer-side-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}

.timer-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .95rem;
  min-height: 23.5rem;
  padding: 2rem 1.5rem;
  background: linear-gradient(145deg, #16264d, #0f1a36);
  color: #fff;
  text-align: center;
}
.timer-stage[data-tone="warn"] {
  background: linear-gradient(145deg, #6b3c0b, #3d2105);
}
.timer-stage[data-tone="done"] {
  background: linear-gradient(145deg, #881337, #4c0519);
}

.timer-stage-title {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 700;
  color: #cbd8ff;
  letter-spacing: .02em;
}
.timer-display {
  font-size: clamp(3.3rem, 9.5vw, 5.8rem);
  font-weight: 820;
  line-height: 1.04;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.timer-progress-track {
  width: min(100%, 24rem);
  height: .5rem;
  border-radius: 999px;
  background: #ffffff26;
  overflow: hidden;
}
.timer-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa, #93c5fd);
  transition: width .12s linear;
}
.timer-stage[data-tone="warn"] .timer-progress-fill { background: #fbbf24; }
.timer-stage[data-tone="done"] .timer-progress-fill { background: #fb7185; }

.timer-stage-state { color: #dbe5ffcc; font-size: .9rem; }
.timer-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem;
  margin-top: .35rem;
}
.timer-controls .secondary-button {
  background: #ffffff1f;
  border-color: #ffffff38;
  color: #fff;
}
.timer-controls .secondary-button:hover:not(:disabled) { background: #ffffff33; }

.timer-exit-fs {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  min-height: 2.5rem;
  padding: .4rem .9rem;
  border: 1px solid #ffffff44;
  border-radius: .7rem;
  background: #ffffff1a;
  color: #fff;
  cursor: pointer;
  font-weight: 680;
}

.timer-stage.is-pseudo-fullscreen,
.timer-stage.is-native-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 999;
  min-height: 100vh;
  border-radius: 0;
  padding: 2.5rem;
}
.timer-stage.is-pseudo-fullscreen .timer-display,
.timer-stage.is-native-fullscreen .timer-display {
  font-size: clamp(4.8rem, 18vw, 13.5rem);
}
.timer-stage.is-pseudo-fullscreen .timer-stage-title,
.timer-stage.is-native-fullscreen .timer-stage-title {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}
.timer-stage.is-pseudo-fullscreen .timer-progress-track,
.timer-stage.is-native-fullscreen .timer-progress-track {
  width: min(88vw, 44rem);
  height: .75rem;
}

.lap-list {
  display: grid;
  gap: .36rem;
  margin: .6rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 13rem;
  overflow-y: auto;
}
.lap-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .42rem .65rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #f9fbff;
  font-variant-numeric: tabular-nums;
  font-size: .86rem;
}
.lap-list small { color: var(--muted); }

/* === 8. Password & Secure Number Picker === */
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .25rem .65rem;
  margin-top: .7rem;
}

.strength-track {
  height: .38rem;
  background: #edf1f9;
  overflow: hidden;
}
.strength-bar {
  height: 100%;
  background: #16a34a;
  transition: width .2s ease, background-color .2s ease;
}
.strength-bar[data-level="weak"] { background: #dc2626; }
.strength-bar[data-level="fair"] { background: #d97706; }
.strength-bar[data-level="good"] { background: #2563eb; }
.strength-bar[data-level="strong"] { background: #15803d; }

.pwd-list {
  display: grid;
  gap: .55rem;
  padding: 1rem clamp(1rem, 2.6vw, 1.4rem) 1.25rem;
}
.pwd-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .62rem .75rem;
  border: 1px solid #dde5f4;
  border-radius: .8rem;
  background: #f8faff;
}
.pwd-row code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(.95rem, 1.6vw, 1.12rem);
  font-weight: 700;
  letter-spacing: .04em;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.pwd-row .ch-digit { color: #2445c4; }
.pwd-row .ch-sym { color: #b45309; }

.num-results {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 11.5rem;
  padding: 1.5rem 1.25rem;
  background: #f8faff;
}
.num-ball {
  display: inline-grid;
  place-items: center;
  min-width: 3.35rem;
  height: 3.35rem;
  padding-inline: .75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #4b61e6, #283db3);
  color: #fff;
  font-size: 1.22rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 .32rem .8rem #273fb738;
}

.num-history-wrap {
  padding: .85rem clamp(1rem, 2.6vw, 1.4rem) 1.1rem;
  border-top: 1px solid var(--line);
}
.num-history {
  display: grid;
  gap: .3rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .84rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* === Wave 2/3: PDF Sign Visual Drag Preview, PDF-to-Image, Crop/Stitch/Grid, Text Diff/RMB, SplitBill, EXIF, Dev === */
.sign-pad-wrap {
  padding: .9rem clamp(1rem, 2.6vw, 1.45rem);
  background: #f8faff;
}
#pdf-sign-pad {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 680 / 220;
  border: 1.5px dashed #a8b7e6;
  border-radius: .9rem;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

.pdf-sign-preview-wrap {
  border-top: 1px solid var(--line);
  background: #f1f5fc;
}
.pdf-sign-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .65rem clamp(1rem, 2.6vw, 1.45rem);
  border-bottom: 1px solid var(--line);
  background: #fff;
  font-size: .88rem;
}
.pdf-sign-stage {
  display: grid;
  place-items: center;
  padding: 1rem;
  min-height: 14rem;
}
.pdf-sign-canvas-box {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border: 1px solid #cbd5e1;
  border-radius: .45rem;
  background: #fff;
  box-shadow: 0 .45rem 1.35rem rgba(15, 23, 42, .12);
  overflow: hidden;
  user-select: none;
}
#pdf-sign-preview-canvas {
  display: block;
  max-width: 100%;
  max-height: 30rem;
  width: auto;
  height: auto;
}
.pdf-sign-overlay {
  position: absolute;
  border: 1.5px dashed #3349c7;
  border-radius: .35rem;
  background: rgba(51, 73, 199, .08);
  cursor: grab;
  touch-action: none;
  box-shadow: 0 2px 8px rgba(51, 73, 199, .22);
}
.pdf-sign-overlay:active { cursor: grabbing; background: rgba(51, 73, 199, .15); }
.pdf-sign-overlay img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.pdf-sign-drag-tag {
  position: absolute;
  top: -1.3rem;
  left: 0;
  padding: .08rem .38rem;
  border-radius: .28rem;
  background: #3349c7;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.timer-ambient-box {
  display: grid;
  gap: .45rem;
  margin-top: .85rem;
  padding: .75rem .85rem;
  border: 1px solid #dbe4f5;
  border-radius: .85rem;
  background: #f6f9ff;
}

.p2i-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: .85rem;
  padding: 1rem clamp(1rem, 2.6vw, 1.45rem);
  background: #f8faff;
  min-height: 14rem;
}
.p2i-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: #fff;
  overflow: hidden;
  display: grid;
}
.p2i-card img {
  width: 100%;
  aspect-ratio: .72;
  object-fit: contain;
  background: #f1f5f9;
  display: block;
}
.p2i-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  padding: .45rem .6rem;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.crop-stage canvas { cursor: grab; touch-action: none; }
.crop-stage canvas:active { cursor: grabbing; }

.stitch-preview-box {
  display: grid;
  place-items: center;
  padding: 1.15rem;
  min-height: 22rem;
  max-height: 38rem;
  overflow: auto;
  background: repeating-conic-gradient(#e7edf6 0% 25%, #f7f9fd 0% 50%) center / 1.24rem 1.24rem;
}
.stitch-preview-box canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 .4rem 1.2rem #1724401c;
  border-radius: .45rem;
}

.grid-tiles-stage {
  padding: 1.2rem;
  display: grid;
  place-items: center;
  min-height: 18rem;
  background: #f8faff;
}
.grid-tiles {
  display: grid;
  grid-template-columns: repeat(var(--grid-n, 3), minmax(0, 1fr));
  gap: .45rem;
  width: min(100%, 24rem);
}
.grid-tile-link {
  position: relative;
  display: block;
  border-radius: .48rem;
  overflow: hidden;
  border: 1px solid #d5dff2;
  aspect-ratio: 1;
}
.grid-tile-link img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-tile-link span {
  position: absolute;
  top: .3rem;
  left: .3rem;
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #172440cc;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
}

/* Diff Viewer */
.diff-output {
  max-height: 28rem;
  overflow: auto;
  background: #fcfdff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem;
  line-height: 1.55;
}
.diff-line {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr);
  border-bottom: 1px solid #eef2f9;
}
.diff-ln {
  padding: .24rem .45rem;
  text-align: right;
  color: var(--muted);
  background: #f4f7fc;
  user-select: none;
  font-variant-numeric: tabular-nums;
}
.diff-text {
  padding: .24rem .7rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.diff-line--add { background: #ecfdf5; color: #14532d; }
.diff-line--add .diff-ln { background: #d1fae5; color: #166534; font-weight: 700; }
.diff-line--del { background: #fef2f2; color: #991b1b; text-decoration: line-through; }
.diff-line--del.has-inline-diff { text-decoration: none; color: #7f1d1d; }
.diff-line--del .diff-ln { background: #fee2e2; color: #991b1b; font-weight: 700; }
.diff-mark-del {
  background: #fecaca;
  color: #7f1d1d;
  text-decoration: line-through;
  border-radius: .22rem;
  padding: 0 .14rem;
  font-weight: 700;
}
.diff-mark-add {
  background: #bbf7d0;
  color: #14532d;
  border-radius: .22rem;
  padding: 0 .14rem;
  font-weight: 700;
}

/* RMB Output */
.rmb-input-lg { font-size: 1.35rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.rmb-stage {
  display: grid;
  place-items: center;
  min-height: 12rem;
  padding: 2rem 1.4rem;
  background: linear-gradient(145deg, #f8faff, #eef3ff);
  text-align: center;
}
.rmb-output {
  font-size: clamp(1.35rem, 3vw, 2.05rem);
  font-weight: 810;
  color: var(--blue);
  letter-spacing: .04em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Split Bill */
.bill-member-name { padding: .2rem .55rem; font-size: .82rem; font-weight: 640; color: var(--ink); }
.bill-exp-form { border-top: 1px solid var(--line); padding-top: .5rem; }
.bill-split-grid { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.bill-panel-body { padding: 1.05rem clamp(1rem, 2.6vw, 1.45rem) 1.3rem; }
.bill-subhead { font-size: .9rem; font-weight: 760; color: var(--muted); margin-bottom: .55rem; }
.transfer-list { display: grid; gap: .5rem; }
.transfer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border: 1px solid #cdd9f8;
  border-radius: .85rem;
  background: #f4f7ff;
  font-size: 1rem;
  font-weight: 720;
}
.transfer-card strong { color: var(--blue); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.ledger-list { display: grid; gap: .42rem; margin: 0; padding: 0; list-style: none; }
.ledger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .35rem .75rem;
  padding: .58rem .8rem;
  border: 1px solid var(--line);
  border-radius: .72rem;
  background: #fff;
  font-size: .86rem;
  font-variant-numeric: tabular-nums;
}
.ledger-row small { color: var(--muted); flex: 1; }
.net-pos { color: #15803d; font-weight: 740; }
.net-neg { color: #b42336; font-weight: 740; }
.net-zero { color: var(--muted); font-weight: 640; }

/* EXIF Inspector */
.exif-body { padding: 1rem clamp(1rem, 2.6vw, 1.45rem) 1.3rem; }
.exif-risk-banner {
  margin-bottom: .85rem;
  padding: .72rem .95rem;
  border: 1px solid #fecaca;
  border-radius: .8rem;
  background: #fef2f2;
  color: #991b1b;
  font-size: .9rem;
  font-weight: 700;
}
.exif-preview-wrap { display: grid; place-items: center; margin-bottom: .85rem; }
.exif-preview-wrap img {
  max-width: 100%;
  max-height: 14rem;
  border-radius: .75rem;
  border: 1px solid var(--line);
  object-fit: contain;
}
.exif-meta-list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.exif-meta-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem .75rem;
  padding: .52rem .78rem;
  border: 1px solid var(--line);
  border-radius: .68rem;
  background: #f9fbff;
  font-size: .86rem;
}
.exif-meta-list li.exif-warn { border-color: #fca5a5; background: #fff1f2; color: #991b1b; }
.exif-meta-list li.exif-safe { border-color: #bbf7d0; background: #f0fdf4; color: #166534; font-weight: 640; }

/* Dev Converter */
.code-textarea {
  width: 100%;
  padding: .75rem .88rem;
  border: 1px solid #c9d4ea;
  border-radius: .8rem;
  background: #f8faff;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88rem;
  line-height: 1.5;
  resize: vertical;
}
.color-picker-hero {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-top: .75rem;
}
.color-picker-hero input[type="color"] {
  width: 4.5rem;
  height: 4.5rem;
  padding: .25rem;
  border: 1px solid #cbd5e1;
  border-radius: .9rem;
  background: #fff;
  cursor: pointer;
}
.color-preview-block {
  flex: 1;
  height: 4.5rem;
  border-radius: .9rem;
  border: 1px solid #d2dcf0;
  box-shadow: inset 0 0 0 1px #ffffff30;
}
.color-val-rows { display: grid; gap: .65rem; }
.color-val-row {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
}
.color-val-row label { font-size: .86rem; font-weight: 760; color: var(--muted); }

@media (max-width: 46rem) {
  .two-col-fields, .wm-export-row { grid-template-columns: minmax(0, 1fr); }
  .check-grid { grid-template-columns: minmax(0, 1fr); }
  .timer-stage { min-height: 18rem; padding: 1.5rem 1rem; }
}

/* === PDF Split Visual Thumbnail Picker & Saved Reusable Signatures === */
.pdf-thumbs-wrap {
  padding: .95rem 1.05rem 1.15rem;
  background: #f8faff;
}
.pdf-thumbs-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem .8rem;
  padding: .75rem .9rem;
  border: 1px dashed #c2d0ee;
  border-radius: .85rem;
  background: #fff;
  font-size: .84rem;
  color: var(--muted);
}
.pdf-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.4rem, 1fr));
  gap: .65rem;
  max-height: 27rem;
  overflow-y: auto;
  padding: .15rem;
}
.pdf-thumb-card {
  display: grid;
  gap: .36rem;
  padding: .42rem;
  border: 1.5px solid #d5dff2;
  border-radius: .78rem;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease, opacity .15s ease;
  opacity: .56;
}
.pdf-thumb-card:hover { border-color: var(--blue); opacity: .88; }
.pdf-thumb-card.is-selected {
  opacity: 1;
  border-color: var(--blue);
  background: #eef3ff;
  box-shadow: 0 0 0 2px rgba(51, 73, 199, .18);
}
.pdf-thumb-page {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 210 / 297;
  object-fit: contain;
  border-radius: .42rem;
  border: 1px solid #e2e8f5;
  background: #ffffff;
}
.pdf-thumb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  padding: 0 .12rem;
}
.pdf-thumb-head strong { font-size: .76rem; font-weight: 700; color: var(--ink); }
.pdf-thumb-check {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  font-size: .68rem;
  font-weight: 800;
  color: transparent;
  background: #fff;
}
.pdf-thumb-card.is-selected .pdf-thumb-check {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.pdf-saved-sigs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-top: .65rem;
  padding-top: .58rem;
  border-top: 1px dashed #d5dff2;
}
.pdf-saved-sigs-label { font-size: .78rem; font-weight: 660; color: var(--muted); }
.pdf-saved-sig-item {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd7f0;
  border-radius: .65rem;
  background: #fff;
  overflow: hidden;
}
.pdf-saved-sig-btn {
  display: inline-flex;
  align-items: center;
  padding: .2rem .45rem;
  border: 0;
  background: #ffffff;
  cursor: pointer;
}
.pdf-saved-sig-btn:hover { background: #f0f5ff; }
.pdf-saved-sig-img {
  display: block;
  height: 2rem;
  width: auto;
  max-width: 6.2rem;
  object-fit: contain;
  background: #ffffff;
}
.pdf-saved-sig-del {
  width: 1.55rem;
  height: 2.4rem;
  border: 0;
  border-left: 1px solid #e2e8f5;
  background: #f8faff;
  color: var(--muted);
  font-size: .92rem;
  cursor: pointer;
}
.pdf-saved-sig-del:hover { background: #fee2e2; color: #b91c1c; }

/* === Dark Mode Overrides for Extra Tools === */
[data-theme="dark"] .sub-tabs {
  background: rgba(18, 25, 42, .92);
  border-color: rgba(255, 255, 255, .1);
}
[data-theme="dark"] .sub-tabs button[aria-pressed="true"] {
  background: #f8fafc;
  color: #0b0f19;
}
[data-theme="dark"] .text-input,
[data-theme="dark"] .select-input,
[data-theme="dark"] .color-picker-hero input[type="color"] {
  background: #0e1627;
  border-color: rgba(148, 163, 184, .26);
  color: var(--ink);
}
[data-theme="dark"] .wm-stage,
[data-theme="dark"] .crop-stage {
  background: radial-gradient(circle, rgba(148, 163, 184, .14) 1px, transparent 1.5px), #0e1627;
  background-size: 1.15rem 1.15rem;
}
[data-theme="dark"] .wm-stage[data-has-image],
[data-theme="dark"] .crop-stage[data-has-image] {
  background: repeating-conic-gradient(#162138 0% 25%, #0f172a 0% 50%) center / 1.24rem 1.24rem;
}
[data-theme="dark"] .qr-stage {
  background: #10182b;
  border-color: rgba(148, 163, 184, .18);
}
[data-theme="dark"] .qr-stage canvas,
[data-theme="dark"] #qr-canvas {
  background: #ffffff;
  border-color: rgba(255, 255, 255, .25);
}
[data-theme="dark"] .qr-decode-box,
[data-theme="dark"] .file-queue-item,
[data-theme="dark"] .p2i-card,
[data-theme="dark"] .pdf-sign-stage,
[data-theme="dark"] .pdf-sign-preview-wrap,
[data-theme="dark"] .pwd-row,
[data-theme="dark"] .pwd-strength,
[data-theme="dark"] .draw-stage,
[data-theme="dark"] .exif-preview-box,
[data-theme="dark"] .exif-meta-list li,
[data-theme="dark"] .diff-pane,
[data-theme="dark"] .rmb-box,
[data-theme="dark"] .bill-summary-bar,
[data-theme="dark"] .bill-entry,
[data-theme="dark"] .transfer-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .swatch-card,
[data-theme="dark"] .dev-output-box {
  background: #131c31;
  border-color: rgba(148, 163, 184, .2);
  color: var(--ink);
}
[data-theme="dark"] .p2i-gallery,
[data-theme="dark"] .pdf-sign-pad-wrap,
[data-theme="dark"] .diff-output,
[data-theme="dark"] .dev-panel-body {
  background: #0e1627;
  border-color: rgba(148, 163, 184, .18);
}
[data-theme="dark"] .file-ops button {
  background: #17223a;
  border-color: rgba(148, 163, 184, .24);
  color: #cbd5e1;
}
[data-theme="dark"] .file-ops button:hover:not(:disabled) {
  background: #203052;
  border-color: #7b9aff;
  color: #fff;
}
[data-theme="dark"] .selected-banner {
  background: rgba(51, 73, 199, .22);
  border-color: rgba(123, 154, 255, .38);
  color: #dbeafe;
}
[data-theme="dark"] .qr-decode-result {
  background: rgba(6, 95, 70, .28);
  border-color: rgba(52, 211, 153, .38);
  color: #d1fae5;
}
[data-theme="dark"] .pwd-row .ch-digit { color: #93c5fd; }
[data-theme="dark"] .pwd-row .ch-sym { color: #fcd34d; }
[data-theme="dark"] .diff-line { border-bottom-color: rgba(148, 163, 184, .14); }
[data-theme="dark"] .diff-ln { background: #17223a; color: #94a3b8; }
[data-theme="dark"] .diff-line--add { background: rgba(6, 95, 70, .28); color: #a7f3d0; }
[data-theme="dark"] .diff-line--add .diff-ln { background: rgba(6, 95, 70, .48); color: #6ee7b7; }
[data-theme="dark"] .diff-line--del,
[data-theme="dark"] .diff-line--del.has-inline-diff { background: rgba(127, 29, 29, .28); color: #fecaca; }
[data-theme="dark"] .diff-line--del .diff-ln { background: rgba(127, 29, 29, .48); color: #fca5a5; }
[data-theme="dark"] .diff-mark-del { background: rgba(239, 68, 68, .44); color: #fff; }
[data-theme="dark"] .diff-mark-add { background: rgba(16, 185, 129, .44); color: #fff; }
[data-theme="dark"] .net-pos { color: #6ee7b7; }
[data-theme="dark"] .net-neg { color: #fca5a5; }
[data-theme="dark"] .exif-risk-banner {
  background: rgba(127, 29, 29, .35);
  border-color: rgba(248, 113, 113, .45);
  color: #fecaca;
}
[data-theme="dark"] .exif-meta-list li.exif-warn {
  background: rgba(127, 29, 29, .3);
  border-color: rgba(248, 113, 113, .42);
  color: #fecaca;
}
[data-theme="dark"] .exif-meta-list li.exif-safe {
  background: rgba(6, 95, 70, .3);
  border-color: rgba(52, 211, 153, .42);
  color: #6ee7b7;
}
[data-theme="dark"] .sign-pad-wrap,
[data-theme="dark"] .grid-tiles-stage {
  background: #0e1627;
}
[data-theme="dark"] .pdf-sign-preview-bar,
[data-theme="dark"] .ledger-row {
  background: #131c31;
  border-color: rgba(148, 163, 184, .18);
  color: var(--ink);
}
[data-theme="dark"] .pdf-badge {
  background: rgba(225, 29, 72, .24);
  color: #fda4af;
}
[data-theme="dark"] .timer-ambient-box {
  background: #111b30;
  border-color: rgba(123, 154, 255, .24);
}
[data-theme="dark"] .stitch-preview-box {
  background: repeating-conic-gradient(#162138 0% 25%, #0f172a 0% 50%) center / 1.24rem 1.24rem;
}
[data-theme="dark"] .grid-tile-link { border-color: rgba(148, 163, 184, .28); }
[data-theme="dark"] .rmb-stage {
  background: linear-gradient(145deg, #121c33, #192647);
}
[data-theme="dark"] .rmb-output { color: #93b4ff; }
[data-theme="dark"] .code-textarea {
  background: #0e1627;
  border-color: rgba(148, 163, 184, .26);
  color: var(--ink);
}
[data-theme="dark"] .strength-track { background: #1e2c4a; }
[data-theme="dark"] .color-preview-block { border-color: rgba(148, 163, 184, .28); }
[data-theme="dark"] .swatch { border-color: rgba(226, 232, 240, .45); }
[data-theme="dark"] .file-ops button.danger:hover {
  border-color: #f87171;
  color: #fecaca;
  background: rgba(239, 68, 68, .22);
}
[data-theme="dark"] .file-queue-item:hover,
[data-theme="dark"] .transfer-card:hover {
  border-color: rgba(123, 154, 255, .42);
}
[data-theme="dark"] .pdf-sign-pad-wrap canvas,
[data-theme="dark"] #pdf-sign-pad,
[data-theme="dark"] #pdf-sign-canvas-box,
[data-theme="dark"] .pdf-thumb-page,
[data-theme="dark"] .pdf-saved-sig-btn,
[data-theme="dark"] .pdf-saved-sig-img {
  background: #ffffff;
}
[data-theme="dark"] .pdf-thumbs-wrap {
  background: #0e1627;
}
[data-theme="dark"] .pdf-thumbs-notice {
  background: #131c31;
  border-color: rgba(123, 154, 255, .36);
  color: #cbd5e1;
}
[data-theme="dark"] .pdf-thumb-card {
  background: #141e35;
  border-color: rgba(148, 163, 184, .24);
  color: var(--ink);
}
[data-theme="dark"] .pdf-thumb-card.is-selected {
  background: rgba(59, 91, 219, .24);
  border-color: #7b9aff;
  box-shadow: 0 0 0 2px rgba(123, 154, 255, .24);
}
[data-theme="dark"] .pdf-thumb-check {
  background: #0f172a;
  border-color: rgba(148, 163, 184, .4);
}
[data-theme="dark"] .pdf-thumb-card.is-selected .pdf-thumb-check {
  background: #5b7cff;
  border-color: #7b9aff;
  color: #fff;
}
[data-theme="dark"] .pdf-saved-sigs {
  border-top-color: rgba(148, 163, 184, .24);
}
[data-theme="dark"] .pdf-saved-sig-item {
  border-color: rgba(148, 163, 184, .32);
  background: #17223a;
}
[data-theme="dark"] .pdf-saved-sig-del {
  background: #17223a;
  border-left-color: rgba(148, 163, 184, .26);
  color: #cbd5e1;
}
[data-theme="dark"] .pdf-saved-sig-del:hover {
  background: rgba(239, 68, 68, .28);
  color: #fecaca;
}
