:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e0e3e8;
  --text: #1f2430;
  --muted: #6b7280;
  --primary: #2f6fed;
  --primary-dark: #2559c4;
}

* { box-sizing: border-box; }

@font-face {
  font-family: 'S-CoreDream-3Light';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-3Light.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

body {
  margin: 0;
  font-family: 'S-CoreDream-3Light', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  padding: 24px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.app-header h1 { margin: 0 0 4px; font-size: 22px; }
.app-header p { margin: 0; color: var(--muted); font-size: 14px; }

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 20px;
  width: 1180px;
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 32px;
  margin-top: 150px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.field-group {
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0 0 16px;
  margin: 0 0 16px;
}
.field-group:last-child { border-bottom: none; margin-bottom: 0; }
.field-group legend { font-weight: 600; padding: 0 0 8px; }

.sub-label { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }

.radio-row { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-col { display: flex; flex-direction: column; gap: 6px; }
.radio-row label, .radio-col label { font-size: 14px; display: flex; align-items: center; gap: 6px; }

@keyframes siteUrlBlink {
  0%, 100% { border-color: var(--border); box-shadow: none; }
  50% { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.25); }
}

#siteUrl {
  animation: siteUrlBlink 0.6s ease-in-out 25;
}

.text-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.close-row { display: flex; gap: 16px; margin-bottom: 8px; }
.close-row > div { flex: 1; }

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

#sizeHint {
  color: var(--primary);
  font-weight: 600;
  animation: sizeHintBlink 0.7s ease-in-out 15s 10;
}

@keyframes sizeHintBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.hidden { display: none; }

.mock-browser {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #fff;
}
.mock-browser-bar {
  background: #e9ebef;
  padding: 8px 10px;
  display: flex;
  gap: 6px;
}
.mock-browser-bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: #c7cad1;
  display: inline-block;
}
.mock-browser-page {
  position: relative;
  height: 800px;
  background:
    linear-gradient(#f0f1f4 1px, transparent 1px) 0 0/100% 40px,
    #fbfbfc;
  overflow: auto;
}

.mock-browser-site-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.script-hint {
  margin: 6px 0 12px;
}

.script-output {
  width: 100%;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  background: #fbfbfc;
  margin: 16px 0 20px;
}

.btn {
  margin-top: 10px;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.btn-secondary { background: #eef1f6; color: var(--text); }
.btn-secondary:hover { background: #e2e6ee; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.guide-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.guide-link:hover { text-decoration: underline; }

.legal-notice {
  margin: 10px 0 20px;
  padding: 8px 12px;
  border-radius: 6px;
  background: #fff6e0;
  color: #8a6300;
  font-size: 12px;
  line-height: 1.5;
}

.gtm-guide-section {
  margin-top: 20px;
}
.gtm-guide-section h2 {
  margin: 0 0 12px;
  font-size: 16px;
}
.blink-slow {
  animation: blink-slow 2.5s ease-in-out infinite;
}
@keyframes blink-slow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.gtm-guide-frame-wrap {
  position: relative;
}
.gtm-guide-frame {
  width: 100%;
  height: 850px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f1efe8;
  display: block;
}
.gtm-guide-frame-overlay {
  position: absolute;
  inset: 0;
  border: none;
  border-radius: 10px;
  background: rgba(20, 20, 18, 0);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.gtm-guide-frame-wrap:hover .gtm-guide-frame-overlay {
  opacity: 1;
  background: rgba(20, 20, 18, 0.28);
}
.gtm-guide-frame-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 20, 18, 0.75);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: none;
  z-index: 1001;
}

.gtm-guide-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

.gtm-guide-frame-wrap.is-expanded {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(960px, 95vw);
  height: 90vh;
  z-index: 1000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.gtm-guide-frame-wrap.is-expanded .gtm-guide-frame {
  height: 100%;
  border-radius: 12px;
}
.gtm-guide-frame-wrap.is-expanded .gtm-guide-frame-overlay {
  display: none;
}
.gtm-guide-frame-wrap.is-expanded .gtm-guide-frame-close {
  display: block;
}
body.gtm-guide-expanded .gtm-guide-backdrop {
  display: block;
}
body.gtm-guide-expanded {
  overflow: hidden;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}
