:root {
  color-scheme: light;
  --page: #edf5ef;
  --ink: #243036;
  --muted: #71807c;
  --panel: rgba(255, 255, 255, 0.62);
  --panel-border: rgba(255, 255, 255, 0.88);
  --field: rgba(255, 255, 255, 0.82);
  --terminal: #1e2228;
  --terminal-soft: #262c34;
  --terminal-border: rgba(255, 255, 255, 0.06);
  --accent: #d96c75;
  --accent-deep: #b9505c;
  --accent-glow: rgba(217, 108, 117, 0.18);
  --shadow: 0 32px 96px rgba(55, 72, 63, 0.18), 0 2px 8px rgba(55, 72, 63, 0.08);
}

* {
  box-sizing: border-box;
}

strong {
  font-weight: 600;
}

html {
  min-height: 100%;
}

html,
body {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(255, 255, 255, 0.92), transparent 30rem),
    radial-gradient(ellipse at 90% 100%, rgba(233, 242, 247, 0.7), transparent 24rem),
    linear-gradient(145deg, var(--page) 0%, #f5f1ea 45%, #eaf2f7 100%);
  color: var(--ink);
  font-family: "Poppins", ui-rounded, "Avenir Next", "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(36, 48, 54, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 48, 54, 0.022) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 70%);
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
  display: flex;
  align-items: start;
  /* align-items: center; */
}

.workspace {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 22px;
  padding: clamp(20px, 3.5vw, 40px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

/* ── Topbar ───────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 4.4rem);
  font-weight: 600;
  line-height: 0.96;
}

/* ── Status badge ─────────────────────────────────── */

.status-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 11px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(55, 72, 63, 0.08);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 0;
  background: #b5bfc0;
  flex-shrink: 0;
  transition: background 0.3s;
}

body[data-running="true"] .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  animation: pulse 1.4s ease-in-out infinite;
}

body[data-done="complete"] .status-dot {
  background: #5bab78;
}

body[data-done="issues"] .status-dot {
  background: #d9a84c;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.status {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

body[data-running="true"] .status {
  color: var(--accent-deep);
}

/* ── Form ─────────────────────────────────────────── */

.audit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: #9eaaa6;
  pointer-events: none;
  flex-shrink: 0;
}

input,
button,
.secondary-button {
  min-height: 56px;
  border: 0;
  border-radius: 0;
  font: inherit;
}

input {
  width: 100%;
  padding: 0 18px 0 44px;
  background: var(--field);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 2px rgba(55, 72, 63, 0.06);
  outline: none;
  transition: box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

input::placeholder {
  color: #9eaaa6;
}

input:focus {
  background: #fffdf9;
  border-color: rgba(217, 108, 117, 0.32);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 1px 2px rgba(55, 72, 63, 0.06);
}

input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button {
  position: relative;
  min-width: 110px;
  padding: 0 24px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(185, 80, 92, 0.28), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  overflow: hidden;
}

.secondary-button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: rgba(217, 108, 117, 0.1);
  color: var(--accent-deep);
  border: 1px solid rgba(217, 108, 117, 0.42);
  box-shadow: 0 2px 8px rgba(185, 80, 92, 0.1), inset 0 1px 0 rgba(255,255,255,0.32);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.secondary-button:hover {
  background: rgba(217, 108, 117, 0.18);
  border-color: rgba(217, 108, 117, 0.72);
  color: var(--accent-deep);
  box-shadow: 0 6px 18px rgba(185, 80, 92, 0.18), inset 0 1px 0 rgba(255,255,255,0.28);
}

.secondary-button:active {
  transform: translateY(1px);
}

.form-secondary-button {
  min-width: 154px;
}

button:hover:not(:disabled) {
  background: var(--accent-deep);
  box-shadow: 0 4px 16px rgba(185, 80, 92, 0.36), inset 0 1px 0 rgba(255,255,255,0.15);
}

button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(185, 80, 92, 0.28);
}

button:disabled {
  cursor: wait;
  background: var(--accent-deep);
  opacity: 0.88;
}

.btn-text {
  transition: opacity 0.15s;
}

.btn-spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 0;
}

body[data-running="true"] .btn-text {
  opacity: 0;
}

body[data-running="true"] .btn-spinner {
  display: block;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Terminal ─────────────────────────────────────── */

.filter-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  position: relative;
  z-index: 3;
  padding: 16px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 3px rgba(55, 72, 63, 0.08);
  backdrop-filter: blur(24px);
}

.filter-panel[hidden] {
  display: none;
}

.filter-top-row {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 420px);
  gap: 14px;
  min-width: 0;
  align-items: stretch;
  justify-content: space-between;
}

.site-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.76);
}

.site-favicon-box {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  /* background: rgba(217, 108, 117, 0.1);
  border: 1px solid rgba(217, 108, 117, 0.28); */
}

.site-favicon-box img {
  width: 44px;
  height: 44px;
}

.site-favicon-box span {
  color: var(--accent-deep);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1rem;
  font-weight: 600;
}

.site-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.site-kicker,
.filter-label,
.filter-head {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.site-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  align-content: start;
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
}

.tag-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  padding-right: 4px;
}

.tag-filter-list::-webkit-scrollbar,
.select-menu::-webkit-scrollbar {
  width: 6px;
}

.tag-filter-list::-webkit-scrollbar-thumb,
.select-menu::-webkit-scrollbar-thumb {
  background: rgba(36, 48, 54, 0.14);
}

.check-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.68);
  color: var(--ink);
  cursor: pointer;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.76rem;
}

.check-row-compact {
  min-height: 0;
  padding: 4px 7px;
  background: rgba(217, 108, 117, 0.08);
  border: 1px solid rgba(217, 108, 117, 0.22);
  color: var(--accent-deep);
  font-family: inherit;
  font-size: 0.72rem;
  text-transform: none;
}

.check-row input {
  appearance: none;
  width: 15px;
  height: 15px;
  min-height: 0;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 0;
  background: #fffdf9;
  border: 1px solid rgba(217, 108, 117, 0.42);
  box-shadow: none;
  cursor: pointer;
}

.check-row input::before {
  width: 7px;
  height: 7px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.12s, transform 0.12s;
}

.check-row input:checked::before {
  opacity: 1;
  transform: scale(1);
}

.tag-chip {
  min-height: 34px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(36, 48, 54, 0.08);
  color: #8d9996;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

.tag-chip input {
  width: 13px;
  height: 13px;
  border-color: rgba(36, 48, 54, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.tag-chip input::before {
  width: 5px;
  height: 5px;
  background: #9aa7a4;
}

.tag-chip.is-selected {
  background: color-mix(in srgb, var(--tag-color) 13%, #ffffff);
  border-color: color-mix(in srgb, var(--tag-color) 46%, #ffffff);
  color: color-mix(in srgb, var(--tag-color) 68%, #243036);
}

.tag-chip.is-selected input {
  border-color: color-mix(in srgb, var(--tag-color) 56%, #ffffff);
}

.tag-chip.is-selected input::before {
  background: var(--tag-color);
}

.tag-chip:not(.is-selected) {
  opacity: 1;
}

.custom-select {
  position: relative;
  z-index: 20;
  min-width: 0;
  max-width: 100%;
}

.select-button {
  width: 100%;
  min-height: 46px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 3px rgba(55, 72, 63, 0.08);
  font-size: 0.78rem;
  text-align: left;
}

.select-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-button:hover {
  background: #fffdf9;
  border-color: rgba(217, 108, 117, 0.32);
}

.select-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-width: 100%;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  background: #fffdf9;
  border: 1px solid rgba(217, 108, 117, 0.24);
  box-shadow: 0 18px 42px rgba(55, 72, 63, 0.2);
}

.select-option {
  width: 100%;
  min-height: 36px;
  min-width: 0;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  border: 0;
  box-shadow: none;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.74rem;
  text-align: left;
  overflow: hidden;
}

.select-option span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-option:hover {
  background: rgba(217, 108, 117, 0.08) !important;
  border-color: transparent;
  color: var(--accent-deep);
  box-shadow: none;
  transform: none;
}

.select-option:hover span {
  width: max-content;
  min-width: 100%;
  animation: marquee-url 5s linear infinite;
}

.select-option.is-selected {
  background: rgba(217, 108, 117, 0.14);
  color: var(--accent-deep);
  box-shadow: inset 3px 0 0 rgba(217, 108, 117, 0.42);
  transform: none;
}

@keyframes marquee-url {
  0%, 18% { transform: translateX(0); }
  82%, 100% { transform: translateX(-45%); }
}

.terminal-wrap {
  position: relative;
  z-index: 1;
  min-height: clamp(400px, 55vh, 660px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--terminal);
  border: 1px solid var(--terminal-border);
  box-shadow: 0 20px 56px rgba(22, 26, 32, 0.36), inset 0 1px 0 rgba(255,255,255,0.05);
}

.terminal-top {
  position: relative;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  background: var(--terminal-soft);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 0;
  flex-shrink: 0;
}

.dot-red    { background: #ff5f56; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.18); }
.dot-yellow { background: #ffbd2e; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.14); }
.dot-green  { background: #27c840; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.14); }

.terminal-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.28);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.75rem;
  pointer-events: none;
  white-space: nowrap;
}

.terminal {
  min-height: 0;
  margin: 0;
  padding: 24px 28px 34px;
  overflow: auto;
  color: #c9d2d8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal:empty::before {
  content: "Waiting for a URL…";
  color: #454e58;
  font-style: italic;
}

.terminal::-webkit-scrollbar {
  width: 6px;
}

.terminal::-webkit-scrollbar-track {
  background: transparent;
}

.terminal::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 0;
}

.terminal::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.18);
}

/* ── Terminal fullscreen ──────────────────────────── */

.terminal-fullscreen-btn {
  min-height: 0;
  min-width: 0;
  padding: 6px 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  border: none;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  margin-left: auto;
  transition: color 0.15s;
}

.terminal-fullscreen-btn:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  transform: none;
}

.fs-icon-collapse { display: none; }

.terminal-wrap.is-fullscreen {
  min-height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.terminal-wrap:fullscreen {
  background: var(--terminal);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100%;
}

.terminal-wrap.is-fullscreen .fs-icon-expand   { display: none; }
.terminal-wrap.is-fullscreen .fs-icon-collapse { display: block; }

/* ── ANSI helpers ─────────────────────────────────── */

.ansi-bg {
  padding: 4px 7px;
  border-radius: 0;
}

.terminal-link {
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: filter 0.15s;
}

.terminal-link:hover {
  filter: brightness(1.22);
}

.stderr {
  color: #ff9aa2;
}

/* ── Checks preview ───────────────────────────────── */

.shell-detail {
  align-items: start;
}

.detail-workspace {
  gap: 24px;
}

.status-dot-live {
  background: #5bab78;
}

.summary-grid,
.checks-grid,
.detail-columns {
  display: grid;
  gap: 12px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-tile,
.check-panel {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 3px rgba(55, 72, 63, 0.08);
}

.summary-tile {
  min-height: 98px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
}

.tile-label,
.check-count,
.check-panel p,
.issue-block span,
.issue-list span {
  color: var(--muted);
}

.tile-label,
.check-count {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
}

.summary-tile strong {
  font-size: 2rem;
  line-height: 1;
}

.checks-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-panel {
  min-height: 250px;
  padding: 20px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.check-panel-wide {
  grid-column: 1 / -1;
}

.check-head,
.detail-row,
.issue-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check-tag {
  padding: 5px 8px;
  color: #fff;
  letter-spacing: 0.75px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 600;
}

.tag-ok { background: #4f9f68; }
.tag-error { background: #d96c75; }
.tag-warn { background: #b08a4c; }
.tag-purple { background: #b99ad6; }
.tag-blue { background: #5b78af; }
.tag-info { background: #6aa39d; }

.check-panel h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.check-panel p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.code-line,
.issue-block,
.issue-list {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
}

.code-line,
.issue-block {
  padding: 12px;
  background: rgba(30, 34, 40, 0.92);
  color: #c9d2d8;
  overflow-wrap: anywhere;
}

.issue-block {
  display: grid;
  gap: 6px;
}

.issue-block strong {
  color: #f1d0d3;
  font-weight: 600;
}

.detail-row {
  padding-top: 10px;
  border-top: 1px solid rgba(36, 48, 54, 0.08);
  font-size: 0.9rem;
}

.detail-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.issue-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.issue-list li {
  min-height: 38px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.56);
}

.issue-list strong {
  color: var(--ink);
}

.terminal-preview {
  min-height: 360px;
}

/* ── Mobile ───────────────────────────────────────── */

@media (max-width: 1024px) {
  .filter-top-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  h1 {
    font-size: clamp(1.9rem, 5.5vw, 3rem);
  }
}

@media (max-width: 720px) {
  .shell {
    width: calc(100vw - 20px);
    padding: 12px 0;
    align-items: stretch;
  }

  .workspace {
    padding: 18px;
    gap: 18px;
  }

  h1 {
    font-size: clamp(1.75rem, 9vw, 2.4rem);
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .audit-form {
    grid-template-columns: 1fr;
  }

  .filter-top-row,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .secondary-button {
    min-height: 48px;
    width: 100%;
  }

  .form-secondary-button {
    min-width: 0;
  }

  .summary-grid,
  .checks-grid,
  .detail-columns {
    grid-template-columns: 1fr;
  }

  .check-panel {
    min-height: 0;
  }

  .terminal-label {
    display: none;
  }

  .terminal {
    padding: 18px 16px 24px;
    font-size: 0.8rem;
    line-height: 1.65;
  }
}

.structured-view-btn {
  display: inline;
  font: inherit;
  color: #6aa39d !important;
  background: none !important;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none !important;
  cursor: pointer;
  vertical-align: baseline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.structured-view-btn:hover {
  color: #8fd0c8 !important;
  text-decoration: underline !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 28, 32, 0.55);
  backdrop-filter: blur(6px);
  animation: modal-fade 0.2s ease;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal {
  width: min(760px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--terminal);
  border: 1px solid var(--terminal-border);
  /* border-radius: 16px; */
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modal-pop 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--terminal-border);
  background: var(--terminal-soft);
}

.modal-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.modal-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6aa39d;
}

.modal-url {
  font-size: 0.9rem;
  color: #e6edf0;
  word-break: break-all;
}

.modal-close {
  flex-shrink: 0;
  width: auto;
  height: auto;
  min-width: 56px;
  padding: 0 4px;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: none !important;
  color: #97a3a5;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.modal-close:hover {
  background: none;
  color: #fff;
}

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: radial-gradient(ellipse at 10% 0%, rgba(255, 255, 255, 0.92), transparent 30rem),    radial-gradient(ellipse at 90% 100%, rgba(233, 242, 247, 0.7), transparent 24rem),    linear-gradient(145deg, var(--page) 0%, #f5f1ea 45%, #eaf2f7 100%);
}

.modal-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.modal-block + .modal-block {
  margin-top: 16px;
}

.modal-block-head {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 6px;
}

.modal-json {
  margin: 0;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #d4dde0;
  background: var(--terminal-soft);
  border: 1px solid var(--terminal-border);
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.modal-json .json-key {
  color: #6aa39d;
}

.modal-json .json-string {
  color: #9ecf8a;
}

.modal-json .json-number {
  color: #d99a6c;
}

.modal-json .json-boolean {
  color: #c98fd6;
}

.modal-json .json-null {
  color: #97a3a5;
  font-style: italic;
}

.modal-code {
  position: relative;
}

.modal-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #c2cdcf;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--terminal-border);
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.modal-code:hover .modal-copy,
.modal-copy:focus-visible {
  opacity: 1;
}

.modal-copy:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: none;
}

.modal-copy.is-copied {
  opacity: 1;
  color: #9ecf8a;
  border-color: rgba(158, 207, 138, 0.5);
}
