/* Diecut Studio controls, shared by the Nester and Box Designer (load after tokens.css, before the app's CSS).
   A push button is `.btn` in Box Designer and any plain <button> in the Nester (body.nester). `:where(body.nester)`
   keeps each selector exactly as strong as each app's own rule was, so the apps' later rules still win. */
input, select, button, textarea { font: inherit; color: inherit; }
.ic, svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.btn, :where(body.nester) button {
  border: 0; border-radius: 6px; background: var(--control); color: var(--ink);
  box-shadow: 0 0 0 .5px var(--control-line), 0 .5px 1px rgba(0, 0, 0, .08);
  padding: 4px 11px; line-height: 18px; transition: background .12s, opacity .12s;
}
.btn:hover:not(:disabled), :where(body.nester) button:hover:not(:disabled) { background: color-mix(in srgb, var(--control) 88%, var(--ink) 6%); }
.btn:active:not(:disabled), :where(body.nester) button:active:not(:disabled) { background: var(--fill-2); }
.btn:disabled, :where(body.nester) button:disabled { opacity: .4; }
.btn.small, :where(body.nester) button.small { padding: 2px 9px; font-size: 12px; }
.btn.ghost, :where(body.nester) button.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover:not(:disabled), :where(body.nester) button.ghost:hover:not(:disabled) { background: var(--fill); }
.btn.primary, :where(body.nester) button.primary {
  background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
  padding: 8px 16px; font-size: 13px;
}
.btn.primary:hover:not(:disabled), :where(body.nester) button.primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.07); }
.btn.danger, :where(body.nester) button.danger { color: var(--bad); }

/* toolbar buttons: borderless icon + label, like a unified macOS toolbar */
.tb { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 6px; background: transparent; box-shadow: none; padding: 5px 9px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.tb:hover:not(:disabled) { background: var(--fill); color: var(--ink); }
.tb span { font-size: 12.5px; font-weight: 500; }
.tb.icon { padding: 5px 7px; }
.tb.accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .14); padding: 5px 12px; }
.tb.accent:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); filter: brightness(1.07); }
.tb.accent:disabled { opacity: .35; }
.bar-div { width: 1px; height: 18px; background: var(--line-strong); margin: 0 6px; }

/* icon buttons inside segmented groups */
.ib { width: 30px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; box-shadow: none; color: var(--ink-2); border-radius: 5px; }
.ib:hover:not(:disabled) { background: var(--fill-2); color: var(--ink); }

input[type=number], input[type=text], input:not([type]), select, textarea {
  border: 0; border-radius: 6px; background: var(--control); color: var(--ink);
  box-shadow: inset 0 0 0 .5px var(--control-line), 0 .5px 0 rgba(0, 0, 0, .03);
  padding: 4px 7px; font-variant-numeric: tabular-nums;
}
input[type=number], input[type=text], input:not([type]), select { height: 26px; }
select { padding-right: 4px; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none; box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent);
}
input[type=checkbox], input[type=range] { accent-color: var(--accent); }
input[type=checkbox] { margin: 0; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill-2); border-radius: 7px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; box-shadow: none; border-radius: 5px; padding: 3px 8px; font-size: 12px; color: var(--ink-2); }
.seg button.on { background: var(--seg-on); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 .5px var(--control-line), 0 1px 2px rgba(0, 0, 0, .1); }
.seg button[hidden] { display: none; }

.warn-ic { color: var(--warn); cursor: default; display: inline-flex; }
.warn-ic svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- the window's top bar: 84 px for the traffic lights, tabs, name, icon buttons, one filled action ---------- */
.bar { height: 52px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 84px; border-bottom: .5px solid var(--line); }
.title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.job-name {
  height: auto !important; box-shadow: none !important; background: transparent !important; border-radius: 5px;
  font-size: 14px; font-weight: 650; padding: 1px 4px; margin-left: -4px; max-width: 420px; color: var(--ink);
}
.job-name:hover { background: var(--fill) !important; }
.job-name:focus { background: var(--control) !important; box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent) !important; }
.job-sub { display: none; }
.bar-actions { display: flex; gap: 4px; align-items: center; }
.bar-actions > button:not(.tb) { padding: 4px 12px; font-size: 12.5px; }
.bar-actions > button.primary { padding: 4px 14px; }
.seg.view-tabs { margin: 0; width: auto; grid-auto-columns: auto; flex: none; }
.view-tabs button { padding: 3px 14px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.view-tabs .count { color: var(--ink-3); font-weight: 500; margin: 0; font-size: 11.5px; }
.view-tabs .stale-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
body.is-stale .view-tabs .stale-dot { display: inline-block; }
.view-tabs button:disabled { opacity: .55; }

/* ---------- the status bar under the canvas: a message on the left, view tools and zoom on the right ---------- */
.statusbar { min-height: 30px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 6px 0 16px; border-top: .5px solid var(--line); }
.status { flex: 1; min-width: 0; color: var(--ink-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.err { color: var(--warn); white-space: normal; padding: 6px 0; }
.zoombar { display: flex; align-items: center; gap: 1px; flex: none; }
.zoombar .ib { height: 22px; }
.zoom-pct { border: 0; border-radius: 6px; background: transparent; box-shadow: none; min-width: 52px; font-size: 11.5px; font-variant-numeric: tabular-nums; padding: 3px 4px; color: var(--ink-2); }
.zoom-pct:hover:not(:disabled) { background: var(--fill-2); }
