@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;600;700&family=Rajdhani:wght@500;700&display=swap');

:root {
  --bg: #eef2f6;
  --ink: #1d2a3a;
  --ink-muted: #5c6f86;
  --surface: #ffffff;
  --surface-2: #f5f8fb;
  --border: #d5dfe9;
  --navy: #17324f;
  --blue: #2f86e5;
  --orange: #ff5e1f;
  --success: #21a369;
  --danger: #c9344e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Barlow', sans-serif;
  color: var(--ink);
  background:
    linear-gradient(125deg, rgba(23, 50, 79, 0.12) 0%, transparent 40%),
    linear-gradient(35deg, rgba(47, 134, 229, 0.08) 0%, transparent 45%),
    var(--bg);
}

.site-logo-wrap {
  display: flex;
  justify-content: center;
  padding: .55rem 0 0;
}

.site-logo-home {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  opacity: .84;
  text-decoration: none;
  transition: opacity .15s ease;
}

.site-logo-home:hover {
  opacity: 1;
}

.site-logo-home img {
  width: auto;
  height: 32px;
  max-width: 145px;
}

.site-name {
	font-size: 1.5rem;
	color: var(--ink);
	letter-spacing: .04em;
	font-weight: 400;
	font-family: 'Rajdhani', sans-serif;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2.2rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 12px 26px rgba(15, 34, 55, 0.08);
  padding: 1.1rem;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--orange), var(--blue));
}

h1, h2, h3 {
  margin: 0 0 .55rem;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: .02em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--navy);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .72rem;
  padding: .34rem .78rem;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
}

.lead {
  color: var(--ink-muted);
  line-height: 1.6;
}

label {
  display: block;
  margin-bottom: .22rem;
  font-size: .86rem;
  color: var(--ink-muted);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: .56rem .64rem;
  background: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: .75rem;
}

.grid > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: .65rem;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
}

button, .btn, .result a {
  border: 0;
  border-radius: 0;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  padding: .54rem .82rem;
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  background: #e7eef7;
  color: var(--navy);
  border: 1px solid #c8d6e7;
}

button.danger {
  background: var(--danger);
}

.inline-form {
  margin: .9rem 0;
  display: grid;
  gap: .4rem;
}

.source-block {
  border: 1px solid var(--border);
  background: #fff;
  padding: .85rem;
  margin-bottom: .8rem;
}

.source-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .4rem;
}

.source-actions {
  display: flex;
  gap: .45rem;
}

.result {
  margin-top: .6rem;
  padding: .72rem;
  background: #f3f8ff;
  border-left: 4px solid var(--orange);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}

.options-wrap { margin-top: .8rem; }

.options-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .18s ease, opacity .18s ease;
}

.options-panel.open {
  max-height: 450px;
  opacity: 1;
}

.options-grid { margin-top: .7rem; }

.options-form {
  border: 1px solid var(--border);
  background: #fff;
  padding: .8rem;
}

.preview-box {
  margin-top: .5rem;
  padding: .62rem;
  border: 1px dashed #b9c9dc;
  background: #f7fbff;
}

.preview-box ul {
  margin: .35rem 0 .2rem;
  padding-left: 1.2rem;
}

.muted {
  color: var(--ink-muted);
  font-size: .9rem;
}

.alert {
  margin: .8rem 0;
  padding: .68rem;
}

.alert.error {
  background: #ffecef;
  color: #7f2330;
}

.alert.success {
  background: #e7fff2;
  color: #1e6d49;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}

.inline-import {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.footer-card {
  position: relative;
  text-align: center;
  font-size: .92rem;
}

.footer-card p {
  margin: .3rem 0;
}

.footer-card a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.footer-card a:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.footer-update-note {
  position: absolute;
  right: 1rem;
  bottom: .62rem;
  font-size: .72rem;
  font-style: italic;
  opacity: .92;
}

.footer-update-note a {
  font-weight: 500;
}

.error-card {
  max-width: 740px;
  margin: 12vh auto 0;
}

.trace-box {
  white-space: pre-wrap;
  border: 1px solid var(--border);
  background: #fff;
  padding: .72rem;
  max-height: 320px;
  overflow: auto;
}

@media (max-width: 780px) {
  .grid { grid-template-columns: 1fr; }
  .toolbar, .inline-import, .source-actions, .result { flex-direction: column; align-items: stretch; }
  .footer-update-note {
    position: static;
    display: block;
    margin-top: .45rem;
    text-align: center;
  }
}
