/* —— Parity: hotkey bind menu + capture —— */
.swin-bind-wrap {
  position: relative;
  display: inline-flex;
}
.swin-bind-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 200px;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border-radius: 10px;
  background: var(--swin-card-solid, var(--swin-bg));
  border: 1px solid var(--swin-line-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.swin-bind-menu[hidden] { display: none !important; }
.swin-bind-item {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  font: inherit;
  font-size: var(--swin-font-callout);
  color: var(--swin-ink);
  cursor: pointer;
}
.swin-bind-item:hover { background: var(--swin-well); }
.swin-bind-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--swin-line);
}
.swin-bind-capture {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.swin-slot-ctrls.is-capturing > .swin-menu-btn[data-swin-cycle],
.swin-slot-ctrls.is-capturing > .swin-chord,
.swin-slot-ctrls.is-capturing > .swin-bind-wrap,
.swin-slot-ctrls.is-capturing > .swin-icon-clear {
  display: none !important;
}
.swin-slot-ctrls:not(.is-capturing) > .swin-bind-capture {
  display: none !important;
}
.swin-capture-label {
  color: #ff9f0a;
  font-size: var(--swin-font-callout);
  font-weight: 500;
  white-space: nowrap;
}

/* —— History detail sheet + context menu —— */
.swin-hist-detail {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  border-radius: inherit;
  max-width: none !important;
  pointer-events: auto;
}
.swin-hist-detail[hidden] { display: none !important; }
.swin-hist-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  border-radius: inherit;
}
.swin-hist-detail-card {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100% - 48px));
  max-height: min(520px, calc(100% - 48px));
  overflow: auto;
  background: var(--swin-bg);
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.06);
}
html[data-theme="dark"] .swin-hist-detail-card {
  border-color: rgba(255, 255, 255, 0.08);
}
.swin-hist-detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.swin-hist-opt-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  font-style: normal;
  color: #0d9488;
  background: rgba(13, 148, 136, 0.14);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
html[data-theme="dark"] .swin-hist-opt-badge {
  color: #5eead4;
  background: rgba(45, 212, 191, 0.16);
}
.swin-hist-meta .swin-hist-opt-badge {
  margin-left: 2px;
  vertical-align: middle;
}
.swin-hist-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 10px;
}
.swin-hist-detail-head strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.swin-hist-detail-head p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--swin-faint);
}
.swin-hist-detail-x {
  appearance: none;
  border: 0;
  background: rgba(0, 0, 0, 0.06);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--swin-muted);
  flex-shrink: 0;
}
html[data-theme="dark"] .swin-hist-detail-x {
  background: rgba(255, 255, 255, 0.08);
}
.swin-hist-detail-x .si { --si-cell: 12px; }
.swin-hist-detail-body {
  padding: 4px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.swin-hist-detail-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.swin-hist-detail-field > span {
  font-size: 12.5px;
  color: var(--swin-muted);
}
.swin-hist-detail-pill {
  font-size: 14px;
  line-height: 1.45;
  padding: 11px 16px;
  border-radius: 14px;
  background: var(--swin-well);
  border: 1px solid var(--swin-line);
  white-space: pre-wrap;
  word-break: break-word;
}
.swin-hist-detail-pill.is-original {
  opacity: 0.88;
  border-style: dashed;
}
.swin-hist-detail-pill.is-error {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.06);
  border-color: rgba(255, 69, 58, 0.22);
}
.swin-hist-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
html[data-theme="dark"] .swin-hist-detail-actions {
  border-top-color: rgba(255, 255, 255, 0.1);
}
.swin-hist-detail-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
html[data-theme="dark"] .swin-hist-detail-act {
  background: rgba(255, 255, 255, 0.08);
}
.swin-hist-detail-act:hover {
  background: rgba(0, 0, 0, 0.1);
}
html[data-theme="dark"] .swin-hist-detail-act:hover {
  background: rgba(255, 255, 255, 0.12);
}
.swin-hist-detail-act .si {
  --si-cell: 12px;
}
.swin-hist-detail-act[hidden] {
  display: none !important;
}
.swin-row-trail {
  justify-content: flex-end;
  padding-top: 0;
  padding-bottom: 10px;
}
.swin-row-trail .swin-link-btn {
  margin-left: auto;
}
.swin-hist-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--swin-line);
}
.swin-hist-detail-meta-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  font-size: 12px;
}
.swin-hist-detail-meta-row > span {
  color: var(--swin-muted);
  font-weight: 500;
}
.swin-hist-detail-meta-row strong {
  font-weight: 500;
  word-break: break-all;
}
.swin-hist-detail-meta-row em {
  color: var(--swin-faint);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.swin-hist-ctx {
  position: fixed;
  z-index: 40;
  min-width: 168px;
  padding: 6px;
  border-radius: 10px;
  background: var(--swin-card-solid, var(--swin-bg));
  border: 1px solid var(--swin-line-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: none !important;
}
.swin-hist-ctx[hidden] { display: none !important; }
.swin-hist-ctx-item {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 7px 10px;
  border-radius: 7px;
  font: inherit;
  font-size: var(--swin-font-callout);
  color: var(--swin-ink);
  cursor: pointer;
}
.swin-hist-ctx-item:hover { background: var(--swin-well); }
.swin-hist-ctx-item.is-danger { color: #ff453a; }
/* hist-iconbtn primary rules live with history block; keep hover/cursor only here if needed */
.swin-hist-item {
  cursor: pointer;
}

/* —— Files jobs list —— */
.swin-jobs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.swin-job {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--swin-r-md, 12px);
  background: var(--swin-card-solid, var(--swin-well));
  border: 1px solid var(--swin-line);
}
.swin-job-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #32ade6;
}
.swin-job-ico .si { --si-cell: 16px; }
.swin-job-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.swin-job-body strong {
  font-size: var(--swin-font-body);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.swin-job-status {
  font-size: var(--swin-font-callout);
  color: var(--swin-muted);
}
.swin-job-status.is-done { color: #30d158; }
.swin-job-text {
  margin: 4px 0 0;
  font-size: var(--swin-font-callout);
  color: var(--swin-ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.swin-job-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.swin-job-bar {
  grid-column: 2 / -1;
  height: 4px;
  border-radius: 999px;
  background: var(--swin-line);
  overflow: hidden;
  margin-top: -4px;
}
.swin-job-bar > i {
  display: block;
  height: 100%;
  background: var(--swin-accent);
  border-radius: inherit;
  transition: width 0.3s ease;
}

/* —— ASR Pro lock + sheet extras —— */
.swin-model-block.is-pro-locked .swin-model {
  opacity: 0.72;
}
.swin-pro-lock {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  font-style: normal;
  color: #ff9f0a;
  background: rgba(255, 159, 10, 0.12);
  white-space: nowrap;
  vertical-align: middle;
}
.swin-toggle.is-locked,
.swin-toggle[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.swin-sheet-bullets {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--swin-muted);
  font-size: var(--swin-font-callout);
  line-height: 1.5;
}
.swin-sheet-bullets li { margin: 4px 0; }
.swin-textarea {
  resize: vertical;
  min-height: 64px;
  font-family: inherit !important;
  line-height: 1.4;
}
.swin-chip i.info {
  background: rgba(10, 132, 255, 0.55);
}

/* Settings demo: cross-links & permission actions */
.swin-mode-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.swin-mode-title-row .swin-mode-title {
  margin: 0;
}
.swin-link-btn {
  border: 0;
  background: transparent;
  color: var(--accent, #0a84ff);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  white-space: nowrap;
}
.swin-link-btn:hover {
  text-decoration: underline;
}
.swin-perm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px 10px;
  justify-content: flex-start;
}
.swin-perm-actions .swin-btn {
  font-size: 12px;
}
.swin-word-pill .to.mono,
.swin-word-pill .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
