/* Shared layout for the small tools. Load after /pdf/style.css. */
body { overflow: auto; height: auto; min-height: 100%; }
.kit { width: min(1120px, 100%); margin: 0 auto; padding: 24px 16px 56px; }
.kit h1 { margin: 0 0 4px; font-size: 24px; }
.kit .intro { margin: 0 0 18px; color: var(--muted); font-size: 14px; max-width: 760px; }
.kit h2 { margin: 0 0 12px; font-size: 15px; }
.kit h3 { margin: 16px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }

.cols { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.field:last-child { margin-bottom: 0; }
.field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea, .kit .input {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .kit .input:focus, .kit textarea:focus { border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair.three { grid-template-columns: 1fr 1fr 1fr; }
.with-unit { display: flex; gap: 6px; }
.with-unit > input { flex: 1; min-width: 0; }
.with-unit > select { width: auto !important; flex: none; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.seg button, .chip {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
}
.seg button.active, .chip.active { border-color: var(--accent); background: rgba(79, 140, 255, .18); }
.chip:hover, .seg button:hover { border-color: var(--line-hover); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; min-width: 0; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .sub { font-size: 12px; color: var(--muted); }
.tile.big { grid-column: 1 / -1; border-color: rgba(79, 140, 255, .5); background: rgba(79, 140, 255, .08); }
.tile.big .value { font-size: 30px; }

.kit table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.kit th, .kit td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.kit th:first-child, .kit td:first-child { text-align: left; white-space: normal; }
.kit th { color: var(--muted); font-weight: 600; font-size: 12px; }
.kit tr.total td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.kit tr.minus td:last-child { color: var(--danger-text); }
.scroll { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.scroll table th { position: sticky; top: 0; background: var(--panel); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.note { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 12.5px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); }
.note.warn { border-color: var(--warn-line); background: rgba(250, 178, 25, .07); color: var(--warn-text); }
.bad { color: var(--danger-text); }
.good { color: var(--good); }
.muted { color: var(--muted); }

.kit textarea.big {
  width: 100%; min-height: 300px; resize: vertical; font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; outline: none;
}
.bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .15s; }
.bar.over > i { background: var(--danger); }

.kit .toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--panel-3); border: 1px solid var(--line-strong); color: var(--text); padding: 10px 16px; border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5); font-size: 13.5px;
}

@media (max-width: 860px) {
  .cols, .cols.even { grid-template-columns: 1fr; }
  .topbar-note { display: none; }
}
@media (max-width: 480px) {
  .pair.three { grid-template-columns: 1fr 1fr; }
  .app-name { display: none; }
}
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}
