:root {
  --ink: #111827;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --canvas: #f8fafc;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-soft: rgba(248, 250, 252, 0.92);
  --line: #dbe4ec;
  --line-strong: #cbd5e1;
  --copper: #b6673f;
  --copper-soft: #8f4c2f;
  --success: #2f7048;
  --danger: #a33f43;
  --radius: 0.3rem;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at 80% -10%, rgba(15, 23, 42, 0.08), transparent 34rem), radial-gradient(circle at -10% 68%, rgba(100, 116, 139, 0.08), transparent 32rem), var(--canvas);
  color: var(--ink);
  font-family: monospace;
  font-stretch: expanded;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.08);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.app-shell::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(39, 49, 58, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 49, 58, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  pointer-events: none;
}

.topbar,
.workspace {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 5px 0 5px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  /* width: 35px; */
  /* height: 35px; */
  place-items: center;
  /* border: 1px solid rgb(248 250 252 / 0%); */
  /* border-radius: var(--radius); */
  /* background: linear-gradient(145deg, #94a3b800, rgb(197 120 79 / 0%)); */
  /* color: #8f4c2f00; */
  /* font: 700 17px/1 var(--font-geist-mono), monospace; */
}

.brand-name {
  margin: 0;
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.brand-sub {
  margin: 2px 0 0;
  color: var(--muted-2);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.73rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 10px rgba(104, 176, 131, 0.72);
}

.workspace {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 5px;
}

.intro {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  margin-bottom: 27px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--copper-soft);
  font: 600 0.69rem/1.3 var(--font-geist-mono), monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 690px;
  margin: 0;
  font-size: clamp(2.25rem, 5.2vw, 4.85rem);
  font-weight: 590;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.intro-copy {
  max-width: 335px;
  margin: 0 0 4px;
  color: #27313a;
  font-size: 0.88rem;
  line-height: 1.65;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
  margin: 5px 0 5px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 19px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 630;
}

.panel-step {
  color: #27313a;
  font: 500 0.67rem/1 var(--font-geist-mono), monospace;
}

.builder-form {
  padding: 20px;
}

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

.field,
.field-full {
  min-width: 0;
}

.field-full {
  grid-column: 1 / -1;
}

.field label,
.field-full label,
.mode-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: #27313a;
  font-size: 0.72rem;
  font-weight: 560;
}

.optional,
.counter {
  color: #27313a;
  font: 500 0.63rem/1.2 var(--font-geist-mono), monospace;
}

.control {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-size: 0.79rem;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

textarea.control {
  min-height: 86px;
  padding-top: 11px;
  resize: vertical;
  line-height: 1.5;
}

.control::placeholder {
  color: #94a3b8;
}

.control:hover {
  border-color: #94a3b8;
}

.control:focus {
  border-color: #64748b;
  background: #ffffff;
  outline: none;
}

.control:disabled {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: var(--muted-2);
  cursor: not-allowed;
}

.field-meta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.redirect-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.mode-option {
  position: relative;
}

.mode-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mode-option span {
  display: flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 1px);
  font-weight: 600;
  cursor: pointer;
  transition: 160ms ease;
}

.mode-option input:checked + span {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(100, 116, 139, 0.08);
  color: #94a3b8;
}

.mode-option input:focus-visible + span {
  outline: 2px solid var(--copper-soft);
  outline-offset: 2px;
}

.delay-wrap {
  display: grid;
  grid-template-columns: 1fr 70px;
  gap: 10px;
}

.range-control {
  width: 100%;
  accent-color: #111827;
}

.range-box {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.range-box.disabled {
  border-color: #e2e8f0;
  opacity: 0.42;
}

.field-note {
  margin: 6px 0 0;
  color: #27313a;
  font-size: x-small;
}

.form-divider {
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.submit-note {
  margin: 0;
  color: #27313a;
  font-size: x-small;
  line-height: 1.45;
}

.submit-button,
.copy-button,
.open-button,
.landing-button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.submit-button {
  min-width: 160px;
  min-height: 42px;
  padding: 0 18px;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(100, 116, 139, 0.08);
  transition: transform 160ms ease, background 160ms ease;
  margin-left: auto;
}

.submit-button:hover {
  background: #27313a;
  transform: translateY(-1px);
}

.submit-button:disabled {
  opacity: 0.58;
  cursor: wait;
  transform: none;
}

.side-column {
  display: block;
}

.preview-body {
  padding: 18px;
}

.social-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.social-image {
  display: grid;
  aspect-ratio: 1.78 / 1;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(30, 38, 44, 0.4)), repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 1px, #94a3b8 1px 11px);
  color: #f8fafc;
}

.social-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-copy {
  padding: 13px 14px 14px;
}

.social-domain {
  margin: 0 0 5px;
  color: var(--muted-2);
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.social-title {
  overflow: hidden;
  margin: 0;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #27313a;
  font: 500 0.62rem/1.4 var(--font-geist-mono), monospace;
}

.meta-value {
  overflow: hidden;
  color: #475569;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 275px;
  font-size: small;
}

.result-body {
  padding: 17px 18px 18px;
}

.empty-result {
  display: grid;
  min-height: 111px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: #27313a;
  font-size: 0.68rem;
  text-align: center;
  margin: 3px;
}

.result-url {
  display: flex;
  gap: 8px;
}

.result-url code {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  overflow: hidden;
  padding: 0 11px;
  border: 1px solid #64748b;
  border-radius: var(--radius);
  background: rgba(100, 116, 139, 0.08);
  color: #15779b;
  font: 500 0.68rem/1 var(--font-geist-mono), monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-button,
.open-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #64748b;
  color: #64748b;
  font-size: 0.67rem;
  font-weight: 620;
}

.copy-button:hover,
.open-button:hover {
  background: rgba(255, 255, 255, 0.075);
}

.result-meta {
  display: flex;
  gap: 7px;
  margin-top: 11px;
}

.result-chip {
  color: #64748b;
  text-transform: uppercase;
  border-left: ridge;
}

.api-strip {
}

.api-strip code {
  color: #64748b;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 44px));
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--success);
  border-radius: var(--radius);
  background: #171c20;
  color: #e4e8eb;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
  font-size: 0.72rem;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.redirect-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 8%, rgba(197, 120, 79, 0.14), transparent 30rem),
    #0a0d0f;
}

.redirect-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(20, 24, 28, 0.94);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.redirect-kicker {
  margin: 0 0 13px;
  color: var(--copper-soft);
  font: 600 0.65rem/1 var(--font-geist-mono), monospace;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.redirect-card h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 620;
  letter-spacing: -0.04em;
}

.redirect-card p {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.countdown-ring {
  display: grid;
  width: 78px;
  height: 78px;
  margin: 26px auto 19px;
  place-items: center;
  border: 1px solid rgba(197, 120, 79, 0.42);
  border-radius: 999px;
  background: rgba(197, 120, 79, 0.08);
  color: var(--copper-soft);
  font: 650 1.45rem/1 var(--font-geist-mono), monospace;
}

.landing-button {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  background: var(--copper);
  color: #160d08;
  font-size: 0.75rem;
  font-weight: 760;
  text-transform: uppercase;
}

.redirect-fallback {
  display: inline-block;
  margin-top: 17px;
  color: var(--muted);
  font-size: 0.68rem;
}

.redirect-fallback:hover {
  color: var(--ink);
}

.guard-card {
  position: relative;
  overflow: hidden;
  text-align: left;
}

.guard-card::after {
  position: absolute;
  top: -48px;
  right: -48px;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(197, 120, 79, 0.24);
  border-radius: 999px;
  content: "";
}

.guard-card p {
  margin-left: 0;
}

.bot-page {
  min-height: 100vh;
  background: #fff;
  color: #000;
  font: 11pt/1.45 Georgia, serif;
  padding: 15px 10px;
}

.bot-page main {
  max-width: 850px;
  margin: auto;
}

.bot-page h1 {
  margin: 17pt 0 2pt;
  color: #666;
  font: 19pt/1.2 Calibri, sans-serif;
}

.bot-page p {
  margin: 0 0 1em;
}

@media (max-width: 900px) {
  .intro {
    display: block;
  }

  .intro-copy {
    max-width: 620px;
    margin-top: 18px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .topbar,
  .workspace,
  .api-strip {
    width: min(100% - 28px, 1180px);
  }

  .topbar {
    padding-top: 18px;
  }

  .status-pill {
    padding: 7px;
    font-size: 0;
  }

  .workspace {
    padding-top: 34px;
  }

  .intro h1 {
    font-size: clamp(2.45rem, 15vw, 4rem);
  }

  .field-grid,
  .side-column {
    grid-template-columns: 1fr;
  }

  .field-full {
    grid-column: auto;
  }

  .builder-form,
  .preview-body,
  .result-body {
    padding: 16px;
  }

  .submit-row {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-button {
    width: 100%;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 720px) {
  .redirect-fields {
    grid-template-columns: 1fr;
  }
}
