:root {
  --bg: #08111f;
  --panel: #101d31;
  --panel-2: #14243d;
  --line: #263b5c;
  --text: #eef5ff;
  --muted: #aebdd1;
  --mint: #3ddc97;
  --mint-soft: rgba(61, 220, 151, .12);
  --amber: #ffd166;
  --amber-soft: rgba(255, 209, 102, .12);
  --blue: #63a4ff;
  --blue-soft: rgba(99, 164, 255, .12);
  --red: #ff7b8c;
  --shadow: 0 24px 70px rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -5%, rgba(61, 220, 151, .14), transparent 30rem),
    radial-gradient(circle at 95% 12%, rgba(99, 164, 255, .11), transparent 28rem),
    linear-gradient(180deg, #07101c 0%, #0b1730 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(38, 59, 92, .85); background: rgba(8, 17, 31, .86); backdrop-filter: blur(18px); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 780; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #062319; background: var(--mint); font-size: 13px; letter-spacing: -.03em; box-shadow: 0 0 28px rgba(61, 220, 151, .2); }
.brand small { display: block; margin-top: -2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.live-dot, .quiet-link { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 12px; }
.live-dot { padding: 7px 11px; }
.live-dot i, .status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(61,220,151,.1); }
.live-dot b { color: var(--text); }
.quiet-link { padding: 7px 12px; text-decoration: none; transition: .2s ease; }
.quiet-link:hover { color: var(--text); border-color: rgba(61,220,151,.55); }

.hero { padding: 76px 0 54px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 64px; align-items: end; }
.eyebrow, .section-kicker { margin: 0 0 12px; color: var(--mint); font-size: 12px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(44px, 6.6vw, 82px); line-height: .98; letter-spacing: -.06em; }
.hero h1 span { color: var(--muted); }
.hero-copy { max-width: 700px; margin: 24px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 20px); }
.bonus-callout { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 15px; padding: 23px; border: 1px solid rgba(255,209,102,.3); border-radius: 20px; background: linear-gradient(145deg, rgba(255,209,102,.12), rgba(255,255,255,.025)); box-shadow: var(--shadow); }
.bonus-icon { display: grid; place-items: center; width: 38px; height: 38px; color: #312100; background: var(--amber); border-radius: 12px; }
.bonus-label { margin: 0; color: var(--amber); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.bonus-callout h2 { margin: 4px 0 8px; font-size: 18px; line-height: 1.3; }
.bonus-callout p:last-child { margin: 0; color: #ced7e5; font-size: 13px; }

.workflow-wrap { padding: 34px 0 40px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(5, 13, 24, .36); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.section-heading.compact { margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(27px, 4vw, 42px); line-height: 1.1; letter-spacing: -.04em; }
.print-btn, .secondary-btn, .quiet-button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.03); cursor: pointer; transition: .2s ease; }
.print-btn:hover, .secondary-btn:hover, .quiet-button:hover { color: var(--text); border-color: rgba(61,220,151,.45); }
.workflow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.workflow li { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding-right: 18px; }
.workflow li:not(:last-child)::after { content: ""; position: absolute; top: 15px; right: 6px; width: 12px; height: 1px; background: var(--line); }
.workflow li > span { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(61,220,151,.42); border-radius: 9px; color: var(--mint); background: var(--mint-soft); font: 800 10px/1 inherit; }
.workflow b, .workflow small { display: block; }
.workflow b { font-size: 13px; }
.workflow small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.4; }

.scripts-section { padding: 74px 0 78px; }
.updated { margin: 0; color: var(--muted); font-size: 12px; }
.scripts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.script-card { --accent: var(--mint); --soft: var(--mint-soft); position: relative; display: flex; flex-direction: column; min-width: 0; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(160deg, rgba(20,36,61,.96), rgba(13,27,47,.96)); box-shadow: 0 14px 40px rgba(0,0,0,.16); }
.script-card::before { content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 72%); }
.script-card.tone-amber { --accent: var(--amber); --soft: var(--amber-soft); }
.script-card.tone-blue { --accent: var(--blue); --soft: var(--blue-soft); }
.script-card.featured { transform: translateY(-8px); border-color: rgba(255,209,102,.34); box-shadow: 0 24px 64px rgba(0,0,0,.24); }
.recommended { position: absolute; top: 14px; right: 14px; padding: 4px 8px; color: #362500; background: var(--amber); border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.script-head { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding-right: 68px; }
.style-number { display: grid; place-items: center; width: 42px; height: 42px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 13px; background: var(--soft); font-size: 12px; font-weight: 850; }
.script-label { margin: 0; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.script-head h3 { margin: 1px 0 0; font-size: 19px; letter-spacing: -.02em; }
.script-description { min-height: 64px; margin: 17px 0; color: var(--muted); font-size: 13px; }
.script-box { flex: 1; padding: 18px; border: 1px solid rgba(38,59,92,.95); border-radius: 14px; background: rgba(6,16,29,.68); }
.script-box p { margin: 0; color: #edf4ff; font-size: 13px; white-space: pre-line; }
.guidance { margin: 15px 0; }
.guidance span, .guidance b { display: block; }
.guidance span { color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.guidance b { margin-top: 3px; color: #cad5e5; font-size: 11px; font-weight: 600; }
.copy-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); border-radius: 11px; color: var(--accent); background: var(--soft); cursor: pointer; font-weight: 800; transition: .2s ease; }
.copy-btn:hover { filter: brightness(1.18); transform: translateY(-1px); }
.copy-btn kbd { padding: 2px 6px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; background: rgba(0,0,0,.14); font-size: 9px; font-family: inherit; }

.handoff { padding: 0 0 84px; }
.handoff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.handoff-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: rgba(16,29,49,.7); }
.result-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 16px; border-radius: 10px; font-size: 11px; font-weight: 900; }
.result-icon.warm { color: var(--amber); background: var(--amber-soft); }
.result-icon.green { color: var(--mint); background: var(--mint-soft); }
.result-icon.blue { color: var(--blue); background: var(--blue-soft); }
.handoff h3 { margin: 0 0 6px; font-size: 16px; }
.handoff p { margin: 0; color: var(--muted); font-size: 13px; }
footer { border-top: 1px solid var(--line); color: var(--muted); background: rgba(5,12,22,.48); }
footer .shell { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; padding: 11px 16px; opacity: 0; pointer-events: none; color: #062319; background: var(--mint); border-radius: 999px; transform: translate(-50%, 14px); transition: .22s ease; font-size: 13px; font-weight: 800; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Admin */
.admin-shell { width: min(1320px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 120px; }
.login-panel { width: min(460px, 100%); margin: 7vh auto 0; padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(150deg, rgba(20,36,61,.98), rgba(10,23,41,.98)); box-shadow: var(--shadow); }
.login-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 24px; border-radius: 14px; color: #062319; background: var(--mint); font-weight: 900; }
.login-panel h1, .admin-titlebar h1 { margin: 0; letter-spacing: -.04em; }
.login-panel > p:not(.section-kicker) { margin: 10px 0 26px; color: var(--muted); }
label { display: block; color: #dce6f4; font-size: 12px; font-weight: 750; }
input, textarea { width: 100%; margin-top: 7px; padding: 12px 13px; color: var(--text); border: 1px solid var(--line); outline: none; border-radius: 10px; background: #0a182a; transition: border-color .18s, box-shadow .18s; }
textarea { resize: vertical; line-height: 1.6; }
input:focus, textarea:focus { border-color: rgba(61,220,151,.75); box-shadow: 0 0 0 3px rgba(61,220,151,.1); }
.primary-btn { padding: 12px 18px; border: 0; border-radius: 11px; color: #062319; background: var(--mint); cursor: pointer; font-weight: 850; transition: .2s ease; }
.primary-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-btn:disabled, .secondary-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.login-panel .primary-btn { width: 100%; margin-top: 16px; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--mint); font-size: 12px; }
.form-message.error { color: var(--red); }
.admin-titlebar { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.admin-titlebar h1 { font-size: clamp(34px, 5vw, 54px); }
.admin-titlebar > div > p:last-child { margin: 8px 0 0; color: var(--muted); }
.admin-actions { display: flex; gap: 9px; }
.quiet-button { border-color: transparent; }
.status-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 13px 16px; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); font-size: 12px; }
.status-strip b { color: var(--text); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: start; }
.editor-column { display: grid; gap: 16px; }
.editor-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(16,29,49,.82); }
.editor-card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.editor-card-title > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--mint); background: var(--mint-soft); font-size: 11px; font-weight: 900; }
.editor-card-title b, .editor-card-title small { display: block; }
.editor-card-title small { color: var(--muted); font-size: 10px; }
.editor-card > label, .field-grid { margin-top: 14px; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two { grid-template-columns: 1fr 2fr; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.preview-sticky { position: sticky; top: 88px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(8,18,32,.9); box-shadow: var(--shadow); }
.preview-title { display: flex; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.preview-title h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.preview-title > span { color: var(--muted); font-size: 10px; }
.preview-list { display: grid; gap: 10px; }
.mini-script { --mini-accent: var(--mint); padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.mini-script.mini-2 { --mini-accent: var(--amber); }
.mini-script.mini-3 { --mini-accent: var(--blue); }
.mini-top { display: flex; gap: 9px; align-items: center; }
.mini-top > span { display: grid; place-items: center; width: 30px; height: 30px; color: var(--mini-accent); background: color-mix(in srgb, var(--mini-accent) 12%, transparent); border-radius: 8px; font-size: 9px; font-weight: 900; }
.mini-top small { display: block; color: var(--mini-accent); font-size: 8px; text-transform: uppercase; }
.mini-top h3 { margin: 0; font-size: 14px; }
.mini-description { margin: 10px 0; color: var(--muted); font-size: 10px; }
.mini-copy { max-height: 150px; margin: 0; padding: 11px; overflow: auto; color: #e8f0fb; border-radius: 9px; background: #09182b; font-size: 10px; white-space: pre-line; }
.preview-note { margin: 13px 0 0; color: var(--muted); font-size: 10px; }
.publish-bar { position: sticky; z-index: 25; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 15px 18px; border: 1px solid rgba(61,220,151,.3); border-radius: 15px; background: rgba(8,18,32,.94); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.publish-bar b, .publish-bar small { display: block; }
.publish-bar b { font-size: 13px; }
.publish-bar b.dirty { color: var(--amber); }
.publish-bar small { color: var(--muted); font-size: 10px; }
.publish-message { text-align: right; }

@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .workflow { grid-template-columns: repeat(3, 1fr); gap: 22px 0; }
  .scripts-grid { grid-template-columns: 1fr; }
  .script-card.featured { transform: none; }
  .script-description { min-height: 0; }
  .editor-layout { grid-template-columns: 1fr; }
  .preview-sticky { position: static; }
}

@media (max-width: 680px) {
  .shell, .admin-shell { width: min(100% - 22px, 1180px); }
  .live-dot { display: none; }
  .hero { padding: 54px 0 38px; }
  .hero h1 { font-size: 45px; }
  .bonus-callout { grid-template-columns: 1fr; }
  .workflow { grid-template-columns: repeat(2, 1fr); }
  .workflow li:nth-child(2n)::after { display: none; }
  .section-heading, .admin-titlebar { align-items: flex-start; flex-direction: column; }
  .scripts-section { padding: 56px 0; }
  .handoff-grid { grid-template-columns: 1fr; }
  footer .shell { align-items: flex-start; justify-content: center; flex-direction: column; }
  .admin-shell { padding-top: 34px; }
  .admin-titlebar { gap: 16px; }
  .admin-actions { width: 100%; }
  .admin-actions button { flex: 1; }
  .status-strip { align-items: flex-start; flex-direction: column; gap: 5px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .publish-bar { bottom: 8px; }
  .publish-bar div { display: none; }
  .publish-bar .primary-btn { width: 100%; }
}

@media print {
  body { color: #111; background: white; }
  .topbar, .bonus-callout, .print-btn, .copy-btn, footer, .toast, .admin-body { display: none !important; }
  .hero { padding: 20px 0; }
  .hero h1, .section-heading h2, .script-head h3 { color: #111; }
  .hero-copy, .workflow small, .updated, .script-description, .guidance b, .handoff p { color: #444; }
  .workflow-wrap { border-color: #bbb; background: white; }
  .scripts-grid { grid-template-columns: 1fr; }
  .script-card { break-inside: avoid; color: #111; border-color: #aaa; background: white; box-shadow: none; }
  .script-card.featured { transform: none; }
  .script-box { border-color: #ccc; background: #f7f7f7; }
  .script-box p { color: #111; }
}
