/* Number Manager — user app. Builds on common.css tokens/components. */

.center { text-align: center; }
.row-wrap.center { justify-content: center; }
.min0 { min-width: 0; }
.mobile-only { display: none !important; }
.skeleton.w40 { width: 40%; }
.skeleton.w60 { width: 60%; }
.skeleton.h34 { height: 34px; border-radius: 10px; }
.skeleton.h36 { height: 36px; }
.skeleton.h52 { height: 52px; border-radius: 12px; }
.skeleton.h120 { height: 120px; border-radius: 12px; }
.bar.thin { height: 4px; }
svg.i.flip { transform: rotate(180deg); }

/* ------------------------------------------------------------- boot */
.boot-inner { display: grid; gap: 18px; justify-items: center; padding: 16px; }
.boot-err { display: grid; gap: 12px; justify-items: center; text-align: center; max-width: 380px; padding: 28px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); color: var(--text-2); }
.boot-err .be-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------- auth */
.auth-wrap { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 420px); justify-content: center; align-content: center; gap: 56px; padding: 40px 20px; overflow: hidden; }
.auth-wrap::before {
  content: ""; position: absolute; inset: auto auto -30% -20%; width: 70vmax; height: 70vmax; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
.auth-wrap > * { position: relative; z-index: 1; }
.auth-wrap .auth-card { max-width: none; padding: 30px 28px 26px; gap: 20px; }
.auth-theme { position: fixed; top: 16px; right: 16px; z-index: 5; }
.auth-hero { display: none; }
.auth-brand { justify-content: center; }
.auth-seg { display: flex; width: 100%; }
.auth-seg button { flex: 1; height: 34px; font-size: 14px; }
.auth-reason { font-size: 13.5px; }
.pw-wrap .input { padding-right: 44px; }
.pw-eye { color: var(--muted); }
.guest-box { display: grid; gap: 12px; }
.guest-btn { border-style: dashed; }
.guest-btn svg.i { color: var(--accent-text); }
.pending-state { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 8px 0 4px; }
.pending-state h1 { font-size: 20px; font-weight: 700; }
.pending-state p { color: var(--text-2); font-size: 14.5px; }
.pending-state .btn { margin-top: 6px; }
.ps-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.ps-ic svg.i { width: 26px; height: 26px; }

@media (min-width: 980px) {
  .auth-wrap { grid-template-columns: minmax(0, 500px) 420px; align-items: center; }
  .auth-hero { display: grid; gap: 22px; align-content: center; padding-right: 8px; }
  .auth-brand { display: none; }
  .hero-brand { font-size: 18px; }
  .hero-title { font-size: 38px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
  .hero-sub { font-size: 16px; color: var(--text-2); max-width: 460px; }
  .hero-points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; }
  .hero-points li { display: flex; gap: 14px; align-items: flex-start; }
  .hero-points li div { display: grid; gap: 1px; }
  .hero-points b { font-size: 15px; font-weight: 650; }
  .hero-points span { color: var(--muted); font-size: 14px; }
  .hp-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface); border: 1px solid var(--border); color: var(--accent-text); box-shadow: var(--shadow-xs); }
}

/* ------------------------------------------------------------ shell */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.app-top { flex: none; }
.lib-toggle { display: none; }
.brand-name { max-width: 240px; }
.top-stats { display: flex; gap: 8px; margin-left: 10px; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--muted); white-space: nowrap; box-shadow: var(--shadow-xs); }
.pill b { font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.pill.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.pill.accent b { color: var(--accent-text); }

.acct-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; border-radius: 12px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text); transition: background .15s, border-color .15s; }
.acct-btn:hover { background: var(--surface-3); }
.acct-btn .avatar svg.i { width: 16px; height: 16px; }
.acct-name { max-width: 160px; font-size: 14px; font-weight: 600; }
.acct-chev { color: var(--muted); width: 16px; height: 16px; }
.acct-panel { min-width: 270px; }
.menu-head .mh { display: flex; gap: 10px; align-items: center; }
.menu-head .mh-text { flex: 1; min-width: 0; }
.menu-head .avatar svg.i { width: 20px; height: 20px; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.menu-label { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 6px 10px 2px; letter-spacing: .02em; }
a.menu-item, a.menu-item:hover { text-decoration: none; color: var(--text); }

.banner-text { flex: 1; min-width: 0; }
.banner.announce svg.i, .guest-banner > svg.i { flex: none; }
.guest-banner .btn { color: var(--text); }

.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.main { min-width: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 24px 28px 48px; scroll-padding-top: 16px; }

/* ---------------------------------------------------------- sidebar */
.sidebar { display: flex; flex-direction: column; min-height: 0; background: color-mix(in srgb, var(--surface) 70%, transparent); border-right: 1px solid var(--border); }
.side-head { display: flex; align-items: center; gap: 8px; padding: 18px 16px 12px; }
.side-title { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.side-title svg.i { color: var(--accent-text); }
.side-title h2 { font-size: 15px; font-weight: 650; }
.count-chip { font-size: 11.5px; background: var(--surface-3); color: var(--text-2); padding: 0 8px; border-radius: 99px; line-height: 20px; font-weight: 500; }
.side-close { display: none; }
.side-search { margin: 0 16px 10px; }
.side-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.li { display: grid; gap: 6px; width: 100%; text-align: left; padding: 10px 12px 11px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.li:hover { background: var(--surface-3); }
.li.open { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-xs); }
.li.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.li-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.li-name { flex: 1; font-size: 14px; font-weight: 600; }
.li-open { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.li-open svg.i { width: 11px; height: 11px; }
.li-sub { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.li-sub b { font-weight: 600; }
.li-pct { font-size: 11.5px; color: var(--muted); }
.li.done .li-name, .li.done .li-sub b { color: var(--muted); }
.li.sk { pointer-events: none; gap: 10px; }
.side-empty { display: grid; justify-items: center; gap: 4px; padding: 32px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.side-empty .glyph { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); margin-bottom: 6px; }
.side-empty b { color: var(--text); font-size: 14px; font-weight: 600; }
.side-foot { border-top: 1px solid var(--border); padding: 12px 16px 14px; display: grid; gap: 8px; }
.q-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.q-title .badge { margin-left: auto; }
.q-item { display: grid; gap: 5px; }
.q-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.q-row b { font-weight: 600; color: var(--text); }
.drawer-backdrop { display: none; }

/* -------------------------------------------------------- workspace */
.m-stats { display: none; }
.ws-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.ws-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.ws-title h1 { font-size: 22px; font-weight: 700; }
.kbd-hint { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.ws-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.layout-seg button { display: inline-grid; place-items: center; width: 34px; padding: 0; }
.layout-seg svg.i { width: 16px; height: 16px; }

.toggle-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 9px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none; transition: background .15s, border-color .15s, color .15s; box-shadow: var(--shadow-xs); }
.toggle-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.toggle-chip .tc-box { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; background: var(--surface); transition: background .15s, border-color .15s; }
.toggle-chip .tc-box svg.i { width: 12px; height: 12px; stroke-width: 3; opacity: 0; color: var(--on-accent); }
.toggle-chip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); }
.toggle-chip:has(input:checked) { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-text); }
.toggle-chip input:checked + .tc-box { background: var(--accent); border-color: var(--accent); }
.toggle-chip input:checked + .tc-box svg.i { opacity: 1; }
.toggle-chip:has(input:focus-visible) { box-shadow: var(--ring); }

.ws-grid, .ws-loading { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.ws-error .empty-state { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }

/* welcome */
.welcome { display: grid; justify-items: center; gap: 28px; padding: 24px 0 8px; }
.dropzone { width: 100%; max-width: 620px; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 48px 28px 40px; border: 2px dashed var(--border-strong); border-radius: 20px; background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; box-shadow: var(--shadow); }
.dropzone:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.dz-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 4px; }
.dz-icon svg.i { width: 26px; height: 26px; }
.dz-title { font-size: 19px; font-weight: 700; }
.dz-text { color: var(--muted); font-size: 14px; max-width: 420px; }
.dz-btn { margin-top: 8px; pointer-events: none; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 760px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.steps li div { display: grid; gap: 2px; min-width: 0; }
.steps b { font-size: 14px; font-weight: 650; }
.steps span:not(.step-n) { font-size: 12.5px; color: var(--muted); }
.step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); font-family: var(--mono); font-size: 13px; font-weight: 600; }
.ws-empty .empty-state { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 18px; padding: 48px 20px; }
.ws-empty .empty-state p { max-width: 380px; }
.ws-empty .row-wrap { margin-top: 8px; }

/* ------------------------------------------------------------ panel */
.panel { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.panel:hover { border-color: var(--border-strong); }
.panel:focus-within { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.panel:has(.menu-panel:not([hidden])) { z-index: 20; }
.panel.flash { animation: panel-flash 1s ease-out; }
@keyframes panel-flash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent), var(--shadow); border-color: var(--accent); }
  100% { box-shadow: 0 0 0 12px transparent, var(--shadow); }
}
.sk-panel { gap: 14px; padding: 18px; }
.p-head { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0 -6px 0 0; }
.p-pos { flex: none; min-width: 32px; height: 26px; padding: 0 7px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 12.5px; font-weight: 600; }
.p-pos.nokey { background: var(--surface-3); color: var(--muted); }
.p-title { flex: 1; min-width: 0; display: grid; gap: 0; text-align: left; border: 0; background: none; padding: 2px 4px; margin: -2px 0; border-radius: 8px; cursor: pointer; color: var(--text); }
.p-title:hover .p-name { color: var(--accent-text); }
.p-name { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; transition: color .15s; }
.p-meta { font-size: 12px; color: var(--muted); }
.p-x { color: var(--muted); }
.p-stats { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 2px; }
.p-big { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.p-rem { font-size: 34px; font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.p-tot { font-size: 15px; color: var(--muted); white-space: nowrap; }
.p-pct { font-size: 12px; color: var(--muted); white-space: nowrap; }
.panel.done .p-rem { color: var(--muted); }

/* -------------------------------------------------------- copy view */
.cv { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cv-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cv-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.cv-picker { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; min-width: 42px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
.stepper { display: inline-flex; align-items: stretch; height: 34px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.stepper button { width: 32px; border: 0; background: var(--surface-2); color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: background .15s, color .15s; }
.stepper button:hover { background: var(--accent-soft); color: var(--accent-text); }
.stepper button svg.i { width: 15px; height: 15px; }
.stepper input { width: 58px; border: 0; background: transparent; text-align: center; font-size: 15px; font-weight: 600; padding: 0 2px; }
.stepper input:focus { outline: none; }
.stepper:focus-within { border-color: var(--accent); box-shadow: var(--ring); }

.btn-copy { position: relative; width: 100%; height: 52px; font-size: 16px; border-radius: 13px; gap: 10px; letter-spacing: -.005em; }
.btn-copy .bc-ic { display: inline-grid; place-items: center; }
.btn-copy .bc-ic svg.i { width: 20px; height: 20px; }
.btn-copy:active:not(:disabled) { transform: translateY(1px) scale(.997); }
.bc-kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: inherit; background: color-mix(in srgb, currentColor 14%, transparent); border-color: color-mix(in srgb, currentColor 28%, transparent); border-bottom-width: 1px; }
.btn-copy.loading .bc-kbd { visibility: hidden; }
.btn-copy.copied, .btn-copy.copied:hover { background: linear-gradient(180deg, #25ad5f 0%, #178a48 100%); color: #fff; filter: none; }

.cv-warn { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; }
.cv-warn svg.i { width: 16px; height: 16px; margin-top: 2px; }
.cv.is-done .cv-label, .cv.is-done .cv-picker, .cv.is-done .btn-copy { display: none; }
.cv-done { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 18px 14px 16px; border-radius: 14px; background: var(--ok-soft); }
.cd-ic { color: var(--ok); }
.cd-ic svg.i { width: 30px; height: 30px; }
.cd-text { display: grid; gap: 2px; }
.cd-text b { font-size: 15px; }
.cd-text span { font-size: 13px; color: var(--text-2); }
.cd-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }

.cv-last { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 8px 8px 10px; border-radius: 12px; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 18%, transparent); }
.cl-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; flex: none; }
.cl-ic svg.i { width: 14px; height: 14px; stroke-width: 2.6; }
.cl-text { display: grid; min-width: 0; flex: 1 1 120px; line-height: 1.35; }
.cl-text b { font-size: 13.5px; font-weight: 650; }
.cl-text span { font-size: 12px; color: var(--text-2); }
.cl-actions { display: flex; gap: 2px; margin-left: auto; }
.cl-actions .btn { height: 30px; padding: 0 9px; font-size: 13px; color: var(--text); }
.cl-actions .btn:hover { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.cv-last.undone { background: var(--surface-3); border-color: var(--border); }
.cv-last.undone .cl-ic { background: var(--muted); }
.cv-last.undone .cl-actions .btn:hover { background: var(--surface-2); }

.cv-preview { border: 1px solid var(--border); background: var(--surface-2); border-radius: 13px; overflow: hidden; min-width: 0; }
.pv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pv-t { display: inline-flex; align-items: center; gap: 6px; }
.pv-t svg.i { width: 15px; height: 15px; color: var(--muted); }
.pv-range { font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.pv-list { list-style: none; margin: 0; padding: 6px 12px 7px; transition: opacity .2s; }
.pv-list.refreshing { opacity: .55; }
.pv-list li { display: flex; align-items: baseline; gap: 12px; padding: 2px 0; font-size: 13.5px; min-width: 0; }
.pv-list .sn { min-width: 42px; text-align: right; color: var(--muted); font-size: 11.5px; flex: none; }
.pv-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-list.expanded { max-height: 264px; overflow-y: auto; }
.pv-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 7px 10px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--accent-text); font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.pv-more:hover { background: var(--surface-3); }
.pv-more svg.i { width: 15px; height: 15px; }
.pv-note { font-size: 12px; color: var(--muted); padding: 0 12px 8px; text-align: center; }
.pv-sk { display: grid; gap: 9px; padding: 11px 12px 12px; }
.pv-sk .skeleton { height: 11px; }
.pv-sk .skeleton:nth-child(odd) { width: 78%; }
.pv-err { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; font-size: 13px; color: var(--danger); }
.pv-err svg.i { width: 15px; height: 15px; }

/* compact list layout */
.ws-grid.list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ws-grid.list .panel { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); grid-template-areas: "head cv" "stats cv" "bar cv"; column-gap: 24px; row-gap: 8px; align-items: center; padding: 14px 16px; }
.ws-grid.list .p-head { grid-area: head; }
.ws-grid.list .p-stats { grid-area: stats; margin: 0; }
.ws-grid.list .p-bar { grid-area: bar; }
.ws-grid.list .cv { grid-area: cv; }
.ws-grid.list .p-rem { font-size: 26px; }
.ws-grid.list .cv-preview, .ws-grid.list .cv-label { display: none; }
.ws-grid.list .cv-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 250px); gap: 8px 14px; align-items: center; }
.ws-grid.list .cv-main > .cv-warn, .ws-grid.list .cv-main > .cv-done, .ws-grid.list .cv-main > .cv-last { grid-column: 1 / -1; }
.ws-grid.list .btn-copy { height: 44px; font-size: 15px; }
.ws-grid.list .cv-done { grid-template-columns: auto 1fr auto; justify-items: start; text-align: left; padding: 10px 14px; }

/* ----------------------------------------------------------- detail */
.dv { display: grid; gap: 18px; max-width: 1280px; }
.dv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px 0 -6px -10px; }
.dv-hint { display: inline-flex; align-items: center; gap: 5px; }
.dv-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; }
.dv-title { display: grid; gap: 6px; min-width: 0; }
.dv-name { font-size: 26px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dv-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.dv-meta span { display: inline-flex; align-items: center; gap: 6px; }
.dv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dv-stats .stat-card { gap: 6px; }
.dv-stats .bar { margin: 4px 0 2px; }
.dv-copy { padding: 22px 24px; }
.cv-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 26px; align-items: start; }
.cv-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.cv-title svg.i { color: var(--accent-text); }
.cv-detail .btn-copy { height: 56px; font-size: 17px; }
.cv-detail .pv-list { columns: 2; column-gap: 28px; padding: 8px 14px; }
.cv-detail .pv-list li { break-inside: avoid; }
.cv-detail .pv-list.expanded { max-height: 380px; }
.dv-tabs { overflow: hidden; }
.dv-tabs .tabs { padding: 0 14px; }
.tab-body { padding: 16px 18px 18px; }
.tab-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.tt-search { width: min(320px, 100%); }
.sel-info { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); border-color: transparent; box-shadow: none; }
.btn-danger-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 16%, var(--danger-soft)); border-color: transparent; }
.tbl { border: 1px solid var(--border); border-radius: 12px; }
.tbl .table tbody tr:last-child td { border-bottom: 0; }
.tbl tbody { transition: opacity .2s; }
.tbl tbody.refreshing { opacity: .6; }
.table td.ck, .table th.ck { width: 1%; padding-right: 4px; }
.table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; vertical-align: middle; cursor: pointer; }
.table td.sn { color: var(--muted); font-size: 12.5px; width: 1%; }
.table td.nm { font-size: 14px; }
.table td.tagc { width: 1%; text-align: right; }
.table td .skeleton { height: 12px; min-width: 40px; }
.q-table tr.next td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.q-table tr.next td.nm { color: var(--accent-text); font-weight: 600; }
.q-table tr.sel td { background: color-mix(in srgb, var(--info) 11%, transparent); }
.q-table tbody tr:hover td { background: var(--surface-2); }
.q-table tr.sel:hover td { background: color-mix(in srgb, var(--info) 15%, transparent); }
.tag-next { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; background: var(--accent-grad); color: var(--on-accent); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.h-table tr.undone td { color: var(--muted); }
.h-table tr.undone td.num b { text-decoration: line-through; }
.h-table .row-actions .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.pager { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tbl-err { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 18px 8px; color: var(--danger); font-size: 14px; white-space: normal; }
.empty-state.sm { padding: 28px 12px; white-space: normal; }
.empty-state.sm p { font-size: 13px; max-width: 360px; }

.up-cards { display: grid; gap: 12px; }
.up-card { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.up-card.removed { background: var(--surface-2); }
.up-card.sk { gap: 10px; }
.upc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upc-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.up-card.removed .upc-ic { background: var(--surface-3); color: var(--muted); }
.upc-t { flex: 1 1 160px; min-width: 0; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.kv-i { display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.kv-i .k { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv-i b { font-size: 16px; font-weight: 600; }
.kv-i b.small { font-size: 13px; font-family: var(--font); }
.kv-i.good b { color: var(--ok); }
.kv-i.warn b { color: var(--warn); }
.kv-i.bad b { color: var(--danger); }
.kv-i.accent b { color: var(--accent-text); }
.up-card .kv-i { background: var(--surface-2); }
.up-card.removed .kv-i { background: var(--surface); }

/* ----------------------------------------------------------- modals */
.manual-ta { min-height: 200px; font-size: 13.5px; background: var(--surface-2); }
.vb-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.keys { display: grid; gap: 10px; }
.keys > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--text-2); }
.keys > div > span:first-child { flex: none; display: inline-flex; gap: 4px; align-items: center; }

.seg.rm-seg { display: flex; width: 100%; }
.rm-seg button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; }
.rm-ta { min-height: 160px; font-size: 13.5px; }
.rm-count { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.rm-result { display: grid; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ok) 30%, var(--border)); background: color-mix(in srgb, var(--ok-soft) 60%, var(--surface)); }
.rm-res-title { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ok); }

.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-cards.col { grid-template-columns: minmax(0, 1fr); }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.radio-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
.radio-card input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.radio-card:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.radio-card:has(input:focus-visible) { box-shadow: var(--ring); }
.rc-b { display: grid; gap: 2px; min-width: 0; }
.rc-t { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); flex-wrap: wrap; }
.rc-t svg.i { color: var(--accent-text); }
.rc-d { font-size: 12.5px; color: var(--muted); }

/* upload modal */
.up { display: grid; gap: 16px; }
.up-drop { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; width: 100%; padding: 16px 18px; text-align: left; border: 1.5px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.up-drop:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.up-drop:disabled { opacity: .55; cursor: not-allowed; }
.up-drop .dz-icon { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 13px; margin: 0; }
.up-drop .dz-icon svg.i { width: 21px; height: 21px; }
.upd-t { font-size: 15px; font-weight: 600; }
.upd-d { font-size: 12.5px; color: var(--muted); }
.up-files { display: grid; gap: 10px; }
.up-files:empty { display: none; }
.uf { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); min-width: 0; }
.uf.st-done { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.uf.st-failed, .uf.st-error, .uf.st-invalid { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.uf.st-skipped { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.uf-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.uf-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.uf.st-done .uf-ic { background: var(--ok-soft); color: var(--ok); }
.uf.st-failed .uf-ic, .uf.st-error .uf-ic, .uf.st-invalid .uf-ic { background: var(--danger-soft); color: var(--danger); }
.uf-title { flex: 1; min-width: 0; }
.uf-name { font-size: 14.5px; font-weight: 600; }
.uf-meta { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.uf-status.ok { color: var(--ok); }
.uf-status.warn { color: var(--warn); }
.uf-status.bad { color: var(--danger); }
.uf-namerow { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; }
.uf-namerow .label { font-size: 12.5px; white-space: nowrap; }
.uf-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.us { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--muted); white-space: nowrap; }
.us b { font-size: 13px; font-weight: 600; color: var(--text); }
.us.good b { color: var(--ok); }
.us.warn b { color: var(--warn); }
.us.bad b { color: var(--danger); }
.us.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.us.accent b { color: var(--accent-text); }
.us.big b { font-size: 14px; }
.sk-inline { display: inline-block; width: 34px; height: 10px; vertical-align: middle; }
.uf-inv summary { cursor: pointer; font-size: 12.5px; color: var(--warn); display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.uf-inv summary::-webkit-details-marker { display: none; }
.sample { margin-top: 8px; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; max-height: 160px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.sample .ln { display: inline-block; min-width: 40px; color: var(--muted); }
.uf-prog .bar { height: 6px; }
.uf-prog.indet .bar span { width: 38% !important; animation: indet 1.15s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(265%); } }
.uf-msg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.uf-msg.ok { color: var(--ok); }
.uf-msg.warn { color: var(--warn); }
.uf-msg.bad { color: var(--danger); }
.uf-msg .link-btn { margin-left: auto; }
.up-opts { display: grid; gap: 10px; }
.up-skipck span b { color: var(--text); font-weight: 600; }
.up-skipck .d { display: block; font-size: 12.5px; color: var(--muted); }
.up-foot { align-items: center; }
.up-sum { min-width: 0; }

/* devices */
.dev-list { display: grid; gap: 8px; }
.dev { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); flex-wrap: wrap; }
.dev.current { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
.dev-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.dev-t { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.dev-t .strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-t .xs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dev-t .xs svg.i { width: 12px; height: 12px; }

/* drag & drop overlay */
.drop-overlay { position: fixed; inset: 0; z-index: 400; display: none; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); pointer-events: none; }
body.dragging .drop-overlay { display: grid; animation: fade .15s; }
.drop-card { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 40px 48px; border: 2px dashed var(--accent); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); }
.drop-card b { font-size: 19px; }
.drop-card span:last-child { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .kbd-hint { display: none; }
  .shell { grid-template-columns: 272px minmax(0, 1fr); }
  .top-stats .pill:nth-child(3) { display: none; }
}
@media (max-width: 1000px) {
  .cv-detail { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .top-stats { display: none; }
}

@media (max-width: 759px) {
  .mobile-only { display: inline-flex !important; }
  .lib-toggle { display: inline-grid; margin-left: -6px; }
  .brand-name { max-width: 46vw; }
  .acct-name, .acct-chev { display: none; }
  .acct-btn { padding: 0 2px; }
  .banner { padding: 8px 14px; font-size: 13px; }

  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 90; width: min(86vw, 340px); background: var(--surface); border-right: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(-104%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); visibility: hidden; padding-top: env(safe-area-inset-top); }
  body.drawer-open .sidebar { transform: none; visibility: visible; }
  .side-close { display: inline-grid; }
  body.drawer-open .drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 85; background: rgba(6, 12, 16, .5); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: fade .2s; }

  .main { padding: 14px 14px 40px; }
  .m-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .m-stat { display: grid; gap: 1px; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); min-width: 0; }
  .m-stat .k { font-size: 11.5px; color: var(--muted); font-weight: 500; }
  .m-stat b { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
  .m-stat.accent { background: var(--accent-soft); border-color: transparent; }
  .m-stat.accent b, .m-stat.accent .k { color: var(--accent-text); }

  .ws-head { margin-bottom: 14px; gap: 10px; }
  .ws-title h1 { font-size: 19px; }
  .ws-tools { width: 100%; gap: 6px; }
  .ws-tools .btn-primary { margin-left: auto; }
  .ws-grid, .ws-loading { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ws-loading .sk-panel:nth-child(n+2) { display: none; }
  .ws-grid.list .panel { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stats" "bar" "cv"; }
  .ws-grid.list .cv-main { grid-template-columns: minmax(0, 1fr); }

  .welcome { padding-top: 4px; gap: 18px; }
  .dropzone { padding: 32px 18px 28px; }
  .steps { grid-template-columns: minmax(0, 1fr); }

  .dv { gap: 14px; }
  .dv-hint { display: none; }
  .dv-name { font-size: 21px; }
  .dv-actions { width: 100%; }
  .dv-stats { gap: 8px; }
  .dv-stats .stat-card { padding: 12px; }
  .dv-stats .stat-card .value { font-size: 19px; }
  .dv-stats .stat-card .label { font-size: 12px; }
  .dv-stats .stat-card .label svg.i { display: none; }
  .dv-stats .stat-card .foot { font-size: 11.5px; }
  .dv-copy { padding: 16px; }
  .cv-detail .pv-list { columns: 1; }
  .tab-body { padding: 12px; }
  .tt-search { width: 100%; }
  .radio-cards { grid-template-columns: minmax(0, 1fr); }
  .up-foot .up-sum { flex-basis: 100%; }
  .up-foot .spacer { display: none; }
  .up-foot .btn { flex: 1; }
  .uf-namerow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

@media (max-width: 560px) {
  .dv-actions .btn > span, .dv-actions .btn > svg.i-sm { display: none; }
  .dv-actions .btn { padding: 0 11px; }
  .table.compact th, .table.compact td { padding: 8px 10px; }
  .q-table th:last-child, .q-table td.tagc { display: none; }
  .h-table td.num.small.text-2, .h-table th:nth-child(4) { display: none; }
  .p-rem { font-size: 30px; }
  .chip { min-width: 38px; padding: 0 8px; }
}

@media (max-width: 400px) {
  .panel { padding: 13px 13px 14px; }
  .cv-picker { justify-content: flex-start; }
  .chips { gap: 5px; }
  .chip { height: 30px; min-width: 36px; font-size: 13px; }
  .stepper input { width: 50px; }
  .toggle-chip { padding: 0 10px 0 8px; }
  .ws-tools .btn-ghost span { display: none; }
}
