@keyframes jhzzz-import-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.jhzzz-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(15 23 42 / 42%);
  backdrop-filter: blur(4px);
  animation: jhzzz-import-in .18s ease-out;
}

body > .jhzzz-import-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: grid !important;
  place-items: center !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.jhzzz-import-panel {
  box-sizing: border-box;
  width: min(1080px, calc(100vw - 48px));
  max-height: min(900px, calc(100vh - 32px));
  overflow: auto;
  padding: 20px 28px 18px;
  border: 1px solid var(--border, #d4d4d8);
  border-radius: 16px;
  background: var(--background, #fff);
  color: var(--foreground, #18181b);
  box-shadow: 0 24px 80px rgb(15 23 42 / 28%);
}

body > .jhzzz-import-overlay > .jhzzz-import-panel {
  position: relative !important;
  inset: auto !important;
  margin: 0 !important;
  transform: none !important;
}

.jhzzz-import-header,
.jhzzz-import-footer,
.jhzzz-import-key-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.jhzzz-import-header { align-items: center; }
.jhzzz-import-eyebrow { display: flex; align-items: center; gap: 12px; color: var(--foreground, #18181b); font-size: 14px; font-weight: 700; }
.jhzzz-import-promo { display: inline-flex; align-items: center; min-height: 28px; margin: 0; padding: 3px 10px; border: 1px solid #f0b78f; border-radius: 999px; background: #fff7ed; color: #b45309; font-size: 12px; font-weight: 600; }
.jhzzz-import-panel > h2 { margin: 9px 0 14px; color: var(--foreground, #18181b); font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: 0; line-height: 1.2; }

.jhzzz-import-close {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--muted-foreground, #71717a) !important;
  font-size: 24px !important;
  line-height: 1;
}

.jhzzz-import-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; }
.jhzzz-import-tab,
.jhzzz-import-button { cursor: pointer; font: inherit; letter-spacing: 0; }
.jhzzz-import-tab { min-height: 38px; padding: 7px 14px; border: 1px solid var(--border, #d4d4d8); border-radius: 999px; background: transparent; color: var(--foreground, #18181b); font-size: 14px; font-weight: 650; white-space: nowrap; }
.jhzzz-import-tab em { margin-left: 7px; padding: 2px 6px; border-radius: 999px; background: #2563eb; color: #fff; font-size: 11px; font-style: normal; }
.jhzzz-import-tab:hover,
.jhzzz-import-tab.active { border-color: #2563eb; background: #2563eb; color: #fff; }
.jhzzz-import-tab.active em { background: rgb(255 255 255 / 20%); }

.jhzzz-import-model-row { display: grid; grid-template-columns: 54px minmax(220px, 525px) 1fr; align-items: center; gap: 12px; margin-top: 14px; }
.jhzzz-import-model-row > strong { color: var(--foreground, #18181b); font-size: 14px; }
.jhzzz-import-model-control { display: flex; align-items: center; gap: 8px; min-width: 0; }
.jhzzz-import-model-row select,
.jhzzz-import-key-card input,
.jhzzz-import-key-card select,
.jhzzz-import-cc-name input,
.jhzzz-import-secondary-field input,
.jhzzz-import-copy-field code {
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid var(--border, #d4d4d8);
  border-radius: 7px;
  outline: 0;
  background: var(--background, #fff);
  color: var(--foreground, #18181b);
  font: inherit;
}
.jhzzz-import-model-row select { flex: 1; width: 100%; height: 42px; padding: 0 13px; font-size: 14px; }
.jhzzz-import-model-row select:focus,
.jhzzz-import-key-card input:focus,
.jhzzz-import-cc-name input:focus,
.jhzzz-import-secondary-field input:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgb(37 99 235 / 18%); }
.jhzzz-import-model-row select:disabled { cursor: not-allowed; opacity: .65; }
.jhzzz-import-model-hint { color: var(--muted-foreground, #71717a); font-size: 12px; }

.jhzzz-import-tool-content { margin-top: 12px; padding: 18px; border: 1px solid var(--border, #d4d4d8); border-radius: 16px; background: color-mix(in srgb, var(--background, #fff) 94%, var(--muted, #f4f4f5)); }
.jhzzz-import-description,
.jhzzz-import-recommendation,
.jhzzz-import-hint { margin: 0 0 12px; color: var(--muted-foreground, #71717a); font-size: 13px; line-height: 1.6; }
.jhzzz-import-content-title { margin: 0 0 12px; font-size: 17px; }
.jhzzz-import-target-row,
.jhzzz-import-platform-row,
.jhzzz-import-download-row,
.jhzzz-import-command-row,
.jhzzz-import-project,
.jhzzz-import-copy-field { display: flex; align-items: center; gap: 8px; }
.jhzzz-import-target-row { flex-wrap: wrap; margin-bottom: 12px; }
.jhzzz-import-mini-label,
.jhzzz-import-download-label,
.jhzzz-import-detected { color: var(--foreground, #18181b); font-size: 13px; font-weight: 650; }
.jhzzz-import-segment { min-width: 128px; border-radius: 7px; }
.jhzzz-import-segment.active { border-color: #2563eb; background: #2563eb; color: #fff; }
.jhzzz-import-secondary-toggle { margin-left: auto; }
.jhzzz-import-cc-name { display: grid; gap: 6px; margin: 10px 0 12px; color: var(--muted-foreground, #71717a); font-size: 12px; }
.jhzzz-import-cc-name input { width: min(420px, 100%); height: 36px; padding: 0 10px; }
.jhzzz-import-secondary-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; padding: 10px; border: 1px solid var(--border, #d4d4d8); border-radius: 9px; }
.jhzzz-import-secondary-field { display: grid; gap: 6px; color: var(--muted-foreground, #71717a); font-size: 12px; }
.jhzzz-import-secondary-field input { width: 100%; height: 36px; padding: 0 9px; }
.jhzzz-import-primary { border-color: #2563eb !important; background: #2563eb !important; color: #fff !important; }
.jhzzz-import-primary:hover { background: #1d4ed8 !important; }
.jhzzz-import-download-row { flex-wrap: wrap; margin: 10px 0 8px; }
.jhzzz-import-download-link { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1px solid var(--border, #d4d4d8); border-radius: 7px; color: var(--foreground, #18181b); font-size: 13px; text-decoration: none; }
.jhzzz-import-download-link::before { margin-right: 5px; content: "↓"; }
.jhzzz-import-download-link:hover { border-color: #2563eb; color: #2563eb; }
.jhzzz-import-project { margin-top: 8px; color: var(--muted-foreground, #71717a); font-size: 12px; }
.jhzzz-import-project a { color: inherit; text-decoration: none; }
.jhzzz-import-project a:hover { color: #2563eb; text-decoration: underline; }
.jhzzz-import-platform-row { justify-content: space-between; margin-bottom: 12px; }
.jhzzz-import-platform-tab { min-width: 82px; border-radius: 7px; }
.jhzzz-import-platform-tab.active { border-color: #2563eb; background: #2563eb; color: #fff; }
.jhzzz-import-detected { margin-left: auto; }
.jhzzz-import-code { max-height: 300px; min-height: 130px; margin: 10px 0; padding: 14px; overflow: auto; border: 1px solid var(--border, #d4d4d8); border-radius: 8px; background: color-mix(in srgb, var(--muted, #f4f4f5) 65%, var(--background, #fff)); color: var(--foreground, #18181b); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.jhzzz-import-command-row { justify-content: space-between; margin: 8px 0; }
.jhzzz-import-command-row code { flex: 1; min-width: 0; padding: 9px 11px; overflow: auto; border: 1px solid var(--border, #d4d4d8); border-radius: 7px; background: var(--background, #fff); color: var(--foreground, #18181b); font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.jhzzz-import-or { display: block; color: var(--muted-foreground, #71717a); font-size: 12px; }
.jhzzz-import-steps { margin: 0 0 14px; padding-left: 21px; color: var(--foreground, #18181b); font-size: 13px; line-height: 1.75; }
.jhzzz-import-copy-field { margin: 8px 0; }
.jhzzz-import-copy-field > span { width: 70px; color: var(--foreground, #18181b); font-size: 13px; font-weight: 650; }
.jhzzz-import-copy-field code { flex: 1; overflow: auto; padding: 9px 11px; font: 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }
.jhzzz-import-hint { margin-top: 12px; }

.jhzzz-import-key-card { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 9px 12px; border: 1px solid var(--border, #d4d4d8); border-radius: 9px; }
.jhzzz-import-key-note { flex: 1; color: var(--muted-foreground, #71717a); font-size: 12px; }
.jhzzz-import-key-label { color: var(--foreground, #18181b); font-size: 13px; white-space: nowrap; }
.jhzzz-import-key-card input { flex: 1; height: 34px; padding: 0 10px; font-size: 12px; }
.jhzzz-import-key-card select { max-width: 130px; height: 34px; padding: 0 8px; font-size: 12px; }
.jhzzz-import-key-card select[hidden] { display: none; }
.jhzzz-import-icon-button { min-width: 34px; padding: 7px 10px; }
.jhzzz-import-key-card a { color: var(--foreground, #18181b); font-size: 12px; white-space: nowrap; }
.jhzzz-import-footer { justify-content: flex-start; padding: 14px 0 0; color: var(--muted-foreground, #71717a); }
.jhzzz-import-footer a { color: inherit; font-size: 13px; text-decoration: none; }
.jhzzz-import-footer a:hover { color: #2563eb; text-decoration: underline; }
.jhzzz-import-later { margin-left: auto; border: 0 !important; background: transparent !important; color: var(--muted-foreground, #71717a) !important; }
.jhzzz-import-button { min-height: 34px; padding: 7px 12px; border: 1px solid var(--border, #d4d4d8); border-radius: 6px; background: var(--background, #fff); color: var(--foreground, #18181b); font-size: 13px; }
.jhzzz-import-button:hover { background: var(--muted, #f4f4f5); }
.jhzzz-import-button:disabled { cursor: not-allowed; opacity: .45; }
.jhzzz-import-notice { display: none; margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: #eff6ff; color: #1d4ed8; font-size: 12px; }
.jhzzz-import-notice.show { display: block; }
.jhzzz-import-notice.error { background: #fff1f2; color: #be123c; }

.jhzzz-test-overlay { position: fixed; inset: 0; z-index: 2147483001; display: grid; place-items: center; padding: 20px; background: rgb(2 6 23 / 48%); }
.jhzzz-test-panel { position: relative; box-sizing: border-box; width: min(680px, calc(100vw - 40px)); overflow: hidden; border: 1px solid #334155; border-radius: 10px; background: #07111f; color: #dbeafe; box-shadow: 0 24px 72px rgb(2 6 23 / 55%); }
.jhzzz-test-title { padding: 12px 48px 12px 16px; border-bottom: 1px solid #1e293b; color: #93c5fd; font: 600 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.jhzzz-test-terminal { box-sizing: border-box; max-height: min(480px, 60vh); margin: 0; padding: 16px; overflow: auto; color: #d1fae5; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.jhzzz-test-panel.is-error .jhzzz-test-title { color: #fca5a5; }
.jhzzz-test-panel.is-error .jhzzz-test-terminal { color: #fecaca; }
.jhzzz-test-close { position: absolute; top: 7px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #94a3b8; cursor: pointer; font-size: 23px; line-height: 1; }
.jhzzz-test-close:hover { background: #1e293b; color: #fff; }

@media (max-width: 760px) {
  .jhzzz-import-panel { width: min(calc(100vw - 20px), 680px); max-height: calc(100vh - 20px); padding: 16px; border-radius: 9px; }
  .jhzzz-import-model-row { grid-template-columns: 48px minmax(0, 1fr); }
  .jhzzz-import-model-hint { grid-column: 2; }
  .jhzzz-import-model-control { flex-wrap: wrap; }
  .jhzzz-import-model-control select { flex-basis: 100%; }
  .jhzzz-import-key-card { align-items: stretch; flex-wrap: wrap; }
  .jhzzz-import-key-note { flex-basis: 100%; }
  .jhzzz-import-key-card input { flex-basis: calc(100% - 44px); }
  .jhzzz-import-secondary-models { grid-template-columns: 1fr; }
  .jhzzz-import-platform-row { align-items: flex-start; flex-wrap: wrap; }
  .jhzzz-import-detected { width: 100%; margin: 4px 0 0; }
  .jhzzz-import-command-row { align-items: stretch; flex-direction: column; }
  .jhzzz-import-footer { flex-wrap: wrap; }
}
