:root {
  color-scheme: light;
  --host-bg: #f3ede5;
  --host-panel: rgba(255, 250, 245, 0.92);
  --host-panel-strong: #fffaf5;
  --host-border: rgba(121, 102, 84, 0.18);
  --host-shadow: 0 24px 60px rgba(56, 42, 24, 0.12);
  --host-text: #2d261f;
  --host-muted: #766a5d;
  --host-accent: #9a5a17;
  font-family: 'IBM Plex Sans', 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(235, 180, 103, 0.34), transparent 28%),
    radial-gradient(circle at top right, rgba(183, 210, 207, 0.42), transparent 26%),
    linear-gradient(180deg, #fbf7f2 0%, var(--host-bg) 100%);
  color: var(--host-text);
}

a,
button {
  font: inherit;
}

.host-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px;
}

.host-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.host-eyebrow,
.surface-label,
.surface-note {
  margin: 0;
}

.host-eyebrow {
  color: var(--host-muted);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.host-title {
  margin: 6px 0 0;
  font-family: 'Fraunces', 'Georgia', serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 500;
  line-height: 1;
}

.host-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.host-actions a,
.host-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--host-border);
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.86);
  color: var(--host-text);
  padding: 0 16px;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(55, 38, 21, 0.06);
}

.host-actions button {
  cursor: pointer;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 20px;
  min-height: calc(100vh - 132px);
}

.surface {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.surface-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}

.surface-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.surface-note {
  margin-top: 4px;
  color: var(--host-muted);
  font-size: 14px;
}

.surface-frame {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  border: 1px solid var(--host-border);
  border-radius: 32px;
  background: var(--host-panel);
  box-shadow: var(--host-shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.surface-frame iframe,
.mobile-screen iframe,
.widget-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.mobile-stage {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.mobile-device-frame {
  position: relative;
  width: min(100%, 392px);
  height: 720px;
  flex: 0 0 720px;
  padding: 16px;
  border: 1px solid rgba(53, 53, 57, 0.14);
  border-radius: 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(229, 225, 220, 0.9)),
    #f8f2ea;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 30px 60px rgba(47, 35, 21, 0.16);
}

.mobile-device-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 134px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(21, 20, 20, 0.88);
}

.mobile-screen {
  overflow: hidden;
  height: 688px;
  border-radius: 30px;
  background: #fffaf5;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.widget-window {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  will-change: transform;
}

.widget-frame {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.widget-resize-handle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: nwse-resize;
  touch-action: none;
}

.widget-resize-handle::before {
  content: '';
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(118, 106, 93, 0.52);
  border-bottom: 2px solid rgba(118, 106, 93, 0.52);
  border-bottom-right-radius: 4px;
}

.widget-window[data-minimized='true'] {
  overflow: hidden;
}

.widget-window[data-minimized='true'] .widget-resize-handle {
  display: none;
}

@media (max-width: 1199px) {
  .host-shell {
    padding-bottom: 140px;
  }

  .host-toolbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .host-toolbar {
    flex-direction: column;
  }

  .host-actions {
    justify-content: flex-start;
  }

  .workspace {
    display: grid;
    min-height: auto;
  }

  .surface-web .surface-frame {
    min-height: 74vh;
  }

  .mobile-stage {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .host-shell {
    padding: 16px 16px 120px;
  }

  .host-actions a,
  .host-actions button {
    width: 100%;
  }

  .mobile-device-frame {
    width: 100%;
    min-height: 640px;
  }

  .mobile-screen {
    min-height: 608px;
  }
}
