@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #eff2fc;
  --surface: #ffffff;
  --ink: #0b0f19;
  --muted: #6b6f80;
  --border: #e2e5f1;
  --shadow: 0 18px 50px rgba(6, 6, 73, 0.1);
  --primary: #060649;
  --primary-strong: #30185e;
  --accent: #4c82f7;
  --warn: #b98700;
  --bad: #ef4444;
  --good: #22c55e;
  --radius: 8px;
  --font-base: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-heading: "Plus Jakarta Sans", "DM Sans", system-ui, sans-serif;
  --font-mono: "SF Mono", "Fira Code", Consolas, monospace;
  --layout-max: 1180px;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(76, 130, 247, 0.16), transparent 29rem),
    linear-gradient(180deg, #f8faff 0%, #eff2fc 48%, #ffffff 100%) !important;
  color: var(--ink);
  font-family: var(--font-base);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(6, 6, 73, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 6, 73, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 80%);
}

h1,
h2,
h3,
.section-title,
.brand {
  font-family: var(--font-heading);
  letter-spacing: 0;
}

a {
  color: var(--accent);
}

header.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86) !important;
  color: var(--ink) !important;
  border-bottom: 1px solid rgba(226, 229, 241, 0.9);
  box-shadow: 0 8px 30px rgba(6, 6, 73, 0.06) !important;
  backdrop-filter: blur(18px);
}

.nav-inner {
  max-width: var(--layout-max) !important;
  justify-content: space-between;
}

.brand {
  min-height: 40px;
  color: var(--primary);
  font-size: 16px !important;
  font-weight: 800 !important;
}

.brand img {
  height: 34px !important;
  width: auto;
}

.brand span {
  color: var(--muted);
  opacity: 1 !important;
  font-weight: 600 !important;
}

.page {
  max-width: var(--layout-max) !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 24px !important;
  padding: 30px 24px 56px !important;
}

.side,
.card,
.hero {
  border: 1px solid rgba(226, 229, 241, 0.92) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
}

.side {
  top: 86px !important;
  padding: 10px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(14px);
}

.side-title {
  padding: 6px 10px;
  color: #9397ad !important;
  font-family: var(--font-heading);
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
}

.side-link {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px !important;
  color: #33354d !important;
  font-weight: 700 !important;
}

.side-link:hover {
  background: #f3f6ff !important;
  border-color: #d8def3 !important;
}

.side-link.current {
  background: linear-gradient(135deg, #060649, #30185e) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(48, 24, 94, 0.24);
}

.nav-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 6px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(6, 6, 73, 0.12);
}

.side-link.current .nav-icon {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.dev-toggle {
  display: flex !important;
  width: 100%;
  min-height: 38px;
  margin: 10px 0;
  padding: 8px 10px !important;
  justify-content: flex-start;
  gap: 8px;
  border: 1px solid var(--border) !important;
  background: #f8faff !important;
  color: #33354d !important;
  box-shadow: none !important;
  font-size: 12px;
}

.dev-toggle[aria-pressed="true"] {
  background: #eefbf3 !important;
  color: #15803d !important;
  border-color: rgba(34, 197, 94, 0.28) !important;
}

.dev-toggle-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #9397ad;
}

.dev-toggle[aria-pressed="true"] .dev-toggle-dot {
  background: #22c55e;
}

.dev-panel {
  display: grid;
  gap: 8px;
  margin: -2px 0 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.dev-panel-label {
  margin: 0;
  color: #6b6f80;
  font-size: 12px;
}

.dev-panel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.dev-panel-input {
  min-width: 0 !important;
  min-height: 36px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
}

.dev-panel-submit {
  min-height: 36px;
  padding: 8px 10px !important;
  font-size: 12px;
}

.dev-panel-message {
  min-height: 14px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}

.dev-link {
  background: #fbfcff;
  border-style: dashed !important;
}

[hidden] {
  display: none !important;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 224px;
  padding: 34px 38px !important;
  margin-bottom: 22px !important;
  background:
    radial-gradient(circle at 88% 18%, rgba(76, 130, 247, 0.2), transparent 18rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.92)) !important;
  color: var(--primary) !important;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 6, 73, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(6, 6, 73, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent 0%, #000 62%, transparent 100%);
  opacity: 0.72;
}

.hero::before {
  content: "";
  position: absolute;
  top: 28px;
  right: 34px;
  width: 104px;
  height: 104px;
  border: 1px solid rgba(226, 229, 241, 0.9);
  border-radius: 24px;
  background: #ffffff url("https://cdn.siesta.ai/brand/logo/siesta-ai-badge.png") center/64px 64px no-repeat;
  box-shadow: 0 18px 48px rgba(6, 6, 73, 0.14);
}

.hero > div {
  position: relative;
  z-index: 2;
  max-width: min(680px, calc(100% - 160px));
}

.hero h1 {
  margin-top: 12px !important;
  margin-bottom: 12px !important;
  color: var(--primary);
  font-size: clamp(34px, 4vw, 52px) !important;
  line-height: 1.04;
  font-weight: 800;
}

.hero p {
  max-width: 620px !important;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.hero img {
  position: relative;
  z-index: 1;
  width: 76px !important;
  height: 76px !important;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.pill,
.badge {
  border: 1px solid rgba(76, 130, 247, 0.2) !important;
  background: #f3f6ff !important;
  color: var(--primary) !important;
  border-radius: 999px !important;
  font-family: var(--font-heading);
  font-weight: 800 !important;
  letter-spacing: 0.03em !important;
}

.hero .pill {
  border-color: rgba(76, 130, 247, 0.22) !important;
  background: #f3f6ff !important;
  color: var(--primary) !important;
}

.card {
  margin-bottom: 20px !important;
  padding: 24px !important;
  background: rgba(255, 255, 255, 0.96) !important;
}

.card-section {
  margin-top: 22px !important;
  padding-top: 20px !important;
  border-top: 1px solid var(--border) !important;
}

.section-title {
  margin-bottom: 14px !important;
  color: var(--primary) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}

.section-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(6, 6, 73, 0.12);
}

.small {
  color: var(--muted) !important;
  font-size: 13px !important;
}

.row {
  margin: 0 !important;
}

label {
  color: #33354d;
  font-weight: 700 !important;
}

input[type="text"],
.snippet {
  border-color: var(--border) !important;
  border-radius: 8px !important;
  background: #fbfcff !important;
  color: var(--ink) !important;
  font-family: var(--font-base);
}

input[type="text"] {
  min-height: 44px;
  padding: 10px 12px !important;
}

input[type="text"]:focus,
.snippet:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px rgba(76, 130, 247, 0.16) !important;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0 !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #060649, #30185e) !important;
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-weight: 800 !important;
  box-shadow: 0 12px 28px rgba(48, 24, 94, 0.22);
}

button:hover {
  filter: none !important;
  transform: translateY(-1px);
}

.ghost-btn {
  background: #ffffff !important;
  color: var(--primary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none;
}

.ti {
  display: inline-flex;
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: currentColor;
  font-family: inherit !important;
  font-size: 1em;
  line-height: 1;
}

.ti::before {
  content: "";
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: var(--ti-mask) center / contain no-repeat;
  mask: var(--ti-mask) center / contain no-repeat;
}

.ti-message-circle,
.ti-code,
.ti-shield-lock,
.ti-lock-code,
.ti-world-upload,
.ti-adjustments,
.ti-player-play,
.ti-eye,
.ti-file-import,
.ti-copy,
.ti-trash,
.ti-activity,
.ti-sparkles,
.ti-external-link,
.ti-device-desktop,
.ti-arrow-left {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='4' width='16' height='16' rx='4' fill='black'/%3E%3C/svg%3E");
}

.ti-message-circle,
.ti-activity {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 5.5A4.5 4.5 0 0 1 8.5 1h7A4.5 4.5 0 0 1 20 5.5v5A4.5 4.5 0 0 1 15.5 15H11l-5.5 4.2A1 1 0 0 1 4 18.4V5.5Z'/%3E%3C/svg%3E");
}

.ti-code,
.ti-lock-code {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m8.7 7.3-4 4a1 1 0 0 0 0 1.4l4 4 1.4-1.4L6.8 12l3.3-3.3-1.4-1.4Zm6.6 0-1.4 1.4 3.3 3.3-3.3 3.3 1.4 1.4 4-4a1 1 0 0 0 0-1.4l-4-4Z'/%3E%3C/svg%3E");
}

.ti-shield-lock {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 5 5v6c0 4.6 2.9 8.8 7 10 4.1-1.2 7-5.4 7-10V5l-7-3Zm-2 9.2V10a2 2 0 1 1 4 0v1.2a1.8 1.8 0 0 1 1 1.6V16H9v-3.2a1.8 1.8 0 0 1 1-1.6Zm1.4-.2h1.2V10a.6.6 0 0 0-1.2 0v1Z'/%3E%3C/svg%3E");
}

.ti-world-upload,
.ti-external-link {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 5h7v2H7v10h10v-5h2v7H5V5Zm9 0h5v5h-2V8.4l-5.3 5.3-1.4-1.4L15.6 7H14V5Z'/%3E%3C/svg%3E");
}

.ti-adjustments {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M5 7h8a3 3 0 0 0 5.8 0H21V5h-2.2A3 3 0 0 0 13 5H5v2Zm0 12h2.2a3 3 0 0 0 5.6 0H21v-2h-8.2a3 3 0 0 0-5.6 0H5v2Zm0-6h14v-2H5v2Z'/%3E%3C/svg%3E");
}

.ti-player-play {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 4v16l13-8L7 4Z'/%3E%3C/svg%3E");
}

.ti-eye {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 5c5 0 8.6 4.4 10 7-1.4 2.6-5 7-10 7s-8.6-4.4-10-7c1.4-2.6 5-7 10-7Zm0 3.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Z'/%3E%3C/svg%3E");
}

.ti-file-import,
.ti-copy {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 3h8l4 4v14H7V3Zm2 2v14h8V9h-4V5H9ZM5 7H3v14h10v-2H5V7Z'/%3E%3C/svg%3E");
}

.ti-trash {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M8 4h8l1 2h4v2H3V6h4l1-2Zm-2 6h12l-1 11H7L6 10Z'/%3E%3C/svg%3E");
}

.ti-sparkles {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 2 2.2 6.2L20 10l-5.8 1.8L12 18l-2.2-6.2L4 10l5.8-1.8L12 2Zm7 11 1.1 3 2.9 1-2.9 1L19 21l-1.1-3-2.9-1 2.9-1L19 13ZM5 14l.9 2.1L8 17l-2.1.9L5 20l-.9-2.1L2 17l2.1-.9L5 14Z'/%3E%3C/svg%3E");
}

.ti-device-desktop {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 4h18v12H3V4Zm7 14h4l1 2H9l1-2Z'/%3E%3C/svg%3E");
}

.ti-arrow-left {
  --ti-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m10 5 1.4 1.4L7.8 10H20v2H7.8l3.6 3.6L10 17l-6-6 6-6Z'/%3E%3C/svg%3E");
}

.ghost-btn.active,
.ghost-btn[aria-pressed="true"] {
  background: #4c82f7 !important;
  color: #ffffff !important;
  border-color: #4c82f7 !important;
}

.status {
  width: 100%;
  border-radius: 8px !important;
  background: #f3f6ff !important;
  color: #33354d !important;
}

.status.good {
  background: #eefbf3 !important;
  border-color: rgba(34, 197, 94, 0.26) !important;
  color: #15803d !important;
}

.status.warn {
  background: #fff8e8 !important;
  border-color: rgba(255, 186, 8, 0.32) !important;
  color: #8a6400 !important;
}

.status.bad {
  background: #fff1f2 !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
  color: #b91c1c !important;
}

.snippet {
  min-height: 130px !important;
  font-family: var(--font-mono) !important;
  line-height: 1.55;
}

.snippet-guide {
  margin-top: 12px;
}

.snippet-guide-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.snippet-guide-panel {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--sai-border);
  border-radius: 8px;
  background: #fbfcff;
}

.snippet-guide-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.snippet-guide-controls label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--sai-muted);
}

.snippet-guide-input {
  width: 100%;
  min-width: 0 !important;
  border: 1px solid var(--sai-border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--sai-ink);
  padding: 9px 10px;
  font: inherit;
}

.snippet-guide-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 12px;
}

.snippet-guide-list div {
  display: grid;
  grid-template-columns: minmax(120px, 160px) 1fr;
  gap: 10px;
}

.snippet-guide-list dt {
  color: var(--sai-ink);
  font-weight: 800;
}

.snippet-guide-list dd {
  margin: 0;
  color: var(--sai-muted);
}

.log-list {
  max-height: 430px !important;
}

.log-item {
  border-radius: 8px !important;
  background: #fbfcff !important;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.log-item:hover {
  border-color: rgba(42, 30, 97, 0.22) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.log-item:focus-within {
  outline: 2px solid rgba(68, 125, 255, 0.35);
  outline-offset: 2px;
}

.log-head {
  cursor: pointer;
}

.log-head::after {
  content: "Details";
  margin-left: auto;
  color: var(--sai-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.log-item.expanded .log-head::after {
  content: "Hide";
}

.log-details {
  display: none;
  border-top: 1px solid var(--sai-border);
  margin-top: 4px;
  padding-top: 10px;
  color: var(--sai-muted);
  font-size: 12px;
}

.log-item.expanded .log-details {
  display: grid;
  gap: 8px;
}

.log-details dl {
  display: grid;
  grid-template-columns: minmax(92px, 140px) 1fr;
  gap: 6px 12px;
  margin: 0;
}

.log-details dt {
  color: var(--sai-muted);
  font-weight: 800;
}

.log-details dd {
  margin: 0;
  color: var(--sai-ink);
  word-break: break-word;
}

.log-details code {
  font-size: 12px;
}

.log-detail-actions {
  margin: 0;
  padding-left: 17px;
}

.log-detail-actions li {
  margin: 2px 0;
}

.log-info {
  border-left-color: var(--accent) !important;
}

.log-warn {
  border-left-color: #ffba08 !important;
}

.log-bad {
  border-left-color: var(--bad) !important;
}

.widget-shell,
.preview-frame {
  border-radius: 8px !important;
  border-color: #cfd6ec !important;
  background: #f8faff !important;
}

.preview-frame {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

body.embed-mode::before {
  display: none;
}

body.embed-mode {
  background: #ffffff !important;
}

body.embed-mode .page {
  max-width: none !important;
  width: 100% !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

body.embed-mode main.container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.embed-mode #embedCard {
  width: 100% !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.embed-mode .preview-frame {
  width: 100% !important;
  height: 100vh !important;
  border: 0 !important;
  border-radius: 0 !important;
}

@media (max-width: 1280px) {
  .hero::after {
    display: none;
  }
}

@media (max-width: 760px) {
  .snippet-guide-controls,
  .snippet-guide-list div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  header.nav {
    position: relative;
  }

  .page {
    grid-template-columns: 1fr !important;
    padding: 18px 16px 40px !important;
  }

  .side {
    position: relative !important;
    top: auto !important;
  }

  .hero {
    min-height: auto;
    padding: 28px 22px !important;
  }

  .hero h1 {
    font-size: 34px !important;
  }

  input[type="text"] {
    min-width: 0 !important;
  }
}

@media (max-width: 560px) {
  .nav-inner,
  .brand,
  .row {
    align-items: stretch !important;
  }

  .brand {
    gap: 8px !important;
  }

  .brand img {
    height: 30px !important;
  }

  .card {
    padding: 18px !important;
  }

  button,
  input[type="text"] {
    width: 100%;
  }
}
