/* ============================================================
   TOOL — the workspace: the operation switcher and one large
   working surface, under the GI app bar and tool header.
   ============================================================ */

/* ---------- Operation switcher ----------
   The one place to move between Merge, Split and Compress. Sits at the
   top of the working area; selected = brand text + brand underline. */

.switcher {
  margin-bottom: 20px; overflow-x: auto; scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--border);   /* baseline under the tabs; the active underline paints over it */
}
.switcher::-webkit-scrollbar { display: none; }
.switcher-in { display: flex; align-items: stretch; gap: 4px; min-width: max-content; }
.swtab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 14px 13px; border: 0; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color var(--dur-fast), background-color var(--dur-fast);
}
.swtab svg { width: 16px; height: 16px; flex: none; }
.swtab::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px;
  border-radius: 2px 2px 0 0; background: transparent;
  transition: background-color var(--dur-fast);
}
.swtab:hover { color: var(--text); background: rgba(18, 18, 24, 0.035); }
.swtab[aria-selected="true"] { color: var(--brand); font-weight: 600; }
.swtab[aria-selected="true"]::after { background: var(--brand); }
.swtab[aria-selected="true"] svg { color: var(--brand); }
.swtab .badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
@media (max-width: 640px) {
  .switcher-in { gap: 0; }
  .swtab { flex: 1 1 auto; justify-content: center; gap: 6px; padding-left: 6px; padding-right: 6px; }
  .swtab::after { left: 2px; right: 2px; }
}

/* ---------- Workspace ---------- */

.work { flex: 1; padding: 16px 0 40px; }
@media (min-width: 768px) { .work { padding: 20px 0 56px; } }

.work-body { display: flex; flex-direction: column; gap: 16px; }

/* The processing / success / error surface replaces the workspace
   in place, so the user never loses the header context. */
.stage { border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-xs); }

.work-tips { margin-top: 32px; }
.work-tips h4 {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 12px;
}

/* ---------- Sticky action bar ---------- */

.actions {
  position: sticky; bottom: 0; z-index: 30;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.actions-in { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.actions-status { display: none; flex: 1; min-width: 0; }
@media (min-width: 700px) { .actions-status { display: block; } }
.actions-status p { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions-status .ok { font-weight: 500; color: var(--success); }
.actions-status .todo { font-weight: 500; color: var(--warning); }
.actions-status .dim { color: var(--faint); }
.actions-btns { display: flex; align-items: center; gap: 8px; width: 100%; }
@media (min-width: 700px) { .actions-btns { width: auto; } }
.actions-btns .btn { border-radius: var(--r-md); }
.actions-btns .fill { flex: 1; }
@media (min-width: 700px) { .actions-btns .fill { flex: none; } }

/* ---------- Split-specific ---------- */

.rangebox { display: grid; gap: 12px; }
@media (min-width: 640px) { .rangebox { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chipset button {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; color: var(--text-2); cursor: pointer;
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.chipset button:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-active); }

/* ---------- Compress-specific ---------- */

.sizecompare {
  display: flex; align-items: stretch; border: 1px solid var(--border);
  background: var(--sunken); border-radius: var(--r-md); overflow: hidden;
}
.sizecompare > div { flex: 1; padding: 14px 16px; min-width: 0; }
.sizecompare > div + div { border-left: 1px solid var(--border); }
.sizecompare span { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }
.sizecompare b { display: block; margin-top: 5px; font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.sizecompare small { display: block; margin-top: 3px; font-size: 12px; line-height: 17px; color: var(--muted); }
