﻿:root {
  --bg: #0c1118;
  --line: rgba(232, 220, 196, 0.1);
  --text: #ebe4d6;
  --muted: #9aa6b5;
  --accent: #e8a04a;
  --accent-2: #3ecfb2;
  --danger: #ef6b6b;
  --warn: #e8a04a;
  --ok: #3ecfb2;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Syne", "Manrope", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}
.glow {
  pointer-events: none;
  position: fixed;
  width: 48vw;
  height: 48vw;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  opacity: 0.35;
  animation: drift 16s ease-in-out infinite alternate;
}
.glow-a {
  top: -18vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(232, 160, 74, 0.35), transparent 65%);
}
.glow-b {
  right: -12vw;
  bottom: -20vw;
  background: radial-gradient(circle, rgba(62, 207, 178, 0.1), transparent 65%);
  animation-delay: -6s;
  opacity: 0.22;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4%, 6%) scale(1.08); }
}

.top, .layout { position: relative; z-index: 1; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 2rem 0.4rem;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: 0.9rem; }
.mark {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background:
    linear-gradient(145deg, var(--accent), #c46b2c 55%, transparent 56%),
    linear-gradient(325deg, var(--accent-2), transparent 60%);
  box-shadow: 0 0 0 1px rgba(232, 220, 196, 0.15), inset 0 0 20px rgba(255,255,255,0.08);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(6deg) scale(1.04); }
}
.brand-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}
.brand-sub { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.85rem; }
.top-meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 26, 36, 0.7);
  backdrop-filter: blur(8px);
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 1.25rem;
  padding: 1rem 2rem 2rem;
  max-width: 1680px;
  margin: 0 auto;
}
.right-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.panel {
  background: linear-gradient(180deg, rgba(24, 34, 49, 0.92), rgba(18, 26, 36, 0.88));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.config { padding: 1.4rem 1.35rem 1.5rem; }
.config h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.lead { margin: 0.55rem 0 1.2rem; color: var(--muted); font-size: 0.92rem; }
.lead code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-2);
  background: rgba(62, 207, 178, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 1rem;
  padding: 0.9rem 0.85rem 1rem;
}
legend {
  padding: 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.field { display: grid; gap: 0.35rem; margin-top: 0.65rem; }
.field > span { font-size: 0.82rem; color: var(--muted); }
input[type="text"], input[type="url"], input[type="number"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.72);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 0.8rem; }
input:focus, textarea:focus {
  border-color: rgba(232, 160, 74, 0.55);
  box-shadow: 0 0 0 3px rgba(232, 160, 74, 0.12);
}

.file-drop {
  display: grid;
  place-items: center;
  gap: 0.25rem;
  text-align: center;
  padding: 1.1rem 0.8rem;
  border: 1px dashed rgba(232, 160, 74, 0.35);
  border-radius: 12px;
  background: rgba(232, 160, 74, 0.04);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.file-drop:hover, .file-drop.drag {
  background: rgba(232, 160, 74, 0.1);
  border-color: rgba(232, 160, 74, 0.7);
  transform: translateY(-1px);
}
.file-drop.compact { padding: 0.9rem; margin-top: 0.65rem; }
.drop-title { font-weight: 600; }
.drop-hint, .drop-file { font-size: 0.78rem; color: var(--muted); }
.drop-file:not(:empty) { color: var(--accent-2); }

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.seg-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.55rem 0.4rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}
.seg-btn.active {
  color: #1a1208;
  background: linear-gradient(135deg, #f0c07a, var(--accent));
  border-color: transparent;
}
.hidden { display: none !important; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.75rem;
}
.grid-2 legend { grid-column: 1 / -1; }
.grid-2 .full { grid-column: 1 / -1; }
.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.check input { accent-color: var(--accent); width: 1rem; height: 1rem; }

.cta {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: #1a1208;
  background: linear-gradient(135deg, #f3c987, var(--accent) 45%, #d9772f);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(232, 160, 74, 0.28);
  transition: transform 0.18s ease, filter 0.18s ease;
}
.cta:hover { transform: translateY(-2px); filter: brightness(1.05); }
.cta:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.form-error {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 0.88rem;
}

.preview-panel { padding: 0; overflow: hidden; flex: 1 1 auto; min-height: 0; }
.preview-chrome {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.55);
}
.dots { display: flex; gap: 0.35rem; }
.dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a4658;
}
.dots i:nth-child(1) { background: #ef6b6b; }
.dots i:nth-child(2) { background: #e8a04a; }
.dots i:nth-child(3) { background: #3ecfb2; }
.preview-url {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
}
.preview-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  height: min(72vh, 780px);
  max-height: none;
  min-height: 440px;
  background:
    linear-gradient(180deg, rgba(18,26,36,0.2), rgba(12,17,24,0.9)),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 10px,
      rgba(232, 220, 196, 0.02) 10px,
      rgba(232, 220, 196, 0.02) 11px
    );
  overflow: hidden;
}
.preview-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  display: block;
  background: #0a0e14;
  animation: fadeShot 0.28s ease;
}
.preview-stage img[hidden],
.preview-stage img.is-empty {
  display: none !important;
}
@keyframes fadeShot {
  from { opacity: 0.55; }
  to { opacity: 1; }
}
.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
}
.preview-empty p {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--text);
}
.preview-empty span { font-size: 0.8rem; max-width: 28rem; }

.log-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.35);
}
.log-head-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}
.log-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.log-job-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(232, 160, 74, 0.1);
  border: 1px solid rgba(232, 160, 74, 0.25);
  white-space: nowrap;
}
.log-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.log-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.5);
}
.log-stat em {
  font-style: normal;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
}
.log-stat.stat-ok em { color: var(--ok); }
.log-stat.stat-err em { color: var(--danger); }
.log-stat.stat-info em { color: var(--accent-2); }
.log-actions { display: flex; gap: 0.4rem; margin-left: auto; }
.log-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(232, 160, 74, 0.35);
  background: rgba(232, 160, 74, 0.08);
  color: var(--text);
  border-radius: 8px;
  padding: 0.38rem 0.7rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.15s;
}
.log-btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
}
.log-btn:hover:not(:disabled) {
  border-color: rgba(232, 160, 74, 0.65);
  background: rgba(232, 160, 74, 0.14);
  transform: translateY(-1px);
}
.log-btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(154, 166, 181, 0.45);
  background: rgba(255, 255, 255, 0.04);
}
.log-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.log-btn-sm { padding: 0.32rem 0.55rem; font-size: 0.72rem; }
.log-btn-success {
  border-color: rgba(62, 207, 178, 0.45);
  background: rgba(62, 207, 178, 0.1);
  color: var(--ok);
}
.log-btn-success:hover:not(:disabled) {
  border-color: rgba(62, 207, 178, 0.75);
  background: rgba(62, 207, 178, 0.18);
}
.log-btn-danger {
  border-color: rgba(239, 107, 107, 0.45);
  background: rgba(239, 107, 107, 0.1);
  color: var(--danger);
}
.log-btn-danger:hover:not(:disabled) {
  border-color: rgba(239, 107, 107, 0.75);
  background: rgba(239, 107, 107, 0.18);
}
.log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.35);
}
.log-filters {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.log-filter {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.18s ease;
}
.log-filter:hover {
  color: var(--text);
  border-color: rgba(232, 160, 74, 0.4);
}
.log-filter.active {
  color: #1a1208;
  border-color: transparent;
  background: linear-gradient(135deg, #f0c07a, var(--accent));
}
.log-filter[data-filter="success"].active {
  background: linear-gradient(135deg, #6ee7c8, var(--ok));
}
.log-filter[data-filter="error"].active {
  background: linear-gradient(135deg, #f5a5a5, var(--danger));
  color: #2b0d0d;
}
.log-filter[data-filter="info"].active {
  background: linear-gradient(135deg, #7ee8d8, var(--accent-2));
}
.log-filter-hint {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}
.log-body {
  height: 240px;
  overflow: auto;
  padding: 0.65rem 0.75rem 0.75rem;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.95), rgba(12, 17, 24, 0.88)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 22px,
      rgba(232, 220, 196, 0.025) 22px,
      rgba(232, 220, 196, 0.025) 23px
    );
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 160, 74, 0.35) transparent;
}
.log-body::-webkit-scrollbar { width: 6px; }
.log-body::-webkit-scrollbar-thumb {
  background: rgba(232, 160, 74, 0.35);
  border-radius: 999px;
}
.log-empty {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}
.log-empty svg { opacity: 0.35; }
.log-empty p {
  margin: 0.35rem 0 0;
  font-family: var(--display);
  font-size: 0.95rem;
  color: var(--text);
}
.log-empty span { font-size: 0.76rem; max-width: 22rem; line-height: 1.5; }
.log-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 0.65rem;
  align-items: start;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.4rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 220, 196, 0.06);
  background: rgba(18, 26, 36, 0.72);
  animation: logIn 0.25s ease both;
}
@keyframes logIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.log-item::before {
  content: "";
  grid-row: 1 / span 3;
  width: 3px;
  border-radius: 999px;
  align-self: stretch;
  min-height: 2.2rem;
}
.log-item.level-info::before { background: var(--accent-2); box-shadow: 0 0 8px rgba(62, 207, 178, 0.35); }
.log-item.level-success::before { background: var(--ok); box-shadow: 0 0 8px rgba(62, 207, 178, 0.45); }
.log-item.level-error::before { background: var(--danger); box-shadow: 0 0 8px rgba(239, 107, 107, 0.45); }
.log-item.level-warn::before { background: var(--warn); box-shadow: 0 0 8px rgba(232, 160, 74, 0.35); }
.log-item-top {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.log-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.log-badge.info { color: #0d2b24; background: rgba(62, 207, 178, 0.75); }
.log-badge.success { color: #0d2b24; background: rgba(62, 207, 178, 0.92); }
.log-badge.error { color: #2b0d0d; background: rgba(239, 107, 107, 0.9); }
.log-badge.warn { color: #2a1a05; background: rgba(232, 160, 74, 0.88); }
.log-time {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}
.log-site {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent-2);
  word-break: break-all;
}
.log-label {
  grid-column: 2;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}
.log-url {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
  word-break: break-all;
  opacity: 0.85;
}

.preview-caption {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--text);
  min-height: 2.6rem;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.pulse-dot.live {
  background: var(--accent-2);
  box-shadow: none;
  animation: none;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(62, 207, 178, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(62, 207, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 178, 0); }
}

.live {
  display: flex;
  flex-direction: column;
  min-height: 360px;
  flex: 1;
  padding: 1.2rem 1.2rem 1rem;
}
.live-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.live h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 220px;
}
.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.progress-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.35s ease;
}
#progressText {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.stat {
  background: rgba(12, 17, 24, 0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.65rem;
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--ok);
}
.stat span { font-size: 0.72rem; color: var(--muted); }
.stat.warn b { color: var(--warn); }
.stat.danger b { color: var(--danger); }
.stat.muted b { color: var(--muted); }

.table-wrap {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
th, td {
  padding: 0.7rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  position: sticky;
  top: 0;
  background: #152032;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
tbody tr { animation: rowIn 0.35s ease both; }
@keyframes rowIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
td.url { font-family: var(--mono); font-size: 0.78rem; word-break: break-all; max-width: 280px; }
td.msg { color: var(--muted); max-width: 360px; }
td.msg .tiny { font-size: 0.72rem; margin-top: 0.25rem; opacity: 0.85; word-break: break-all; }
.empty td { text-align: center; color: var(--muted); padding: 3rem 1rem; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.badge.ok { color: #0d2b24; background: rgba(62, 207, 178, 0.85); }
.badge.warn { color: #2a1a05; background: rgba(232, 160, 74, 0.9); }
.badge.danger { color: #2b0d0d; background: rgba(239, 107, 107, 0.9); }
.badge.muted { color: var(--text); background: rgba(154, 166, 181, 0.25); border-color: var(--line); }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: 1rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .live { min-height: 360px; }
  .top { padding: 1rem 1rem 0; }
}
/* Monitoring layout refinements */
.layout {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  max-width: 1920px;
  align-items: stretch;
}
.right-col { gap: 0.85rem; }
.preview-panel {
  min-height: 620px;
  border-radius: 16px;
}
.preview-chrome { padding: 0.8rem 1rem; }
.preview-url { font-size: 0.82rem; }
.preview-stage {
  height: clamp(560px, 68vh, 860px);
  min-height: 560px;
  aspect-ratio: auto;
}
.preview-stage img {
  object-fit: contain;
  image-rendering: auto;
}
.preview-caption {
  font-size: 0.95rem;
  padding: 0.78rem 1rem;
}
.pulse-dot.live { animation: ping 1.4s ease-out infinite; }
.log-panel {
  max-height: 370px;
  border-radius: 16px;
}
.log-head { padding: 0.7rem 0.9rem; }
.log-toolbar { padding: 0.5rem 0.9rem; }
.log-body {
  height: 260px;
  padding: 0.8rem;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.82), rgba(8, 12, 18, 0.94));
}
.log-item {
  max-width: min(760px, 96%);
  margin-left: auto;
  border-radius: 8px;
  border-color: rgba(232, 220, 196, 0.12);
  background: rgba(20, 29, 42, 0.9);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
}
.log-item.level-success { background: rgba(16, 45, 39, 0.92); }
.log-item.level-error { background: rgba(52, 22, 25, 0.94); }
.log-item.level-warn { background: rgba(55, 40, 20, 0.94); }
.log-label { font-size: 0.86rem; }
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  margin: -0.45rem 0 1rem;
}
.analysis-card {
  border: 1px solid rgba(232, 220, 196, 0.1);
  border-radius: 8px;
  padding: 0.68rem 0.7rem;
  background: rgba(8, 12, 18, 0.58);
}
.analysis-card span {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}
.analysis-card b {
  display: block;
  margin-top: 0.18rem;
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.1;
  color: var(--text);
}
.analysis-card.strong b { color: var(--accent-2); }
@media (min-width: 1500px) {
  .layout { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .preview-stage { height: clamp(660px, 72vh, 940px); }
  .log-body { height: 300px; }
}
@media (max-width: 980px) {
  .preview-panel { min-height: 420px; }
  .preview-stage { height: 52vh; min-height: 360px; }
  .analysis-grid { grid-template-columns: repeat(2, 1fr); }
}


/* Large-screen monitoring and realtime toast layer */
.monitor-toggle {
  flex: 0 0 auto;
  border: 1px solid rgba(62, 207, 178, 0.38);
  background: rgba(62, 207, 178, 0.1);
  color: var(--accent-2);
  border-radius: 8px;
  padding: 0.36rem 0.72rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.monitor-toggle:hover {
  border-color: rgba(62, 207, 178, 0.75);
  background: rgba(62, 207, 178, 0.18);
  transform: translateY(-1px);
}
.monitor-toggle.active {
  color: #071512;
  border-color: transparent;
  background: linear-gradient(135deg, #78f0d4, var(--accent-2));
}
.toast-stack {
  position: fixed;
  top: 5.2rem;
  right: 1.4rem;
  z-index: 20;
  display: grid;
  gap: 0.65rem;
  width: min(460px, calc(100vw - 2rem));
  pointer-events: none;
}
.toast-stack .toast-item {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 8px;
  border-color: rgba(232, 220, 196, 0.16);
  background: rgba(16, 24, 35, 0.94);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
  backdrop-filter: blur(18px);
  pointer-events: auto;
}
.toast-stack .toast-success { background: rgba(13, 54, 45, 0.95); }
.toast-stack .toast-error { background: rgba(58, 21, 26, 0.96); }
.toast-stack .toast-warn { background: rgba(60, 42, 17, 0.96); }
.toast-stack .toast-item.leaving {
  animation: toastOut 0.24s ease forwards;
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(18px) scale(0.98); }
}
body.monitor-mode .top {
  padding-top: 0.8rem;
}
body.monitor-mode .brand-sub,
body.monitor-mode .config {
  display: none;
}
body.monitor-mode .layout {
  grid-template-columns: 1fr;
  max-width: none;
  padding: 0.75rem 1rem 1rem;
}
body.monitor-mode .right-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 28vw);
  grid-template-rows: auto 1fr;
  gap: 0.85rem;
  min-height: calc(100vh - 5.2rem);
}
body.monitor-mode .preview-panel {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: calc(100vh - 6.1rem);
}
body.monitor-mode .preview-stage {
  height: calc(100vh - 10.4rem);
  min-height: 620px;
}
body.monitor-mode .log-panel {
  grid-column: 2;
  grid-row: 1;
  max-height: none;
  min-height: 380px;
}
body.monitor-mode .log-body {
  height: min(42vh, 480px);
}
body.monitor-mode .live {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
}
body.monitor-mode .stats {
  grid-template-columns: repeat(2, 1fr);
}
body.monitor-mode .analysis-grid {
  grid-template-columns: repeat(2, 1fr);
}
body.monitor-mode .table-wrap {
  min-height: 260px;
}
body.monitor-mode .toast-stack {
  top: 4.4rem;
  right: calc(28vw + 2rem);
  width: min(520px, 34vw);
}
@media (max-width: 1180px) {
  body.monitor-mode .right-col {
    display: flex;
    min-height: auto;
  }
  body.monitor-mode .preview-panel {
    min-height: 540px;
  }
  body.monitor-mode .preview-stage {
    height: 60vh;
    min-height: 460px;
  }
  body.monitor-mode .toast-stack,
  .toast-stack {
    top: auto;
    right: 1rem;
    bottom: 1rem;
    width: min(420px, calc(100vw - 2rem));
  }
}
@media (max-width: 640px) {
  .monitor-toggle {
    padding: 0.32rem 0.55rem;
    font-size: 0.7rem;
  }
  .toast-stack {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
  }
  .toast-stack .toast-item:nth-child(n+3) {
    display: none;
  }
}

/* Console polish pass: cleaner identity, larger preview, charted analytics */
.glow { display: none; }
body {
  background:
    linear-gradient(135deg, #0a0f16 0%, #101a22 46%, #17150f 100%);
}
.mark {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2f5f7;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  animation: none;
}
.mark i {
  font-style: normal;
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 800;
  color: #142131;
}
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background:
    linear-gradient(135deg, rgba(8, 12, 18, 0.96), rgba(18, 28, 38, 0.96)),
    radial-gradient(circle at 72% 22%, rgba(232, 160, 74, 0.16), transparent 34%);
  backdrop-filter: blur(18px);
}
.login-card {
  width: min(420px, 100%);
  border: 1px solid rgba(232, 220, 196, 0.16);
  border-radius: 8px;
  padding: 2rem;
  background: rgba(15, 23, 33, 0.92);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}
.login-mark {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f2f5f7;
  color: #142131;
  font-family: var(--display);
  font-weight: 800;
  margin-bottom: 1.25rem;
}
.login-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
}
.login-card p {
  margin: 0.45rem 0 1.4rem;
  color: var(--muted);
}
.login-field {
  display: grid;
  gap: 0.42rem;
}
.login-field span {
  color: var(--muted);
  font-size: 0.82rem;
}
.login-field input {
  width: 100%;
  border: 1px solid rgba(232, 220, 196, 0.16);
  border-radius: 8px;
  padding: 0.92rem 1rem;
  background: rgba(5, 9, 14, 0.72);
  color: var(--text);
  font: inherit;
  outline: none;
}
.login-field input:focus {
  border-color: rgba(62, 207, 178, 0.72);
  box-shadow: 0 0 0 3px rgba(62, 207, 178, 0.12);
}
.login-submit {
  width: 100%;
  margin-top: 1rem;
  border: 0;
  border-radius: 8px;
  padding: 0.92rem 1rem;
  background: linear-gradient(135deg, #49d6bd, #f0b65d);
  color: #07120f;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.login-error {
  margin-top: 0.75rem;
  color: var(--danger);
  font-size: 0.86rem;
}
.login-card.shake { animation: loginShake 0.28s ease; }
@keyframes loginShake {
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}
.monitor-toggle { display: none !important; }
.layout {
  grid-template-columns: minmax(280px, 318px) minmax(0, 1fr);
  max-width: none;
  padding: 0.8rem 1rem 1rem;
  gap: 1rem;
}
.config {
  max-height: calc(100vh - 6.2rem);
  overflow: auto;
  border-radius: 8px;
}
.right-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
}
.preview-panel {
  min-height: calc(100vh - 8rem);
  border-radius: 8px;
}
.preview-chrome {
  min-height: 3.4rem;
}
.preview-stage {
  height: calc(100vh - 12.9rem);
  min-height: 720px;
  background: #070b10;
}
.preview-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transform: scale(1.035);
  transform-origin: top center;
  background: #070b10;
}
.preview-empty {
  background:
    linear-gradient(160deg, rgba(17, 27, 38, 0.82), rgba(8, 12, 18, 0.94)),
    repeating-linear-gradient(-12deg, transparent 0 14px, rgba(232, 220, 196, 0.026) 14px 15px);
}
.preview-empty p {
  font-size: clamp(1.3rem, 2.2vw, 2.2rem);
}
.preview-caption {
  min-height: 3.1rem;
  font-size: 1rem;
}
.log-panel,
.live {
  border-radius: 8px;
}
.analysis-grid {
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(120px, 0.8fr));
  align-items: stretch;
  gap: 0.65rem;
  margin: -0.15rem 0 1rem;
}
.analysis-card {
  min-height: 94px;
  display: grid;
  align-content: center;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 16, 24, 0.78), rgba(9, 13, 19, 0.64));
}
.analysis-card b {
  font-size: clamp(1.2rem, 1.6vw, 1.7rem);
}
.chart-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 0.9rem;
}
.rate-ring {
  --rate: 0deg;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ok) var(--rate), rgba(255, 255, 255, 0.08) 0deg);
  position: relative;
}
.rate-ring::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #0e1621;
}
.rate-ring span {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.analysis-bars {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.46rem;
  border: 1px solid rgba(232, 220, 196, 0.1);
  border-radius: 8px;
  padding: 0.72rem;
  background: rgba(7, 11, 17, 0.54);
}
.bar-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr 2.4rem;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.bar-row i {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}
.bar-row em {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
  transition: width 0.35s ease;
}
.bar-row.warn em { background: var(--warn); }
.bar-row.danger em { background: var(--danger); }
.bar-row.muted em { background: var(--muted); }
.bar-row b {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-align: right;
}
@media (min-width: 1700px) {
  .layout { grid-template-columns: minmax(286px, 310px) minmax(0, 1fr); }
  .preview-stage { height: calc(100vh - 12.2rem); min-height: 790px; }
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .config { max-height: none; }
  .preview-panel { min-height: 620px; }
  .preview-stage { height: 62vh; min-height: 520px; }
}
@media (max-width: 760px) {
  .login-card { padding: 1.35rem; }
  .analysis-grid { grid-template-columns: 1fr 1fr; }
  .chart-card, .analysis-bars { grid-column: 1 / -1; }
  .preview-stage { min-height: 380px; }
}

/* Preview size tuning */
.preview-panel {
  min-height: calc(100vh - 12rem);
}
.preview-stage {
  height: clamp(560px, 62vh, 760px);
  min-height: 560px;
}
@media (min-width: 1700px) {
  .preview-stage {
    height: clamp(620px, 64vh, 820px);
    min-height: 620px;
  }
}
@media (max-width: 1180px) {
  .preview-panel { min-height: 540px; }
  .preview-stage { height: 56vh; min-height: 440px; }
}
@media (max-width: 760px) {
  .preview-stage { height: 48vh; min-height: 340px; }
}

/* Browser-window layout polish */
html,
body {
  height: 100%;
}

body {
  min-height: 100%;
  overflow: hidden;
}

.noise,
.glow {
  pointer-events: none;
}

.top {
  height: 4.15rem;
  padding: 0.72rem 1rem 0.48rem;
  gap: 1rem;
}

.brand {
  min-width: 0;
}

.brand-name {
  line-height: 1.05;
}

.brand-sub,
.top-meta {
  line-height: 1.2;
}

.layout {
  width: 100%;
  height: calc(100vh - 4.15rem);
  grid-template-columns: clamp(260px, 18vw, 318px) minmax(0, 1fr);
  gap: 0.78rem;
  padding: 0.62rem 0.95rem 0.9rem;
  overflow: hidden;
}

.panel {
  border-radius: 8px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
}

.config {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 0.92rem;
  scrollbar-width: thin;
}

.config h1 {
  margin-bottom: 0.28rem;
  font-size: clamp(1.45rem, 1.5vw, 1.82rem);
}

.config .lead {
  margin-bottom: 0.78rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

fieldset {
  margin: 0 0 0.72rem;
  padding: 0.78rem;
  gap: 0.58rem;
}

legend {
  margin-bottom: 0.5rem;
}

.file-drop {
  min-height: 5.1rem;
  padding: 0.76rem;
}

.file-drop.compact {
  min-height: 4.25rem;
}

.field textarea {
  min-height: 6.7rem;
  resize: vertical;
}

.grid-2 {
  gap: 0.56rem;
}

.check {
  min-height: 2.38rem;
  padding: 0.58rem 0.62rem;
}

.cta {
  min-height: 2.72rem;
  padding: 0.7rem 0.86rem;
}

.right-col {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(300px, 47vh) minmax(156px, 20vh) minmax(205px, 1fr);
  gap: 0.72rem;
  overflow: hidden;
}

.preview-panel,
.log-panel,
.live {
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.preview-panel {
  display: flex;
  flex-direction: column;
}

.preview-chrome {
  flex: 0 0 auto;
  min-height: 2.82rem;
  padding: 0.58rem 0.72rem;
}

.preview-url {
  min-width: 0;
}

.preview-stage {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  border-radius: 0;
}

.preview-stage img {
  transform: scale(1.02);
}

.preview-caption {
  flex: 0 0 auto;
  min-height: 2.58rem;
  padding: 0.62rem 0.78rem;
  font-size: 0.9rem;
}

.preview-empty p {
  font-size: clamp(1rem, 1.55vw, 1.55rem);
}

.log-panel {
  display: flex;
  flex-direction: column;
}

.log-head {
  flex: 0 0 auto;
  padding: 0.72rem 0.78rem 0.55rem;
  gap: 0.58rem;
}

.log-head h2,
.live-head h2 {
  font-size: 1rem;
}

.log-stats {
  gap: 0.42rem;
}

.log-stat,
.log-btn,
.log-filter {
  border-radius: 8px;
}

.log-toolbar {
  flex: 0 0 auto;
  padding: 0.48rem 0.78rem;
}

.log-body {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  padding: 0.62rem;
  overflow: auto;
}

.log-line {
  border-radius: 8px;
}

.live {
  display: flex;
  flex-direction: column;
  padding: 0.78rem;
}

.live-head {
  flex: 0 0 auto;
  margin-bottom: 0.58rem;
}

.stats {
  flex: 0 0 auto;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 0.48rem;
  margin-bottom: 0.58rem;
}

.stat {
  min-height: 4rem;
  padding: 0.58rem;
  border-radius: 8px;
}

.stat b {
  font-size: clamp(1.16rem, 1.25vw, 1.48rem);
}

.analysis-grid {
  flex: 0 0 auto;
  grid-template-columns: minmax(185px, 1.05fr) repeat(3, minmax(104px, 0.72fr));
  gap: 0.48rem;
  margin: 0 0 0.58rem;
}

.analysis-card {
  min-height: 4.9rem;
  padding: 0.58rem;
}

.chart-card {
  grid-template-columns: 58px 1fr;
  gap: 0.62rem;
}

.rate-ring {
  width: 56px;
  height: 56px;
}

.rate-ring::after {
  inset: 6px;
}

.rate-ring span {
  font-size: 0.82rem;
}

.analysis-card b {
  font-size: clamp(1rem, 1.15vw, 1.36rem);
}

.analysis-bars {
  gap: 0.34rem;
  padding: 0.56rem;
}

.bar-row {
  grid-template-columns: 2.85rem 1fr 2.15rem;
  gap: 0.5rem;
  font-size: 0.74rem;
}

.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: 8px;
}

table {
  min-width: 680px;
}

th,
td {
  padding: 0.58rem 0.66rem;
}

.toast-stack {
  right: 1rem;
  bottom: 1rem;
  max-height: min(48vh, 440px);
  overflow: hidden;
}

@media (min-width: 1700px) {
  .layout {
    grid-template-columns: clamp(268px, 16vw, 312px) minmax(0, 1fr);
  }

  .right-col {
    grid-template-rows: minmax(340px, 49vh) minmax(168px, 20vh) minmax(220px, 1fr);
  }
}

@media (max-width: 1380px) {
  .layout {
    grid-template-columns: clamp(252px, 20vw, 300px) minmax(0, 1fr);
    gap: 0.66rem;
    padding-inline: 0.72rem;
  }

  .right-col {
    grid-template-rows: minmax(260px, 43vh) minmax(148px, 20vh) minmax(190px, 1fr);
    gap: 0.62rem;
  }

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

  .chart-card {
    grid-column: span 2;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .top {
    height: auto;
    min-height: 3.9rem;
  }

  .layout {
    height: auto;
    min-height: calc(100vh - 3.9rem);
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .config {
    height: auto;
    overflow: visible;
  }

  .right-col {
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .preview-stage {
    flex: none;
    height: min(52vh, 520px);
    min-height: 340px;
  }

  .log-body {
    max-height: 320px;
  }

  .table-wrap {
    max-height: 420px;
  }
}

@media (max-width: 760px) {
  .top {
    align-items: flex-start;
    padding: 0.72rem;
  }

  .layout {
    padding: 0.58rem;
  }

  .config,
  .live {
    padding: 0.72rem;
  }

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

  .chart-card,
  .analysis-bars {
    grid-column: 1 / -1;
  }

  .preview-stage {
    height: 48vh;
    min-height: 300px;
  }

  .log-head,
  .log-toolbar {
    padding-inline: 0.62rem;
  }
}

/* Final right-column ratio tuning */
.right-col {
  grid-template-rows: minmax(350px, 50vh) minmax(140px, 18vh) minmax(160px, 1fr);
}

.live {
  padding: 0.68rem;
}

.live-head {
  margin-bottom: 0.46rem;
}

.stats {
  gap: 0.4rem;
  margin-bottom: 0.46rem;
}

.stat {
  min-height: 3.55rem;
  padding: 0.48rem;
}

.stat span {
  font-size: 0.72rem;
}

.analysis-grid {
  gap: 0.4rem;
  margin-bottom: 0.46rem;
}

.analysis-card {
  min-height: 4.25rem;
  padding: 0.48rem;
}

.analysis-bars {
  padding: 0.48rem;
}

.bar-row {
  gap: 0.42rem;
}

@media (min-width: 1700px) {
  .right-col {
    grid-template-rows: minmax(392px, 50vh) minmax(168px, 20vh) minmax(190px, 1fr);
  }
}

@media (max-width: 1380px) {
  .right-col {
    grid-template-rows: minmax(330px, 47vh) minmax(136px, 18vh) minmax(158px, 1fr);
  }
}

/* Data panel accessibility tuning */
.right-col {
  grid-template-rows: minmax(290px, 40vh) minmax(136px, 17vh) minmax(220px, 1fr);
}

.live {
  overflow: auto;
  scrollbar-width: thin;
}

.table-wrap {
  flex: 0 0 150px;
  min-height: 120px;
}

@media (min-width: 1700px) {
  .right-col {
    grid-template-rows: minmax(360px, 43vh) minmax(170px, 19vh) minmax(260px, 1fr);
  }

  .table-wrap {
    flex-basis: 180px;
  }
}

@media (max-width: 1380px) {
  .right-col {
    grid-template-rows: minmax(286px, 39vh) minmax(132px, 17vh) minmax(212px, 1fr);
  }

  .table-wrap {
    flex-basis: 138px;
    min-height: 110px;
  }
}

/* Keep analytics visible on desktop */
@media (min-width: 761px) {
  .analysis-grid {
    grid-template-columns: minmax(168px, 1fr) repeat(3, minmax(86px, 0.55fr)) minmax(250px, 1.12fr);
    align-items: stretch;
  }

  .chart-card,
  .analysis-bars {
    grid-column: auto;
  }

  .analysis-bars {
    align-content: center;
  }
}

@media (max-width: 1380px) and (min-width: 761px) {
  .analysis-grid {
    grid-template-columns: minmax(150px, 0.85fr) repeat(3, minmax(78px, 0.48fr)) minmax(220px, 1fr);
  }

  .analysis-card {
    min-height: 3.85rem;
  }

  .chart-card {
    grid-template-columns: 48px 1fr;
  }

  .rate-ring {
    width: 46px;
    height: 46px;
  }

  .rate-ring span {
    font-size: 0.74rem;
  }

  .analysis-bars {
    gap: 0.26rem;
  }

  .bar-row i {
    height: 7px;
  }
}

/* Adaptive page flow and calmer log display */
html,
body {
  min-height: 100%;
  height: auto;
}

body {
  overflow: auto;
  overflow-x: hidden;
}

.layout {
  height: auto;
  min-height: calc(100vh - 4.15rem);
  align-items: start;
  grid-template-columns: minmax(270px, 0.23fr) minmax(0, 1fr);
  gap: clamp(0.85rem, 1vw, 1.15rem);
  padding: clamp(0.7rem, 1vw, 1rem);
  overflow: visible;
}

.config {
  height: auto;
  max-height: none;
  overflow: visible;
  position: sticky;
  top: 0.75rem;
}

.right-col {
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 1vw, 1.1rem);
  overflow: visible;
}

.preview-panel,
.log-panel,
.live {
  overflow: visible;
  min-height: 0;
}

.preview-stage {
  flex: none;
  height: clamp(300px, 38vw, 560px);
  min-height: 280px;
}

.log-panel {
  max-height: none;
}

.log-body {
  height: auto;
  min-height: 220px;
  max-height: min(46vh, 430px);
  overflow: auto;
  padding: 0.75rem;
  background: rgba(7, 11, 17, 0.62);
}

.log-body .log-item {
  width: 100%;
  max-width: none;
  margin: 0 0 0.55rem;
  border-radius: 8px;
  background: rgba(14, 22, 32, 0.72);
  box-shadow: none;
  border-color: rgba(232, 220, 196, 0.09);
}

.log-body .log-item.level-success {
  background: rgba(13, 38, 34, 0.68);
}

.log-body .log-item.level-error {
  background: rgba(43, 20, 24, 0.72);
}

.log-body .log-item.level-warn {
  background: rgba(44, 33, 18, 0.72);
}

.log-body .log-label {
  font-size: 0.84rem;
}

.live {
  overflow: visible;
}

.table-wrap {
  flex: none;
  min-height: 180px;
  max-height: min(42vh, 420px);
  overflow: auto;
}

.toast-stack {
  top: 5rem;
  right: 1rem;
  bottom: auto;
  width: min(430px, calc(100vw - 2rem));
  max-height: none;
  overflow: visible;
}

.toast-stack .log-item,
.toast-stack .toast-item {
  max-width: none;
  margin: 0 0 0.65rem;
  border-radius: 8px;
  background: rgba(15, 24, 34, 0.96);
  border: 1px solid rgba(232, 220, 196, 0.14);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
}

.toast-stack .toast-success {
  background: rgba(13, 54, 45, 0.96);
}

.toast-stack .toast-error {
  background: rgba(58, 21, 26, 0.97);
}

.toast-stack .toast-warn {
  background: rgba(60, 42, 17, 0.97);
}

.config,
.log-body,
.live,
.table-wrap,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.config::-webkit-scrollbar,
.log-body::-webkit-scrollbar,
.live::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

@media (min-width: 1500px) {
  .layout {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  }

  .preview-stage {
    height: clamp(380px, 35vw, 620px);
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .config {
    position: static;
  }

  .preview-stage {
    height: clamp(300px, 54vh, 520px);
  }
}

@media (max-width: 760px) {
  .preview-stage {
    height: clamp(280px, 48vh, 430px);
  }

  .log-body {
    max-height: 420px;
  }

  .toast-stack {
    top: auto;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
  }
}

/* Hide scrollbars everywhere while preserving scroll behavior */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* URL export button accents */
.log-btn-warn {
  border-color: rgba(232, 160, 74, 0.45);
  background: rgba(232, 160, 74, 0.1);
  color: var(--warn);
}

.log-btn-warn:hover:not(:disabled) {
  border-color: rgba(232, 160, 74, 0.75);
  background: rgba(232, 160, 74, 0.18);
}
