:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #5b6b84;
  --muted2: #74839a;
  --border: rgba(15, 23, 42, 0.1);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-700: #1e40af;
  --ring: rgba(37, 99, 235, 0.18);
  --surface: #f8fafc;
  --radius: 14px;
}

.topbar {
  background: linear-gradient(90deg, #1e40af 0%, #2563eb 55%, #1d4ed8 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lang__label {
  font-size: 12px;
  font-weight: 800;
  color: #e7f1ff;
  opacity: 0.95;
  white-space: nowrap;
}

.select {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 13px;
  outline: none;
}

.select:focus {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.brand__title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.brand__subtitle {
  margin-top: 2px;
  margin-bottom: 0;
  font-size: 12px;
  opacity: 0.9;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 18px 0 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(160%) blur(6px);
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 14px 12px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.85);
  cursor: pointer;
}

.tab:hover {
  background: rgba(37, 99, 235, 0.08);
}

.tab.is-active {
  background: #fff;
  color: var(--primary);
  box-shadow: inset 0 -3px 0 var(--primary);
}

.panel {
  display: none;
  padding: 18px 16px 22px;
}

.panel.is-active {
  display: block;
}

.panel__title {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 6px;
}

.panel__hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}

.panel__note {
  font-size: 12px;
  color: var(--muted2);
  margin-top: 10px;
}

.legal {
  padding: 4px 0 8px;
}

.legal__h {
  font-size: 14px;
  margin: 16px 0 6px;
  color: var(--text);
  font-weight: 900;
}

.legal__p {
  margin: 0;
  color: rgba(15, 23, 42, 0.85);
  line-height: 1.6;
  font-size: 13px;
}

.brand__title {
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 920px) {
  .grid {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  background: #fff;
}

.textarea:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 5px var(--ring);
}

.textarea--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.row--tight {
  gap: 14px;
}

.btn {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: #fff;
  color: rgba(15, 23, 42, 0.92);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  font-size: 13px;
}

.btn:hover {
  background: rgba(248, 250, 252, 0.95);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.btn--primary:hover {
  background: var(--primary-600);
}

.btn--file {
  position: relative;
  overflow: hidden;
}

.btn--file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #334155;
}

.status {
  min-height: 18px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.85);
}

.status.is-error {
  color: #b42318;
}

.status.is-success {
  color: #067647;
}

.drop {
  border: 1px dashed rgba(37, 99, 235, 0.55);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.8);
  padding: 16px;
  cursor: pointer;
  position: relative;
}

.drop:focus {
  outline: none;
  box-shadow: 0 0 0 5px var(--ring);
  border-color: rgba(37, 99, 235, 0.7);
}

.drop.is-dragover {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--primary);
}

.drop__title {
  font-weight: 900;
  color: var(--text);
}

.drop__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.drop__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview img {
  max-width: 100%;
  max-height: 100%;
  display: none;
}

.preview img.is-visible {
  display: block;
}

.meta {
  font-size: 12px;
  color: var(--muted);
}

.results {
  display: grid;
  gap: 12px;
}

.result {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.result__header {
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result__title {
  font-size: 12px;
  font-weight: 900;
  color: var(--text);
}

.result__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.result__body {
  padding: 10px 12px;
}

.result__img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
}

.footer {
  padding: 18px 0 28px;
  color: var(--muted2);
  font-size: 12px;
}

.footer__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.footer__link {
  color: rgba(37, 99, 235, 0.95);
  text-decoration: none;
  font-weight: 800;
}

.footer__link:hover {
  text-decoration: underline;
}

.footer__sep {
  color: rgba(15, 23, 42, 0.35);
}

.btn:focus-visible,
.tab:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 5px var(--ring);
}
