/* Shared components from the redesign mockup: top bar, chips, controls, toasts. */

/* ─── Top bar ─────────────────────────────────────────────── */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: rgba(9, 9, 11, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1480px; margin: 0 auto; padding-inline: 20px; min-height: 60px; display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; padding-block: 6px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(251,191,36,.3), 0 0 16px var(--accent-glow); }
.brand-word { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 2.5px; }
.brand-word em { font-style: normal; color: var(--accent); }
.tabs { display: flex; gap: 2px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; padding: 12px 8px; font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-3); white-space: nowrap; cursor: pointer; text-decoration: none; transition: color .15s; }
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); }
.tab.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.cluster { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; flex-shrink: 0; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; font-family: var(--display); font-size: 11.5px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.chip.on .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 2.4s ease-in-out infinite; }
.chip.warn .dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pulse 1.2s ease-in-out infinite; }
.chip.on { color: var(--text); }
.chip .bar { width: 46px; height: 4px; background: var(--card-3); border-radius: 2px; overflow: hidden; }
/* scaleX instead of width: a flat fill looks the same either way, and this one
   runs on the compositor instead of relaying out the top bar every frame while
   the buffer fills. */
.chip .bar i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform 1s linear; }
.chip.mono { font-family: var(--mono); letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.chip.trial { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); cursor: pointer; }
.chip.licensed { color: var(--ok); border-color: rgba(34,197,94,.4); background: var(--ok-soft); cursor: pointer; }
.chip.expired { color: #fca5a5; border-color: rgba(239,68,68,.5); background: var(--danger-soft); cursor: pointer; animation: pulse 2s ease-in-out infinite; }

/* ─── Buttons ─────────────────────────────────────────────── */
.btn-copy { height: 36px; padding: 0 16px; background: var(--accent); color: #111; font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); transition: background .15s, transform .15s; white-space: nowrap; }
.btn-copy:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--text-2); transition: border-color .15s, color .15s; }
.btn-icon:hover { border-color: var(--line-2); color: var(--text); }
.btn-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ─── Controls ────────────────────────────────────────────── */
/* flex: none - as a flex item (e.g. in .orow) its overflow: hidden would
   otherwise set its automatic minimum size to 0, letting a crowded row
   squeeze it below its content width and clip a button's label ("Auto"
   down to "A") instead of wrapping the row's text column beside it. */
.steps { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.steps button { min-width: 42px; padding: 0 12px; height: 30px; font-family: var(--display); font-size: 11.5px; font-weight: 600; letter-spacing: 1px; color: var(--text-3); border-right: 1px solid var(--line); transition: background .15s, color .15s; white-space: nowrap; }
.steps button:disabled { opacity: .4; cursor: not-allowed; }
.steps button:last-child { border-right: 0; }
.steps button:hover { color: var(--text); }
.steps button.active { background: var(--accent); color: #111; }

.slider { -webkit-appearance: none; appearance: none; flex: 1; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--card-3) var(--p, 50%)); outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 3px; background: var(--accent); border: 2px solid #111; box-shadow: 0 0 10px var(--accent-glow); transform: rotate(45deg); cursor: pointer; }
.slider::-moz-range-thumb { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); border: 2px solid #111; transform: rotate(45deg); cursor: pointer; }

.sw { position: relative; width: 38px; height: 20px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.sw .t { position: absolute; inset: 0; border-radius: 4px; background: var(--card-3); border: 1px solid var(--line-2); transition: background .2s, border-color .2s; }
.sw .t::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 2px; background: #8f8f98; transition: transform .25s var(--spring-soft), background .2s; }
.sw input:checked + .t { background: var(--accent); border-color: var(--accent); }
.sw input:checked + .t::after { transform: translateX(18px); background: #111; }
.sw input:focus-visible + .t { box-shadow: 0 0 0 2px var(--accent-line); }

.txt { width: 100%; height: 38px; padding: 0 12px; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; font-family: var(--mono); font-size: 13px; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.txt::placeholder { color: var(--text-3); }
.txt:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

/* ─── Toasts ──────────────────────────────────────────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); }
.toast { background: rgba(16,16,19,.97); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 11px 14px; box-shadow: 0 14px 40px rgba(0,0,0,.5); animation: toastIn .45s var(--spring-soft) both; }
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--ok); }
.toast.out { animation: toastOut .25s ease-in forwards; }
.toast b { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 1px; }
.toast span { font-size: 12.5px; color: var(--text-2); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* keep the top bar on one line down to a 1100px window: drop the buffer bar first */
@media (max-width: 1260px) {
  .chip.io .bar { display: none; }
}
@media (max-width: 560px) {
  .top-in { padding-inline: 16px; }
  .chip.io { display: none; }
}
