:root {
  color-scheme: light;
  --ink: #101418;
  --muted: #677078;
  --line: #dbe1e6;
  --paper: #f5f7f9;
  --panel: #ffffff;
  --accent: #007c89;
  --accent-strong: #04545d;
  --danger: #b42318;
  --focus: #e2f4f5;
  --shadow: 0 18px 50px rgba(22, 34, 45, 0.08);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 247, 249, 0.96)),
    radial-gradient(circle at 14% 0%, rgba(0, 124, 137, 0.12), transparent 34%),
    var(--paper);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  max-width: 1240px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(219, 225, 230, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(14px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), transparent 48%),
    linear-gradient(135deg, var(--accent), #19a974);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
  flex: 0 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 680px;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
}

.auth-actions,
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-badge,
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1px dashed #aab8c0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(241, 247, 248, 0.86)),
    repeating-linear-gradient(90deg, rgba(0, 124, 137, 0.06) 0 1px, transparent 1px 18px);
  cursor: pointer;
  padding: 22px;
  text-align: center;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.dropzone:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.dropzone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--accent-strong);
  position: relative;
}

.drop-icon::before,
.drop-icon::after {
  content: "";
  position: absolute;
  background: var(--accent);
}

.drop-icon::before {
  width: 22px;
  height: 2px;
}

.drop-icon::after {
  width: 2px;
  height: 22px;
}

.drop-title {
  margin-top: 14px;
  font-weight: 700;
}

.drop-meta,
.muted,
.message,
.metric-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.controls {
  margin-top: 16px;
}

.button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary {
  background: var(--focus);
  border-color: #c5e5e8;
  color: var(--ink);
}

.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.message {
  min-height: 22px;
  margin-top: 14px;
}

.message.error {
  color: var(--danger);
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(19, 25, 29, 0.96), rgba(9, 13, 15, 0.98)),
    #101512;
}

.preview-frame img {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
}

.empty-preview {
  color: #c7d0ca;
  font-weight: 700;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metrics > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.metric-label {
  display: block;
  margin-bottom: 6px;
}

.metrics strong {
  display: block;
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .shell {
    padding: 16px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .tool-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    min-height: 320px;
  }
}
