:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --green: #16a34a;
  --green-dark: #15803d;
  --red: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #ecfdf5 0%, var(--bg) 240px);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--green-dark);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pill {
  font-size: 12px;
  color: var(--green-dark);
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  padding: 4px 11px;
}

main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 22px 18px 28px;
}

.screen {
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hidden {
  display: none !important;
}

.panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}

.panel.small {
  padding: 16px 20px;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.panel h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.panel p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

input[type="text"],
select {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 15px;
  outline: none;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--green);
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 11px 18px;
  font-size: 15px;
}

.primary {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.error {
  color: var(--red);
  font-size: 14px;
  margin: 12px 0 0;
}

.device {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.devicelink {
  display: inline-block;
  font-size: 13px;
  word-break: break-all;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 10px;
}

.status {
  margin: 0;
  font-size: 14px;
  color: var(--green-dark);
}

.controls {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.controls input[type="text"] {
  flex: 1;
  min-width: 240px;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.example {
  background: #f1f5f9;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 999px;
}

.example:hover {
  color: var(--text);
  border-color: var(--green);
}

.stage {
  margin-top: 16px;
}

.placeholder {
  border: 1px dashed var(--line);
  border-radius: 12px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.result {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
}

.caption {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

footer {
  padding: 14px;
  display: flex;
  justify-content: center;
}

footer img {
  height: 28px;
}

@media (max-width: 620px) {
  .controls input[type="text"] {
    min-width: 100%;
  }
}
